My first post here.
I have an old Yun (2013) and have successfully accessed current date and time, in the course of this have managed to loose the wifi connection.
My pc no longer shows the Yun as an available net work connection.
I'm pretty new to all this so any help would be appreciated.
From another post on this forum have downloaded the fing-network app for Android.
This shows that my Yun now has a different ip address so I have been able to configure it.
But it still doesn't show in available connections.
#include <Process.h>
Process date; // process used to get the date
int dates, month, years, hours, minutes, seconds; // for the results
int lastSecond = -1; // need an impossible value for comparison
void setup() {
Bridge.begin(); // initialize Bridge
Serial.begin(9600); // initialize serial
while(!Serial); // wait for Serial Monitor to open
Serial.println("Time Check"); // Title of sketch
}
void loop() {
date.begin("/bin/date");
// date.addParameter("+%d/%m/%Y %T");
date.run();
while (date.available()>0) {
String timeString = date.readString();
Serial.println(timeString);
}
delay(5000);
}
Thank you aarg,
Yes, you're right.
The yun did show among 'networks' but that must have somehow been because it still had all the settings from years ago, in the meantime I've moved home so wifi is entirely different.
Anyway, the Yun is running the sketch shown above but is shown as offline and I can't access its control panel.
Are you sure about the begin() method in loop()? That is highly unusual.
We can't make much sense of the sketch you posted because there is so much logic hidden in 'Process.h' which you haven't referenced by link, posted, or identified.
OK, have reset YÚN RST, WLAN RST for 30sec+.
Still no wifi connection.
Tried to connect to my PC with ethernet cable but can't get a connection, perhaps because of ethernet 1 vs ethernet 2, not sure.
Noticed that the Yun re-appeared in the 'available networks' display and through this was able to enter the Yun setup panel. made sure that Wireless Parameters/network was set to my router and REST API Access = 'open'
Yun is still off line.
The sketch used is from Getting Yun's Date & Time - #2 by jessemonroy650.
I am out of ideas now!
Have just uploaded the 'Blink' sketch to the Yun and the Yun is online.
So you were right to question the Date & Time sketch. I'll look at other approaches and post the results here.
Thanks