Community
cancel
Showing results for 
Search instead for 
Did you mean: 
LLee28
New Contributor I
1,711 Views

Are there any codes or functions in Arduino IDE to reboot the Edison Arduino expansion

Jump to solution

I am afraid the wifi lose connection because of unexpected reason or interuption, it will be good to have a reboot function to reboot the Edison, since wiif will automatically connect after boot-up, I guess.

Thanks.

1 Solution
idata
Community Manager
65 Views

Hi,

Some suggestions could be to disable the connman service with systemctl stop connman, which image are you using?

 

You can also restart the services related to WiFi or the wlan0 interface, in order to avoid restarting the board constantly.

 

If you want to reboot the board you can run the command reboot with a system call, for example.

 

NOTE: before running this code, the Edison can't have the feature of remembering the Arduino sketch after every reboot, because could cause a permanent loop where the board reboots after every boot, in case this happens please flash the board with the flashall script.

void setup() {

 

system("reboot");

 

}

void loop() {

 

// put your main code here, to run repeatedly:

 

}

If you are using the WiFi library on the Arduino IDE, you can restart the interface too, https://www.arduino.cc/en/Reference/WiFi https://www.arduino.cc/en/Reference/WiFi

Regards,

 

Charlie

View solution in original post

5 Replies
idata
Community Manager
66 Views

Hi,

Some suggestions could be to disable the connman service with systemctl stop connman, which image are you using?

 

You can also restart the services related to WiFi or the wlan0 interface, in order to avoid restarting the board constantly.

 

If you want to reboot the board you can run the command reboot with a system call, for example.

 

NOTE: before running this code, the Edison can't have the feature of remembering the Arduino sketch after every reboot, because could cause a permanent loop where the board reboots after every boot, in case this happens please flash the board with the flashall script.

void setup() {

 

system("reboot");

 

}

void loop() {

 

// put your main code here, to run repeatedly:

 

}

If you are using the WiFi library on the Arduino IDE, you can restart the interface too, https://www.arduino.cc/en/Reference/WiFi https://www.arduino.cc/en/Reference/WiFi

Regards,

 

Charlie

View solution in original post

LLee28
New Contributor I
65 Views

Hi, Charlie

Thanks for you answer.

  1. I am using the old version 146 (ww18-15), since it will automatically run my code at boot-up in the version.
  2. I am using campus WiFi, which need to input my username and password except for SSID of campus WiFi. So the Arduino WiFi library doesn't help for me. What I did was connecting wifi in the Linux system through putty, and wifi will be automatically connected after reboot. If there is any better ideas, pls share.

I will have a try as what you say, and will give a feedback.

Thanks again

 

LLee28
New Contributor I
65 Views

Hi, Charlie,

It works very well !!! I want to know where to find such perfect function? Before this thread, I did a lot of google search, but with no luck. I even cannot find this function on Arduino's website.

Many Thanks.

idata
Community Manager
65 Views

Hi,

I'm glad to know that it works for you. The function system(" ") allows you to interact with the Linux side of the board, with this function you can run the commands you run on the Linux Terminal.

 

The Arduino IDE is able to run sketches and to compile and run C code, the system function is declared on the C headers (stdlib.h), this is the reason you didn't find the function on the Arduino website; if in the future there is something that the Arduino libraries don't include, look into the headers and libraries for C in the Arduino IDE, I think it could help you.

Regards,

 

Charlie
LLee28
New Contributor I
65 Views

Oh, I see. Thanks a lot.

Reply