Restarting code without reset button or power-cycle
-
Hi,
I have some code on a Lopy with a boot.py and a main.py. I can ftp into the Lopy over WiFi and upload a new version of the code. I can connect with telnet and see console output over WiFI. What I cannot figure out is how I can execute a new version of the main.py that I have uploaded. When I press the reset button (physically) or cycle power, it will run the new code, but I want to trigger this through telnet.
Any tips?
Thanks
Christian
-
@robert-hh Thanks, that is perfect.
-
@christian_kohler
The documentation is your friend:import machine machine.reset()
See: https://docs.pycom.io/chapter/firmwareapi/pycom/machine/