SOLVED: File download interrupted by RTOS message

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
emtee
Posts: 15
Joined: Thu Jun 14, 2018 4:55 pm
Location: West Kootenay, BC, Canada

SOLVED: File download interrupted by RTOS message

Post by emtee » Tue Apr 28, 2020 4:10 am

I am having issues downloading a large file to my ESP8266.
Approximately 60% into the downloaded, I receive the following text from the ESP8266:

Code: Select all

scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
cnt 

connected with access-point, channel 11
dhcp client start...
ip:192.168.xxx.xxx,mask:255.255.240.0,gw:192.168.xxx.xxx
pm open,type:2 0
I am guessing this information is being generated by the underlying RTOS on the ESP8266.
The board is flashed with firmware I have built from the 1.12 source. I am using uPyLoader to transfer the file to the ESP8266.
The last version of the firmware (1.10) I downloaded and flashed did not have these messages from the RTOS.
Is there a make flag or environment variable I can set to eliminate these messages from the RTOS?
Last edited by emtee on Wed Apr 29, 2020 5:18 pm, edited 1 time in total.

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: File download interrupted by RTOS message

Post by kevinkk525 » Tue Apr 28, 2020 6:53 am

I'm sure it's not the message itself that is interrupting your download. The message indicates that the wifi reconnects during your download and therefore the download fails.
I don't know the reason for this. But you could try disabling wifi sleep according to https://docs.micropython.org/en/latest/ ... sleep_type
Maybe it helps, but maybe the problem is somewhere else.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: File download interrupted by RTOS message

Post by jimmo » Tue Apr 28, 2020 11:48 am

emtee wrote:
Tue Apr 28, 2020 4:10 am
I am having issues downloading a large file to my ESP8266.
emtee wrote:
Tue Apr 28, 2020 4:10 am
I am using uPyLoader to transfer the file to the ESP8266.
kevinkk525 wrote:
Tue Apr 28, 2020 6:53 am
I'm sure it's not the message itself that is interrupting your download. The message indicates that the wifi reconnects during your download and therefore the download fails.
Just to make sure we're on the same page -- emtee, when you say "download" you mean copy a file from your PC, not download a file over wifi (e.g. via HTTP).

I'd need to check but I think that printing out stuff to stdout would possibly confuse something trying to transmit files over the uart (like uPyLoader).

User avatar
emtee
Posts: 15
Joined: Thu Jun 14, 2018 4:55 pm
Location: West Kootenay, BC, Canada

Re: File download interrupted by RTOS message

Post by emtee » Tue Apr 28, 2020 4:46 pm

@jimmo, I should have included more information about my setup.
Yes, I am sending the file over the serial port (USB). The board is a NodeMCU that I have flashed with microPython.
The odd part of this, is when I was using v1.10 of micropython I never saw the messages I am seeing now.

@kevinkk525, I'll try your suggestion of setting the esp.sleep_type(SLEEP_NONE) and see if this helps.

Thank you both for your suggestions.

User avatar
emtee
Posts: 15
Joined: Thu Jun 14, 2018 4:55 pm
Location: West Kootenay, BC, Canada

Re: File download interrupted by RTOS message

Post by emtee » Tue Apr 28, 2020 5:10 pm

I have done a little bit of investigation and compared the two NodeMCU boards I have running. One board is flashed with v1.10 and shows the following information:

Code: Select all

MicroPython v1.10-8-g8b7039d7d on 2019-01-26; ESP module with ESP8266
Type "help()" for more information.
>>> import esp
>>> esp.sleep_type()
2
>>> esp.SLEEP_MODEM
2
>>> 
The other board is flashed with v1.12 that I have built from source. It shows the following information:

Code: Select all

MicroPython v1.12-395-ga177831 on 2020-04-23; ESP module with ESP8266
Type "help()" for more information.
>>> import esp
>>> esp.sleep_type()
2
>>> esp.SLEEP_MODEM
2
>>> 
@kevinkk525, I tried your suggestion and set the esp.sleep_type(SLEEP_NONE) and then downloaded the file. Success! :D

It does seem odd that both boards are set to the same sleep_type() (SLEEP_MODEM), but only the v1.12 board is issuing the messages.

I'll dig a little deeper and see if I can identify any differences between the firmware and code on the two boards.

kevinkk525
Posts: 969
Joined: Sat Feb 03, 2018 7:02 pm

Re: File download interrupted by RTOS message

Post by kevinkk525 » Tue Apr 28, 2020 7:57 pm

Glad my suggestion helped even though I was expecting your "download" to be a file download over wifi not uart :D
It sure does make the wifi more stable but I can't say why 1.12 would have a more unreliable wifi connection, or does 1.10 just not print the reconnect messages?
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

jomas
Posts: 59
Joined: Mon Dec 25, 2017 1:48 pm
Location: Netherlands

Re: File download interrupted by RTOS message

Post by jomas » Tue Apr 28, 2020 9:07 pm

emtee wrote:
Tue Apr 28, 2020 5:10 pm


It does seem odd that both boards are set to the same sleep_type() (SLEEP_MODEM), but only the v1.12 board is issuing the messages.

These are debug messages. They interfere with your download.
To disable, see boot.py and uncomment some lines.

import esp
esp.osdebug(None)

User avatar
emtee
Posts: 15
Joined: Thu Jun 14, 2018 4:55 pm
Location: West Kootenay, BC, Canada

Re: File download interrupted by RTOS message

Post by emtee » Wed Apr 29, 2020 5:17 pm

@jomas, thank you for the information. I have updated the boot.py and this has eliminated the messages.

It appears the default boot.py created with the building of v1.12 has the debug message enabled.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: SOLVED: File download interrupted by RTOS message

Post by jimmo » Thu Apr 30, 2020 12:43 am

emtee wrote:
Wed Apr 29, 2020 5:17 pm
It appears the default boot.py created with the building of v1.12 has the debug message enabled.
Yep, good find...
https://github.com/micropython/micropyt ... tup.py#L54

But this hasn't changed since August 2016?

Post Reply