Recently had a problem where I lost inputs from 2 of my emonESP devices. I misinterpreted the fault and decided to update the firmware on the ESP which in my case are wemos devices. Despite erasing flash first and then uploading firmware and spiffs using platformIO I keep seeing the following:
EmonESP 12880953
Firmware: 2.3.0
Starting APScan: 12 networks found
AP IP Address: 192.168.4.1
Server started
Commencing factory reset.
þactory reset complete! Resetting…
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
EmonESP 12880953
Firmware: 2.3.0
Starting APScan: 13 networks found
AP IP Address: 192.168.4.1
Server started
Assuming I had a duff ESP I used a new one but still get the same result. Out of interest I tried to upload Tasmota on the same ESP and that works perfectly.
That’s probably the GPIO0 (boot) being held low after flash.
Try allowing GPIO0 to go high after flashing.
It’s useful if you forget the wifi or admin settings, to put GPIO0 low to factory reset the device, but does mean it causes this apparent bootloop you’ve found!
Not sure that is an issue on a wemos. Also that doesn’t explain why Tasmota loads and runs without any problems. I only have the problem with emonESP firmware. I have a number of other wemos running emonESP and have never had this problem before.
I am connecting Wemos DI mini ESP modules. I have used these without problems in the past and have 3 running perfectly.
I have used both 4MB and 16MB modules.
The firmware on the Tx is fine.
To double check everything I went back to basics this morning. I deleted the EmonESP directory and cloned emonESP from github again.
It compiled and uploaded without any problems.
Still the same result, starts AP scan and then resets.
Out of interest I also did the same and tried with checking out timer branch.
This will definitely no longer compile. Could somebody confirm this or should I just raise this as an issue on Github?
Downloading the master branch from github just won’t work with PIO because the .ini is old, and will download the most recent ESP framework. Any framework above v2.5.0 won’t work with emonESP as it now stands.
I’ve only ever successfully compiled emonESP master with ArduinoIDE.
emonESP timer compiles fine with PIO, but not Arduino.
Maybe try compile emonESP master with ArduinoIDE.
Otherwise yes, raise a github issue and someone will have a look at updating the .ini to compile in PIO successfully again.
Some progress. I have managed to compile using Arduino.
Now the ESP starts APScan and does not reset. This kind of confirms there are issues with the platformIO compiling.
Sadly I now see the device on my smart phone but all I get when I try to connect is:-
Obtaining IP address…
Then after a considerable time it gives up showing on the phone:-
IP Configuration Failure
I did erase the ESP before uploading the new firmware and SPIFFS.
That’s a similar problem I had with the 2.5.2 framework of esp8266 for arduino.
You’ve definitely selected the correct version, version 2.4.2, in the boards manager?
That was it. I am sure I had selected 2.4.2 framework but it was on 2.5.2.
Corrected that and the problem with resetting is fixed. I can now access EmonESP and everything should be fine. Sadly its not. I cannot get it to connect to my server. I have no idea why. I have other EmonESP units running and I have copied the server settings from them and pasted the write key from my server.
Is there any way to debug the running EmonESP. I have it connected with a serial port but all it shows is:
EmonESP 2056056
Firmware: BUILD_TAG
Connecting to SSID: studiooutside
Connected, IP: 192.168.1.53
Server started
There’s a debug.h header, a tab should be viewable in Arduino.
debug.h seems designed for use with PIO. I’ve never used it. A quick look may suggest uncommenting this might help:
Many thanks. I am now working!
I changed debug and went through the complete firmware upload again and now it is working. However it may have been OK all the time. I filled in all the parameters and hit Save.
Response was:-
Connected: No
For some reason at that stage I hit the HTTP link below the latest data window