I have tried connecting the Arduino to the blynk app using the following code:
and have tried changing the device in the blynk app to arduino uno and arduino mkr1000 however, the app says the arduino isn’t online when i run the code from the online arduino IDE.
So I’ve tried changing the device in the blynk app to generic board (wifi) but the app says that the device isn’t online when i run the code i linked above. Is it possible that my arduino is not compatible with blynk as i read something about it having to use AT commands which i am unsure of?
I’ve now tried using the sketch for the arduino uno with the arduino wifi shield whilst setting the device in the blynk app as the arduino uno which didn’t work. So now I am trying the sketch for the MKR WiFi 1010 but there isn’t an option to choose that device in the app, what device should I choose? I’ve also double checked that the values for auth[], ssid[] and pass[] are all correct.
BTW I have my arduino connected to my laptop via a usb cable if that helps?
@IBK Thanks for the reminder I see it now. But my guess was close as the only difference between the two options with the Arduino WiFi Shield (the closest option I can think of for this board) is the use of SerialUSB instead of Serial for debug. It appears the connection to the “WiFi” is internal with the BlynkSimpleWiFi.h library
@lieuloo as mentioned use Generic Board… all the choices in the App do are designate the available pins to use for direct pin manipulation, a totally irrelevant feature when using Virtual Pins.
If you still cannot connect, then there may be other issues at play like an error in the Auth (just reset it in the device settings in the App and try again) or something in your network preventing proper device to cloud connection?
Hi,
it took me two days to test and figure out. finally let me share how it is working for me:
I do have an original arduino uno wifi rev2
Project settings in blynk app: my device = GENERIC BOARD connection type = WiFi
connection via Iphone hotspot (not via router)
#define BLYNK_PRINT Serial
#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[] = "6**************************e";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "iPhone von M*****";
char pass[] = "g*************";
//char ssid[] = "G*************";
//char pass[] = "m***********";
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);
}
// This function will be called every time Slider Widget
// in Blynk app writes values to the Virtual Pin 1
BLYNK_WRITE(V1)
{
int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
// You can also use:
// String i = param.asStr();
// double d = param.asDouble();
Serial.print("V1 Slider value is: ");
Serial.println(pinValue);
}
void loop()
{
Blynk.run();
}
before this, I did update wifinina firmware to 1.2.4 (not 1.3.0) and you need to install all libraries which you include.