board unresponsive after main.py file activation.

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
Perere
Posts: 3
Joined: Sat Aug 24, 2019 3:29 pm

board unresponsive after main.py file activation.

Post by Perere » Mon May 11, 2020 11:10 am

Hi all.
I have an adafruit feather HUZZAH and I'm trying to use micropython for the first time. There seemed to be an issue that I can flash micropython on to the board and everything seems to work fine. I'll then use mpfshell to put the main.py file that just set some of the pins and flashes an LED ten times. Upon the reset the board is activated and the code run but nothing is accessible. mpfshell is no longer responsive, I tried using picocom to access the repl and that doesn't work either. Rebooting or power cycling simply re-runs the the main.py but I can't access or replace it the main.py anymore. The only way to get it functioning again is to esptool erase flash it and then reupload the firmware however the same problem is still in place where as soon as the board is run with a main.py the board is no longer responsive.

I'm using a MacBook and the screen is also unresponsive after the first run. I also tried using an older version of the esp8266 firmware but with the same outcome so I'm not sure what I'm doing wrong or what I should try next.

User avatar
Roberthh
Posts: 1960
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: board unresponsive after main.py file activation.

Post by Roberthh » Mon May 11, 2020 11:55 am

The REPL prompt is only active when no code is running. So you will get the prompt back after main.py has finished. You should be able to interrupt main.py with Ctrl-C.
For testing I usually write my code into a separate script called e.g. blink.py, and start that from REPL with "import blink". If it shall start when the board boots, you can add "import blink" to main.py.

Perere
Posts: 3
Joined: Sat Aug 24, 2019 3:29 pm

Re: board unresponsive after main.py file activation.

Post by Perere » Mon May 11, 2020 3:58 pm

Thank you for your response. The REPL is unresponsive once the code is finished running. I ampy/mpfshell cannot successfully connect to the board once the first run of main.py has happened. Ctrl + C using Picocom doesn't cause an interrupt either.

SpotlightKid
Posts: 404
Joined: Wed Apr 08, 2015 5:19 am

Re: board unresponsive after main.py file activation.

Post by SpotlightKid » Mon May 11, 2020 4:43 pm

Show us your main.py.

Perere
Posts: 3
Joined: Sat Aug 24, 2019 3:29 pm

Re: board unresponsive after main.py file activation.

Post by Perere » Tue May 12, 2020 1:56 pm

I have come across a great but annoying fix. I haven't seemed to change anything yet when I connected it and reuploaded it today it is all working as intended, from a problem that I couldn't fix a few days ago to seemingly fine. If the problem comes back with any level of repeatability I'll let you know, but either way thank you very much for your time.

Post Reply