Wifi Continuously Connect and Reconnect on mobile device

Hello, and thank you for your suggestions. I’ve tried both changes but I get the “packet too big” line in the serial window.




[1999] 
    ___[1999] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on Arduino Mega

[2506] Connecting to "wifi"
[5557] AT version:1.1.0.0(May 11 2016 18:09:56)
SDK version:1.5.4(baaeaebb)
Ai-Thinker Technology Co. Ltd.
Jun 13 2016 11:29:20
OK
[10622] +CIFSR:STAIP,"192.168.0.112"
+CIFSR:STAMAC,"bc:dd:c2:2d:fe:b9"
[10624] Connected to WiFi
[20776] Ready (ping: 11ms).
[30784] Packet too big: 2603
[36142] Ready (ping: 200ms).
[39833] Packet too big: 2603''

You have to update the AT-firmware to v1.3.0.2_AT_Firmware.bin. This version works reliably at 115200 baud. All other version is not working OK at 115.2 KBaud and especially with Mega.

My test results:

1) ai-thinker-v1.1.1.bin (AT command works with 115200 baud), try with MEGA using 9600 - 115200 not working.
2) ai-thinker-0.9.5.2.bin (AT command totally not working with any baud), try with MEGA using 9600 - 115200 not working.
3) ai-thinker-0.9.5.bin (AT command totally not working with any baud), try with MEGA using 9600 - 115200 not working.

Get the bin file at

https://github.com/mlwmlw/esp8266-workshop/blob/master/firmware/v1.3.0.2%20AT%20Firmware.bin

then update AT-firmware. If you don;t know how to update, Google research.

If you still have problem, post your ful code along with Serial Window.

2 Likes

Thank you for your help. I used an esp8266 flasher but I get the same response.

#define BLYNK_PRINT Serial

#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SPI.h>
#include <max6675.h>
LiquidCrystal_I2C lcd(0x27,20,4);

#define MAXDO1   48
#define MAXCS1   46
#define MAXCLK1  44

MAX6675 thermocouple1(MAXCLK1, MAXCS1, MAXDO1);

//volts
float volt1 = 2;
float volt2 = 3;
float volt3 = 4;

#if defined(ARDUINO_ARCH_SAMD)
// for Zero, output on USB Serial console, remove line below if using programming port to program the Zero!
   #define Serial SerialUSB
#endif


//buttons
int pin_switch1 = 50;

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "";
char pass[] = "";
// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial1

// or Software Serial on Uno, Nano...
//#include <SoftwareSerial.h>
//SoftwareSerial EspSerial(2, 3); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 115200

ESP8266 wifi(&EspSerial);


BlynkTimer timer;

void getVolt()
{
volt1 = analogRead(A1);
  volt1 = volt1/1024*5.0;// Convert the data to the corresponding voltage value in a math way
  delay(200); //Wait for 200ms
///volt2
    volt2 = analogRead(A2);
    volt2 = volt2/1024*5.0;// Convert the data to the corresponding voltage value in a math way
delay(200); //Wait for 200ms
//volt3
   volt3 = analogRead(A3);
  volt3 = volt3/1024*5.0;// Convert the data to the corresponding voltage value in a math way
delay(200); //Wait for 200ms
   
   if (digitalRead(pin_switch1) == LOW) {
    {
  volt1 = analogRead(A1);
  volt1 = volt1/1024*5.0;// Convert the data to the corresponding voltage value in a math way
  delay(200); //Wait for 200ms
///volt2
    volt2 = analogRead(A2);
    volt2 = volt2/1024*5.0;// Convert the data to the corresponding voltage value in a math way
delay(200); //Wait for 200ms
//volt3
   volt3 = analogRead(A3);
  volt3 = volt3/1024*5.0;// Convert the data to the corresponding voltage value in a math way
delay(200); //Wait for 200ms
   
 lcd.clear();
  lcd.setCursor(0,0);
  //lcd.autoscroll();
  lcd.print("V1: ");
  lcd.print(volt1);
  lcd.print("V2: ");
  lcd.print(volt2);
  lcd.setCursor(0,1);
  lcd.print("V3: ");
  lcd.print(volt3);
   delay(100);
 }

  }


Blynk.virtualWrite(V1, volt1);
Blynk.virtualWrite(V2, volt2);
Blynk.virtualWrite(V3, volt3);
    
  delay(100);

}
void getTemp()
{
 double t1 = thermocouple1.readCelsius();
   //delay(500);
  t1= (((t1*9))/5)+32;
   
     Serial.print("Thermocouple Temp1 = *");
     Serial.println(t1);
 
lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("Temp1 = ");
  lcd.print(t1);   
  lcd.print(" F ");
   
    Blynk.virtualWrite(V10, t1);

}
void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V60, millis() / 1000);
}
 

