GPS click on micropython

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Yadnik
Posts: 65
Joined: Thu May 13, 2021 6:01 am

GPS click on micropython

Post by Yadnik » Mon Jul 19, 2021 7:00 pm

I am trying to run the Mickroe GPS Click https://www.mikroe.com/gps-click on a board flashed with Zephyr port of MicroPython. There is however no ready made library available.There is only one available in C as seen from here:https://github.com/MikroElektronika/mik ... clicks/gps .Can someone please tell me how can I run the gps click on my board with this example via repl.
Thank you very much.

Yadnik
Posts: 65
Joined: Thu May 13, 2021 6:01 am

Re: GPS click on micropython

Post by Yadnik » Mon Jul 19, 2021 7:01 pm

I am also facing this problem with other click boards running on various other protocols.Do I have to only copy and convert the code from c to python at a function level and take it into use?

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: GPS click on micropython

Post by pythoncoder » Tue Jul 20, 2021 5:15 am

See this library. I haven't tested with the board you describe, but assuming it emits standard NMEA sentences it should work. There is also MicropyGPS on which which I based my solution.
Peter Hinch
Index to my micropython libraries.

Yadnik
Posts: 65
Joined: Thu May 13, 2021 6:01 am

Re: GPS click on micropython

Post by Yadnik » Tue Jul 20, 2021 8:31 am

Thank you very much.
I am using a zephyr port of MicroPython and not running it on a board that has a dedicated port of micropython on it. Hence I am facing issues with importing the uasyncio module .Whenever I type the statement import uasyncio as asyncio I get an error that no module named 'uasyncio' found.

Yadnik
Posts: 65
Joined: Thu May 13, 2021 6:01 am

Re: GPS click on micropython

Post by Yadnik » Tue Jul 20, 2021 8:32 am

I have also tried cloning the repo in my machine, pasting the required files in the micropython directory and then flashing it to the board but I encounter the same errors.Can you please guide me on this please.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: GPS click on micropython

Post by pythoncoder » Tue Jul 20, 2021 2:04 pm

I'm sorry but I have no experience of Zephyr. Is it possible to install uasyncio with upip? If your hardware is not networked you could try micropip.

If you really can't get uasyncio (which would be a shame) you could try MicropyGPS which uses synchronous code.
Peter Hinch
Index to my micropython libraries.

Yadnik
Posts: 65
Joined: Thu May 13, 2021 6:01 am

Re: GPS click on micropython

Post by Yadnik » Sat Jul 24, 2021 4:33 pm

For simply reading the NMEA data from the sensor, I believe just uart.write("$GPGGA") would be enough right?
Thank you!!

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: GPS click on micropython

Post by pythoncoder » Sat Jul 24, 2021 6:29 pm

The GPS unit I use sends data regularly without needing any prompting. My library in normal use is listen-only. On a cold start it takes a few minutes before it starts sending because it waits to acquire sufficient satellites but then it sends once per second.
Peter Hinch
Index to my micropython libraries.

Yadnik
Posts: 65
Joined: Thu May 13, 2021 6:01 am

Re: GPS click on micropython

Post by Yadnik » Fri Jul 30, 2021 8:24 pm

Thank you very much Peter for your help,
I had written a small driver code for reading the NMEA data from the GPS sensor(u-blox LEA-6S), however it does not print the required data giving a blank output.Can you please have a look at the code:https://github.com/Yadnik1/GPS-Click/bl ... 20CLICK.py and guide me where I am going wrong.
The output I get is like this:https://github.com/Yadnik1/GPS-Click/bl ... 0ERROR.png
Thank you very much!!

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: GPS click on micropython

Post by pythoncoder » Sat Jul 31, 2021 8:23 am

It seems as if the UART is not responding. I think you need help from someone who's used a UART under Zephyr. Is

Code: Select all

gps_module = UART("UART_0")
the correct way to initialise a UART under Zephyr? On the ports I've used (Pyboard, Pi Pico, ESP32) UART ID's are numeric.
Peter Hinch
Index to my micropython libraries.

Post Reply