Monitor Baud Bug

thethinker
Posts: 54
Joined: Thu Mar 01, 2018 1:26 am

Monitor Baud Bug

Postby thethinker » Mon Mar 12, 2018 4:58 am

Hi,
I know the following bug has been fixed in the new IDF:
https://github.com/espressif/esp-idf/issues/1136

However there is still another bug left. I'm using the WSL Ubuntu on Windows 10 and it has the creators update. The 'Make Monitor' Crashes if the monitor baudrate is anything other than 115200, but the 'make simple_monitor' always works. This is due to the fact that the ROM always sends data on 115200 baud upon restart (which is what make monitor does) and since this doesn't match the minicom's baud it starts seeing junk characters which crashes the minicom.
To fix this I have added the following to the idf_monitor.py :

if self._output_enabled:
try:
self.console.write_bytes(b)
except:
pass

Please fix this in the next release.

ESP_Sprite
Posts: 4265
Joined: Thu Nov 26, 2015 4:08 am

Re: Monitor Baud Bug

Postby ESP_Sprite » Mon Mar 12, 2018 8:43 am

Can you make an issue for this on Github? If you post it to the forums, it can easily be forgotten, but we have a process in place for Github issues.

WiFive
Posts: 3005
Joined: Tue Dec 01, 2015 7:35 am

Re: Monitor Baud Bug

Postby WiFive » Mon Mar 12, 2018 9:58 am

ESP_Sprite wrote:Can you make an issue for this on Github? If you post it to the forums, it can easily be forgotten, but we have a process in place for Github issues.
You could keep typing replies telling people to make issues on GitHub or you could write a browser script that opens an issue on GitHub and responds to the post in 1 click. :o #upgradetheprocess

ESP_Sprite
Posts: 4265
Joined: Thu Nov 26, 2015 4:08 am

Re: Monitor Baud Bug

Postby ESP_Sprite » Mon Mar 12, 2018 11:14 am

Image

ESP_Angus
Posts: 2253
Joined: Sun May 08, 2016 4:11 am

Re: Monitor Baud Bug

Postby ESP_Angus » Tue Mar 13, 2018 12:02 am

Hi thethinker,

I don't have a WSL installation up and running right now to quickly test, but you could please confirm if the latest IDF master still crashes. The latest has this commit:
https://github.com/espressif/esp-idf/co ... 6d5f1e20f9

Which may indirectlu solve the problem, if its writing to the console which fails.

If it's not writing to the console then could you please copy-paste the idf_monitor output when the error occurs.

Thanks,


Angus

thethinker
Posts: 54
Joined: Thu Mar 01, 2018 1:26 am

Re: Monitor Baud Bug

Postby thethinker » Tue Mar 13, 2018 1:24 am

Hi,
This should happen with any linux or at least any debian distro I don't think it's just for WSL. I'm already on the latest IDF release. I'm not writing to the console at all. It happens as soon as IDF opens. Bellow is the output:
MONITOR
--- idf_monitor on /dev/ttyS19 921600 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

Traceback (most recent call last):
File "/home/xxx/ESP32/esp-idf/tools/idf_monitor.py", line 624, in <module>
main()
File "/home/xxx/ESP32/esp-idf/tools/idf_monitor.py", line 549, in main
monitor.main_loop()
File "/home/xxx/ESP32/esp-idf/tools/idf_monitor.py", line 272, in main_loop
self.handle_serial_input(data)
File "/home/xxx/ESP32/esp-idf/tools/idf_monitor.py", line 308, in handle_serial_input
self.console.write_bytes(b)
File "/usr/lib/python2.7/dist-packages/serial/tools/miniterm.py", line 57, in write_bytes
self.byte_output.flush()
IOError: [Errno 5] Input/output error



Also after the crash, there is NO way I can exit , I just have to close the terminal and open again.
WiFive is right, I have seen so many instances where people write issues here and they get lost. It would be awesome if you could put this into the bucket list (adding the button for pushing issues to git).

This is exactly like the Write issue that you had and fixed in the new IDF, just add the same try and catch in the read section, which is what I did.

ESP_Angus
Posts: 2253
Joined: Sun May 08, 2016 4:11 am

Re: Monitor Baud Bug

Postby ESP_Angus » Tue Mar 13, 2018 1:59 am

Hi thethinker,

Thanks for the update and the stack trace. I understand what's going on now, will add a fix.
This should happen with any linux or at least any debian distro I don't think it's just for WSL.
FWIW, I don't expect so. stdout pipes on Linux will generally accept any bytes you write to them, without the write() syscall failing. I think this is a WSL translation layer quirk.

Angus

Who is online

Users browsing this forum: No registered users and 52 guests