Help with Blynk.config on Arduino & ESP8266 compile problems

Having struggled with my project I have been researching the forums. I have rewrote my code to use timers and leave loop to timer and Blynk.run.

I’m switching to virtual pins not direct access and I want to use blynk.config not blynk.start so I can manage my connection.

When I try and use blynk.config I get a compile error though. I know it’s either my variable declarations or how I use the function. I don’t know C though and have drawn a blank via Google.

Relevant code looks roughly like


Char[] sever = xxxxxxxxxx
Char [] Auth = xxxxxxxxxx
Char[] said = xxxxxxxxxx
Char[] pass=xxxxxxxxxx

Void setup ()
{
Blank.connectWiFi(ssid, pass);
Blynk.config(Auth, server, 8080);
}

When I compile I get an error as Blynk.config seems to expect 4 arguments.

The compile error is

a reference of type “ESP8266 &” (not const-qualified) cannot be initialized with a value of type “const char *”

message: ‘argument of type “int” is incompatible with parameter of type “const char *”’
at: ‘140,30’

Blynk.config seems to want arguments (ESP8266 &esp8266, const char *auth, const char *domain, unit16_t port)

I don’t have the ESP8266 argument and don’t know what this is looking for me to pass.

It’s an Arduino mega 256 project with esp8266 attached. It’s a development board with h/w serial

I would be very grateful for any help, I have researched the forums and found out what I need to change on my project to improve my code but this issue is blocking me and I have been looking all evening. I didn’t find anything when I searched on this.

Thanks

When running an ESP in AT mode (WiFi Shield) I found I need to use this in order to use Blynk.config() on the Arduino.

#include <ESP8266_Lib.h>  // ESP-01 Link
#include <BlynkSimpleShieldEsp8266.h>  // ESP-01 Link
  wifi.setDHCP(1, 1, 1); //Enable dhcp in station mode and save in flash of esp8266
  Blynk.config(wifi, auth, server, port);
  if (Blynk.connectWiFi(ssid, pass)) {
    Blynk.connect();
  }
1 Like

PS use the backtick key, not a comma for code formatting…

Blynk - FTFC

Great thanks for the help and the tip on code formatting !