Hello Everyone,
I'm having some problems with my Wemos mini.
I run it to control my doorbel.
But every +/- 45 minutes the pin is pulled high and my doorbel will ring.
I have logged when the signal has been send.
2017-10-24 21:02:53.240570,Play: doorbel
2017-10-24 21:48:50.505867,Play: doorbel
2017-10-24 22:38:21.130357,Play: doorbel
2017-10-24 23:12:37.690543,Play: doorbel
2017-10-25 00:28:02.730704,Play: doorbel
2017-10-25 01:00:20.730276,Play: doorbel
2017-10-25 01:37:34.620385,Play: doorbel
2017-10-25 03:23:18.810283,Play: doorbel
2017-10-25 04:37:58.020493,Play: doorbel
2017-10-25 05:10:20.910630,Play: doorbel
2017-10-25 05:42:49.558662,Play: doorbel
I pull down the pin with a resistor and have the switch on the 3.3volt pin and the gpio 13(D7 Wemos)
I'm been pulling my hair on what and why this is happening.
The code below is what handles the button pressed:
unsigned long currentMillis = millis();
// listen for button pressed over here!!!!!
if (buttonState == HIGH ) {
if(sendOnce == false){
// send request
sendOnce = true;
updateMyStatus(PRESSED); // set state to pressed
requestPlay("doorbel");
updateVolumio(START_PLAYING);
digitalWrite(ledPin, HIGH);
delay(100);
digitalWrite(ledPin, LOW);
previousMillis = currentMillis;
} else {
if(currentMillis - previousMillis > interval) {
// save the last time you blinked the LED
if(myStatus != ERROR){
updateMyStatus(ERROR);
}
previousMillis = currentMillis;
}
}
} else if(sendOnce == true && (volumioStatus == IDLE || volumioStatus == OFFLINE ) && buttonState == LOW){
if( volumioStatus == IDLE ) LedBlink();
updateMyStatus(IDLE);
sendOnce = false;
previousMillis = currentMillis;
} else {
previousMillis = currentMillis;
}