Community
cancel
Showing results for 
Search instead for 
Did you mean: 
idata
Community Manager
1,474 Views

Arduino sketch stops working after the USB cable is disconnected

Jump to solution

I am not able to run the sketch once the USB cable is disconnected.

I am using the latest image version : Firmware version installed: 201606061707

Could you please tell me the procedure to run the sketch with just connecting the power supply and no USB.

Thanks and Regards,

Parth Desai

0 Kudos
1 Solution
idata
Community Manager
70 Views

Hi Parth,

We'll do our best to help you configure your Edison. First, in order to upload an Arduino sketch you must have the USB cable connected. Once this sketch is uploaded in the Edison, you should enable the "Arduino sketch persistent" workaround. Now, you can have your Arduino sketch running and disconnect the USB cable. Even though the board might reboot, the sketch should still be active after a reboot.

 

The "Arduino sketch persistent" workaround is not enabled in the latest image, so the procedure is described here:

 

Flash the board to a previous version to get some files, and then reflash to the latest version and copy those files. Make sure you backup any important data stored on your Edison, as this procedure will delete everything that is on the board.

1. Flash your board with image 146 (ww18-15) using the flashall.sh method

(Image 146: https://downloadmirror.intel.com/24910/eng/edison-image-ww18-15.zip https://downloadmirror.intel.com/24910/eng/edison-image-ww18-15.zip).

2. Boot the board and upload any Arduino sketch on it.

3. Connect to the board using PuTTY or SSH.

4. Copy the following files to a SD card or a USB flash drive:

/opt/edison/launcher.sh

 

/opt/edison/clloader

 

/opt/edison/sketch_reset

 

/opt/edison/sketch_reset.sh

5. Flash your board with image the latest image using the flashall.sh method

6. Connect to the board using PuTTY or SSH.

7. Copy the files mentioned before from your SD card or a USB flash drive to their respective directories (if you are not able to copy the files, use kill -9)

8. Make sure the module responsible for launching the sketch is enabled by running the following commands:

systemctl enable clloader

 

systemctl start clloader

You can now upload a sketch and reboot the board.

Let us know if this works for you.

-Sergio

View solution in original post

6 Replies
idata
Community Manager
71 Views

Hi Parth,

We'll do our best to help you configure your Edison. First, in order to upload an Arduino sketch you must have the USB cable connected. Once this sketch is uploaded in the Edison, you should enable the "Arduino sketch persistent" workaround. Now, you can have your Arduino sketch running and disconnect the USB cable. Even though the board might reboot, the sketch should still be active after a reboot.

 

The "Arduino sketch persistent" workaround is not enabled in the latest image, so the procedure is described here:

 

Flash the board to a previous version to get some files, and then reflash to the latest version and copy those files. Make sure you backup any important data stored on your Edison, as this procedure will delete everything that is on the board.

1. Flash your board with image 146 (ww18-15) using the flashall.sh method

(Image 146: https://downloadmirror.intel.com/24910/eng/edison-image-ww18-15.zip https://downloadmirror.intel.com/24910/eng/edison-image-ww18-15.zip).

2. Boot the board and upload any Arduino sketch on it.

3. Connect to the board using PuTTY or SSH.

4. Copy the following files to a SD card or a USB flash drive:

/opt/edison/launcher.sh

 

/opt/edison/clloader

 

/opt/edison/sketch_reset

 

/opt/edison/sketch_reset.sh

5. Flash your board with image the latest image using the flashall.sh method

6. Connect to the board using PuTTY or SSH.

7. Copy the files mentioned before from your SD card or a USB flash drive to their respective directories (if you are not able to copy the files, use kill -9)

8. Make sure the module responsible for launching the sketch is enabled by running the following commands:

systemctl enable clloader

 

systemctl start clloader

You can now upload a sketch and reboot the board.

Let us know if this works for you.

-Sergio

View solution in original post

idata
Community Manager
70 Views

Hi Parth,

 

 

Do you still need assistance with this case? Did you find useful the information from our last post?

 

 

-Sergio

 

idata
Community Manager
70 Views

Hey Sergio,

I tried to search the steps to flash the firmware using the flashall.sh method but could not find for windows machine. I use the flashlite tool to flash my Edison. Is it okay if I use the same to flash the image mentioned by you ? will the steps be the same or change if I use the flashlite tool

Thanks,

Parth

idata
Community Manager
70 Views

The recommended methods to flash the Edison are the flashall and the Setup Tool. You can see instructions on how to perform the flashall in Windows here /docs/DOC-25154 https://communities.intel.com/docs/DOC-25154 and instructions to use the Setup Tool here https://software.intel.com/en-us/get-started-edison-linux-step2 https://software.intel.com/en-us/get-started-edison-linux-step2 .

 

 

We no longer recommend the Flash Tool Lite so it would be better if you use one of the aforementioned methods however you may still flash successfully using the flash Tool Lite. The steps are different for each method. You can find the latest image here https://software.intel.com/en-us/iot/hardware/edison/downloads https://software.intel.com/en-us/iot/hardware/edison/downloads .

 

 

Let us know your results.

 

 

-Sergio

 

idata
Community Manager
70 Views

Hey Sergio,

I flashed my board as instructed by you and then uploaded a sketch and tried to reboot and check if it works, and it did!

1. Flash your board with image 146 (ww18-15) using the flashall.sh method

(Image 146: https://downloadmirror.intel.com/24910/eng/edison-image-ww18-15.zip https://downloadmirror.intel.com/24910/eng/edison-image-ww18-15.zip).

I did not have to do the further steps and I am okay with the firmware version as long as my sketch works on bootup.

Thanks for the help

Regards,

 

Parth Desai
idata
Community Manager
70 Views

It's great to hear the suggestion we provided was useful. In the future, if you want to have this functionality to be on the latest image, you'd just have to follow the steps above. Anyway, if you need further assistance don't hesitate to contact us again.

 

 

-Sergio

 

Reply