Notecard connection and GPS timeout

I am trying to get my notecard to work.

Yesterday i had it sending through GPS data and heartbeat data as required.

It stopped during the night for no reason and now i cannot get it reconect to ther service.

I have started again by restoring the card, but the hub.sync.status is just returning
{“status”:“can’t open session to discovery service: failed to connect using TLS: network timeout {network}”}

OR i get this

> {"req":"hub.sync.status"}
{
 "status": "connect() returned errno 103: connect: connection aborted{host-unreachable} {socket-connect-error}",
 "requested": 69
}

and now i’m getting this

> {"req":"hub.sync.status"}
{
 "alert": true,
 "status": "connect delayed (59 min remaining): can't open session to discovery service: connect: connection aborted{host-unreachable} {service}{extended-service-failure}",
 "time": 1643370628,
 "completed": 177
}

What do i need to do tio get hti to connect?

Thanks

I would start with a card.wireless call to examine the current network connection state. Let’s see what that shows us before any further debugging steps.

Rob

Hi - thanks.

I’d removed the battery / power for a few hours and just restarted it…
Its now reported in!

You mentioned the gps timeout is 900 seconds.
Is there away to reduce this.

Thank you

Yes, you can override the GPS timeout with the reserved environment variable of _gps_expiry_secs. That link will also show you how to set/update environment variables.

Rob

2 Likes

thank you for the help so far.

I have copied the example for the Asset tracker - to get a better understanding of what i’m receiving.

> {"req":"hub.get"}
{
 "mode": "periodic",
 "host": "a.notefile.net",
 "product": "uk.co.medidasoftware.john:gpsv1",
 "device": "dev:867730051184079",
 "inbound": 720,
 "outbound": 60
}
> {"req":"card.location.mode"}
{
 "seconds": 300,
 "mode": "periodic"
}
> {"req":"card.location.track"}
{
 "start": true,
 "minutes": 60,
 "heartbeat": true
}

times are quick so i can see things without having to wait.

So my understanding is…
It will send through a HEARTBEAT every 60 minutes regardless of anything else.

It will check for motion every 300 seconds… and if it has sensed it has moved during that time it will try to get a GPS.

However i’m getting my HEARTBEST but not the individula GPS records ( or attempts of getting a gps ) when it connects.

As i’m writing this i throught i would just pass this:
{“req”:“card.motion.mode”,“start”:true}

Which should have been set - sadly i did not check before writing all this if it was ON or OFF.

Regardless of motion / accelerometer - is there away to get GPS on the heartbeat even if it has not detected motion. I see from here #advanced-tracker-configurations that its not - but worth asking just in case.

If you can get a GPS lock, subsequent heartbeat notes should still include the latest location data. Here is an example of a tracker I have out in the field that has been stationary for some time. Note the status:heartbeat:

    "body": {
        "hdop": 1,
        "status": "heartbeat",
        "temperature": 31.4375,
        "time": 1642477021,
        "voltage": 4.171875
    },
    "best_location_type": "gps",
    "best_lat": -28.0605325,
    "best_lon": 153.39739453125003,
    "best_location": "Clear Island Waters",
    "best_country": "AU",
    "best_timezone": "Australia/Brisbane",
    "where_olc": "5R3MW9QW+QXJP",
    "where_lat": -28.0605325,
    "where_lon": 153.39739453125003,
    "where_location": "Clear Island Waters",
    "where_country": "AU",
    "where_timezone": "Australia/Brisbane",
    "tower_when": 1643603878,
    "tower_lat": -28.060705,
    "tower_lon": 153.398422,
    "tower_country": "AU",
    "tower_location": "Gold Coast Queensland",
    "tower_timezone": "Australia/Brisbane",
    "tower_id": "505,1,28719,147066637",
1 Like

