UART: I cannot get any reading from GPS
-
Hi,
I connected GPS module to GPy and tried to read some data from it using UART. No success despite many attempts. Reading is always None. GPS module works perfectly as I have connected it to my computer and sends data.from machine import UART uart = UART(1, 9600) uart.init(9600, bits=8, parity=None, stop=1, pins=('P3','P4')) print (uart.readline()) while True: if (uart.any()>0): print ('Yra')Any help appreciated!
Used items:
Exp. board 3.0
(sysname='GPy', nodename='GPy', release='1.18.0.r1', version='v1.8.6-849-9569a73 on 2018-07-20', machine='GPy with ESP32', pybytes='0.9.0')
GPS: GP-20U7 -
@andrejpekarcik how about swapping P3 and P4, either the wires or the arguments?
from machine import UART uart = UART(1, 9600) uart.init(9600, bits=8, parity=None, stop=1, pins=('P3','P4')) while True: if (uart.any()>0): print (uart.readline())or better:
from machine import UART import sys uart = UART(1, 9600) uart.init(9600, bits=8, parity=None, stop=1, pins=('P3','P4'), timeout_chars = 10) while True: if (uart.any()>0): sys.stdout.write(uart.read().decode()) -
Hi,
I tried your code, same result.
How can I test somehow if UART on GPy is working?
-
Hooray! I've got it!
Signal wire was broken between pin and GPS. 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