void setup()
{
  // Debug console
  Serial.begin(115200);
 
  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(2000);

  Blynk.begin(auth, wifi, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, wifi, ssid, pass, "blynk-cloud.com", 80);
  //Blynk.begin(auth, wifi, ssid, pass, IPAddress(192,168,1,100), 8080);

  // Setup a function to be called every second
  timer.setInterval(1000L, myTimerEvent);
 timer.setInterval(5000L, getVolt);
  timer.setInterval(5000L, getTemp);
 

}

void loop()
{
  Blynk.run();
  timer.run(); // Initiates BlynkTimer
}


[1999] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on Arduino Mega

[2506] Connecting to 
[5558] AT version:0.40.0.0(Aug  8 2015 14:45:58)
SDK version:1.3.0
Ai-Thinker Technology Co.,Ltd.
Build:1.3.0.2 Sep 11 2015 11:48:04
OK
[10654] +CIFSR:STAIP,"192.168.0.112"
+CIFSR:STAMAC,"bc:dd:c2:2d:fe:b9"
[10655] Connected to WiFi
[22152] Ready (ping: 11ms).
[45851] Packet too big: 2603


Wow. You’re so fast I can’t keep up with.

I’m afraid you hardware + network + code combination somehow triggers the infamous bug Packet too big of the combination AT-firmwame + ESP8266_Lib + BlynkSimpleShieldEsp8266.h.
I saw and experienced this random bug quite a while and am trying to go to the root cause of it, but not yet successful and had to defer.

I currently have just a quick-dirty fix, but didn’t find out the root cause and solve yet.

Anyway, I need some time to duplicate this and let you know later.

2 Likes

:grin: I’ve spent a lot of time with this.
Thank you so much for your help!

@khoih, you might find this useful. It’s obviously related to different hardware, but might give a different perspective on the issue.

Pete.

Dear @PeteKnight:
Many thanks for your insight on a lot of different issues and fields.
This is an interesting bug worth for us to spend time. Hopefully it’s not inside out-of-reach AT-firmware and/or BLE AT-firmware.
Best Regards,

Thank to @PeteKnight pointing out similar problem in BLE, it’s possible just the small buffer size creating this issue.
In the mean time, you can try this test by modifying these line in

./Arduino/libraries/Blynk/src/Blynk/BlynkConfig.h

from

  // Limit the incoming command length.
  #ifndef BLYNK_MAX_READBYTES
  #define BLYNK_MAX_READBYTES  256
  #endif

  // Limit the outgoing command length.
  #ifndef BLYNK_MAX_SENDBYTES
  #define BLYNK_MAX_SENDBYTES  128
  #endif  

to

  // Limit the incoming command length.
  #ifdef BLYNK_MAX_READBYTES
  #undef BLYNK_MAX_READBYTES
  #endif

  #define BLYNK_MAX_READBYTES  1024
  
  // Limit the outgoing command length.
  #ifdef BLYNK_MAX_SENDBYTES
  #undef BLYNK_MAX_SENDBYTES
  #endif

  #define BLYNK_MAX_SENDBYTES  512

and let us know the result. I still haven’t got time to setup Mega+ESP to test.

1 Like

Thank you. I changed that line but I get the same result.

There’s more than one line that needs to be changed.

Pete.

1 Like

Did you change all those lines?
I set up and test the MegaWiFi R3 (Mega2560 + ESP01) similar to your config and still had no issue yet, after change those lines. I’m connecting to Local Blynk Server.
The terminal output:

[1999] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on Arduino Mega

[2506] Connecting to ****
[5598] AT version:0.40.0.0(Aug  8 2015 14:45:58)
SDK version:1.3.0
Ai-Thinker Technology Co.,Ltd.
Build:1.3.0.2 Sep 11 2015 11:48:04
OK
[10802] +CIFSR:STAIP,"192.168.2.79"
+CIFSR:STAMAC,"5c:cf:7f:78:28:1f"
[10803] Connected to WiFi
[20956] Ready (ping: 25ms).
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00

and this is the result connecting to Local Blynk Server, but via DDNS (*.duckdns.org). Still OK.

[1999] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on Arduino Mega

