logo elektroda
logo elektroda
X
logo elektroda

ESP8266(wemos d1 mini) interrupt constantly alerted without cause.

grankee 2328 33
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #31 17954195
    grankee
    Level 9  
    Very useful information, thanks :) You know, as a matter of fact I only use serial.print as a "console", when something doesn't work I print variables to see where the program works differently than I expected, ultimately I won't need serial.print. Even though I managed to solve this in a different way it still bothers me why it worked before even with Serial.print, a digital device is a zero one device, it's governed by some rules that don't change so it's hard to explain with fart.
    Second question is do you know of any microcontrollers with wifi at a similar price but with more working pins that I don't have a problem with, is this kind of esp + pfc the best arrangement? I want to fit the whole project in as small a box as possible so I don't want something the size of an arduino leonardo :D .
    I also know that I could theoretically hook up an arduino nano, mini under I2C and have a lot more pins that will in addition handle encoder or other devices without putting a strain on my esp, but that's firstly extra cost, secondly space.
  • ADVERTISEMENT
  • #32 17954210
    khoam
    Level 42  
    grankee wrote:
    Even though I managed to solve it by another way it still bothers me why it worked before even with Serial.print, a digital device is a zero one device, it is governed by some rules that don't change so it's hard to explain it by luck.
    .
    It all depended on the circumstances i.e. when data was routed via Serial.print() and whether the serial port monitor in the Arduino IDE was active. In my tests I was getting completely random results after each reboot of the board. It follows that the D4 pin in the wemos d1 mini module can be used at most to flash the led on the board, as this will not be risky.

    On the ESP8266 or ESP32 I use ESP_LOGD to display relevant diagnostic information and it decides itself where to send it. The Serial class in the Arduino HAL consumes much more memory and is less flexible to use.

    Added after 10 [minutes]: .

    grankee wrote:
    The second question is whether you know of any microcontrollers with wifi at a similar price but with more working pins
    .
    Microcontrollers or ESP8266 modules? :) .
    As far as modules are concerned you have an overview here: https://www.esp8266.com/wiki/doku.php?id=esp8266-module-family
    The boards with ESP8266 modules are the most popular ones from the NodeMCU series: datasheet .

    Added after 6 [minutes]: .

    grankee wrote:
    such esp + pfc is the best arrangement?
    .
    Such itself, given that there is no I2C hardware controller on the ESP8266 and all communication is emulated software-wise by swiping pins.

    By the way, there is a library for ESP8266 and PCF8574: https://github.com/WereCatf/PCF8574_ESP
  • ADVERTISEMENT
  • #33 17955486
    grankee
    Level 9  
    khoam wrote:
    By the way, there is a library for ESP8266 and PCF8574: https://github.com/WereCatf/PCF8574_ESP
    .
    I know, I have even rewritten one for my own use.
    I wrote one to operate the encoder using the pins in the PFC.
    khoam wrote:
    Such, given that there is no I2C hardware controller in the ESP8266 and all communication is emulated programmatically by swiping pins.
    .
    So what is a better solution to get the extra pins?
  • #34 17955554
    khoam
    Level 42  
    grankee wrote:
    What better solution, then, to get extra pins?>
    .
    Using an ESP8266 module with more pins (I gave you the information in post #32) or directly using ESP-12 type cubes.

Topic summary

The discussion revolves around an issue with the ESP8266 (Wemos D1 Mini) where an interrupt on pin D4 is triggered continuously without an apparent cause. The user initially connected an encoder to this pin, which worked until WiFi functionality was added. After removing the WiFi code, the interrupt issue persisted. Various suggestions were made, including disabling auto-connect for WiFi, using the Exception Decoder for diagnosing watchdog issues, and overwriting flash memory to clear stored WiFi credentials. It was noted that pin D4 is unsuitable for interrupts due to its connection to the onboard LED, which interferes with the interrupt handling. The user eventually switched to pin D7 for the encoder button, but faced challenges with the encoder's rotation detection. The conversation highlighted the importance of choosing appropriate pins for interrupt handling on the ESP8266 and provided insights into potential workarounds and alternative microcontroller options.
Summary generated by the language model.
ADVERTISEMENT