BLYNK
BLYNK.IO       📲 GETTING STARTED       📗 DOCS       👉 SKETCH BUILDER

Arduino UNO Wifi Rev 2(Mega 4809) to Blynk

Hello, I am a beginner with the new version of Blynk
I am using
Arduino Uno Wifi Rev2 (MEGA4809)
Arduino IDE 1.8.16
Blynk App 2.0

I choose the Blynk Examples to connect my board to internet, however I fail to upload the code into the board.
Examples: Blynk → Boards_Wifi -->Arduino_MKR1010
Library: WifiNINA version 1.8.13
Library: Blynk Version 1.0.1

And here is the error messages

In file included from E:\Cloud\Dropbox\Arduino\libraries\arduino_813015\src/WiFiStorage.h:23:0,

             from E:\Cloud\Dropbox\Arduino\libraries\arduino_813015\src/WiFi.h:38,

             from E:\Cloud\Dropbox\Arduino\libraries\arduino_813015\src/WiFiNINA.h:23,

             from E:\Cloud\Dropbox\Arduino\libraries\arduino_483770\examples\Boards_WiFi\Arduino_MKR1010\Arduino_MKR1010.ino:37:

E:\Cloud\Dropbox\Arduino\libraries\arduino_813015\src/utility/wifi_drv.h:293:12: error: ‘PinStatus’ does not name a type

 static PinStatus digitalRead(uint8_t pin);

        ^~~~~~~~~

exit status 1

Error compiling for board Arduino Uno.

Please help

Hey there, you are choosing Arduino uno board in the arduino ide, you should choose arduino uno WIFI rev2 instead, check this out :

Yes I have chosen arduino uno WIFI rev2 in arduino IDE

Sometimes it comes out error message like this

In file included from E:\Cloud\Dropbox\Arduino\libraries\arduino_483770\src/Blynk/BlynkApi.h:36:0,
from E:\Cloud\Dropbox\Arduino\libraries\arduino_483770\src/BlynkApiArduino.h:14,
from E:\Cloud\Dropbox\Arduino\libraries\arduino_483770\src/Adapters/BlynkWiFiCommon.h:24,
from E:\Cloud\Dropbox\Arduino\libraries\arduino_483770\src/BlynkSimpleWiFiNINA.h:22,
from E:\Cloud\Dropbox\Arduino\libraries\arduino_483770\examples\Boards_WiFi\Arduino_MKR1010\Arduino_MKR1010.ino:38:
E:\Cloud\Dropbox\Arduino\libraries\arduino_483770\src/Blynk/BlynkParam.h: In member function ‘long long int BlynkParam::iterator::asLongLong() const’:
E:\Cloud\Dropbox\Arduino\libraries\arduino_483770\src/Blynk/BlynkParam.h:48:50: error: ‘atoll’ was not declared in this scope
long long asLongLong() const { return atoll(ptr); }
^~~~~
E:\Cloud\Dropbox\Arduino\libraries\arduino_483770\src/Blynk/BlynkParam.h:48:50: note: suggested alternative: ‘atol’
long long asLongLong() const { return atoll(ptr); }
^~~~~
atol
E:\Cloud\Dropbox\Arduino\libraries\arduino_483770\src/Blynk/BlynkParam.h: In member function ‘long long int BlynkParam::asLongLong() const’:
E:\Cloud\Dropbox\Arduino\libraries\arduino_483770\src/Blynk/BlynkParam.h:89:46: error: ‘atoll’ was not declared in this scope
long long asLongLong() const { return atoll(buff); }
^~~~~
E:\Cloud\Dropbox\Arduino\libraries\arduino_483770\src/Blynk/BlynkParam.h:89:46: note: suggested alternative: ‘atol’
long long asLongLong() const { return atoll(buff); }
^~~~~
atol
exit status 1
Error compiling for board Arduino Uno WiFi Rev2.

Can you upload your sketch please ?

Here it is

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial

/* Fill-in your Template ID (only if using Blynk.Cloud) */
#define BLYNK_TEMPLATE_ID "TMPLx8at8oPD"
#define BLYNK_DEVICE_NAME "WSC Coral Tank 1"
#define BLYNK_AUTH_TOKEN "bQWUj2rAOMkMEb8g5E9yll4NjaKgWy4i";


#include <SPI.h>
#include <WiFiNINA.h>
#include <BlynkSimpleWiFiNINA.h>

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

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

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

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

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

The link “blynk-cloud . com” should be without spaces before and after the dot. This is because of my limitation on posting a reply.

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

Pete.

Actually this board is one of the worst boards I’ve ever tried, it’s not even supported in the arduino IOT cloud. So I highly recommend you to get a different board like esp32, nodemcu, arduino MKR WIFI 1010, arduino nano 33 IOT, arduino MKR 1000 etc…

it is a pity teh arduino UNO REV 2 did not work anymore with blynk. i had hydroponic project included on this arduino and now i need buy a new board :frowning: :frowning:

any help please?

thanks

I don’t think anyone is saying that this board doesn’t work with Blynk IoT, simply that it’s a difficult board to master and a poor choice for a beginner with any system.

Converting working Blynk Legacy code to Blynk IoT code should simply be a case of adding two additional lines of code at the very beginning of the sketch and re-compiling with the new Blynk libraries.

Pete.

1 Like

Hi Pete

thanks.

the code that i am use, is this one below, and this did not compile with last version of Blynk :frowning:
with version 0.60 of blynk compile but said taht did invalid token


#define BLYNK_PRINT Serial

/* Fill-in your Template ID (only if using Blynk.Cloud) */
//#define BLYNK_TEMPLATE_ID “TMPLkbJH_Tlw”

#include <SPI.h>
#include <Blynk.h>
#include <WiFiNINA.h>
#include <BlynkSimpleWiFiNINA.h>

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

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

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

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

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

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

Pete.

UPDATE on how to fix this error…

@Andyy has figured-out how to fix this issue, the solution is to edit the Arduino\libraries\Blynk\src\Blynk\BlynkParam.h file in the library as documented here:

Pete.