main.py does not appear to working after boot
-
- Posts: 32
- Joined: Mon May 13, 2019 12:42 pm
Re: main.py does not appear to working after boot
I created the main.py on the raspberryPI, then transferred it to the esp32 by being already logged into the ESP32, then using the command "cp main.py /pyboard/" each time that I modify main.py I use the same procedure. I edit the file on the Pi and then transfer it to the ESP32 using the cp command.
I am using rshell for the repl.
Thanks for all your help
I am using rshell for the repl.
Thanks for all your help
-
- Posts: 32
- Joined: Mon May 13, 2019 12:42 pm
Re: main.py does not appear to working after boot
Any thoughts?
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: main.py does not appear to working after boot
You didn't ask any question so what should we say about it? It's a valid method to update your main.py...
Edit: Ah right, the question is in your title only. Please show the main.py, has it ever worked?
Edit: Ah right, the question is in your title only. Please show the main.py, has it ever worked?
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
-
- Posts: 32
- Joined: Mon May 13, 2019 12:42 pm
Re: main.py does not appear to working after boot
Main only executes when I am already logged into the REPL and issue machine.reset() or cmd+D or soft reset. When I do that all works fine. If I power cycle the unit main.py does not execute. I don't know how to further troubleshoot this. Any help would be appreciated.
Re: main.py does not appear to working after boot
What happens if you power the device with a simple USB Micro power supply, like a smart phone charger? I expect it to work, because that's what I do sometimes.
Re: main.py does not appear to working after boot
It is a little bit strange because that is the code in question:
So there a two reasons why main.py is not executed:
1. It does not exist
2. The device is not in the mode PYEXEC_MODE_FRIENDLY_REPL. That may be cause by a Ctrl-A character sent to the device by the RPi during startup, for whatever reason.
Code: Select all
// run boot-up scripts
pyexec_frozen_module("_boot.py");
pyexec_file_if_exists("boot.py");
if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL) {
pyexec_file_if_exists("main.py");
}
1. It does not exist
2. The device is not in the mode PYEXEC_MODE_FRIENDLY_REPL. That may be cause by a Ctrl-A character sent to the device by the RPi during startup, for whatever reason.
-
- Posts: 32
- Joined: Mon May 13, 2019 12:42 pm
Re: main.py does not appear to working after boot
How do I get similar with what that code actually means, especially the frozen part? Also main.py is in the root of the file system has far as I can tell.
>>> os.listdir('')
['boot.py', 'main.py']
>>>
>>> os.listdir('')
['boot.py', 'main.py']
>>>
Re: main.py does not appear to working after boot
The file _boot.py is embedded in the firmware. That's why it is called frozen. If you build your own firmware, you can also embed python scripts into the firmware, at the benefit of faster loading and lower RAM usage.
Did you make the test with a simple USB power supply?
Did you make the test with a simple USB power supply?
-
- Posts: 32
- Joined: Mon May 13, 2019 12:42 pm
Re: main.py does not appear to working after boot
No it will be several hours before I can make this test. Thank you for all your help.
-
- Posts: 32
- Joined: Mon May 13, 2019 12:42 pm
Re: main.py does not appear to working after boot
Using a standard power supply (not powering from the Raspberrry Pi) produces the same results, main.py is not executing. Is there another way of troubleshooting this problem? Is there any chance there's something wrong with the ESP32? Beyond setting variables, energizing leds, and print statements, I'm at a loss as the how to trouble shoot it further. Any and all help will be appreciated