Windows 10 update broke make monitor and make simple_monitor

CharlesSeartech
Posts: 19
Joined: Fri Oct 06, 2017 10:27 am

Windows 10 update broke make monitor and make simple_monitor

Postby CharlesSeartech » Wed Dec 13, 2017 7:56 am

Hi,

I know this is not ESP specific but maybe someone has experienced the same issue and can help. I have done some searching to see if there are reports of a similar problem but have not found any links.
My Windows 10 updated last night and now make monitor and make simple_monitor are not working.
Running make monitor I get the following:
$ make monitor
MONITOR
--- idf_monitor on COM7 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

)
Traceback (most recent call last):
File "D:/Projects/ESP32_Projects/esp-idf/tools/idf_monitor.py", line 570, in <module>
main()
File "D:/Projects/ESP32_Projects/esp-idf/tools/idf_monitor.py", line 504, in main
monitor.main_loop()
File "D:/Projects/ESP32_Projects/esp-idf/tools/idf_monitor.py", line 269, in main_loop
self.handle_serial_input(data)
File "D:/Projects/ESP32_Projects/esp-idf/tools/idf_monitor.py", line 302, in handle_seria
l_input
self.console.write_bytes(b)
File "C:/msys32/mingw32/lib/python2.7/site-packages/serial/tools/miniterm.py", line 63, in write_bytes
self.byte_output.write(byte_string)
File "D:/Projects/ESP32_Projects/esp-idf/tools/idf_monitor.py", line 562, in write
self.output.write(b)
IOError: [Errno 22] Invalid argument
make: *** [/d/Projects/IPStreamer/Espressif/ESP32_Projects/esp-idf/components/esptool_py/Makefile.projbuild:96: monitor] Error 1


