Go Down

Topic: Wemos D1 mini keeps resetting and other problems. (Read 680 times) previous topic - next topic



I have a 'small', quite special, project and have several troubles with the Wemos D1 mini.
The project:
The Wemos D1 mini is connected to several things. 1) Temperature Sensor DS18B20, 2) Capacitive Sensor, 3) Victron Bluesolar serial interface an 4) WS2812b.
The Wemos is sending the readings from the temperature sensor, the capacitive sensor and the Victron every 10 seconds to another endpoint. Also it is listening to incomming http requests... to control the WS2812b.

The problems (maybe connected, don't know):
1) After a random time the sensors can't be read anymore. Not the temp sensor nor the capacitive sensor. Just the serial communication with the Victron is still working.
2) The wemos is restarting or even crashing.

Exception 1)

Exception 9: LoadStoreAlignmentCause: Load or store to an unaligned address
PC: 0x4010051f: interrupt_handler at C:\Users\Work\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266\core_esp8266_wiring_digital.c line 148
EXCVADDR: 0x00373732

Decoding stack results
0x40100498: interrupt_handler at C:\Users\Work\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266\core_esp8266_wiring_digital.c line 130
0x40202f38: SendToBob() at C:\Users\Work\Documents\Arduino\arduino_couch_wemos_d1_mini_neu/arduino_couch_wemos_d1_mini_neu.ino line 153
0x40202f2f: SendToBob() at C:\Users\Work\Documents\Arduino\arduino_couch_wemos_d1_mini_neu/arduino_couch_wemos_d1_mini_neu.ino line 153
0x40209f9e: __yield() at C:\Users\Work\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266\core_esp8266_main.cpp line 100
0x40100378: millis at C:\Users\Work\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266\core_esp8266_wiring.c line 183
0x4020a3d0: WiFiClient::operator bool() at C:\Users\Work\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WiFi\src\WiFiClient.cpp line 350
0x402053cd: ESP8266WebServer::handleClient() at C:\Users\Work\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\libraries\ESP8266WebServer\src\ESP8266WebServer.cpp line 280
0x40202f2f: SendToBob() at C:\Users\Work\Documents\Arduino\arduino_couch_wemos_d1_mini_neu/arduino_couch_wemos_d1_mini_neu.ino line 153
0x402031ef: loop() at C:\Users\Work\Documents\Arduino\arduino_couch_wemos_d1_mini_neu/arduino_couch_wemos_d1_mini_neu.ino line 315
0x40209f6c: loop_wrapper() at C:\Users\Work\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266\core_esp8266_main.cpp line 125
Exception 2)

Exception 28: LoadProhibited: A load referenced a page mapped with an attribute that does not permit loads
PC: 0x4020ccf8
EXCVADDR: 0x00000000

Decoding stack results
0x40209ec0: esp_yield() at C:\Users\Work\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266\core_esp8266_main.cpp line 91
0x40202a02: HandleNewData() at C:\Users\Work\Documents\Arduino\arduino_couch_wemos_d1_mini_neu/arduino_couch_wemos_d1_mini_neu.ino line 83
0x402031ec: loop() at C:\Users\Work\Documents\Arduino\arduino_couch_wemos_d1_mini_neu/arduino_couch_wemos_d1_mini_neu.ino line 313
0x40209f6c: loop_wrapper() at C:\Users\Work\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.0\cores\esp8266\core_esp8266_main.cpp line 125
Until now I could see only this 2 exceptions.

Here is a short serial monitor log. In the first line everything is good and in the next the line is not.
{ "water_temp":"21.00", "water_level":"402", "PID":"0xA049", "FW":"116", "SER#":"HQ15494ZTLL", "V":"27510", "I":"2800", "VPV":"68120", "PPV":"79", "CS":"5", "ERR":"0", "LOAD":"", "IL":"", "H19":"56528", "H20":"58", "H21":"233", "H22":"36", "H23":"796", "HSDS":"277", "last_restart":"314" }
{ "water_temp":"-127.00", "water_level":"-2", "PID":"0xA049", "FW":"116", "SER#":"HQ15494ZTLL", "V":"27520", "I":"3800", "VPV":"67290", "PPV":"106", "CS":"5", "ERR":"0", "LOAD":"", "IL":"", "H19":"56528", "H20":"58", "H21":"233", "H22":"36", "H23":"796", "HSDS":"277", "last_restart":"347" }

If the error happens, only a restart will fix it. It is not getting fixed by itself. (Like a bad sensor reading or something like that... it is permanent.)
I power the Wemos D1 Mini with 5V at the 5V pin.

Does anybody have an idea what this exceptions mean?

The code: https://pastebin.com/EEMFqvUf

( The Fritzing sketch is not 100% exact. Please see it just as a visualisation of what the hardware looks like. )



i have a very similar problem:

i use a wemos d1 mini pro + victron bluesolar mppt 150/35. the wemos is connected only to the gnd and tx pin of the mppt. no other sensors or peripherals are used.

using this lib (the same one you have in your code): https://github.com/physee/Victron.Arduino-ESP8266, i can successfully get the serial data and visualise on the arduino serial monitor. no problems so far.

however, my long term plan is to send this data to blynk, via wifi. i have lots of experience with blynk, so i have a good understanding about how it works. however, when i try to integrate the blynk routine into the original code, i get the same crashes as you, with the Exception 9 etc, from the mcu.

i have also tried to use only the blynk api and send the values vith http. still got the crashes.

with serial prints, i observed that the crash ALWAYS occurs in the Blynk.run(); function, so, i think, the problem lies in the wifi or http protocols, maybe they are interfere somehow with the victron library? when i do not implement any online stuff into my code, it works ok...

did you find the solution for this issue?

Go Up