Bytes_sent Not Updating?

Hello! I’m trialing out my awesome new Notecard for a potential project and I’m trying to estimate my data usage to forecast the cost for a rather large deployment.

I’m trying to use the “card.usage.get” command to check how much data I have sent so far, however, weirdly my number of bytes send does not appear to update even after an hour of running?

I have run the command many times over the last hour and I don’t see any change in bytes_sent. I do see events being published in Notehub.io, so I believe the device is communicating and sending data, however?

See below, my “bytes_sent” has been stuck at 6285 for a few hours, even though the card has been on and running.

> {
 "req": "card.usage.get",
 "mode": "total"
}

{
 "seconds": 63767,
 "bytes_sent": 6285,
 "bytes_received": 11227,
 "notes_sent": 123,
 "sessions_standard": 4,
 "sessions_secure": 4,
 "time": 1638492648
}

Hey @keenan thanks for the heads up, we can take a look. Can you run a card.version request and let me know which firmware version you’re on? And if you’re not on the last dev release, I’d suggest updating when you have a moment.

I just updated to 2.1.1.2013839 yesterday when I started trialing things.

1 Like

awesome, thanks for letting me know. We’ll poke around and see if we can repro this.

Hi @keenan,
the notecard only updates the card.usage.get data at the end of each cellular connection. If the notecard is in a continuous data connection the values will not be updated until the session ends.
Thanks
Sean

1 Like

I see. Thanks for the answer! How do I end a session? Does cycling power end the session?

When I run the “card.usage.get” command, am I looking at the bytes_sent value from the previous session?

Thanks @seant! @keenan good follow-up, and I was just updating our docs to clarify this.

If you’re in continuous mode, you can set the session duration using the duration argument in hub.set. The other option is to set your Notecard into periodic mode if you don’t require a continuous cellular connection.

Brandon beat me to it. If you’re in continuous mode there’s no command to ask the Notecard to “hangup and redial”, but if you want to see the usage update you can do this:

{“req”:“hub.set”,“mode”:“off”}

< poll on card.usage.get until you see an update >

{“req”:“hub.set”,“mode”:“continuous”}

Note that disconnecting and reconnecting a session uses some data since the TCP connection to Notehub is reconnected. This can be significant if you are syncing notefiles that require a TLS connection, (.qis, .qos, .dbs) because each TLS connection uses around 6k of data). If you are not using TLS the TCP disconnect and reconnect typically uses under 1k.

1 Like