Message Limit Reached in 2 hours

What have I done wrong. I compiled my project and linked it to Blynk mobile. After only a couple of hours I now find I cannot use it anymore as the Message limits has been reached (30 day lockout). Its just a temperature monitor but was going to go further with it.

Here’s the code

/* Fill-in information from Blynk Device Info here */
#define BLYNK_TEMPLATE_ID "TMPL5EWfQ8Y8R"
#define BLYNK_TEMPLATE_NAME "ReefTank Control"
#define BLYNK_AUTH_TOKEN "pwCwhBq6aJooO3Un5ieVqnc9jT7WEk1J"
/* Comment this out to disable prints and save space */
// #define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
// the following are extra for temperature 
// #include <SimpleTimer.h>     *** no simple timer found
#include <OneWire.h>
#include <DallasTemperature.h>

// WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "txxxxxxxxxxx";
char pass[] = "Yxxxxxxxxxxxx";

BlynkTimer timer;

#define ONE_WIRE_BUS 2 // DS18B20 on arduino pin2 corresponds to D4 on physical board "D4 pin on the ndoemcu Module"
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature DS18B20(&oneWire);
float temp;
float Fahrenheit=0;

// This function is called every time the Virtual Pin 0 state changes
BLYNK_WRITE(V0)
{
  // Set incoming value from pin V0 to a variable
  int value = param.asInt();

  // Update state
  Blynk.virtualWrite(V1, value);
}

// This function sends Arduino's uptime every second to Virtual Pin 2.
void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V2, millis() / 1000);
}

void setup()
{
  // Debug console
  Serial.begin(115200);

  //Connecting to Blynk Cloud
  Blynk.begin(BLYNK_AUTH_TOKEN, ssid, pass);
  
  DS18B20.begin();
  timer.setInterval(1000L, getSendData);
  // Setup a function to be called every second
  timer.setInterval(1000L, myTimerEvent);
}

void loop()
{
  Blynk.run();
  timer.run();
  // You can inject your own code or combine it with other sketches.
  // Check other examples on how to communicate with Blynk. Remember
  // to avoid delay() function!
}

/***************************************************
 * Send Sensor data to Blynk
 **************************************************/
void getSendData()
{
  DS18B20.requestTemperatures(); 
  temp = DS18B20.getTempCByIndex(0); // Celcius
   Fahrenheit = DS18B20.toFahrenheit(temp); // Fahrenheit
  Serial.println(temp);
  Serial.println(Fahrenheit);
  Blynk.virtualWrite(V3, temp); //virtual pin V3
  Blynk.virtualWrite(V4, Fahrenheit); //virtual pin V4
}

please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly. Triple backticks look like this: ```

@BrianTux you’ve edited your post, but not used triple backticks. Instead you’ve chosen some other random characters.

@Madhukesh gave you an example of what triple backticks look like, please copy and paste these if you can’t find the correct character on your keyboard.

Pete.

hopefully ok now< i was trying to do it on my iphone, I had to turn the laptop on again to do it

You have two functions that you’re calling once per second.

One of these functions does this…

the other does this…

That’s 3 messages per second, or 180 messages per minute.
30,000/180 =166 minutes, or about 2 hours 45 minutes to use-up your monthly allowance of messages.

Every time you change the value of the widget attached to V0 you’re sending another message (from the Blynk server to the device) , then doing this…

so each change of the V0 widget counts for two more messages.

In addition, every time you reboot your device there’s a short exchange of messages between the device and the server, which also counts towards your monthly total.

If you want to use the free plan on a long-term basis (not what it’s intended for) then you’re limited to about 1000 messages per day, or about one every minute and a half.

Upgrading to the Pro plan removes this monthly message limit. If you don’t want to do that then Blynk probably isn’t the platform for you.

Pete.

Thank you for that advice Pete, Ill have another look at the code.
Its a shame the messages work like that as I’ve seen lots of other people using this for the same projects, I guess something has changed recently.
Thanks, Brian

Correct. The message limit is something Blynk has introduced recently, presumably to make the Free subscription less appealing to people who want to use it in the long term.
Unfortunately that has also coincided with the removal of the more affordable Maker subscription, so the Pro subscription is now the only useable option for projects that require a degree of functionality.

Pete.