Sketch uses wifi ... but linino isn't up yet ...

How can I determine if linino is up and the WIFI is connected from a sketch?

The MCU boot very quickly, but linino can take almost a full minute to boot. So on a fresh power up the sketch fails. It's sending commands to linino before linino is up.

Other than sleeping 60 seconds in the script, how can I detect that linino is up and connected to the wifi network from the script?

Thank you for the help! Kyle Disque

Reset MCU after linino completed boot


Check internet connection or do something:

I'm starting to think that there is no way to know that Linino has booted successfully from in a sketch.

I appreciate the suggestion about rebooting the MCU from Linino, but that's a work around.

The issue is that my sketch trys to open a URL right away. If it does this while Linino is booting, it appears to cause instability on one side or the other. Given that when power is applied, the MCU boots quickly and messes up Linino, having Linino reboot the MCU wont work.

So, I'd love to hear if there is a way to open the console and listen for the expected string at the end of the boot messages.


[quote author=Federico Fissore link=topic=200706.msg1480497#msg1480497 date=1385300485] One very naive way I use is to send \n to Serial1 and read the result if available. If at some point that result is "root@Arduino", then linino is ready [/quote]

I saw that.

However during the boot of Linino there is a prompt: "Hit enter to enter failsafe mode".

If I were to try your suggestion, there is a high likelihood that it will send linino into failsafe mode.

Someone must have solved this issue by now. Or maybe Yun's are being use more like toys or learning tools and not in a project where they need to work autonomously (at least not where Arduino/Yun interaction is required)


Here is some code I implemented to start up Firmata. It waits for u-boot to complete:

void setup() 
  Serial1.begin(115200); // Set the baud.
  while (!Serial1) {}
   // Wait for U-boot to finish startup.  Consume all bytes until we are done.
  do {
     while (Serial1.available() > 0) {;
  } while (Serial1.available()>0);
... and some other stuff.

I really wish they used a semaphore, but that would have made our lives easy. XD