me too
accessing uart0 on nodemcu board
Re: accessing uart0 on nodemcu board
As Christian Walther told, you have to install a more recent firmware, like from today's daily build,
Re: accessing uart0 on nodemcu board
Ok, now it seems working. But when I put uos.dupterm(None, 1) into the terminal, it stops working, the terminal hangs.
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: accessing uart0 on nodemcu board
If you write: uos.dupterm(None, 1)
you disable the terminal output to UART so of course you dont see anything. Use the webrepl.
you disable the terminal output to UART so of course you dont see anything. Use the webrepl.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Re: accessing uart0 on nodemcu board
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..
>>> uart.write('AT+CFUN=1,1\r'.encode())
12
uart.read() or uar.readline() shows nothing..
Re: accessing uart0 on nodemcu board
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.
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
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
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
@dariox - If you got this working can you post the code?