My device ran all night long and then stopped working. I first got the error {“alert”:true,“status”:"connect delayed (59 min remaining): can’t open session to discovery service: failed to connect using TLS: network timeout

Then got the error : “status”:“connect delayed (60 min remaining): opening notehub: invalid handler information issued by the service {service}{extended-service-failure}”

I will power down for 1 hour and then see if it’s fixed.

Still no luck with connection. Here is the full log of a notecard sync attempt :

{"req":"hub.set","product":"net.wildc.blues:general_tron","mode":"minimum","body":{"agent":"note-arduino","compiler":"gcc 10.3.0","req_interface":"i2c","cpu_name":"esp8266"}}
{}
{"req":"hub.sync"}
{}
{"req":"hub.sync.status"}
{"status":"starting communications {wait-module} {connecting}","requested":5}
{"req":"hub.sync.status"}
{"status":"modem now ON {modem-on}","requested":13}
{"req":"hub.sync.status"}
{"status":"resolving blues:general_tron.wildc.net.product.notefile.net","requested":21}
{"req":"hub.sync.status"}
{"status":"connecting to 10.0.34.9:8086 {socket-connecting}","requested":30}
{"req":"hub.sync.status"}
{"status":"connecting to 10.0.34.9:8086 {socket-connecting}","requested":38}
{"req":"hub.sync.status"}
{"status":"idle {disconnected}","requested":46}
{"req":"hub.sync.status"}
{"status":"modem now OFF (was active 48 sec, 1412 bytes transferred) {modem-off}","requested":55}
{"req":"hub.sync.status"}
{"status":"starting communications {wait-module} {connecting}","requested":63}
{"req":"hub.sync.status"}
{"status":"modem now ON {modem-on}","requested":71}
{"req":"hub.sync.status"}
{"status":"waiting for wireless service 7 sec [++--] {cell-registration-wait}","requested":80}
{"req":"hub.sync.status"}
{"status":"connect using TLS {socket-tls-connecting}","requested":88}
{"req":"hub.sync.status"}
{"status":"connect using TLS {socket-tls-connecting}","requested":96}
{"req":"hub.sync.status"}
{"status":"discover session handler for dev:864475040556911 product:net.wildc.blues:general_tron","requested":105}
{"req":"hub.sync.status"}
{"status":"idle {disconnected}","requested":113}
{"req":"hub.sync.status"}
{"status":"modem now OFF (was active 53 sec, 10220 bytes transferred) {modem-off}","requested":121}
{"req":"hub.sync.status"}
{"status":"modem now ON {modem-on}","requested":130}
{"req":"hub.sync.status"}
{"status":"waiting for wireless service 1 sec [----] {cell-registration-wait}","requested":138}
{"req":"hub.sync.status"}
{"status":"connect using TLS {socket-tls-connecting}","requested":146}
{"req":"hub.sync.status"}
{"status":"connect using TLS {socket-tls-connecting}","requested":155}
{"req":"hub.sync.status"}
{"status":"connect using TLS {socket-tls-connecting}","requested":163}
{"req":"hub.sync.status"}
{"status":"connect using TLS {socket-tls-connecting}","requested":171}
{"req":"hub.sync.status"}
{"status":"connect using TLS {socket-tls-connecting}","requested":180}
{"req":"hub.sync.status"}
{"status":"connect using TLS {socket-tls-connecting}","requested":188}
{"req":"hub.sync.status"}
{"status":"connect using TLS {socket-tls-connecting}","requested":196}
{"req":"hub.sync.status"}
{"status":"connect using TLS {socket-tls-connecting}","requested":205}
{"req":"hub.sync.status"}
{"status":"connect using TLS {socket-tls-connecting}","requested":213}
{"req":"hub.sync.status"}
{"status":"connect using TLS {socket-tls-connecting}","requested":221}
{"req":"hub.sync.status"}
{"status":"connect using TLS {socket-tls-connecting}","requested":230}
{"req":"hub.sync.status"}
{"status":"tls: failed to connect using TLS: network timeout {network} {socket-tls-error}","requested":238}
{"req":"hub.sync.status"}
{"status":"idle {disconnected}","requested":246}
{"req":"hub.sync.status"}
{"status":"modem now OFF (was active 121 sec, 1500 bytes transferred) {modem-off}","requested":255}
{"req":"hub.sync.status"}
{"alert":true,"status":"connect delayed (59 min remaining): can't open session to discovery service: failed to connect using TLS: network timeout {network} {service}{extended-service-failure}","time":1644792725,"completed":6}

here is output of card.wireless :

> {"req":"card.wireless"}
{
 "status": "{network-up}",
 "count": 2,
 "net": {
  "iccid": "89011703278306882609",
  "imsi": "310170830688260",
  "imei": "864475040556911",
  "modem": "BG95M3LAR02A03_01.006.01.006",
  "band": "LTE BAND 12",
  "rat": "emtc",
  "rssir": -71,
  "rssi": -72,
  "rsrp": -97,
  "sinr": 122,
  "rsrq": -11,
  "bars": 2,
  "mcc": 310,
  "mnc": 410,
  "lac": 34049,
  "cid": 130358800,
  "updated": 1644793104
 }
}

Ok, I tried setting to “continuous” instead of “minimum” and it finally succeeded in a sync.

@tavis if the hub.set mode is minimum the Notecard will only attempt to connect to Notehub when explicitly requested by the host with {"req":"hub.sync"}. The Notecard will not autonomously retry failed connections. As you found, retries occur if the mode is periodic or continuous, and either outbound or inbound duration is non-zero.

That’s just it. I was manually issuing a sync command every 5 minutes but it would always fail.

When the Notecard displays an error such as {extended-service-failure} in the response, along with a timeout, it silently discards sync requests from the host.

The real question is what caused the connection error in the first place - I know we had a period where the Notehub was having intermittent issues with the listeners going down - this was a couple of weeks ago - maybe around the time of your original post.

{"alert":true,"status":"connect delayed (59 min remaining): can't open session to discovery service: failed to connect using TLS: network timeout {network} {service}{extended-service-failure}","time":1644792725,"completed":6}

If this problem is repeatable please let us know - as far as I know the Notehub issues should now be resolved and you should not see that error again.