LoPy4 + Exp.board - Syntax error after deepsleep
-
We have multiple LoPy4 based sensornodes all with frimware 1.18.1.r1 (sysname='LoPy4', nodename='LoPy4', release='1.18.1.r1', version='v1.8.6-849-b0520f1 on 2018-08-29', machine='LoPy4 with ESP32', lorawan='1.0.2', sigfox='1.0.1').
In the test setup I have three 'dummy' sensor nodes that boot after deepsleep, initialize sensors if available (in the test case none), reads the sensors values (generate one random number as test case) and send the measured values over LoRa to a (own made Lore, LoPy4 based) gateway and goes in deep sleep (+/- 60 sec).
Every thing works well for some time but so now and than a 'SyntaxError: invalid syntax' (on different lines in the code and on all nodes) causing the Python script to terminate. The sensor node needs to be reset manually!
Is there a known solution to this issue?
-
@lambert We are still working on a few bug fixes and waiting for the new Sequans firmware. We should be able to release a new
stable
version in the next few weeks.
-
@lambert I would consider it a workaround until the new firmware is officially released.
-
@sympatron said in LoPy4 + Exp.board - Syntax error after deepsleep:
@lambert Try
pycom.wdt_on_boot(True)
. That way you are not depending onmain.py
loading successfully.Thanks, Now total ~3000 wakes on three LoPy's last night without Syntax error and stop. Had 9x, 5x and 7x an application stop and WDT reset, seems ok now.
The only thing is that the Wake reason is now 'Power ON' instead of 'WDT'.
-
@charly86 said in LoPy4 + Exp.board - Syntax error after deepsleep:
@lambert to avoid this I manage exception with auto reset in main.py, this allow device restarting with exception, and allow even you reset or not depending on exception.
try: # do your main code here except Exception as e: print("Exception") print(e) time.sleep(1) machine.reset()
This avoid your device staying in Python console mode ;-)
Of course remove this when testing if you want to see exception
Do that only going into productionThis will not work in this case, because the syntax error prevents execution of anything in
main.py
. For any other exceptions that my happen this helps.
-
@lambert to avoid this I manage exception with auto reset in main.py, this allow device restarting with exception, and allow even you reset or not depending on exception.
try: # do your main code here except Exception as e: print("Exception") print(e) time.sleep(1) machine.reset()
This avoid your device staying in Python console mode ;-)
Of course remove this when testing if you want to see exception
Do that only going into production
-
@lambert Try
pycom.wdt_on_boot(True)
. That way you are not depending onmain.py
loading successfully.
-
@sympatron I'm using the watchdog now as one of the first lines in my main.py just next to import machine. This solves a lot of the 'SyntaxError: invalid syntax' errors. However sometimes the main.py isn't loaded because of the 'SyntaxError: invalid syntax' error in which case the watchdog isn't set and the LoPy4 does stop executing! So really need a solid solution.
-
@lambert According to this post from last week it is planned to be in the very near future:
@catalin said in LoRa Mesh General Questions:
Probably, we'll release a stable version at the end of this week, not completely sure.
-
@sympatron
Is there a release date planned?
-
This is a known problem and does not really depend on the code. It will probably be fixed in version 1.19 if you use LittleFS as your filesystem:
@xykon said in Random syntax error on boot (gpy, others?):
@Sympatron @geir I've now had the LoPy4 running for several days on the development firmware and it hasn't shown the syntax error so far, so I'm cautiously optimistic that the issue has been fixed. We're working on making the development firmware support both FATfs and LittleFS so users can choose at which point they migrate the fs rather than being forced to use LittleFS with the development firmware.
Until it is released I would recommend using the watchdog.
-
This post is deleted!