[2506] Connecting to HueNet
[15668] WIFI CONNECTED
WIFI GOT IP
AT version:0.40.0.0(Aug  8 2015 14:45:58)
SDK version:1.3.0
Ai-Thinker Technology Co.,Ltd
Bi:...Sp1211:84


[20797] +CIFSR:STAIP,"192.168.2.79"
+CIFSR:STAMAC,"5c:cf:7f:78:28:1f"
[20798] Connected to WiFi
[31034] Ready (ping: 21ms).
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00

Can you move the ESPSerial port to Serial3 (and change the ESP-01 wire correspondingly) and test again to see if there was any conflict.

Also you can remove all unnecessary device (LCD, etc), just bare board + ESP-01 and test again if problem persists.

Yes, I don’t know why I said “that line” instead of “those lines”. :sweat_smile:

I made the changes and removed other items, but the problem persisted. I am just connected to my wifi. I can try to connect to the local Blynk server.


[1999] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on Arduino Mega

[2506] Connecting to 
[5558] AT version:0.40.0.0(Aug  8 2015 14:45:58)
SDK version:1.3.0
Ai-Thinker Technology Co.,Ltd.
Build:1.3.0.2 Sep 11 2015 11:48:04
OK
[10644] +CIFSR:STAIP,"192.168.0.112"
+CIFSR:STAMAC,"bc:dd:c2:2d:fe:b9"
[10645] Connected to WiFi
[20803] Ready (ping: 11ms).
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
Thermocouple Temp1 = *32.00
[87567] Packet too big: 2603
Thermocouple Temp1 = *32.00

UPDATE:
I didn’t have the app on my screen and the code ran for much longer. It wasn’t until I opened the app that the error persisted.

Can you try with the following bare-bone code and post the result:

#define BLYNK_PRINT Serial

#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
//Blynk Cloud Server
char auth[] = "***";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "***";
char pass[] = "***";
// Hardware Serial on Mega, Leonardo, Micro...
#define EspSerial Serial3

// Your ESP8266 baud rate:
#define ESP8266_BAUD 115200

ESP8266 wifi(&EspSerial);

void setup()
{
  // Debug console
  Serial.begin(115200);
  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(2000);

  Blynk.begin(auth, wifi, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, wifi, ssid, pass, "blynk-cloud.com", 80);
}

void loop()
{
  Blynk.run();
}

@khoih

I’ve noticed that the Blynk examples work fine, I think it’s when functions are added.
Also, I didn’t have the app on my screen and the code ran for much longer. It wasn’t until I opened the app that the error persisted.

[12445] +CIFS192.168.0.112"
+CIFSR:STAMAC,"bc:dd:c2:2d:fe:b9"
[12445] Connected to WiFi
[1999] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on Arduino Mega

[2506] Connecting to 
[5558] AT version:0.40.0.0(Aug  8 2015 14:45:58)
SDK version:1.3.0
Ai-Thinker Technology Co.,Ltd.
Build:1.3.0.2 Sep 11 2015 11:48:04
OK
[10645] +CIFSR:STAIP,"192.168.0.112"
+CIFSR:STAMAC,"bc:dd:c2:2d:fe:b9"
[10646] Connected to WiFi
[20867] Ready (ping: 12ms).

If so, the other library and/or cell network speed / latency could be the culprit. Using the Local Blynk Server can eliminate the network part.
It’s possibly the Wire and LiquidCrystal_I2C libraries are using too much MCU time in the slow Mega (16MHz MCU clock, etc.), not playing nice, monopolize and prevent other code portions to run when necessary. This will lead to buffer overflow => Packet too Big problem.

Try to use another similar library if possible to test.

Now you’re expert in how to debug by eliminating one-by-one and achieving the good results.

1 Like

Thank you for your help.
Is there an updated guide on how to connect to the local server on a windows device?

or is this not what I want?

I wish :laughing:
I removed the lcd and the wire libraries. The problem still happens when I open the app. I might try another app besides Blynk :pensive: .

Hello,
I have removed the LCD screen completely, changed some values in the library, tried new firmware but I cannot keep wifi connection with the Blynk app. I have the serial monitor open when the code is running, and I only get “packet too big” when the app is pulled up. Otherwise the code runs smoothly for hours, but as soon as I open the app I get the packet message.
Is it possible to clear the packet when it reaches a certain limit without restarting the arduino?
Like once the data is pushed the packet can be cleared?
Thank you!

Packet too big is an internal message that means “something went wrong”, probably caused by bad coding.
Post your full current code and any additional details that will be of help.

Pete.

There are a couple of components to this code. There are voltage and temp readings and a motor control.

//#define BLYNK_DEBUG // Opt
#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG    
#define BLYNK_NO_BUILTIN 
//#define BLYNK_NO_FLOAT 
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <SPI.h>
#include <AFMotor.h>
#include <max6675.h>
#include "Adafruit_MAX31855.h"
#include <Keypad.h>


//Assign volt values to some number to start with
float volt1 = 2;
float volt2 = 3;
float volt3 = 4;
float volt4 = 5;
float volt5 = 8;
float volt6 = 9;
float volt7 = 10;
float volt8 = 11;
int maxValue = 3; // current sensor value that will trigger slowdown
int safeValue = 100; //safe motor speed

//Thermocouple Section
#define MAXDO1   23
#define MAXCS1   25
#define MAXCLK1  27
#define MAXDO2   48
#define MAXCS2   50
#define MAXCLK2  52
#define MAXDO3   41
#define MAXCS3   39
#define MAXCLK3  37
#define MAXDO4   47
#define MAXCS4   49
#define MAXCLK4  51

// Initialize the Thermocouple
Adafruit_MAX31855 thermocouple2(MAXCLK2, MAXCS2, MAXDO2);
MAX6675 thermocouple4(MAXCLK4, MAXCS4, MAXDO4);
MAX6675 thermocouple3(MAXCLK3, MAXCS3, MAXDO3);
MAX6675 thermocouple1(MAXCLK1, MAXCS1, MAXDO1);

//LED
WidgetLED led1(V45);
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "";

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

// Hardware Serial on Mega, Leonardo, Micro...
//Location of RX and TX pins on Arduino board
#define EspSerial Serial3

// or Software Serial on Uno, Nano...
//#include <SoftwareSerial.h>
//SoftwareSerial EspSerial(2, 3); // RX, TX

// Your ESP8266 baud rate:
#define ESP8266_BAUD 115200

ESP8266 wifi(&EspSerial);

//Identify location of motor on shield
AF_DCMotor motor(2);

//Keypad Code..Use when there is no Internet
const byte ROWS = 4; 
const byte COLS = 3; 

char hexaKeys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}
};

byte rowPins[ROWS] = {36, 34, 32, 30}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {28, 26, 24};

Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); 


int x = 0;

BlynkTimer timer;

//Below are functions they start with vois but are not the main void loop or void setup

void setup()
{
  // Debug console
  Serial.begin(115200);
  EspSerial.begin(ESP8266_BAUD);
  delay(2000);

  Blynk.begin(auth, wifi, ssid, pass);
  Blynk.begin(auth, wifi, ssid, pass, "blynk-cloud.com", 8080);
 // Blynk.connectWiFi(ssid, pass);
  //Blynk.begin(auth, wifi, ssid, pass, LOCAL_SERVER, 8080);
  timer.setInterval(1000L, myTimerEvent);
  timer.setInterval(3000L, getTemp);
  timer.setInterval(3000L, getVolt);
//  timer.setInterval(3000L, keyPad);

motor.run(RELEASE);
  //motor.run(FORWARD);
}



void myTimerEvent()
{
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V60, millis() / 1000);//Assign the virtual pin(60) to the timer

}

void getVolt()
{
  //assign the volt readings to an anologue pin 
  //volt1
volt1 = analogRead(A1);//Read the value of the potentiometer to val
  volt1 = volt1/1024*5.0;// Convert the data to the corresponding voltage value in a math way
  
///volt2
    volt2 = analogRead(A2);//Read the value of the potentiometer to val
    volt2 = volt2/1024*5.0;// Convert the data to the corresponding voltage value in a math way

//volt3
   volt3 = analogRead(A3);//Read the value of the potentiometer to val
  volt3 = volt3/1024*5.0;// Convert the data to the corresponding voltage value in a math way

   volt4 = analogRead(A4);//Read the value of the potentiometer to val
  volt4 = volt4/1024*5.0;// Convert the data to the corresponding voltage value in a math way
   
 //volt in arduino section
 volt5 = analogRead(A5);//Read the value of the potentiometer to val
  volt5 = volt5/1024*5.0;// Convert the data to the corresponding voltage value in a math way
  
///volt6
    volt6 = analogRead(A8);//Read the value of the potentiometer to val
    volt6 = volt6/1024*5.0;// Convert the data to the corresponding voltage value in a math way

//volt7
   volt7 = analogRead(A9);//Read the value of the potentiometer to val
  volt7 = volt7/1024*5.0;// Convert the data to the corresponding voltage value in a math way

   volt8 = analogRead(A10);//Read the value of the potentiometer to val
  volt8 = volt8/1024*5.0;// Convert the data to the corresponding voltage value in a math way
  
if (volt1 >= maxValue)
   {   
    motor.run(FORWARD);
   motor.setSpeed(safeValue); 
   led1.on();
    Serial.println("LED on V1: red"); 
    Blynk.virtualWrite(V20, safeValue);
   }
   if (volt1 <= maxValue)
   {   
   led1.off();
    Serial.println("LED on V1: off"); 
   }
//   if (volt1 <= maxValue)
//   {   
//   motor.setSpeed(pinValue); 
//   }
//Assign each voltage reading to its own virtual pin
Blynk.virtualWrite(V1, volt1);
Blynk.virtualWrite(V2, volt2);
Blynk.virtualWrite(V3, volt3);
Blynk.virtualWrite(V4, volt4);
Blynk.virtualWrite(V5, volt5);
Blynk.virtualWrite(V6, volt6);
Blynk.virtualWrite(V7, volt7);
Blynk.virtualWrite(V8, volt8);
    


}

