When you are running a qpyt watch command, and the device resets e.g. after an AppFota or Watchdog, we manually need to rerun the command. This has several issues:
- When (re)running
watch the device will perform a soft reset, so loosing it's hard reset state, this can be mitigated by running attach, not watch.
- As soon as the device firmware has booted the entry point will run, so we always will miss some logs printed to repl.
Solution:
Implement a --delayed-start flag to watch that has the following implications:
- If there is no
/usr/main.py it has no effect, as there is no automatic start script
- deploy
/usr/main.py as /usr/_main.py to the board. This causes QuecPython not to run it automatically
- If we loose serial connection, try to restablish it until success or user canceled
- If we have the serial connection reestablished:
- Manually run
/usr/_main.py with import example;example.run("/usr/main.py") The example package is also used in QPYcom to execute .py files manually
When you are running a
qpyt watchcommand, and the device resets e.g. after an AppFota or Watchdog, we manually need to rerun the command. This has several issues:watchthe device will perform a soft reset, so loosing it's hard reset state, this can be mitigated by runningattach, not watch.Solution:
Implement a
--delayed-startflag towatchthat has the following implications:/usr/main.pyit has no effect, as there is no automatic start script/usr/main.pyas/usr/_main.pyto the board. This causes QuecPython not to run it automatically/usr/_main.pywithimport example;example.run("/usr/main.py")Theexamplepackage is also used in QPYcom to execute .py files manually