Send data from PC to LoPy4 via USB(Ex. Board v3)
-
Hey guys :)
I try to send via UART data(LoRa Msg/payload) from PC to LoPY.
It seems i can't send data via USB to LoPy. I am right?Tried to debug it manually:
from machine import UART import binascii import pycom uart = UART(1, 115200) uart.init(115200, bits=8, parity=None, stop=1) pycom.heartbeat(False) i=0 le=100 u=1 while i<le: u=uart.read(1) if u: #Always None pycom.rgbled(0xff00) print(i) i=i+1I have to use the Pins, right?
Thanks :)
Kind regards
Milad -
@sadtex The default pins for UART 1 are P3(TX) and P4(RX). If you want to use the USB/UART on expansion board 3, you must select UART 0.
Instead of using the UART module, you can also use sys.stdin.read() for receiving and sys.stdout.write() for sending.
Be aware that using UART0 is not fully transparent. It may still react on Control signals like Ctrl-C (abort) and Ctrl-F(safe boot). In order to deactivate this, call micropython.kbd_intr(-1). -
@robert-hh Ah, Thanks !!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login