Page 2 of 3

Re: accessing uart0 on nodemcu board

Posted: Mon Dec 24, 2018 8:44 am
by hwt9520
dariox wrote:
Sun Dec 23, 2018 9:37 pm
I've flashed the same boot.py, but still the same result. I'm currently running no main.py. FW is
esp8266-20180511-v1.9.4.bin
me too

Re: accessing uart0 on nodemcu board

Posted: Mon Dec 24, 2018 9:21 am
by Roberthh
As Christian Walther told, you have to install a more recent firmware, like from today's daily build,

Re: accessing uart0 on nodemcu board

Posted: Mon Dec 24, 2018 2:08 pm
by dariox
Ok, now it seems working. But when I put uos.dupterm(None, 1) into the terminal, it stops working, the terminal hangs.

Re: accessing uart0 on nodemcu board

Posted: Mon Dec 24, 2018 2:12 pm
by kevinkk525
If you write: uos.dupterm(None, 1)
you disable the terminal output to UART so of course you dont see anything. Use the webrepl.

Re: accessing uart0 on nodemcu board

Posted: Mon Dec 24, 2018 10:30 pm
by dariox
OK, thx!

Re: accessing uart0 on nodemcu board

Posted: Tue Dec 25, 2018 3:36 pm
by dariox
I'm now connected over the WebREPL and I can send the commands, but the response is somehow strange. I would expect something different.


>>> uart.write('AT+CFUN=1,1\r'.encode())
12


uart.read() or uar.readline() shows nothing..

Re: accessing uart0 on nodemcu board

Posted: Tue Dec 25, 2018 4:59 pm
by Roberthh
12 is the number of characters sent.
Did you use the proper speed for your Modem?
Please consider that read() and readline() are not blocking. So if read() is called before the modem responds, you get nothing returned.

Re: accessing uart0 on nodemcu board

Posted: Wed Dec 26, 2018 3:47 pm
by dariox
The modem runs at 9600 baudrate. What would be the right command to read the response instead of read() ?

Re: accessing uart0 on nodemcu board

Posted: Wed Dec 26, 2018 4:35 pm
by Roberthh
read() and readline() are good for reading when data is available. You can check with uart.any() if chaarcters are available, and wait for a while for the response from the modem.

Re: accessing uart0 on nodemcu board

Posted: Thu Jan 03, 2019 8:25 am
by flywire
@dariox - If you got this working can you post the code?