Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
1,353 Views

Upload Arduino Sketch to Edison Arduino Wirelessly using Wifi

Jump to solution

Hi,

Can any one guide me how to upload an arduino sketch to edison arduino using wifi? my aim is to upload sketch wirelessly. Fyi, i had installed my edison arduino board inside my prototype. I feel it is really troublesome to bring my laptop near to my laptop whenever i update a new sketch. i had tried using Winscp but i can't make it work. can i use putty? what is the steps?

The steps i had taken was compiled the sketch, find the .elf file for example blink.elf, change the name of sketch to sketch.elf and replaced the one in the edison sketch folder. However, i observed there are two file inside the sketch folder, sketch.elf.old and sketch.elf . If i upload the sketch by using cable, i found that the sketch.elf file will substitute sketch.elf.old and the new sketch will substitute sketch.elf.

0 Kudos

Accepted Solutions
Highlighted
Community Manager
15 Views

Hi Rachael_123,

 

 

Thank you for contacting us.

 

 

I was testing this and found the way to do it. The tricky part is how to run the Arduino sketch once the .elf file has been copied into the Edison. Anyhow, please follow the steps below and let me know if they work for you or if you have any issues with them:

 

 

1. Move the .elf file to /sketch using WinSCP, just like you did.

 

2. Open PuTTY and connect to the Edison through SSH.

 

3. Once you have access to the Edison's console, go to the directory /sketch and write the following command to give executable permissions to the file: chmod +x sketch.elf

 

4. Then run the sketch with this command: ./sketch.elf foo bar &. Your sketch should run now.

 

 

I tried those steps and they worked so I hope they work for you too.

 

 

Have a nice day

 

 

Regards,

 

Leonardo R.

View solution in original post

8 Replies
Highlighted
Community Manager
16 Views

Hi Rachael_123,

 

 

Thank you for contacting us.

 

 

I was testing this and found the way to do it. The tricky part is how to run the Arduino sketch once the .elf file has been copied into the Edison. Anyhow, please follow the steps below and let me know if they work for you or if you have any issues with them:

 

 

1. Move the .elf file to /sketch using WinSCP, just like you did.

 

2. Open PuTTY and connect to the Edison through SSH.

 

3. Once you have access to the Edison's console, go to the directory /sketch and write the following command to give executable permissions to the file: chmod +x sketch.elf

 

4. Then run the sketch with this command: ./sketch.elf foo bar &. Your sketch should run now.

 

 

I tried those steps and they worked so I hope they work for you too.

 

 

Have a nice day

 

 

Regards,

 

Leonardo R.

View solution in original post

Highlighted
Beginner
15 Views

Hi Leonardo R.,

Thank you for your response.

I compiled my sketch in arduino ide and copied the .elf file to desktop and changed the name of sketch to sketch.elf. Next i copied this sketch.elf and replaced sketch.elf in /sketch in edison. I did nothing on sketch.elf.old file, remain it at there as shown.

Next i go to putty, followed your instruction, go to directory /sketch, and typed chmod+x sketch.elf as shown, and i get the message "No such file or directory". May i know what to do?

0 Kudos
Highlighted
Community Manager
15 Views

Hi Rachael_123,

 

 

I want to apologize because I didn't explain this part, to go to the /sketch directory you need to use the command: cd /sketch, normally in Linux terminal when you need to change the directory, you have to use the command cd .

 

 

I'm sorry for the misunderstandings.

 

 

Have a nice weekend

 

 

Regards,

 

Leonardo R.
0 Kudos
Highlighted
Beginner
15 Views

Hi Leonardo,

Thanks for your reply.

I tried it again. First paste the sketch.elf to the sketch directory as shown. Rights of newly pasted file is rw-r--r--..

After i entered command chmod +x sketch.elf, Rights changed to rwxr-xr-x as shown. Fyi, if i upload the sketch using Arduino IDE through usb, i observed the Rights is usually rwxr--r--. Sorry i don't have any idea about purpose of give permission x to Group and Others.

Next, i entered command ./sketch.elf foo bar & but i receive "cannot execute binary file: Exec format error". What should i do?

0 Kudos
Highlighted
Community Manager
15 Views

Hi Rachael_123,

That's weird, just to make sure, are you using the .elf file located in the path: %temp%\arduino_build_636429? Take a look at the next photo, it is the sketch that you have to copy to your Edison:

About the rights using chmod +x, well this is the command that is normally used on the scripts to make them executables.

We will be waiting for your reply.

Regards,

 

Leonardo R.
0 Kudos
Highlighted
Beginner
15 Views

Hi Leonardo.R,

IT IS WORKING now! Thank you so much!!

0 Kudos
Highlighted
Beginner
15 Views

Hi,

I found one more problem. If i don't connect the virtual com port to laptop, i can't see the lines printed on serial monitor of Arduino IDE. Is there any way to see it on putty? without connecting a single cable? My aim is wireless!

0 Kudos
Highlighted
Community Manager
15 Views

Hi Rachael_123,

 

 

That's great, it is good to know that it is working now.

 

 

About the new problem, I'm afraid that there is no way to do this, but at least you can try to create file and write all these values, and check it every time you want.

 

 

Have a nice day.

 

 

Regards,

 

Leonardo R.
0 Kudos