Black Lives Matter - Action and Equality.
0

Issue with auto-load when using adafruit_gps lib
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Issue with auto-load when using adafruit_gps lib

by travisma on Sun May 10, 2020 4:40 pm

I experienced an unusual problem today and have been unable to find a solution. Whenever I save a program as code.py, it always auto-loads and runs when the board powers up. However, I ran into a problem today when using the adafruit_gps library and the gps_simpletest.py program. As long as I manually save the program from Mu (or CTRL-D from REPL), it runs just fine. Reads and displays the GPS data perfectly! However, if I shut the board down and restart it later, the program hangs. It seems to be getting stuck in gps.update().

I've also tested with the gps_echotest.py and it works fine, even on power-up. There is no call to gps.update() in this sample program.

I got the same result on a Trinket M0 and the Metro M0 express. Bootloader ver 3.7 and CPy ver 5.3.

Any suggestions or feedback would be appreciated.

Thanks. --MARK

travisma
 
Posts: 7
Joined: Thu Aug 15, 2019 1:56 pm

Re: Issue with auto-load when using adafruit_gps lib

by siddacious on Mon May 11, 2020 3:02 pm

Can you go into more detail about how you are testing, namely how things are wired and powered in each case? A well lit, clear photo would help as well.
Can you also go into more detail about what specifically you mean by "shut down the board and restart it later"? Is the board staying powered by USB? Are you disconnecting and reconnecting the USB cable? This is a strange enough problem that details like this will matter.

When the program hangs what color is the RGB led? If it's flashing in a patter, what is the pattern?

siddacious
 
Posts: 246
Joined: Fri Apr 21, 2017 3:09 pm

Re: Issue with auto-load when using adafruit_gps lib

by travisma on Mon May 11, 2020 5:47 pm

Siddacious, Thanks for taking a look at this.

The jumper wires make it pretty hard to see what is connected where in a photo (even with only four wires). So I did a quick fritzing diagram (attached). Pretty simple connections.
Trinket GPS_bb.jpg
Trinket connections to GPS
Trinket GPS_bb.jpg (298.32 KiB) Viewed 17 times


When I manually load (from Mu or drag and drop) or do a CTRL-D, the program (gps_simpletest.py from your examples) runs just fine. If I eject the CIRCUITPY drive (using Win10) and disconnect the USB cable from the computer, then come back the next day and plug it in, the program hangs. I have tried other USB ports and even powered it from my phone charger with the same result. Also tried a different cable. I have also found that pressing the reset button on the trinket will sometimes cause it to begin operating. I don't believe the trinket is having issues because I get the same result when testing it on a Metro Express M0.

The dotstar on the trinket is flashing in a pattern. I hope I copied this right:
RED
RED-GN
RED-GN (4 quick flashes)
BL-GN (6 quick flashes)

Thanks.
--MARK

travisma
 
Posts: 7
Joined: Thu Aug 15, 2019 1:56 pm

Re: Issue with auto-load when using adafruit_gps lib

by travisma on Mon May 11, 2020 8:00 pm

Corrected pattern of the dotstar:
Grn
Grn-Red
Grn-Red (4 quick flashes)
Grn-Blu (6 or 7 quick flashes)

--MARK

travisma
 
Posts: 7
Joined: Thu Aug 15, 2019 1:56 pm

Re: Issue with auto-load when using adafruit_gps lib

by tannewt on Tue May 12, 2020 2:03 pm

Whenever you get flashing there will be a better error message available over USB serial. Please see here for how to connect to serial and see the error: https://learn.adafruit.com/welcome-to-c ... al-console

tannewt
 
Posts: 1644
Joined: Thu Oct 06, 2016 8:48 pm

Re: Issue with auto-load when using adafruit_gps lib

by travisma on Tue May 12, 2020 2:35 pm

I'm hoping this is what you are looking for:
================================================
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 58, in <module>
File "adafruit_gps.py", line 150, in update
File "adafruit_gps.py", line 380, in _parse_gpgga
TypeError: can't convert NoneType to int

travisma
 
Posts: 7
Joined: Thu Aug 15, 2019 1:56 pm

Re: Issue with auto-load when using adafruit_gps lib

by travisma on Tue May 12, 2020 3:34 pm

OK guys, you can retire this issue. I've been testing some different GPS modules. After a while, it finally occurred to me that I was only seeing this problem when I had a NEO-6M in the circuit.

After some further research, I found that this is a know issue as the NEO-6M leaves some fields blank for a brief time after a cold restart. The blank field is what is causing the library to hang. See this discussion on github:
https://github.com/adafruit/Adafruit_CircuitPython_GPS/issues/5

Thanks.
--MARK

travisma
 
Posts: 7
Joined: Thu Aug 15, 2019 1:56 pm

Please be positive and constructive with your questions and comments.