6

I am new to using Arduino Yun and I would like to know if it is possible to run an entire script on the Linux side. In my case the script should execute a HTTP request to a remote server, parse the subsequent HTTP response and return some value that then can be used in the Arduino sketch.

If it is possible, what I have to do? For example, how should I write and run script files? what programming language should I use? where I should put those script files on the Linux side?

2
  • Not a Yun expert but shell commands seem easy on the Yun. I don't know much about adding a script to it, so feel free to build off of this and post an answer. Commented Apr 11, 2014 at 21:05
  • Don't know anything about Yun but I'd look at the FileIO class to make a file and write your script into it. Then use Process class to execute it.
    – sachleen
    Commented Apr 11, 2014 at 21:24

1 Answer 1

0

Arduino Yun ships with python pre installed. You can copy python scripts from your pc to the yun with scp (or WinSCP or putty, if you're on windows). Once copied, just run it using Process from your sketch. As they are scripts, program name is python and the path to your script is its first argument (you can do that in a different way, but that would require some linux magic, which I suggest to postpone if you're new to it).

Other pre installed options include lua and bash. Other languages such as ruby, erlang and php are available as optional packages.

2
  • In which directory on Yun should I put my script files?
    – user502052
    Commented Apr 15, 2014 at 12:02
  • Wherever, but the sd card is the preferred choice, so you don't wear out the flash. If you have an sd card with an arduino folder, you should have it available at /mnt/sd Commented Apr 15, 2014 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.