Not saving GPS. Couldn't find location

hi all!

I built a pwnagotchi with a neo-6m GPS unit. I think there’s a race condition between the GPS plugin and the pwnagotchi process where the GPS is locked and receiving data:

(GPGGA values replaced with x’es)

[email protected]:~ $ sudo cat /dev/ttyAMA0 | grep "GGA\|GPGSA"
$GPGGA,162325.00,50xx.xxxx,N,011xx.xxxx,E,1,05,12.40,241.6,M,46.3,M,,*64
$GPGSA,A,3,15,18,13,24,08,,,,,,,,14.82,12.40,8.11*03
$GPGGA,162326.00,50xx.xxxxx,N,011xx.xxxxx,E,1,05,12.39,240.9,M,46.3,M,,*62
$GPGSA,A,3,15,18,13,24,08,,,,,,,,14.80,12.39,8.10*0E

at the same time, /var/log/pwnagotchi.log says:

[2021-10-17 02:09:10,515] [WARNING] !!! captured new handshake on channel 6, -77 dBm: 6c:56:97:da:99:e8 (Amazon Technologies Inc.) -> TP-LINK_DE00 [:e3:27:xx:xx:xx (Tp-Link Technologies Co.,Ltd.)] !!!
[2021-10-17 02:09:12,429] [INFO] not saving GPS. Couldn't find location.
[2021-10-17 02:09:12,588] [INFO] sending association frame to TP-Link_356A (b0:95:75:xx:xx:xx Tp-Link Technologies Co.,Ltd.) on channel 10 [0 clients], -88 dBm...
[2021-10-17 02:09:13,451] [INFO] waiting for 10s on channel 10 ...
[2021-10-17 02:09:14,370] [WARNING] !!! captured new handshake on channel 10, -77 dBm: 56:30:32:17:10:10 () -> Rampe [cc:32:e5:xx:xx:xx (Tp-Link Technologies Co.,Ltd.)] !!!
[2021-10-17 02:09:16,508] [INFO] not saving GPS. Couldn't find location.

if I restart the pwnagotchi (i.e. sudo reboot) it starts working (saves json files with GPS data along with the pcap file) so I think the race condition has to be due to something in the initial lock up time of the GPS unit. I tried the same just restarting the pwnagotchi process sudo systemctl restart pwnagotchi but it still fails to see the GPS unit. I think this may be related to bettercap rather than pwnagotchi.

thanks!