Arduino 101 + Shield YUN and Blynk

Hi, i have some problem with my Arduino 101 and Shield YUN. I have to use the shield wifi to connect my Arduino to Blynk app. This is my code, but it doesn't work because Blynk says that the "device is offline". Can you help me? Thanks a lot!

#define BLYNK_PRINT Serial

#include <Ultrasonic.h>
#include <SPI.h>
#include <WiFi.h>
#include <BlynkSimpleWifi.h>
#include <CurieBLE.h>

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

// Blynk token
char auth[] = "auth";

WidgetLED green(V1);
WidgetLED orange(V2);
WidgetLED red(V3);
WidgetMap myMap(V4);

BlynkTimer timer;
int distance = 0;
int thresh[3] = {25, 50, 75};
Ultrasonic ultrasonic(12, 13);

void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
//Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);

// If you want to remove all points:
//myMap.clear();

int index = 1;
float lat = 40.8185844;
float lon = 16.55683978;
myMap.location(index, lat, lon, "value");

}

void loop()
{
distance = ultrasonic.distanceRead();
Serial.println(distance);
Blynk.run();

if(distance<thresh[0])
green.on();

else if(distance<thresh[1]){
green.on();
orange.on();
}
else if(distance<thresh[2]){
green.on();
orange.on();
red.on();
}
else{
green.off();
orange.off();
red.off();
delay(100);
}
}

cagnazzi_vito:
Hi, i have some problem with my Arduino 101 and Shield YUN. I have to use the shield wifi to connect my Arduino to Blynk app. This is my code, but it doesn't work because Blynk says that the "device is offline". Can you help me? Thanks a lot!

#define BLYNK_PRINT Serial

#include <Ultrasonic.h>
#include <SPI.h>
#include <WiFi.h>
#include <BlynkSimpleWifi.h>
#include <CurieBLE.h>

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

// Blynk token
char auth[] = "auth";

WidgetLED green(V1);
WidgetLED orange(V2);
WidgetLED red(V3);
WidgetMap myMap(V4);

BlynkTimer timer;
int distance = 0;
int thresh[3] = {25, 50, 75};
Ultrasonic ultrasonic(12, 13);

void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
//Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);

// If you want to remove all points:
//myMap.clear();

int index = 1;
float lat = 40.8185844;
float lon = 16.55683978;
myMap.location(index, lat, lon, "value");

}

void loop()
{
distance = ultrasonic.distanceRead();
Serial.println(distance);
Blynk.run();

if(distance<thresh[0])
green.on();

else if(distance<thresh[1]){
green.on();
orange.on();
}
else if(distance<thresh[2]){
green.on();
orange.on();
red.on();
}
else{
green.off();
orange.off();
red.off();
delay(100);
}
}

Please use code tags when posting code.

I do not see any code for using the Yun Shield Wifi nor ethernet.

Have you run any of the Yun/Yun Shield examples?

Have you initialized the Yun Shield?

artisticforge:
Please use code tags when posting code.

I do not see any code for using the Yun Shield Wifi nor ethernet.

Have you run any of the Yun/Yun Shield examples?

Have you initialized the Yun Shield?

Hi, sorry but I'm new. I have initialized the YUN shield and connected to my wifi network. I don't know how to use this shield because for me is the first time. Can you help me? I saw some example of Arduino YUN but didn't help me.

cagnazzi_vito:
Hi, sorry but I'm new. I have initialized the YUN shield and connected to my wifi network. I don't know how to use this shield because for me is the first time. Can you help me? I saw some example of Arduino YUN but didn't help me.

Since this is your first time why not start simple and just use the Arduino 101 board?
Blynk does use Bluetooth and the Arduino 101 has Bluetooth.
There is a Blynk example just for that.

examples -> Blynk -> Boards Bluetooth ->Arduino 101 BLE

I have attached a screenshot.

artisticforge:
Since this is your first time why not start simple and just use the Arduino 101 board?
Blynk does use Bluetooth and the Arduino 101 has Bluetooth.
There is a Blynk example just for that.

