Open jmozmoz opened 6 years ago
Think this was a bug, but has been fixed in my fork V2.1, if you have a sec, could you test on my v2.1 ?
https://github.com/timpur/homie-esp8266/tree/v2.1
Just point your lib_dep to https://github.com/timpur/homie-esp8266#v2.1
, I think
Unfortunately, this does not solve the problem:
πΎ Saved config file.
β Configuration updated
Flagged for reboot
Device is idle
Triggering ABOUT_TO_RESTART event...
β» Rebooting...
β MQTT disconnected
Triggering MQTT_DISCONNECTED event...
β Wi-Fi disconnected
Triggering WIFI_DISCONNECTED event...
ets Jan 8 2013,rst cause:2, boot mode:(1,6)
ets Jan 8 2013,rst cause:4, boot mode:(1,6)
wdt reset
β» Config file loading
β Config file faild to load
β /homie/config.json doesn't exist
Configuration invalid. Using CONFIG MODE
π‘ Firmware bare-minimum (1.0.0)
π Booting into config mode π
Device ID is xxxxx
AP started as Homie-xxxxx with IP 192.168.123.1
Odd, I'll have a look into later today
Did you find any reason for this effect/bug? Can I help debugging?
Sorry, lacking for time... Will try got to this asap.
Can you tell me what module you use and how much flash and what spifs size ?
Are you using an ESP-01 with a PUYA flash on it?? I ran into exactly the same issue with a new set of ESP-01's I was sent from Ali. It seems the new puya flash has some issues. I had to apply the same patch to esp.cpp to get the SPIFFS working. https://github.com/esp8266/Arduino/issues/4061
@plambrechtsen you are right. Applying the patch https://github.com/esp8266/Arduino/issues/4061#issuecomment-368273656 solves the problem.
Awesome, glad to hear it helped. It had me stumped for quite some time wondering why SPIFFS wasn't working as I couldn't set the initial config or the upload of the ui_bundle.gz wasn't working either.
This is interesting to know, sorry I haven't found time to look into this deaply, but when I do, good to know this ... Not sure how to fix this, might be something to add to docks ...
I don't think this is something that could easily be fixed in homie as it's an underlying issue with the esp8266 SPIFFS writing function. Unless you wanted to lift and shift all of that into Homie which I certainly wouldn't recommend. Otherwise you could add logic into the Web UI and serial console that reads back the config.json file after writing it. If it isn't able to read the config back then you know you have the issue with SPIFFS not working. Another thought about how this could be worked around is to have an option to write the config into offsets in the EEPROM but that would require agreeing particular offsets for where particular configuration items would sit rather than having a free text json file and being limited to 512/1024 bytes. Which would completely change how config is currently managed today.
Is it possible to monkey patch that routine (EspClass::flashWrite)?
Otherwise, it would be helpful if it is documented: ESP-01 + PUYA flash => patch your framework.
Using the bare minimum example, I am trying to update the settings using the way described at https://marvinroger.github.io/homie-esp8266/docs/develop/others/ota-configuration-updates/
This is the command to publish the new config and the json file:
mosquitto_pub -h alpha -p 1883 -u xxx -P 'yyy' -t 'homie/bare/$implementation/config/set' -f test.json
This is the output on the serial console:
The output from the broker during the update process:
Then the ESP-01 stops.
If I reset it manually, the output on the serial device is:
Here is main.cpp and platformio.ini: