Nextion display

good day after a year I wanted to upload this program to wemos d1 R1 and it says this error: exit status 1 no matching function for call to 'SoftwareSerial::SoftwareSerial(int, int, bool, int) and I don’t know why… thanks

    #include <ESP8266WiFi.h>
    #include <BlynkSimpleEsp8266.h>
    //#include "Adafruit_Si7021.h"
    #include <SI7021.h>

    #include <SoftwareSerial.h>;
    #include <Nextion.h>
    #include <SimpleTimer.h>

    #include <Wire.h>
    float temp, hum;
    SimpleTimer timer;

    //extern SoftwareSerial HMISerial;
    //SI7021 sensor;
    SoftwareSerial HMISerial(12, 14, false, 256); //RX-D 5 , TX-D 6
    Nextion myNextion(HMISerial, 9600); 


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

    // Your WiFi credentials.
    // Set password
    char ssid[] = "boss";
    char pass[] = "";

    float temperature;
    float humidity;

    void sendUptime()
    {

      int brightness = analogRead(A0);
      int bright = map(brightness, 0, 1033, 85, 02);
      String dim = "dim=" + String(bright);
      myNextion.sendCommand(dim.c_str());

    }
    BLYNK_WRITE(V1)
    {
      float currentHour = param.asFloat(); // assigning incoming value from pin V5 to a variable
      // You can also use:
      // String i = param.asStr();
      // double d = param.asDouble();
     //Serial.print("currentHour is: ");
      //Serial.println(currentHour);

      myNextion.setComponentText("t",String( currentHour));
    }

    BLYNK_WRITE(V2)
    {
      float currentMinute = param.asFloat(); // assigning incoming value from pin V5 to a variable
      // You can also use:
      // String i = param.asStr();
      // double d = param.asDouble();
      //Serial.print("currentMinute is: ");
      //Serial.println(currentMinute);

      myNextion.setComponentText("t",String( currentMinute));
    }
    BLYNK_WRITE(V3)
    {
      float currentDate = param.asFloat(); // assigning incoming value from pin V5 to a variable
      // You can also use:
      // String i = param.asStr();
      // double d = param.asDouble();
     // Serial.print("currentDate is: ");
      //Serial.println(currentDate);

      myNextion.setComponentText("t", String(currentDate));
    }
    BLYNK_WRITE(V5)
    {
     float temperature = param.asFloat(); // assigning incoming value from pin V5 to a variable
      // You can also use:
      // String i = param.asStr();
       //double d = param.asDouble();
    //  Serial.print("temperature is: ");
    // Serial.println(temperature);

     myNextion.setComponentText("t0", String(temperature));

    }
    BLYNK_WRITE(V6)
    {
      float humidity = param.asFloat(); // assigning incoming value from pin V5 to a variable
      // You can also use:
      // String i = param.asStr();
      // double d = param.asDouble();
      //Serial.print("humidity is: ");
     //Serial.println(humidity);

      myNextion.setComponentText("t2", String(humidity));
    }

     BLYNK_WRITE(V4)
    {
      float lux = param.asFloat(); // assigning incoming value from pin V5 to a variable
      // You can also use:
      // String i = param.asStr();
      // double d = param.asDouble();
     //Serial.print("lux is: ");
     // Serial.println(lux);

      myNextion.setComponentText("t15", String(lux));

    } 
    BLYNK_WRITE(V7)
    {
      float co2_ppm = param.asFloat(); // assigning incoming value from pin V5 to a variable
      // You can also use:
      // String i = param.asStr();
      // double d = param.asDouble();
     // Serial.print("co2_ppm is: ");
      //Serial.println(co2_ppm);

      myNextion.setComponentText("t15", String(co2_ppm));

    }
    BLYNK_WRITE(V8)
    {
      float dst = param.asFloat(); // assigning incoming value from pin V5 to a variable
      // You can also use:
      // String i = param.asStr();
      // double d = param.asDouble();
     // Serial.print("dst tlak is: ");
     // Serial.println(dst);

      myNextion.setComponentText("t7", String(dst));

    }
    BLYNK_WRITE(V9)
    {
      float bp = param.asFloat(); // assigning incoming value from pin V5 to a variable
      // You can also use:
      // String i = param.asStr();
      // double d = param.asDouble();
    //  Serial.print("bp tlak is: ");
     // Serial.println(bp);

      myNextion.setComponentText("t11", String(bp));

    }
    BLYNK_WRITE(V10)
    {
      float bt = param.asFloat(); // assigning incoming value from pin V5 to a variable
      // You can also use:
      // String i = param.asStr();
      // double d = param.asDouble();
      //Serial.print("bt temp is: ");
      //Serial.println(bt);

      myNextion.setComponentText("t9", String(bt));

    }

    BLYNK_WRITE(V15)
    {
      float maxRpm = param.asFloat(); // assigning incoming value from pin V5 to a variable
    //   You can also use:
     //  String i = param.asStr();
      // double d = param.asDouble();
      Serial.print("maxRpm is: ");
     Serial.println(maxRpm);

      myNextion.setComponentText("t5",String( maxRpm));
    }

    BLYNK_WRITE(V16)
    {
      float maxKmh = param.asFloat(); // assigning incoming value from pin V5 to a variable
      // You can also use:
      // String i = param.asStr();
      // double d = param.asDouble();
     // Serial.print("maxKmh is: ");
     // Serial.println(maxKmh);

      myNextion.setComponentText("t4",String( maxKmh));
    }

    BLYNK_WRITE(V17)
    {
      float maxTemp = param.asFloat(); // assigning incoming value from pin V5 to a variable
      // You can also use:
      // String i = param.asStr();
      // double d = param.asDouble();
     // Serial.print("maxTemp is: ");
     // Serial.println(maxTemp);

      myNextion.setComponentText("t",String( maxTemp));
    }

    BLYNK_WRITE(V18)
    {
      float minTemp = param.asFloat(); // assigning incoming value from pin V5 to a variable
      // You can also use:
      // String i = param.asStr();
      // double d = param.asDouble();
     // Serial.print("minTemp is: ");
     // Serial.println(minTemp);

      myNextion.setComponentText("t",String( minTemp));
    }

    void setup()
    {
      myNextion.init();
      //sensor.begin();  //D2-SDA D1-SCL
      Serial.begin(9600);
      
      Blynk.begin(auth, ssid, pass);
      // You can also specify server:
      //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442);
      //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);

      timer.setInterval(60000L, sendUptime);
    }


    void loop()
    {

      // myNextion.setComponentText("t10", String(sensor.readHumidity(), 2));
     // myNextion.setComponentText("t9", String(sensor.readTemperature(), 2));

          Blynk.run();
          timer.run();
         
     
     }```

@Jiri_Bam 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:
```

Copy and paste these if you can’t find the correct symbol on your keyboard.

Pete.

This is (almost) the same question you asked back in 2017, and the answer hasn’t changed since:

1 Like

Wow, good old memories with @Costas, @Gunner and @Lichtsignaal supporting new Blynkers at that time.

2 Likes

I knoooow! The good old days, almost got misty-eyed thinking about it! :smiling_face_with_three_hearts:

1 Like

yes, but last time it worked for me, now I don’t know why it reports this error… :slight_smile:







blynk_bridge:18:44: error: no matching function for call to 'SoftwareSerial::SoftwareSerial(int, int, bool, int)'
   18 | SoftwareSerial HMISerial(12, 14, false, 256); //RX-D 5 , TX-D 6
      |                                            ^
In file included from C:\Users\jirbos\Desktop\meteo new1\blynk_bridge\blynk_bridge.ino:8:
C:\Users\jirbos\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\SoftwareSerial\src/SoftwareSerial.h:93:5: note: candidate: 'SoftwareSerial::SoftwareSerial(int8_t, int8_t, bool)'
   93 |     SoftwareSerial(int8_t rxPin, int8_t txPin = -1, bool invert = false);
      |     ^~~~~~~~~~~~~~
C:\Users\jirbos\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\SoftwareSerial\src/SoftwareSerial.h:93:5: note:   candidate expects 3 arguments, 4 provided
C:\Users\jirbos\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\SoftwareSerial\src/SoftwareSerial.h:89:5: note: candidate: 'SoftwareSerial::SoftwareSerial()'
   89 |     SoftwareSerial();
      |     ^~~~~~~~~~~~~~
C:\Users\jirbos\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\SoftwareSerial\src/SoftwareSerial.h:89:5: note:   candidate expects 0 arguments, 4 provided
blynk_bridge:19:1: error: 'Nextion' does not name a type
   19 | Nextion myNextion(HMISerial, 9600);
      | ^~~~~~~
blynk_bridge:20:1: error: 'myNextion' does not name a type
   20 | myNextion.init();
      | ^~~~~~~~~
C:\Users\jirbos\Desktop\meteo new1\blynk_bridge\blynk_bridge.ino: In function 'void sendUptime()':
blynk_bridge:40:3: error: 'myNextion' was not declared in this scope
   40 |   myNextion.sendCommand(dim.c_str());
      |   ^~~~~~~~~
C:\Users\jirbos\Desktop\meteo new1\blynk_bridge\blynk_bridge.ino: In function 'void BlynkWidgetWrite1(BlynkReq&, const BlynkParam&)':
blynk_bridge:52:3: error: 'myNextion' was not declared in this scope
   52 |   myNextion.setComponentText("t",String( currentHour));
      |   ^~~~~~~~~
C:\Users\jirbos\Desktop\meteo new1\blynk_bridge\blynk_bridge.ino: In function 'void BlynkWidgetWrite2(BlynkReq&, const BlynkParam&)':
blynk_bridge:64:3: error: 'myNextion' was not declared in this scope
   64 |   myNextion.setComponentText("t",String( currentMinute));
      |   ^~~~~~~~~
C:\Users\jirbos\Desktop\meteo new1\blynk_bridge\blynk_bridge.ino: In function 'void BlynkWidgetWrite3(BlynkReq&, const BlynkParam&)':
blynk_bridge:75:3: error: 'myNextion' was not declared in this scope
   75 |   myNextion.setComponentText("t", String(currentDate));
      |   ^~~~~~~~~
C:\Users\jirbos\Desktop\meteo new1\blynk_bridge\blynk_bridge.ino: In function 'void BlynkWidgetWrite5(BlynkReq&, const BlynkParam&)':
blynk_bridge:86:2: error: 'myNextion' was not declared in this scope
   86 |  myNextion.setComponentText("t0", String(temperature));
      |  ^~~~~~~~~
C:\Users\jirbos\Desktop\meteo new1\blynk_bridge\blynk_bridge.ino: In function 'void BlynkWidgetWrite6(BlynkReq&, const BlynkParam&)':
blynk_bridge:98:3: error: 'myNextion' was not declared in this scope
   98 |   myNextion.setComponentText("t2", String(humidity));
      |   ^~~~~~~~~
C:\Users\jirbos\Desktop\meteo new1\blynk_bridge\blynk_bridge.ino: In function 'void BlynkWidgetWrite4(BlynkReq&, const BlynkParam&)':
blynk_bridge:110:3: error: 'myNextion' was not declared in this scope
  110 |   myNextion.setComponentText("t15", String(lux));
      |   ^~~~~~~~~
C:\Users\jirbos\Desktop\meteo new1\blynk_bridge\blynk_bridge.ino: In function 'void BlynkWidgetWrite7(BlynkReq&, const BlynkParam&)':
blynk_bridge:122:3: error: 'myNextion' was not declared in this scope
  122 |   myNextion.setComponentText("t15", String(co2_ppm));
      |   ^~~~~~~~~
C:\Users\jirbos\Desktop\meteo new1\blynk_bridge\blynk_bridge.ino: In function 'void BlynkWidgetWrite8(BlynkReq&, const BlynkParam&)':
blynk_bridge:134:3: error: 'myNextion' was not declared in this scope
  134 |   myNextion.setComponentText("t7", String(dst));
      |   ^~~~~~~~~
C:\Users\jirbos\Desktop\meteo new1\blynk_bridge\blynk_bridge.ino: In function 'void BlynkWidgetWrite9(BlynkReq&, const BlynkParam&)':
blynk_bridge:146:3: error: 'myNextion' was not declared in this scope
  146 |   myNextion.setComponentText("t11", String(bp));
      |   ^~~~~~~~~
C:\Users\jirbos\Desktop\meteo new1\blynk_bridge\blynk_bridge.ino: In function 'void BlynkWidgetWrite10(BlynkReq&, const BlynkParam&)':
blynk_bridge:158:3: error: 'myNextion' was not declared in this scope
  158 |   myNextion.setComponentText("t9", String(bt));
      |   ^~~~~~~~~
C:\Users\jirbos\Desktop\meteo new1\blynk_bridge\blynk_bridge.ino: In function 'void BlynkWidgetWrite15(BlynkReq&, const BlynkParam&)':
blynk_bridge:171:3: error: 'myNextion' was not declared in this scope
  171 |   myNextion.setComponentText("t5",String( maxRpm));
      |   ^~~~~~~~~
C:\Users\jirbos\Desktop\meteo new1\blynk_bridge\blynk_bridge.ino: In function 'void BlynkWidgetWrite16(BlynkReq&, const BlynkParam&)':
blynk_bridge:183:3: error: 'myNextion' was not declared in this scope
  183 |   myNextion.setComponentText("t4",String( maxKmh));
      |   ^~~~~~~~~
C:\Users\jirbos\Desktop\meteo new1\blynk_bridge\blynk_bridge.ino: In function 'void BlynkWidgetWrite17(BlynkReq&, const BlynkParam&)':
blynk_bridge:195:3: error: 'myNextion' was not declared in this scope
  195 |   myNextion.setComponentText("t",String( maxTemp));
      |   ^~~~~~~~~
C:\Users\jirbos\Desktop\meteo new1\blynk_bridge\blynk_bridge.ino: In function 'void BlynkWidgetWrite18(BlynkReq&, const BlynkParam&)':
blynk_bridge:207:3: error: 'myNextion' was not declared in this scope
  207 |   myNextion.setComponentText("t",String( minTemp));
      |   ^~~~~~~~~
C:\Users\jirbos\Desktop\meteo new1\blynk_bridge\blynk_bridge.ino: In function 'void setup()':
blynk_bridge:212:3: error: 'myNextion' was not declared in this scope
  212 |   myNextion.init();
      |   ^~~~~~~~~
Byly nalezené násobné knihovny "SD.h"
 Použitý: C:\Users\jirbos\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\SD
 Nepoužitý: C:\Program Files (x86)\Arduino\libraries\SD
exit status 1
no matching function for call to 'SoftwareSerial::SoftwareSerial(int, int, bool, int)'

The answer can be found in the old thread. Read it!!

Your question(s) is about general programming, not Blynk. There was a time, say 2017, when people through their kindness tried to help everyone, regardless of it was relevant to Blynk or not. But that was then, this is now. Unless you can show that you made an actual effort to first solve the problem on your own, the chances of getting any help is probably somewhere between 0 and 0.0.

Did you even try to Google the error message?

:angry:

@Jiri_Bam looking at your sketch you appear to be using Blynk Legacy with the Legacy cloud servers.
These cloud servers will be turned off on 31st December (15 days time) so you should be focussing on migrating to Blynk IoT rather than trying to get an old sketch working with Legacy.

Your SoftwareSerial error is because the library is expecting a maximum of three parameters (although normally only two are used) and you are attempting to provide four parameters.

If this worked in the last then it’s probably because you were using an earlier version of the ESP8266 core, which is where the SoftwareSerial library for the ESP8266 lives.

Pete.

od thanks i will try and is this a good example for migrating to blynk iot? Blynk Example Browser

yes, I tried, but I only found old articles… ok, I’ll try to solve the problem myself

I’ve told you what the problem is, and that there are only 15 days of Blynk Legacy operation left, which will make your SoftwareSerial issue irrelevant unless you take some positive action.

Pete.

2 Likes

yes I know and I’m trying but it shows me only one this code in blynk iot…

#define BLYNK_TEMPLATE_ID ""
#define BLYNK_DEVICE_NAME "Wemos D1"  // Put your Auth Token here. (see Step 3 above)
#define BLYNK_AUTH_TOKEN ""
#define BLYNK_FIRMWARE_VERSION        "1.1.0"


#define BLYNK_PRINT Serial 
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>

#include <Wire.h>
#include <SI7021.h>
float temperature, humidity;

char auth[] = BLYNK_AUTH_TOKEN;

SI7021 sensor;
#define I2C_SCL 5// Barometric Pressure Sensor (BMP085)
#define I2C_SDA 4


BlynkTimer timer; 
//SimpleTimer timer;

char ssid[] = "";
char pass[] = "";

void setup()
{

 Wire.begin();
 sensor.begin(SDA,SCL);
 Wire.begin(I2C_SDA, I2C_SCL);
 // See the connection status in Serial Monitor
 Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);
 
 timer.setInterval(20000L,sendUptime);

}

void sendUptime()
{
float temperature = sensor.getCelsiusHundredths();
int humidity = sensor.getHumidityPercent();

Blynk.virtualWrite(V1,temperature ); // virtual pin 
Blynk.virtualWrite(V2, humidity); // virtual pin

}

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

I have no idea what this statement means, or what the screenshot and sketch you have posted mean, or how they relate to the issue that this topic is about.

If you want assistance with a problem then you need to get better at communicating what that problem is, and what environment that problem relates to.

Pete.

1 Like

I didn’t want to start a new topic here… you told me to switch to Blynk IOT so i switched but in Blynk Iot i don’t see any values… it still shows me the value :1… i don’t know why… thanks

It’s probably how you’ve configured the maximum values for the V1 and V2 datastreams.

Pete.

yes I had a maximum value of 1 in the datastream… but now the temperature is showing incorrectly… but in the old Blynk it was displayed fine… what should I try? Thanks

int temperature = sensor.getCelsiusHundredths();
int humidity = sensor.getHumidityPercent();

Blynk.virtualWrite(V1, (float)temperature/100,2); // virtual pin 
Blynk.virtualWrite(V2, humidity); // virtual pin

humidity is displayed well


#define BLYNK_TEMPLATE_ID ""
#define BLYNK_DEVICE_NAME "Wemos D1"  // Put your Auth Token here. (see Step 3 above)
#define BLYNK_AUTH_TOKEN ""
#define BLYNK_FIRMWARE_VERSION        "1.1.0"


#define BLYNK_PRINT Serial 
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>

#include <Wire.h>
#include <SI7021.h>

float temperature,humidity;


char auth[] = BLYNK_AUTH_TOKEN;

SI7021 sensor;
#define I2C_SCL 5// Barometric Pressure Sensor (BMP085)
#define I2C_SDA 4

BlynkTimer timer; 
//SimpleTimer timer;

char ssid[] = "boss";
char pass[] = "17641764";

void setup()
{

 Wire.begin();
 sensor.begin(SDA,SCL);
 Wire.begin(I2C_SDA, I2C_SCL);
 // See the connection status in Serial Monitor
 Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);
 
 timer.setInterval(20000L,sendUptime);

}

void sendUptime()
{
int temperature = sensor.getCelsiusHundredths();
int humidity = sensor.getHumidityPercent();

Blynk.virtualWrite(V1, (float)temperature/100,2); // virtual pin 
Blynk.virtualWrite(V2, humidity); // virtual pin

}

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

Try replacing your code screenshot with the copied/pasted code with triple backticks to begin with.

Pete.

I gave a screenshot because the temperature and humidity are displayed in a different color in the code… so if this could not be the reason why it is displayed incorrectly…

That’s about keyword coding, nothing to do with syntax issues.

I’d suggest that you do your division and rounding before writing the result to Blynk.

Pete.

yes indeed it was
now it works …
and could I send you a private message? so that I don’t annoy you with all the nonsense here
thanks

int temperature = sensor.getCelsiusHundredths()/100;