# SIM / Bytes usage history data?

**URL:** https://discuss.blues.com/t/sim-bytes-usage-history-data/818
**Category:** Notehub.io
**Created:** [May 10, 2022, 1:26am UTC](https://discuss.blues.com/t/sim-bytes-usage-history-data/818 "2022-05-10T01:26:32Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![ndavey](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@ndavey](https://discuss.blues.com/u/ndavey)
#### Post date: [May 10, 2022, 1:26am UTC](https://discuss.blues.com/t/sim-bytes-usage-history-data/818/1 "2022-05-10T01:26:32Z")

</div>

Hi,  
In the SIM section of a device, is it possible to have a table/history of the bytes used updates?  
Much like the session/events… So you can track usage vs time for example.

Thanks,  
Neil

---

<div class="post-metadata">

### Author: ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)
#### Post date: [May 10, 2022, 1:25pm UTC](https://discuss.blues.com/t/sim-bytes-usage-history-data/818/2 "2022-05-10T13:25:54Z")

</div>

Hi @ndavey,

Currently that data is not available in Notehub (however, I’ll add it as a request in our engineering team backlog!). Not sure if this will help you, but the `card.usage` APIs can help you to actively monitor/measure data usage (see [this doc](https://dev.blues.io/notecard/notecard-walkthrough/low-bandwidth-design/#measuring-data-usage) for more info).

Thanks,  
Rob

---

<div class="post-metadata">

### Author: ![ndavey](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@ndavey](https://discuss.blues.com/u/ndavey)
#### Post date: [May 10, 2022, 1:49pm UTC](https://discuss.blues.com/t/sim-bytes-usage-history-data/818/3 "2022-05-10T13:49:13Z")

</div>

Hi @RobLauer ,  
Thanks, on the Notehub side I thought it might be another handy piece of data along with the bits that are currently there. After posting this I did come across card.usage API, useful on the device side/during development… Using it to push usage back outbound seemed not ideal but usable…

Thanks,  
Neil

---

<div class="post-metadata">

### Author: ![ndavey](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@ndavey](https://discuss.blues.com/u/ndavey)
#### Post date: [May 11, 2022, 7:09am UTC](https://discuss.blues.com/t/sim-bytes-usage-history-data/818/4 "2022-05-11T07:09:53Z")

</div>

Which is the more true value? Bytes used in NoteHub or card.usage?  
Bytes used in Notehub is greater than card.usage (x2).  
Does card.usage not include connection overhead?

---

<div class="post-metadata">

### Author: ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)
#### Post date: [May 11, 2022, 1:18pm UTC](https://discuss.blues.com/t/sim-bytes-usage-history-data/818/5 "2022-05-11T13:18:54Z")

</div>

Hi @ndavey,

Great question. In short, `card.usage` will always be the most accurate, while the values you see in Notehub are more of an approximation.

The reason is because the values from `card.usage` are derived from the Notecard “asking” the cellular modem (every time the modem powers down) how many bytes were sent over the cellular network. Notehub, on the other hand, can only approximate this number by looking at the bytes transferred at a higher level (TCP/TLS). The numbers you see in Notehub under Device → SIM is updated nightly via a process that asks the cellular carrier how much data has been used for that particular SIM.

Hope that helps!

Rob

---

<div class="post-metadata">

### Author: ![ndavey](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@ndavey](https://discuss.blues.com/u/ndavey)
#### Post date: [May 11, 2022, 1:48pm UTC](https://discuss.blues.com/t/sim-bytes-usage-history-data/818/6 "2022-05-11T13:48:29Z")

</div>

Thank @RobLauer,  
Interesting…  
I’ll do some better data collection, because my card.usage value is like 1/2 of what the sim usage says.

I had been running this (hub.get) for a couple of days, just idle (no notes activity):

{  
“unsecure”: true,  
“mode”: “continuous”,  
“host”: “[a.notefile.net](http://a.notefile.net)”,  
“product”: “######”,  
“device”: “####”,  
“sync”: true,  
“inbound”: 60,  
“outbound”: 60  
}

Did a card.restart today, and card.usage hadn’t changed much, but SIM usage went up ~95KB from one day to the next.

Tonight I’v just added (hub.set):

“duration”: 1440

And over the next few days I’ll better track and record the data (SIM vs card.usage)…

Neil

---

<div class="post-metadata">

### Author: ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)
#### Post date: [May 11, 2022, 1:58pm UTC](https://discuss.blues.com/t/sim-bytes-usage-history-data/818/7 "2022-05-11T13:58:53Z")

</div>

Yes, please update with your findings here. As mentioned, `card.usage` should be the most accurate, while there can be significant lag in the usage data you see in Notehub (depending on when we’re able to download the latest usage statistics from the cellular provider).

---

<div class="post-metadata">

### Author: ![ndavey](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@ndavey](https://discuss.blues.com/u/ndavey)
#### Post date: [June 10, 2022, 2:15am UTC](https://discuss.blues.com/t/sim-bytes-usage-history-data/818/8 "2022-06-10T02:15:58Z")

</div>

So I’ve been doing some testing over the last month. I’ve recorded sim usage form Notehub, card events from hub and card.usage bytes/notes/session values from the card. I’ve also adjusted some hub.set values over this time (also recorded). The NoteCard has been sitting idle, no active usage. NoteCard is NOTE-NBGL-500 running firmware 3.2.1.13982

Plotted up, this is what it looks like:

 ![Picture 1](https://us1.discourse-cdn.com/flex020/uploads/blues/original/1X/d4d44c0a39e2b5414d1825bb510d7191427fe914.png)  
Dark blue line is Sim Usage, Card Events and Card.usage totals are essentially identical.  
First few days where at this card setting:

{  
“unsecure”: true,  
“mode”: “continuous”,  
“sync”: true,  
“inbound”: 60,  
“outbound”: 60,  
“duration”: 1440  
}

Then changing inbound, outbound and duration values, with the last roughly 2 weeks running this:

{  
“unsecure”: true,  
“mode”: “continuous”,  
“sync”: true,  
“inbound”: 1440,  
“outbound”: 1440,  
“duration”: 10080  
}

So it seems card.usage is reporting a lower value than SIM usage…

Regards  
Neil

---

<div class="post-metadata">

### Author: ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)
#### Post date: [June 10, 2022, 1:40pm UTC](https://discuss.blues.com/t/sim-bytes-usage-history-data/818/9 "2022-06-10T13:40:30Z")

</div>

Hi @ndavey,

Thanks for following up on this. While we look into any possible issues on our end, can you please clarify how you got the “Hub (kb)” number? Is that from checking “bytes used” in Notehub every day for this particular device?

Thanks,  
Rob

---

<div class="post-metadata">

### Author: ![ndavey](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@ndavey](https://discuss.blues.com/u/ndavey)
#### Post date: [June 13, 2022, 4:20pm UTC](https://discuss.blues.com/t/sim-bytes-usage-history-data/818/10 "2022-06-13T16:20:55Z")

</div>

Hi @RobLauer,  
Yes, Hub (kb) is “bytes used” from the SIM tab for the device.  
The data for a day were all recorded within a few minutes of each other (eg refresh hub, do card.usage) I have the excel if useful.

Regards  
Neil
