Page 1 of 1

Monitor Baud Bug

Posted: Mon Mar 12, 2018 4:58 am
by thethinker
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.

Re: Monitor Baud Bug

Posted: Mon Mar 12, 2018 8:43 am
by ESP_Sprite
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.

Re: Monitor Baud Bug

Posted: Mon Mar 12, 2018 9:58 am
by WiFive
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

Re: Monitor Baud Bug

Posted: Mon Mar 12, 2018 11:14 am
by ESP_Sprite
Image

Re: Monitor Baud Bug

Posted: Tue Mar 13, 2018 12:02 am
by ESP_Angus
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

Re: Monitor Baud Bug

Posted: Tue Mar 13, 2018 1:24 am
by thethinker
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.

Re: Monitor Baud Bug

Posted: Tue Mar 13, 2018 1:59 am
by ESP_Angus
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