LoPy UART for GPS not reading data
-
Thanks for the quick reply.
My test is now working. I can't explain why!
I changed a few things, like removed the jumper pins, then replaced them.
Changed the UART0 baudrate to 9600, and then back to 115200.
None of this is relevant though, as from power up the unit is now receiving fine.Odd. I'd like to think I 'fixed' something, but don't believe I changed anything useful.
Anyway, now I can proceed!
-
@johnmcdnz
good to here that it work for you.
Maybe there was some not linked to contacts. -
@johnmcdnz I did a post of a minimalistic NMEA parser. see here. Perhaps it might help you as well
-
@affoltep @johnmcdnz
just curious - what gps module do you use?And if you can tell why? :)
-
@livius It's this
http://www.addicore.com/NEO-6M-GPS-p/231.htm
available and cheap :-)
(I don't buy from that website, just a local supplier of the same thing) -
@livius This module here, as well cheap and with integrated antenna.
-
@johnmcdnz
thank you - yes it is really good@affoltep
interesting - i didn't see it before -
is it fast and accurate? Looks really interestingly -
@livius Looks like a reasonable unit, claims 2.5m accuracy, <30s fix from cold and 1s from hot start.
-
@affoltep I have copied your code. Excuse my ignorance with Python, what's the correct way to pass the data string to the code and read the response.
e.g. if NMEA string is in 'data', and decode is to be in 'place'
place = NmeaParser.update(data)
I know this is incorrect, but what is right? -
Is this correct:
place = NmeaParser() place.update(data) print (place.longitude, ":", place.latitude) -
@johnmcdnz Here are some code fragments how I use:
#initialize UART interface to the GNSS module gps_pps = Pin('P23', mode = Pin.IN) gps_enable = Pin('P8', mode=Pin.OUT) gps_enable(False) gps_uart = UART(1, 9600) gps_uart.init(9600, bits=8, parity=None, stop=1) #Create NMEA structure nmea = NmeaParser()...
latitudebinary = 0 longitudebinary = 0 altitude = 0 hdop = 0 newpos = False...
while not newpos: if gps_uart.any(): nmea.update(gps_uart.readline()) if nmea.fix_stat & nmea.valid_sentence: newpos = True if (time.ticks_diff(start, time.ticks_ms()) > GNSS_TRIAL): pycom.rgbled(red) print('No actual GNSS postition') time.sleep(0.2) pycom.rgbled(off) return latitudebinary = int(((nmea.latitude + 90) / 180) * 16777215) longitudebinary = int(((nmea.longitude + 180) / 360) * 16777215) altitude = int(nmea.altitude) hdop = int(nmea.hdop * 10)Hope it is understandable ;)
-
@affoltep Many thanks for the help. I'll carry on work with it tomorrow. Made good progress tonight. Cheers.
-
I have completed this project and have posted on this topic:
https://forum.pycom.io/topic/819/lopy-gps-receiver-project
@affoltep -
hi @affoltep i tried to connect a gps to my lopy4 and use your code, but it's not working.. of course the gps led is blinking and the code is running well.
this is my wired setup
can you help me please?
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