examples -> Blynk -> Boards Bluetooth ->Arduino 101 BLE

I have attached a screenshot.

Yes I know, but it is for a school project. And BLE is in BETA. So I have to use WiFi

cagnazzi_vito:
Yes I know, but it is for a school project. And BLE is in BETA. So I have to use WiFi

Have you attempted the Blynk bluetooth example for the Arduino 101 board? It does not matter if this is for a school project. You need to learn somethings and not just go off rote.

You are not even attempting to use the wifi nor ethernet of the Yun shield.

I finished school many decades ago. I do not need to be doing school projects.

artisticforge:
Have you attempted the Blynk bluetooth example for the Arduino 101 board? It does not matter if this is for a school project. You need to learn somethings and not just go off rote.

You are not even attempting to use the wifi nor ethernet of the Yun shield.

I finished school many decades ago. I do not need to be doing school projects.

Yes I've tried the example but it doesn't work because, as said, the BLE in Blynk app is in BETA and so when I try to connect my Arduino 101, Blynk find it but is not able to connect. For this reason I use the wifi. I thought that the libraries to be used were those of the shield wifi and instead are those of Arduino YUN. So I see the YUN example, and there is only "Bridge.h" as library to connect Arduino to Blynk. But nothing...

cagnazzi_vito:
Yes I've tried the example but it doesn't work because, as said, the BLE in Blynk app is in BETA and so when I try to connect my Arduino 101, Blynk find it but is not able to connect. For this reason I use the wifi. I thought that the libraries to be used were those of the shield wifi and instead are those of Arduino YUN. So I see the YUN example, and there is only "Bridge.h" as library to connect Arduino to Blynk. But nothing...

Why not just use a wifi shield instead of the yun shield? The yun shield seems like overkill.
Why are you using the Arduino 101 board? Why not a mkr1000 which has wifi. An Arduino Zero or MKRZero?
Why not start out with a board which all ready has wifi?

I will try the blynk examples later. I have the Arduino 101 and a yun shield . I do not necessarily want a blynk account. I will try it with one of my iPad. I will try it with the Arduino Zero , Arduino MKR Zero and the Arduino 101 with an Arduino Wifi 101 shield. May try it with the Arduino 101 and the Yun shield just to prove that it can be done. Will let you know later

artisticforge:
Why not just use a wifi shield instead of the yun shield? The yun shield seems like overkill.
Why are you using the Arduino 101 board? Why not a mkr1000 which has wifi. An Arduino Zero or MKRZero?
Why not start out with a board which all ready has wifi?

I will try the blynk examples later. I have the Arduino 101 and a yun shield . I do not necessarily want a blynk account. I will try it with one of my iPad. I will try it with the Arduino Zero , Arduino MKR Zero and the Arduino 101 with an Arduino Wifi 101 shield. May try it with the Arduino 101 and the Yun shield just to prove that it can be done. Will let you know later

MKR1000 has an operating voltage at 3.3V but in my project I use a sensor that works at 5V. According to the professor the best choice (due to time and hardware availability) was the Arduino 101 and the YUN shield. For this reason I use them. But I have problems because I don't understand which libraries I have to use to connect the device with Blynk. I haven't found examples that can help me.

cagnazzi_vito:
MKR1000 has an operating voltage at 3.3V but in my project I use a sensor that works at 5V. According to the professor the best choice (due to time and hardware availability) was the Arduino 101 and the YUN shield. For this reason I use them. But I have problems because I don't understand which libraries I have to use to connect the device with Blynk. I haven't found examples that can help me.

I am working on it.
I am trying to install the local Blynk server on my Debian Linux Server.
Firefox is being dumb. will not allow me to download Java SDK 9 from oracle.com

artisticforge:
I am working on it.
I am trying to install the local Blynk server on my Debian Linux Server.
Firefox is being dumb. will not allow me to download Java SDK 9 from oracle.com

Thank you for your help...