Hard data limits in Electron?

Hi,

a question about the data plan of the Electron: In all the documents you emphasize that the limits you can set are only soft limits and they can be exceeded because the reporting can be delayed by up to one hour. I am not sure what the data rate on a 3G Electron is. Say it’s 1 Mbit/s. Then in the extreme if I have a runaway application due to a stupid programming error it could consume ~400 Mbytes in that hour which is about 400 Dollars. If the Electron is faster, then it could be more. Are there any hard limits on the maximum usage at all? Or can a case like the above happen?

Thanks in advance!

1 Like

I think this will answer your question:

What if I run out?
If you reach your data limit and want to keep your device online, just hop over to the Dashboard and increase the limit. It will automatically unpause and you’ll be back online in a few minutes. We highly recommend that you set a high limit for critical applications.
You can find more information here: https://docs.particle.io/guide/getting-started/data/electron/

Hi @hl68fx, no actually it answers the opposite of my questions. The problem I am seeing is that the limit is a soft limit. It will not apply immediately but up to one hour later. During that time the Electron will happily continue using data without obeying any limit I know about. That data will also accumulate cost. Depending on the speed of the connection the cost could be hundreds of $$$. This can happen for example if you use UDP by yourself and have some error so that the program sends out data in an endless loop. That’s what worries me a bit.

Where did you read about a delay of one hour in reporting? It should be an advantage of the Particle sim versus normal sim cards that something like that never happens.

Hi @hl68fx,

see https://docs.particle.io/guide/getting-started/billing/electron/:

We measure data use by querying cellular carriers for what they've measured. Because of this our knowledge of a SIM's usage has a little lag and it's possible to go over a set limit, especially if you're using data very quickly. For additional use above a pre-set data limit we'll charge a pro-rated amount based on your additional MB rate. If you're in the US and get 0.01MB over your limit then you'll see about an additional penny on your bill.

and the "little lag" seems to be mentioned a bit more explictly here:

It's important to note that the estimated cost represents data used up to that point in time, as opposed to a projection until the end of the billing period. In addition, reported data usage may be up to 1 hour behind, so don't expect to see the data used by an over-the-air flash right away.

Thanks for the link! That could indeed be a problem.
This happened for me on a local provider with an Arduino and an Adafruit Fona. My data volume of 1Gb was away in a few hours :smiley: But 10€ for 1 GB was not very dramatic.

1 Like

@Stevie, it sounds like there needs to be an onboard data counter or data rate indicator for doing a simple predictive calculation. That would allow a data watchdog to be implemented. @mdma, any thoughts on this?

1 Like

@peekay123, if the watchdog is implemented in a way that it will be in the system thread and thus not affected by some runaway loop, that might be a workaround, I agree. Preferable would be some hard data limit, though. Like “cost will never exceed the soft limit plus $10” or so.

@Stevie, I agree. Just tell my sons that when they exceed our family plan data limit! Rogers LOVES to charge us a ridiculous amount for an extra 1GB of data.

Perhaps another thing to think about is what constitutes a “runaway loop” and could a separate watchdog thread be used to detect this, perhaps through a counting semaphore. The careful placement of a semaphore decrement in the user code, indicating a “healthy” loop which the watchdog thread increments at a fixed interval. When the semaphore exceeds a preset value, that indicates a runaway loop and can then act accordingly, perhaps with a system reset. Just throwing out some ideas.

1 Like

@peekay123: Yes, I know that :slight_smile: Fortunately now data plans over here are usually unlimited but throttle the bandwidth to 64 kBit/s after for example 4 GB (at least for cell phones, land line is unlimited).

Yes, some kind of separate watchdog thread could also work. That’s the least I will do. But those programming errors :fearful:

1 Like

There is an API for retrieving the data counters coming in 0.5.0. For Particle SIMs there are limits installed on the backend too (5MB iirc) which will prevent runaway data usage.

2 Likes

@mdma: That sounds great, can you elaborate a bit more about what the “backend” is? Thanks!