Arduino Forum

Using Arduino => Microcontrollers => Topic started by: ArthurD on Feb 07, 2016, 07:51 pm

Title: Running Arduino sketches on the Pi
Post by: ArthurD on Feb 07, 2016, 07:51 pm
Quote
Running Arduino sketches on the Pi

Postby kolban ยป Wed Feb 03, 2016 2:09 am
A new project can be found on Github here:

https://github.com/me-no-dev/RasPiArduino

Which provides the ability to compile Arduino sketches using the Arduino IDE on either Windows or Linux and run the resulting binaries on the Raspberry Pi.

A video tutorial has been built which illustrates getting the solution up and running. That video can be found here:

https://www.youtube.com/watch?v=lZvhtfUlY8Y

In the video, we only show getting it going for the B+ and Pi 2 but we can also run the solution on the Pi Zero and other variants.

In another video, we show how to write binaries directly to the Pi file system:

https://www.youtube.com/watch?v=sd5NLSKp1QU
Title: Re: Running Arduino sketches on the Pi
Post by: dmjlambert on Feb 08, 2016, 01:48 am
I think that is interesting and useful.   

Now if the Arduino IDE was running on the Pi, the extra features were added via the Boards Manager, and sketches wrote were deposited as executables in some directory on the Pi instead of "uploading" or transferring via Samba that would be fabulous.   It would be similar to the way PCduino is supposed to work.   

To take it one step further, having an option to run the sketch on the Pi as bare metal and only boot up Linux on the Pi if a particular IO pin is grounded, that would be even better.   
Title: Re: Running Arduino sketches on the Pi
Post by: ArthurD on Feb 08, 2016, 09:52 am
I agree, Linux user space is not a blessing - it's actually a curse.
Title: Re: Running Arduino sketches on the Pi
Post by: Isaac96 on Feb 14, 2016, 04:53 pm
Now I have a reason for getting a Pi Zero! That is awesome!
Title: Re: Running Arduino sketches on the Pi
Post by: bperrybap on Feb 15, 2016, 07:38 am
Now I have a reason for getting a Pi Zero! That is awesome!
I have one, but I'm not a fan of the Pi zero.
It seems crazy to make a linux device that has no network connectivity.
To me it could have been a great IoT device if it just had built in wifi.
But not having a standard USB port and no network connectivity makes it not very useful to me.
I'd rather use the other models.


--- bill
Title: Re: Running Arduino sketches on the Pi
Post by: john1993 on Feb 15, 2016, 10:54 am
in a way ONLY network connectivity although its not that difficult to get a console up too over ssh or serial.  by some miracle i managed to get 4 now with two in constant use over internet (security and media server).  one of the others as desktop pc running arduino ide, firefox, cad, 3d printer, etc but thats not its strong point.

in reality it has exactly one standard usb which can be expanded to 4 for less than a dollar with cheap ebay hubs. some even smaller than the pi.

considering one can have half dozen of these for cost of one of the other models they are very popular where cost IS a consideration.  half the power and 1/4 the size too.  so popular in fact you cannot buy more than one at a time anywhere and and even then only a couple sources.  so popular the waiting list may be months or years for some.  quite the phenomenon.

but imo its silly to compare with arduino like so many do.  bananas and oranges.  speaking of which pi "clones" are hardly competition in terms of cost, popularity, or support.
Title: Re: Running Arduino sketches on the Pi
Post by: ArthurD on Feb 15, 2016, 04:05 pm
I personally would never purchase a Zero, not even a B+:
just the Pi 2B quadcore is powerful enough for all tasks, because Linux brakes down the whole computational performance which overtaxes a single-core.

But with my 2B I'm absolutely fine, I just purchased a 2nd one.
It costs 40 EUR incl. VAT and shipping (original, made in GB).
:)
Title: Re: Running Arduino sketches on the Pi
Post by: Isaac96 on Feb 16, 2016, 05:36 am
I have one, but I'm not a fan of the Pi zero.
It seems crazy to make a linux device that has no network connectivity.
To me it could have been a great IoT device if it just had built in wifi.
But not having a standard USB port and no network connectivity makes it not very useful to me.
I'd rather use the other models.


--- bill
For wifi, try the C.H.I.P. $9.
Title: Re: Running Arduino sketches on the Pi
Post by: ArthurD on Feb 19, 2016, 11:06 pm
Pi Zero single core, 512kB RAM, 700 MHz, plus shipping plus USB hub plus external LAN = 30 EUR
Raspi 2 model B quadcore, 1GB RAM, 900 MHz, LAN, Wifi-ready, costs 40 EUR incl. shipping.

so what...?
Title: Re: Running Arduino sketches on the Pi
Post by: HermannSW on Jul 28, 2016, 11:30 pm
> Pi Zero single core, 512kB RAM, 700 MHz, plus shipping plus USB hub plus external LAN = 30 EUR
>
What?

Raspberry Pi Zero is sold for 5$ + 5$ shipping from thepihut.com and pimoroni.com (they limit order to 1pc).

Only cable needed is USB to micro USB cable that every Arduino user should have plenty of.

You ssh into Pi Zero over USB (OTG), and with internet connection sharing Pi Zero has internet access as well (for "sudo apt-get ..."). Of course Arduino SPI ethernet module does work as well ( I did that before I was able to get internet connection sharing right, SPI ethernet gives 4.7 Mbps, internet connection sharing 19Mbps and Ubuntu over same cable give 91Mbps):
https://twitter.com/HermannSW/status/757941145804664832 (https://twitter.com/HermannSW/status/757941145804664832)
(https://pbs.twimg.com/media/CoS_Ku9WEAEiUU1.jpg)


Yesterday I installed "Raspberry" board into Arduino IDE following the corresponding chapter in Kolban's book:
https://twitter.com/HermannSW/status/756225040169988096 (https://twitter.com/HermannSW/status/756225040169988096)

Arduino Blink sample worked immediately:
https://twitter.com/HermannSW/status/758360136813543425 (https://twitter.com/HermannSW/status/758360136813543425)
(https://pbs.twimg.com/media/CoY8LklXEAAXImg.jpg)

(https://stamm-wilbrandt.de/en/forum/RasPiArduino.anim.gif)


Btw, Pi Zero is 1GHz, not 700MHZ. So "Raspberry" board for Arduino IDE makes "1GHz Arduino" available!

Hermann.
Title: Re: Running Arduino sketches on the Pi
Post by: HermannSW on Jul 29, 2016, 01:32 am
> I personally would never purchase a Zero, not even a B+:
> just the Pi 2B quadcore is powerful enough for all tasks, because Linux brakes
> down the whole computational performance which overtaxes a single-core.
>
Then "NanoPi Neo", quad core 1.2GHz A7 for just 8$ might be interesting:

"I did order two NanoPi Neo, with 7$ shipping for 23$ in total"
http://forum.arduino.cc/index.php?topic=412642.msg2842531#msg2842531 (http://forum.arduino.cc/index.php?topic=412642.msg2842531#msg2842531)
(https://pbs.twimg.com/media/Cnan7sAXYAEVpy1.jpg)
Title: Re: Running Arduino sketches on the Pi
Post by: Chris_Tziros on Sep 20, 2018, 01:43 am
How are the pins specified in the arduino IDE beeing translated to the Raspberry pi GPIO pins? I mean what is the matching? Is there a link that i can see something lik: arduino pin 11 corresponds to raspberry GPIO pin 4