Hi Pete,
Now that the display is working I am on your as_GPS driver. I am using a Neo Max6 GPS module on an ESP32.
I cloned your micropython-asyncio repository and I tried astests.py in v3/as_drivers/as_GPS.
It gives me a
ImportError: attempted relative import with no known parent package
error. astests in micropython-async/gps (v2 I guess) works fine.
I replaced the relative imports by absolute ones (as in the working astests.py) and tried to run the program on the ESP32. There I get a
OverflowError: overflow converting long int to machine word
error.
Any ideas how to correct?
Thanks Uli
problems with as_GPS
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: problems with as_GPS
Two points.
Firstly, if installed and run as per the docs, the relative imports work.
Secondly, the astests.py script is documented as a "special test program". I evidently didn't clarify this properly. It simulates the GPS data enabling a quick check on the code, and it's intended to be run under Linux. It runs under CPython 3.8+ or MicroPython. The problem arises because it assumes the Unix epoch. MicroPython on bare metal uses a different epoch. From the v3 directory the following runs here:
I'll update the docs to clarify this. You are the first to try to run this on bare metal - I certainly never did.
I suggest you start with one of the scripts in section 3, adapted for whichever UART you are using.
Firstly, if installed and run as per the docs, the relative imports work.
Secondly, the astests.py script is documented as a "special test program". I evidently didn't clarify this properly. It simulates the GPS data enabling a quick check on the code, and it's intended to be run under Linux. It runs under CPython 3.8+ or MicroPython. The problem arises because it assumes the Unix epoch. MicroPython on bare metal uses a different epoch. From the v3 directory the following runs here:
Code: Select all
micropython -m as_drivers.as_GPS.astests
I suggest you start with one of the scripts in section 3, adapted for whichever UART you are using.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: problems with as_GPS
Things work quite ok now but...
There is one things that intrigues me: I get plenty of crc errors. First I thought that this must be a hardware problem but when I run just the uart, printing out all the messages I see and putting them to the parser when reading back the file, then my crc error count is zero!
Otherwise everything looks fine
Uli
There is one things that intrigues me: I get plenty of crc errors. First I thought that this must be a hardware problem but when I run just the uart, printing out all the messages I see and putting them to the parser when reading back the file, then my crc error count is zero!
Otherwise everything looks fine
Uli
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: problems with as_GPS
That is odd. I don't think I've ever seen a CRC error from my Adafruit GPS. I can only think they come from the GPS module.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: problems with as_GPS
Yes, that was my first reaction as well. Particularly because I use one of those super-cheap Chinese modules.
However I also tried this: I simply read the NMEA sentences coming from the GPS receiver and print them out. Then I cut and paste ~ 400 of these messages into a file on the PC and I run them through a program similar to your astest.py program (this time on run it in CPython!) with the only difference that I don't use predefined hardcoded sentences but the sentences from the file. As you can see, not a single crc error!
I observe that the GPS module sends batches of ~ 10 sentences at a frequency of 1 Hz. Does your GPS module do the same thing?
However I also tried this: I simply read the NMEA sentences coming from the GPS receiver and print them out. Then I cut and paste ~ 400 of these messages into a file on the PC and I run them through a program similar to your astest.py program (this time on run it in CPython!) with the only difference that I don't use predefined hardcoded sentences but the sentences from the file. As you can see, not a single crc error!
I observe that the GPS module sends batches of ~ 10 sentences at a frequency of 1 Hz. Does your GPS module do the same thing?
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: problems with as_GPS
See my notes on timing. I guess if your GPS is sending a lot of satellite data at 9600 baud there could be occasional overrun errors.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.