Howdy All
Just got the Swan and have the latest firmware and Circuit Python on it, with note carrier F. At this point I am able to connect to the cellular network and send data to NoteHub, but not able to get a lock on GPS. I have put it near a window as well as moved in to my deck with a clear view of the sky (clear, cold evening and day) .
I have followed this link the GPS tutorial and this link – (performed all the steps).
For comparison, I do have a small GPS module that I got from AMZN also. It is able to get a lock (it’s not 100% perfect, but it does latch on to GPS - even near the window). I also tried swapping the antennae w/o any luck.
I am curious are there any other troubleshooting steps that I could take? I also tried both
continuous mode and the periodic mode (60 seconds) and trying moved the swan a bit, such that it knows that it made some motion…
I am powering the swan with exactly 5V using an external power supply with a dial.
P.S I’ve also included some sample uPython code below (periodic gps) to show what I’m doing…
Any help would be great, thanks!
John
######################## Sample Code ########################
import notecard
import board
import busio
import time
import json
prodid="$my_prod_id"
port = busio.I2C(board.SCL, board.SDA)
card = notecard.OpenI2C(port, 0, 0, debug = True)
##Setup mod
req = {"req": "hub.set"}
req["product"] = prodid
req["mode"] = "continuous"
rsp = card.Transaction(req)
while True:
#Check the time
req = {"req": "card.time"}
rsp = card.Transaction(req)
if rsp['zone'] is not 'UTC,Unknown':
print("OK - Cellular Data Gotten")
break
else:
print("NOTOK - Cellular Data not Gotten - trying again")
time.sleep(2)
def send_data_notehub(data):
req = {"req": "note.add"}
req["file"] = "sensors.qo"
req["sync"] = True
req["body"] = data
rsp = card.Transaction(req)
req = {"req": "card.location.mode"}
req["mode"] = "periodic"
req["seconds"] = 60
rsp = card.Transaction(req)
while True:
req = {"req": "card.location"}
rsp = card.Transaction(req)
lat = rsp.get('lat')
lon = rsp.get('lon')
if lat and lon:
print(f"OK - GPS Data lat: {lat} lon: {lon}")
#send_data_notehub({ "lat": lat, "lon": lon})
else:
#send_data_notehub({ "No": "GPS"})
print('NOTOK - No GPS data')
print("rsp:",rsp)
print(time.localtime())
time.sleep(60)