gmag11 / EnigmaIOT

Secure sensor and gateway platform based on ESP8266 and ESP32
https://gmag11.github.io/EnigmaIOT
MIT License
237 stars 48 forks source link

Bootloop in new nodes #36

Closed dgcasana closed 2 years ago

dgcasana commented 3 years ago

I have been testing the new version 0.9.8, for the integration in homeassitant especially. And I have found that flashing a new esp (with clean flash) not finding "/config.json" fails, it causes a bootloop instead of creating the access point and asking for parameters.

This is the serial output:

<<<stack<<<

--------------- CUT HERE FOR EXCEPTION DECODER ---------------
��␀␀�␀␀␀��␀�␀���␀�␀␀␀�␀��␀�␀��␀␀␀␀␀␀␀␀␀␀␀␀␀�␀␀�␀␀␀�␀␀␀��␀�␀��␀␀�␀��␀������␀���␀�␀�␀␀␀␀␀�␀␀␀␀␀�������␀��␀␀�������␀␀���␀�␀�␀␀�␀�␀␀␀�␀��␀�␀�␀��␀␀�␀��␀␀�␀␀������␀�␀␀�␀␀␀␀␀�␀�␀␀␀�␀␀␀␀␀␀�␀␀␀␀␀␀␀�␀␀␀␀����␀�␀��␀␀�␀␀␀�␀␀�␀␀␀␀�␀␀␀␀␀�����������␀␀�␀␀␀�␀␀␀��␀␀�␀␀���␀��␀��␀��␀␀␀�␀��␀␀�␀�␀�␀�������␀���������␀␀␀␀␀��␀��␀���␀␀�␀␀������␀�␀␀�␀␀␀␀␀��␀␀␀␀�␀␀�␀␀�␀␀␀␀␀␀␀�␀␀␀�␀␀␀␀����␀�␀��␀␀␀�␀␀␀␀�␀␀␀␀␀�����������␀␀␀�␀␀␀��␀␀�␀␀���␀��␀��␀��␀␀␀�␀��␀␀�␀�␀�␀�������␀���������␀␀␀␀␀��␀��␀␀��␀␀�␀�␀��␀���������␀␀␀␀␀��␀��␀␀��␀␀�␀␀��␀␀␀␀␀␀�␀␀�␀�␀␀�␀␀�␀␀��␀␀�␀␀�␀��␀␀���␀␀�␀

W [96][H: 4184][EnigmaIOTNode.cpp:346] loadFlashData() | /config.json do not exist
*WM: Adding parameter
*WM: sleepy
*WM: Adding parameter
*WM: nodename
*WM: SET AP STA
*WM:
*WM: Configuring access point...
*WM: EnigmaIoTNode1e122d
*WM: AP IP address: 
*WM: 192.168.4.1

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Exception (28):
epc1=0x40232f58 epc2=0x00000000 epc3=0x00000000 excvaddr=0x11c00000 depc=0x00000000

>>>stack>>>

ctx: cont
sp: 3ffffa20 end: 3fffffc0 offset: 0190
3ffffbb0:  4028cd8c 00000001 3ffffc30 0000000bb

If the "config.json" exists (created with version 0.9.7) it does not give problems. I have tried this with:

all the same problem.

dgcasana commented 2 years ago

After many tests I have found the problem, compiling with the arduino IDE it works correctly. the case is that compiling with Visual Studio and PlatformIO it fails to refer to a directory other than "src":

But the problem is with my Visual Studio, not with your code, which is wonderful.