How to use UART?
-
How can I connect an external device (GPS receiver) to LoPy and setup, configure and read in program?
-
You need last firmware
import os os.uname() (sysname='LoPy', nodename='LoPy', release='0.9.1.b1', version='a78d0fa on 2016-10-21', machine='LoPy with ESP32') from machine import UART com = UART(1,pins=("G23","G24")) #USE P2 P3 , keep UART 0 for usb connection com.readline() b'$GPVTG,318.32,T,,M,0.03,N,0.06,K,N*3C\r\n' ``` -
Tip: for code formatting, use four spaces indentation. The REPL prompt
>>>will otherwise make a nested folding quote block.import os os.uname() (sysname='LoPy', nodename='LoPy', release='0.9.1.b1', version='a78d0fa on 2016-10-21', machine='LoPy with ESP32') from machine import UART com = UART(1,pins=("G23","G24")) #USE P2 P3 , keep UART 0 for usb connection com.readline() b'$GPVTG,318.32,T,,M,0.03,N,0.06,K,N*3C\r\n' -
@LoneTech Ok thanks
-
Hi
did someone managed to make it work with an external GPS module
I have the data coming in but when i tried to use the lib micrpyGPS it failed since it wasn't able to allocat memory
so before starting re writing everything to convert the sentance if someone had any sketchup>>> from micropyGPS import MicropyGPS Traceback (most recent call last): File "<stdin>", line 1, in <module> MemoryError: memory allocation failed, allocating 136 bytes >>> com = UART(1,pins=("P3","P4")) >>> com.readline() b'$GPVTG,,,,,,,,,N*30\r\n' >>> com.readline() b'$GPG$GPRMC,12$GPVTG,,,,,,,,,N*30\r\n' >>> com.readline() b'$GPGGA,123243.00,,,,,0,0$GPRMC,123244.00,V,,,,,,,210217,,,N*78\r\n'
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