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.
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.
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
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.