Page 1 of 2

GPS click on micropython

Posted: Mon Jul 19, 2021 7:00 pm
by Yadnik
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.

Re: GPS click on micropython

Posted: Mon Jul 19, 2021 7:01 pm
by Yadnik
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?

Re: GPS click on micropython

Posted: Tue Jul 20, 2021 5:15 am
by pythoncoder
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.

Re: GPS click on micropython

Posted: Tue Jul 20, 2021 8:31 am
by Yadnik
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.

Re: GPS click on micropython

Posted: Tue Jul 20, 2021 8:32 am
by Yadnik
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.

Re: GPS click on micropython

Posted: Tue Jul 20, 2021 2:04 pm
by pythoncoder
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.

Re: GPS click on micropython

Posted: Sat Jul 24, 2021 4:33 pm
by Yadnik
For simply reading the NMEA data from the sensor, I believe just uart.write("$GPGGA") would be enough right?
Thank you!!

Re: GPS click on micropython

Posted: Sat Jul 24, 2021 6:29 pm
by pythoncoder
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.

Re: GPS click on micropython

Posted: Fri Jul 30, 2021 8:24 pm
by Yadnik
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!!

Re: GPS click on micropython

Posted: Sat Jul 31, 2021 8:23 am
by pythoncoder
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.