This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Slow down LTE data

I'm new to this world of IoT. I want to use my thingy91 to monitor temperature at a vacation home, but don't need the data every few seconds. What is the best way to slow down the data throughput to something closer to once an hour?

I have friends familiar with the programming but I want to put them in the right direction, before it cost me too may beers

Thanks

  • I have not delved into thingy91 development.  So I can't give you a code example.  However, I have produced a similar result on a different project.  the temperature reporting system should be starting a timer.  When the timer finishes it will trigger a callback.  Inside that callback is where the sending the temperature to wherever is being done.  

    To slow down the sample rate one would increase the length on that timer.  Depending on how often you want the temperature sent, the timer may not be able to be long enough.  In this case they should have a static variable that is tracking how many times the timer has gone off. 

    e.g the timer max is 1 minute but you need 10.  You would set "X" to 10.

    Pseudocode:

    temperature_timer_callback (){
        static timer_count = 0;
        timer_count ++;
        
        if (timer_count > X){//X = the number of times the timer should trigger
            send_temperature;
            timer_count = 0; //reset count
        }
    }

     

Related