If i use digitalwrite, i can successfully run solenoid and pump, turning on and off several times in a row to complete a sequence.
With PWM using gpio4 and 5, have weird behaviour where second time i try to engage pwm it will fail, regardless of where in the sequence, but it will run pwm the next time after the failure. Examples:
Run pwm on pump ok
Stop pwm and wait
Run pwm x% fails
Run pwm y% works
Or
Run pwm on pump ok
Stop pwm and wait
Run Digitalwrite on pump ok
Run pwm y% fails
Or
Run pwm on pump ok
Stop pwm and wait
Run Digitalwrite on pump ok
Run Digitalwrite on pump ok
Then when press button again to do second drink.....
Run pwm on pump Fails
Stop pwm and wait
Run Digitalwrite on pump ok
Run Digitalwrite on pump ok
Or
Run pwm on pump ok
Stop pwm and wait
Run Digitalwrite on pump ok
Run Pwm on pump fails
Then when press button again to do second drink.....
Run pwm on pump ok
Stop pwm and wait
Run Digitalwrite on pump ok
Run Digitalwrite on pump ok
So the code is executed.... just pwm function fails every second call
Using Arduino IDE and upgraded to latest
Nodemcu esp8266 12