make monitor not working on windows

User avatar
rudi ;-)
Posts: 1729
Joined: Fri Nov 13, 2015 3:25 pm

[solved] make monitor not working on windows

Postby rudi ;-) » Fri Mar 17, 2017 12:23 pm

preetam wrote:here is the error

Code: Select all

$ make monitor
MONITOR
/bin/sh: winpty: command not found.
make: *** [~/ESP32/esp-idf/components/esptool_py/Makefile.projbuild:92: monitor] error 127

Angus gave a good tip in comments (scroll down) for the meantime, ( going to build new Windows installs very soon... which has this built-in then later..) :

if you be in msys32 console
install winpty

Code: Select all

pacman -S winpty
$ pacman -S winpty
Löse Abhängigkeiten auf...
Suche nach in Konflikt stehenden Paketen...

Pakete (1) winpty-0.2.2-2

Gesamtgröße des Downloads: 0,49 MiB
Gesamtgröße der installierten Pakete: 2,87 MiB

:: Installation fortsetzen? [J/n] j
:: Empfange Pakete...
winpty-0.2.2-2-i686 499,1 KiB 402K/s 00:01 [##################################################] 100%
(1/1) Prüfe Schlüssel im Schlüsselring [##################################################] 100%
(1/1) Überprüfe Paket-Integrität [##################################################] 100%
(1/1) Lade Paket-Dateien [##################################################] 100%
(1/1) Prüfe auf Dateikonflikte [##################################################] 100%
(1/1) Überprüfe verfügbaren Festplattenspeicher [##################################################] 100%
:: Verarbeite Paketänderungen...
(1/1) Installiere winpty [##################################################] 100%
installed version:
$ winpty --version
winpty version 0.2.2-dev
commit none
test:
$ make monitor
MONITOR
--- idf_monitor on COM27 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0008,len:8
load:0x3fff0010,len:3464
load:0x40078000,len:7828
load:0x40080000,len:252
0x40080000: _WindowOverflow4 at ??:?
entry 0x40080034
0x40080034: _WindowOverflow4 at ??:?
I (43) boot: ESP-IDF v2.0-rc1-296-g02fdf82 2nd stage bootloader
I (44) boot: compile time 16:13:37
I (44) boot: Enabling RNG early entropy source...
I (64) boot: SPI Speed : 40MHz
I (77) boot: SPI Mode : DIO
I (89) boot: SPI Flash Size : 4MB
I (101) boot: Partition Table:
I (113) boot: ## Label Usage Type ST Offset Length
I (135) boot: 0 phy_init RF data 01 01 0000f000 00001000
I (159) boot: 1 ota_0 OTA app 00 10 00010000 000ea000
I (182) boot: 2 nvs WiFi data 01 02 000fa000 00016000
I (205) boot: 3 ota_1 OTA app 00 11 00110000 000ea000
I (228) boot: 4 otadata OTA data 01 00 001fd000 00003000
I (252) boot: End of partition table
I (265) boot: Disabling RNG early entropy source...
I (282) boot: Loading app partition at offset 00010000
I (1450) boot: segment 0: paddr=0x00010018 vaddr=0x00000000 size=0x0ffe8 ( 65512)
I (1450) boot: segment 1: paddr=0x00020008 vaddr=0x3f400010 size=0x19e78 (106104) map
I (1467) boot: segment 2: paddr=0x00039e88 vaddr=0x3ffb0000 size=0x02190 ( 8592) load
I (1497) boot: segment 3: paddr=0x0003c020 vaddr=0x40080000 size=0x00400 ( 1024) load
0x40080000: _WindowOverflow4 at ??:?
I (1520) boot: segment 4: paddr=0x0003c428 vaddr=0x40080400 size=0x1a70c (108300) load
I (1598) boot: segment 5: paddr=0x00056b3c vaddr=0x400c0000 size=0x00034 ( 52) load
I (1599) boot: segment 6: paddr=0x00056b78 vaddr=0x00000000 size=0x09490 ( 38032)
I (1615) boot: segment 7: paddr=0x00060010 vaddr=0x400d0018 size=0x78f08 (495368) map
0x400d0018: _stext at ??:?
I (1642) cpu_start: Pro cpu up.
I (1653) cpu_start: Single core mode
I (1667) heap_alloc_caps: Initializing. RAM available for dynamic allocation:
I (1690) heap_alloc_caps: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM
I (1711) heap_alloc_caps: At 3FFBA6B0 len 00025950 (150 KiB): DRAM
I (1732) heap_alloc_caps: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (1753) heap_alloc_caps: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1775) heap_alloc_caps: At 4009AB0C len 000054F4 (21 KiB): IRAM
I (1796) cpu_start: Pro cpu start user code
[0;32}I (1856) cpu_start: Starting scheduler on PRO CPU.

eMbeddedHome 2017
I (1868) uart: queue free spaces: 10
I (1906) wifi: wifi firmware version: 0b5b6e7
I (1906) wifi: config NVS flash: enabled
I (1906) wifi: config nano formating: disabled
I (1911) wifi: Init dynamic tx buffer num: 32
I (1912) wifi: wifi driver task: 3ffc3060, prio:23, stack:3584
I (1917) wifi: Init static rx buffer num: 10
I (1921) wifi: Init dynamic rx buffer num: 0
I (1925) wifi: Init rx ampdu len mblock:7
I (1928) wifi: Init lldesc rx ampdu entry mblock:4
I (1933) wifi: wifi power manager task: 0x3ffc8408 prio: 21 stack: 2560
I (1939) wifi: wifi timer task: 3ffc9488, prio:22, stack:3584
E (1945) phy_init: PHY data partition validated
I (1968) phy: phy_version: 329, Feb 22 2017, 15:58:07, 0, 0
I (1969) wifi: Init ampdu: 1
I (1969) wifi: Init ampdu: 1
I (1969) wifi: mode : sta (24:0a:c4:04:5c:8c) + softAP (24:0a:c4:04:5c:8d)

ready

--- idf_monitor (1.0) - ESP-IDF monitor tool
--- based on miniterm from pySerial
---
--- Ctrl+] Exit program
--- Ctrl+T Menu escape key, followed by:
--- Menu keys:
--- Ctrl+T Send the menu character itself to remote
--- Ctrl+] Send the exit character itself to remote
--- Ctrl+R Reset target board via RTS line
--- Ctrl+F Run 'make flash' to build & flash
--- Ctrl+A Run 'make app-flash to build & flash app

install, exec - like a charme!

@Angus
thank you

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

User avatar
rajkumar patel
Posts: 29
Joined: Mon Apr 10, 2017 12:43 pm
Location: india

Re: make monitor not working on windows

Postby rajkumar patel » Tue Sep 19, 2017 11:23 am

hello everyone,

pacman -S winpty solved my problem regarding package missing issue.

Code: Select all

$ make monitor
MONITOR
/bin/sh: winpty: command not found.
make: *** [~/ESP32/esp-idf/components/esptool_py/Makefile.projbuild:92: monitor] error 127
however,
while running console example in examples/system/console dir, reading commands from keyboard after running
-- make monitor
or
-- python $(path/to/idf_monitor.py) --baud 115200 --port COM4 -- --make make build/console.elf

are halting the normal execution and further processing becomes impossible.

logs are shown here :

case 1:
for , $make monitor command
initial logs are as follow

Code: Select all

$ make monitor
MONITOR
--- idf_monitor on COM4 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0010,len:4
load:0x3fff0014,len:4276
load:0x40078000,len:0
load:0x40078000,len:11380
entry 0x40078cac
I (647) cpu_start: Pro cpu up.
I (647) cpu_start: Starting app cpu, entry point is 0x40080fb0
0x40080fb0: call_start_cpu1 at D:/temp_idf/esp-idf/components/esp32/cpu_start.c:198

I (0) cpu_start: App cpu up.
I (656) heap_init: Initializing. RAM available for dynamic allocation:
I (677) heap_init: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM
I (696) heap_init: At 3FFB8070 len 00027F90 (159 KiB): DRAM
I (715) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (734) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (754) heap_init: At 400940F8 len 0000BF08 (47 KiB): IRAM
I (773) cpu_start: Pro cpu start user code
I (833) cpu_start: Starting scheduler on PRO CPU.
I (192) cpu_start: Starting scheduler on APP CPU.

This is an example of ESP-IDF console component.
Type 'help' to get the list of commands.
Use UP/DOWN arrows to navigate through command history.
Press TAB when typing command name to auto-complete.
[5n
Your terminal application does not support escape sequences.
Line editing and history features are disabled.
On Windows, try using Putty instead.
esp32>
now as soon as i write any single character and without any enter hit

Code: Select all

Exception in thread Thread-1:
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 "D:/temp_idf/esp-idf/tools/idf_monitor.py", line 118, in _run_outer
    self.run()
  File "D:/temp_idf/esp-idf/tools/idf_monitor.py", line 153, in run
    c = self.console.getkey()
  File "D:/temp_idf/esp-idf/tools/idf_monitor.py", line 233, in getkey_patched
    c = self.enc_stdin.read(1)
AttributeError: 'Console' object has no attribute 'enc_stdin'
this code i get and then my msys stops taking any sort of input from keyboard and all i have to do is to close the msys.

case 2 :
for, idf_monitor.py
logs are -

Code: Select all

$ python idf_monitor.py --port COM4 --baud 115200 --make make build/console.elf
--- idf_monitor on COM4 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0010,len:4
load:0x3fff0014,len:4276
load:0x40078000,len:0
load:0x40078000,len:11380
entry 0x40078cac
I (647) cpu_start: Pro cpu up.
I (647) cpu_start: Starting app cpu, entry point is 0x40080fb0
0x40080fb0: call_start_cpu1 at D:/temp_idf/esp-idf/components/esp32/cpu_start.c:198

I (0) cpu_start: App cpu up.
I (656) heap_init: Initializing. RAM available for dynamic allocation:
I (677) heap_init: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM
I (696) heap_init: At 3FFB8070 len 00027F90 (159 KiB): DRAM
I (715) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (734) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (754) heap_init: At 400940F8 len 0000BF08 (47 KiB): IRAM
I (773) cpu_start: Pro cpu start user code
I (833) cpu_start: Starting scheduler on PRO CPU.
I (192) cpu_start: Starting scheduler on APP CPU.

This is an example of ESP-IDF console component.
Type 'help' to get the list of commands.
Use UP/DOWN arrows to navigate through command history.
Press TAB when typing command name to auto-complete.

Your terminal application does not support escape sequences.
Line editing and history features are disabled.
On Windows, try using Putty instead.
esp32> help



now from last input i'm not able to give any command - not even 'help'.
in both cases linenoiseProbe() call from app_main() is always returning with -2 as it reads not morethan 4 bytes from serial in determined time. is this ok? however in putty also this same return value i am getting.

this is important to note that,
Console example is working too much fine with putty as it is accepting commands smoothly, however previous history of given commands and auto fill(suggestions) with a TAB hit is not possible in this case. and yes, upon reset 1st command execution is getting failed and printing a message of "unrecognized command".(this occurs one time on board reset only).

am i missing some sort of required settings?

thanks.
Regards,
Rajkumar M. Patel

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

Re: make monitor not working on windows

Postby ESP_Angus » Wed Sep 20, 2017 12:27 am

Hi Rajkumar,

I'm not able to reproduce this problem. Can you please give us some more details about your environment:

- What version of the IDF Windows environment & ESP-IDF are you using? Having to install winpty manually makes me think you may have a quite old version, as 20170330 includes this utility. Environment version 20170330 is a good choice for IDF v2.1, 20170918 is the current version of the IDF master branch (pre-V3.0). If you're using the console component then I recommend re-installing your environment.

- How are you launching the terminal that you're using to run "make"? The only supported method is via launching mingw32.exe (which will print a "MINGW32" prompt in purple on the command line). Other environments may work, but you have to make sure you are invoking a MINGW32 version of Python otherwise the serial port & terminal interactions will not work as expected.

- As mentioned in the example output you saw, the "console" component doesn't work fully with idf_monitor.py on Windows. This is due to limitations in the MSYS terminal shell.

- If you get in a situation where the terminal shell seems to not be printing characters but may be registering input, you can try typing "reset<enter>" and see if this corrects the situation.

User avatar
rajkumar patel
Posts: 29
Joined: Mon Apr 10, 2017 12:43 pm
Location: india

Re: make monitor not working on windows

Postby rajkumar patel » Wed Sep 20, 2017 5:59 am

hi ESP_Angus,

sorry for late reply, actually i didn't get the email notification for this subscribed topic.

1. yes, i am using too much old version for this msys toolchain --

Code: Select all

<Packages>
    <ApplicationName>MSYS2 32bit</ApplicationName>
    <ApplicationVersion>1.0.0</ApplicationVersion>
    <Package>
        <Name>com.msys2.root</Name>
        <Title>MSYS2 32bit</Title>
        <Description>Cygwin-derived Posix-like env. for Windows with Arch Linux's Pacman</Description>
        <Version>20160205</Version>
        <LastUpdateDate></LastUpdateDate>
        <InstallDate>2016-08-16</InstallDate>
        <Size>0</Size>
    </Package>
    <Package>
        <Name>com.msys2.root.base</Name>
        <Title>MSYS2 32bit base</Title>
        <Description>Cygwin-derived Posix-like env. for Windows with Arch Linux's Pacman</Description>
        <Version>20160205</Version>
        <LastUpdateDate></LastUpdateDate>
        <InstallDate>2016-08-16</InstallDate>
        <Size>204444311</Size>
    </Package>
</Packages>
i will try running this after upgradation.

2. i'm running make in
C:\msys32\msys2_shell(windows command script)

3. yeah, i think, msys teminal shell is the limitation for limited working of this console example code.

4. i tried using reset command but this is not working.

angus, one thing i noticed is,
whatever commands i give after running idf_monitor.py script,
all commands are buffered in and hence stored internally and as soon as i terminate the console process(with ctrl+C) all the enter(newline) separated commands(or text) gets executed one by one in sequential manner.
as per my expectation this commands should go directly on uart and hence to the device rather than getting buffered.

in initialize_console() itself at the beginning we are disabling buffering in stdin and stdout stream(i suppose) by
setvbuf(stdin, NULL, _IONBF, 0);
setvbuf(stdout, NULL, _IONBF, 0);
isn't this enough?
or
can i use any other settings to stop this buffering?

and as i always feel, many thanking to you ESP_Angus, for your quick and elaborated response.

regards.
Regards,
Rajkumar M. Patel

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

Re: make monitor not working on windows

Postby ESP_Angus » Wed Sep 20, 2017 6:57 am

rajkumar patel wrote:angus, one thing i noticed is,
whatever commands i give after running idf_monitor.py script,
all commands are buffered in and hence stored internally and as soon as i terminate the console process(with ctrl+C) all the enter(newline) separated commands(or text) gets executed one by one in sequential manner.
as per my expectation this commands should go directly on uart and hence to the device rather than getting buffered.
This buffering is a problem with MINGW32 Python when running in the MINGW32 terminal, not with the firmware.

Using Putty is the best solution for now. We're looking to find a better way around this in the future.

User avatar
rajkumar patel
Posts: 29
Joined: Mon Apr 10, 2017 12:43 pm
Location: india

Re: make monitor not working on windows

Postby rajkumar patel » Wed Sep 20, 2017 7:34 am

yes ESP_Angus,
surely there was nothing wrong with the firmware and i've realized this thing from your former post only.

i'll try running console on , your suggested, latest msys environment. will let you know if i still get any issues -- however, chances would be rare. :D

thanks a lot, Angus. :)
Regards,
Rajkumar M. Patel

Who is online

Users browsing this forum: No registered users and 349 guests