and running make simple_monitor I get the following:
$ make simple_monitor
--- forcing DTR inactive
--- forcing RTS inactive
--- Miniterm on COM7 115200,8,N,1 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
?[0;32mI (10) boot: ESP-IDF v3.0-dev-1248-g7e8c2a9c-dirty 2nd stage bootloader?[0m
?[0;32mI (10) boot: compile time 10:23:55?[0m
?[0;32mI (10) boot: Enabling RNG early entropy source...?[0m
?[0;32mI (15) boot: SPI Speed : 40MHz?[0m
?[0;32mI (19) boot: SPI Mode : DIO?[0m
?[0;32mI (23) boot: SPI Flash Size : 4MB?[0m
?[0;32mI (27) boot: Partition Table:?[0m
?[0;32mI (31) boot: ## Label Usage Type ST Offset Length?[0m
?[0;32mI (38) boot: 0 nvs WiFi data 01 02 00009000 00004000?[0m
?[0;32mI (46) boot: 1 otadata OTA data 01 00 0000d000 00002000?[0m
?[0;32mI (53) boot: 2 phy_init RF data 01 01 0000f000 00001000?[0m
?[0;32mI (61) boot: 3 factory factory app 00 00 00010000 00100000?[0m
?[0;32mI (68) boot: 4 ota_0 OTA app 00 10 00110000 00100000?[0m
?[0;32mI (76) boot: 5 ota_1 OTA app 00 11 00210000 00100000?[0m
?[0;32mI (83) boot: End of partition table?[0m
?[0;32mI (87) boot: Defaulting to factory image?[0m
?[0;32mI (92) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x1b66c (112236) map?[0m
?[0;32mI (140) esp_image: segment 1: paddr=0x0002b694 vaddr=0x3ffb0000 size=0x03af8 ( 15096) load?[0m
?[0;32mI (146) esp_image: segment 2: paddr=0x0002f194 vaddr=0x40080000 size=0x00400 ( 1024) load?[0m
?[0;32mI (147) esp_image: segment 3: paddr=0x0002f59c vaddr=0x40080400 size=0x00a74 ( 2676) load?[0m
?[0;32mI (157) esp_image: segment 4: paddr=0x00030018 vaddr=0x400d0018 size=0x6b298 (438936) map?[0m
?[0;32mI (317) esp_image: segment 5: paddr=0x0009b2b8 vaddr=0x40080e74 size=0x114e4 ( 70884) load?[0m
?[0;32mI (346) esp_image: segment 6: paddr=0x000ac7a4 vaddr=0x400c0000 size=0x00000 ( 0) load?[0m
?[0;32mI (357) boot: Loaded app from partition at offset 0x10000?[0m
?[0;32mI (357) boot: Disabling RNG early entropy source...?[0m
?[0;32mI (358) cpu_start: Pro cpu up.?[0m
?[0;32mI (362) cpu_start: Starting app cpu, entry point is 0x4008102c?[0m
?[0;32mI (363) cpu_start: App cpu up.?[0m
?[0;32mI (372) heap_init: Initializing. RAM available for dynamic allocation:?[0m
?[0;32mI (379) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM?[0m
?[0;32mI (385) heap_init: At 3FFCFE98 len 00010168 (64 KiB): DRAM?[0m
?[0;32mI (391) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM?[0m
?[0;32mI (398) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM?[0m
?[0;32mI (405) heap_init: At 40092358 len 0000DCA8 (55 KiB): IRAM?[0m
?[0;32mI (410) cpu_start: Pro cpu start user code?[0m
?[0;32mI (92) cpu_start: Starting scheduler on PRO CPU.?[0m
?[0;32mI (0) cpu_start: Starting scheduler on APP CPU.?[0m
?[0;32mI (95) main:

and after a random time:
I Exception in thread rx:
Traceback (most recent call last):
File "C:/msys32/mingw32/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "C:/msys32/mingw32/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "C:/msys32/mingw32/lib/python2.7/site-packages/serial/tools/miniterm.py", line 448, in reader
self.console.write_bytes(data)
File "C:/msys32/mingw32/lib/python2.7/site-packages/serial/tools/miniterm.py", line 63, in write_bytes
self.byte_output.write(byte_string)
IOError: [Errno 0] Error


Windows Version 1709, OS Build 16299.98

Regards,
Charles


CharlesSeartech
Posts: 19
Joined: Fri Oct 06, 2017 10:27 am

Re: Windows 10 update broke make monitor and make simple_monitor

Postby CharlesSeartech » Wed Dec 13, 2017 12:46 pm

Thanks for the link.

I had to add a second try: except: with pass to get it working.

Code: Select all

$ make monitor
MONITOR
--- idf_monitor on COM7 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
║       )
Traceback (most recent call last):
  File "D:/Projects/ESP32_Projects/esp-idf/tools/idf_monitor.py", line 582, in <module>

    main()
  File "D:/Projects/ESP32_Projects/esp-idf/tools/idf_monitor.py", line 504, in main
    monitor.main_loop()
  File "D:/Projects/ESP32_Projects/esp-idf/tools/idf_monitor.py", line 269, in main_loo
p
    self.handle_serial_input(data)
  File "D:/Projects/ESP32_Projects/esp-idf/tools/idf_monitor.py", line 302, in handle_s
erial_input
    self.console.write_bytes(b)
  File "C:/msys32/mingw32/lib/python2.7/site-packages/serial/tools/miniterm.py", line 63, in write_bytes
    self.byte_output.write(byte_string)
  File "D:/Projects/ESP32_Projects/esp-idf/tools/idf_monitor.py", line 569, in write
    self.output.write(b)
IOError: [Errno 22] Invalid argument
make: *** [/d/Projects/ESP32_Projects/esp-idf/components/esptool_py/Makefile.projbuild:96: monitor] Error 1

Code: Select all

               else:
                    # self.output.write(b)
                    try:
                        self.output.write(b)
                    except IOError:
                        # Windows 10 bug since the Fall Creators Update, sometimes writing to console randomly fails
                        # (but always succeeds the second time, it seems.) Ref https://github.com/espressif/esp-idf/issues/1136
                        try:
                            self.output.write(b)
                        except IOError:
                            # Windows 10 bug since the Fall Creators Update, sometimes writing to console randomly fails
                            # (but [b]NOT [/b]always succeeds the second time, it seems.) Ref https://github.com/espressif/esp-idf/issues/1136
                            # self.output.write(b)
                            pass
                    self.matched = b''

User avatar
urbanze
Posts: 295
Joined: Sat Jun 10, 2017 9:55 pm
Location: Brazil

Re: Windows 10 update broke make monitor and make simple_monitor

Postby urbanze » Wed Dec 13, 2017 2:59 pm

New esp-idf 3.0 realease an update for this, try!

I had this problem too and after update, work's normaly

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

Re: Windows 10 update broke make monitor and make simple_monitor

Postby ESP_Angus » Wed Dec 13, 2017 10:03 pm

CharlesSeartech wrote:Thanks for the link.

I had to add a second try: except: with pass to get it working.
Thanks for the update, Charles. In my testing the second write always succeeded, but seems that's not strictly the case. I've reopened the issue on Github, and we'll update the monitor again.

Who is online

Users browsing this forum: No registered users and 131 guests