gorcsgergely / myNSPanel

Custom Sonoff NSPanel firmware
2 stars 0 forks source link

Boot loop #1

Closed arjena closed 2 days ago

arjena commented 2 days ago

I tried to compile your code in VSCode/Platformio, and that went well without any effort. But when I upload to the nsPanel it goes into a boot loop. It may of course be that the FTDI programmer I use is unable to provide enough power for the ESP32, so I also tried to upload an otherwise empty ota code (elegant ota by ayushsharma82) but that also goes into bootloop. Connected to mains it should appear on my network, but it does not so I can only assume it is still in bootloop on mains power. Another esp32 (not nsPanel) works fine with this code. Reading about this I find this may be because the wrong esp chip is set in platform.ini.

Your platform.ini is set to:

[env:esp32dev] platform = espressif32 board = esp32dev

Does this work for you?

gorcsgergely commented 2 days ago

Hi!

The programmer is not enough to power the NSPanel. That is for sure, I came accross the same issue. You can sniff the serial messages and it will tell you what happens.

There could be several reasons why it is not on your network. I may not connect to your wifi. You can find the fallback wifi setting in the code. If I remember correctly it is SSID=home, pass=12345678 Try to make a network with that and see if it appears.

The project works fine as-is with the current setup on my end.

arjena commented 2 days ago

I will dig a little deeper in the code to see if I can find the fallback wifi settings. Will report back. Tnx.

gorcsgergely commented 2 days ago

It is in the includes/config.h You can see the use in the main loop, where it loads this fallback config after not being able to connect to the user defined network.

I am pretty sure you need to use the fallback wifi, as you only have a chance to overwrite it from a browser after you have a working unit. (Or from the LCD but you need the TFT file also uploaded for that, which you can only do over the browser again)

arjena commented 2 days ago

Thanks, found it. When I load the code to an esp32 dev board it works ok. (except for the MQTT connection, I had to 'hard code' that in the main.cpp to make it work. But on the NSPanel still no luck. I don't have a 5V supply at hand here, will try again later when I can supply the NSPanel with 5V outside the enclosure.

gorcsgergely commented 2 days ago

In the previus version NSPanel acted as the main MQTT broker. I tried it with different MQTT libraries but it was not stable enough so I decided to rely on an external MQTT broker (eg. Mosquito) The symproms were the same for both. After several hours, the broker worked well, but rejected any new clients. Maybe I'll get back to this problem later on.

arjena commented 2 days ago

When I open the web page (still on the esp32 dev board) the ssid and password are readable, but the Mqtt address is all garbled (������������������������). So something is lost in translation there. No problem, I won't need to change the brokers IP address anyway. I also had some trouble in the past using both a web server and MQTT on the same device. On one occasion, it stopped responding to MQTT after a while, but when I loaded the exact same code on another esp it worked perfectly. I have my own MQTT broker running on a Pi, so I don't need a broker on the NSPanel.

arjena commented 2 days ago

Aha, when I put just the main board back in the six-pin slot of the enclosure it works. I can access the server and change the settings. Will try later with everything in place, but now I have to leave so it must wait. Hate it when that happens ;).

arjena commented 2 days ago

Put everything back together again and it still works. So now I can start adapting your code to my needs. Tnx!

gorcsgergely commented 2 days ago

I close the issue as it is not code related