Hi, I had success using Arduino Uno for some personal projects and now for a new project I want to use Arduino Yun for the wireless option.
I had running two boards for some time, maybe days and suddendly they stop working and cannot be found on the network. It's just some simple code that reads a DHT21 sensor and sends the data over the internet. I checked for the "-u" python flag in the Bridge and its present. Also when a board hangs there is no Access Point with the name Arduino-YUNXXXX, they just die. I cannot understand why something so simple will fail.
#include <Bridge.h>
#include <HttpClient.h>
#include <dht.h>
dht DHT;
#define DHT21_PIN 4
unsigned long previousMillis = 0;
long interval = 300000;
void setup() {
// Initialize Bridge
Bridge.begin();
Serial.begin(9600);
delay(5000);
}
void loop() {
unsigned long currentMillis = millis();
if (currentMillis - previousMillis > interval) {
Sensor();
previousMillis = currentMillis;
}
delay(50);
}
void Sensor() {
//variables
float h, t;
unsigned long l;
String s; char tmp[10];
do {
int chk = DHT.read21(DHT21_PIN);
h = DHT.humidity;
t = DHT.temperature;
delay(10000);
} while (isnan(h) || isnan(t));
s = "http://domain.example/add?" ;
//sensor: humidity
dtostrf(h,1,2,tmp);
s += "h1=";
s += tmp;
//sensor: temperature
dtostrf(t,1,2,tmp);
s += "&t1=";
s += tmp;
sendGet(s);
}
void sendGet(String s) {
HttpClient client;
client.get(s);
// if there are incoming bytes available
// from the server, read them and print them:
while (client.available()) {
char c = client.read();
Serial.print(c);
}
Serial.flush();
}
I've run into a lot of problems with the early releases.
I wish it was made a little more obvious that it needs to be upgraded out of the box. I only found it by joining the forum and searching for an unrelated topic.
I'd say they should really add this process to the "Getting Started" guide prior to folks getting unstable behavior.
=== Release 1.4.2 - September 4th, 2014
=== Release 1.4.1 - August 8th, 2014
=== Release 1.4 - July 15th, 2014
=== Release 1.3 - July 14th, 2014
=== Release 1.2 - July 11th, 2014
=== Release 1.1 - June 23rd, 2014
=== Release 1.0 - April 17th, 2014
root@Arduino:/mnt/sda1# uname -a
Linux Arduino 3.3.8 #1 Fri Jun 20 12:50:18 CEST 2014 mips GNU/Linux
root@Arduino:/mnt/sda1# cat /etc/arduino/openwrt-yun-release
built=Fri Jun 20 07:32:45 CEST 2014
That's because compiling openwrtyun on our build server takes around 36 hours (it's a slow machine, so that it consumes less power when it's idle)
However, the difference between the date in the file and the date in the changelog is misleading. I'll fix it asap
I've been having a very similar issue. I collect a data from 3 analog inputs every sec, average them, and upload the average to thingspeak.com every minute. I then make a graph using highcharts. As you can see in my graph
there are several instances where thingspeak does not receive data. This "dead time" usually lasts ~12 minutes. However, it can sometimes last indefinitely (the little graph on the very bottom shows some 1-2 day long deadtimes, which only ended when I rebooted the yun).
At ~9:10am today (during the temporary peak and deadtime in the green pressure trace), I updated the Yun, following the tutorial at http://arduino.cc/en/Tutorial/YunSysupgrade. Despite this, the Yun continued to lose WiFi connection or whatever other issue it may be...