I have the LTE notecard running with a I2C interface to a ESP32. My program posts hourly data to notehub which seems to work fine. Occasionally when some important input change, it posts an immediate data packet to notehub. When this happens, the notecard seems to refuse to connect.
I’m using the latest notecard python library. My configuration is basically:
init ():
req = {"req": "hub.set"}
req["product"] = productUID
req["mode"] = "minimum"
rsp = card.Transaction(req)
print (req, rsp)
req = {"req": "hub.sync"} # force an initial synchronization
rsp = card.Transaction(req)
post_data():
req = {"req": "note.update"}
req["note"] = "data_readings"
req["file"] = "sensors.db"
req["body"] = data.get_data() # get latest data
req["sync"] = True
rsp = card.Transaction(req)
req = {"req": "hub.sync"} # force an send to the hub
rsp = card.Transaction(req)
# We're waiting for transaction to complete so that we can synchronize our
# clock with the cell tower clock
while (1):
req = {"req": "hub.sync.status"} # wait for completion
rsp = card.Transaction(req)
print (req, rsp)
if "time" in rsp:
now = rsp.get("time")
update_our_clock (now) # keep our clock synced with cell tower time
return # get outta here
time.sleep (2) # give the card time to work
These are the error messages I get:
{'req': 'hub.sync.status'} {'requested': 19682, 'status': "modem now OFF {modem-off} (network: can't connect (31.2 min remaining) {registration-failure}{network}{extended-network-failure})", 'seconds': 7385, 'sync': True}
{'req': 'hub.sync.status'} {'requested': 19684, 'status': "disconnected (was {connected}) via close of notebox {notehub-disconnected} (network: can't connect (31.2 min remaining) {registration-failure}{network}{extended-network-failure})", 'seconds': 7385, 'sync': True}
{'req': 'hub.sync.status'} {'status': 'starting communications {wait-module} {connecting} {registration-failure} {network}{extended-network-failure}', 'sync': True, 'requested': 19686}
{'req': 'hub.sync.status'} {'status': 'starting communications {wait-module} {connecting} {registration-failure} {network}{extended-network-failure}', 'sync': True, 'requested': 19689}
{'req': 'hub.sync.status'} {'status': 'starting communications {wait-module} {connecting} {registration-failure} {network}{extended-network-failure}', 'sync': True, 'requested': 19691}
The init() function is called once on power up. The post_data() function is called hourly or when some important input changes. This error only happens when the input changes. I’ve had the system running for days without input changing and everything seems to work OK.
I don’t think it is a antenna/communications problem because, when it is in its “locked up” state, I can cycle power and everything reconnects within a minute.
This is the response from a card version request:
{‘req’: ‘card.version’} {‘sku’: ‘NOTE-NBGL-500’, ‘board’: ‘1.11’, ‘name’: ‘Blues Wireless Notecard’, ‘body’: {‘ver_major’: 4, ‘org’: ‘Blues Wireless’, ‘ver_build’: 4015681, ‘built’: ‘Dec 5 2022 12:54:58’, ‘ver_minor’: 1, ‘ver_patch’: 1, ‘product’: ‘Notecard’, ‘version’: ‘notecard-4.1.1’}, ‘device’: ‘dev:xxxxxxxxxxxx’, ‘api’: 4, ‘version’: ‘notecard-4.1.1.4015681’}
Any ideas?