void getTemp()
{
 // Assign a variable to the farenheit conversions of the digital pins
   double t1 = thermocouple1.readFarenheit();

   double t2 = thermocouple2.readFarenheit();
   
   double t3 = thermocouple3.readFarenheit();
  
   double t4 = thermocouple4.readFarenheit();
  

   //Display these values in the Serial monitor(top right looking glass symbol)
     Serial.print("Thermocouple Temp1 = *");
     Serial.println(t1);
     Serial.print("Thermocouple Temp2= *");
     Serial.println(t2);
     Serial.print("Thermocouple Temp3 = *");
     Serial.println(t3);
     Serial.print("Thermocouple Temp4= *");
     Serial.println(t4);

     //Assign each temp reading to its own virtual pin on Blynk app
    Blynk.virtualWrite(V10, t1);
    Blynk.virtualWrite(V11, t2); 
    Blynk.virtualWrite(V12, t3);
    Blynk.virtualWrite(V13, t4); 

}

BLYNK_WRITE(V20)
{
  //Connect a virtual pin to the motor to control its speed
  int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
  //Tell motor to run in one direction, forward
   if (volt1 <= maxValue)
   {   
 volt1 = analogRead(A1);//Read the value of the potentiometer to val
  volt1 = volt1/1024*5.0;//
  motor.run(FORWARD);
  Serial.println(pinValue);
  motor.setSpeed(pinValue);    
   }
//while (V1 > 2)
//{
//  int pinValue = param.asInt();
//  int pinValue2= pinValue/2;
//  motor.run(FORWARD);
//  Serial.println("pinValue2=");
//  Serial.println(pinValue2);
//  motor.setSpeed(pinValue2);
//}
//}

}
BLYNK_APP_DISCONNECTED() {
// Your code here

//void keyPad()
//{
   char customKey = customKeypad.getKey();
  
  if (customKey){
    Serial.println(customKey);
motor.run(FORWARD);
if (customKey == '0')
{
  motor.setSpeed(0);
}
if (customKey == '1')
{
  motor.setSpeed(28);
}
if (customKey == '2')
{
  motor.setSpeed(57);
}
if (customKey == '3')
{
  motor.setSpeed(85);
}
if (customKey == '4')
{
  motor.setSpeed(113);
}
if (customKey == '5')
{
  motor.setSpeed(142);
}
if (customKey == '6')
{
  motor.setSpeed(170);
}
if (customKey == '7')
{
  motor.setSpeed(198);
}
if (customKey == '8')
{
  motor.setSpeed(227);
}
if (customKey == '9')
{
  motor.setSpeed(255);
}




}
}

void loop()
{
  //Keep loop clean
  //run blynk app and timer
 Blynk.run();
 timer.run(); // Initiates BlynkTimer
}


You can try to use the Blynk_Teensy library, you can use for Mega2560 just to see if the issue fixed (as similar issue happened to Teensy 4.0)

Then just replace in the code

//#include <BlynkSimpleShieldEsp8266.h>
#include <BlynkSimpleShieldEsp8266_Teensy.h>

There are also some typo errors in the call, not readFarenheit(), but readFahrenheit().

Must be:

 double t1 = thermocouple1.readFahrenheit();

  double t2 = thermocouple2.readFahrenheit();

  double t3 = thermocouple3.readFahrenheit();

  double t4 = thermocouple4.readFahrenheit();

Then post the results.

1 Like