# Help to select a Raspberry Pi for embedding Julia application

**URL:** https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848
**Category:** General Usage
**Created:** [May 20, 2020, 5:58pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848 "2020-05-20T17:58:46Z")
**Posts on this page:** 20
**Page:** 4

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [May 23, 2020, 2:24pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/61 "2020-05-23T14:24:18Z")

</div>

Let me give a little more information about the experiment.

In this first phase, I would like to see the viability to use Julia to control the satellite attitude (orientation). It is a dynamic language, very different to what we are used to (C/C++). However, it will bring a lot of improvements when developing the attitude control subsystem (ACS) because it will make the gap between the algorithm design and the embedded code smaller. Thus, the proposal is to build a mockup suspended by a thread and control it in one axis using a small reaction wheel. This will provide a very representative example of what will happen in space in terms of controller algorithm. Hence, I will be able to see if this system has the real-time performance required.

If this test is successful, I will apply for funding to build a small Cubesat that the only mission is to test the controller. In this case, there will be a lot of problems, as you said, about temperatures. The space is very extreme. While in Earth’s eclipse, the temperature can go very low. However, while under direct sunlight, it can get very hot. There is an entire field called Thermal Engineering that takes care of those things. They will design a system to ensure that the temperature stays under operational limits. Notice that the lifespan of such missions is very small, usually less than 1 year. Thus, I really do not need to concern about radiation.

---

<div class="post-metadata">

### Author: ![viralbshah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/viralbshah/32/54_2.png) [@viralbshah](https://discourse.julialang.org/u/viralbshah)
#### Post date: [May 23, 2020, 2:44pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/62 "2020-05-23T14:44:41Z")

</div>

> [@Ronis\_BR](#):
>
> Thanks for the suggestion! I think there will be no problem to build a custom system image with PackageCompiler removing all the unnecessary packages from stdlib. However, now that you mention, I think 512MB of RAM will really not be enough to build Julia and/or build the sysimg. AFAIK, there is no way to “cross-compile” the sysimg right?

I believe you should be able to use a Pi 4 as a development platform (or perhaps even one of those new AWS ARM machines) and build a system image that works on Pi zero, with perhaps appropriate architecture flags. I don’t think these workflows are well tested though.

Does the stock armv7 Julia binary work on Pi zero?

-viral

---

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [May 23, 2020, 3:39pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/63 "2020-05-23T15:39:20Z")

</div>

> [@viralbshah](#):
>
> Does the stock armv7 Julia binary work on Pi zero?

Thanks for the tips! I think only an old version of Julia works out-of-the-box on the Pi Zero. However, I read that some people could successfully build Julia 1.4.1 for it.

---

<div class="post-metadata">

### Author: ![GregR](https://avatars.discourse-cdn.com/v4/letter/g/e68b1a/32.png) [@GregR](https://discourse.julialang.org/u/GregR)
#### Post date: [May 23, 2020, 4:37pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/64 "2020-05-23T16:37:30Z")

</div>

I tried, when you run julia you get:

pi@raspberrypi:~/julia\_tools/julia-1.4.1/bin $ ./julia  
Illegal instruction

But you can:  
sudo apt-get install julia

and you will get version installed 1.0.3 which runs.

Greg

---

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [May 23, 2020, 5:43pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/65 "2020-05-23T17:43:13Z")

</div>

Will it be too difficult to provide a “lite” version of Julia with a reduce number of packages from stdlib for such applications? Or will it be as difficult as the main distribution to be built against those ARM devices?

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [May 24, 2020, 4:38pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/66 "2020-05-24T16:38:10Z")

</div>

I would try with other options, e.g. (undocumented) `--compile=min`, it can be much faster, on my desktop (useful for scripts), and takes less memory after startup, and for each module added, if you’re swapping you should get much more dramatic speed difference:

I checked with `ps aux`:

```julia
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
pharald+ 2956 0.9 0.1 746512 174300 pts/60 Sl+ 16:28 0:01 /home/pharaldsson_sym/julia-1.6.0-DEV-8f512f3f6d/bin/julia -O0 --compile=min --startup-file=no

after doing only: `using Revise`:

pharald+ 2956 0.8 0.1 778136 228476 pts/60 Sl+ 16:28 0:02 /home/pharaldsson_sym/julia-1.6.0-DEV-8f512f3f6d/bin/julia -O0 --compile=min --startup-file=no

then same for other startup options to compare:
pharald+ 3077 3.4 0.1 749620 185212 pts/60 Sl+ 16:33 0:01 /home/pharaldsson_sym/julia-1.6.0-DEV-8f512f3f6d/bin/julia --startup-file=no

pharald+ 3077 8.8 0.2 900608 330040 pts/60 Sl+ 16:33 0:07 /home/pharaldsson_sym/julia-1.6.0-DEV-8f512f3f6d/bin/julia --startup-file=no

```

---

<div class="post-metadata">

### Author: ![viralbshah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/viralbshah/32/54_2.png) [@viralbshah](https://discourse.julialang.org/u/viralbshah)
#### Post date: [May 24, 2020, 4:48pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/67 "2020-05-24T16:48:35Z")

</div>

> [@Ronis\_BR](#):
>
> Will it be too difficult to provide a “lite” version of Julia with a reduce number of packages from stdlib for such applications? Or will it be as difficult as the main distribution to be built against those ARM devices?

There are no such plans, and providing anything non-standard significantly increases the burden of support. It should be easy to pair down the system image and packagecompile what you need. If anything, we need to make it easier to do that.

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [May 24, 2020, 4:58pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/68 "2020-05-24T16:58:13Z")

</div>

Julia can work for hard-realtime, and avoid the GC completely (not too difficult, but you want to make sure you do not mess up and do allocations by accident, that is easier than e.g. in Java):  
[https://juliacomputing.com/case-studies/mit-robotics.html](https://juliacomputing.com/case-studies/mit-robotics.html)

It also depends on the hardware, and OS, as you say. ARM Cortex-R can run Linux (unlike ARM Cortex-M microcontrollers), and it and Julia can support, and I believe a real-time variant of Linux (or other).

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [May 24, 2020, 5:17pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/69 "2020-05-24T17:17:55Z")

</div>

In case someone misunderstood, you can only interface Arduino, i.e. send data to it, you can’t send send a Julia program to it. No original or even later ARM-based versions (unless I missed some recent more powerful with non-microcontroller ARM).

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [May 24, 2020, 6:09pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/70 "2020-05-24T18:09:55Z")

</div>

Understood. On my desk - Jetson Nano, Rasp Pi, Arduino Mega (an elegoo clone to be precise). I would not expect Julia to run on the Arduino.

---

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [May 24, 2020, 6:12pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/71 "2020-05-24T18:12:23Z")

</div>

> [@viralbshah](#):
>
> There are no such plans, and providing anything non-standard significantly increases the burden of support. It should be easy to pair down the system image and packagecompile what you need. If anything, we need to make it easier to do that.

Nice! I think I will buy the Pi Zero and see if I can cross compile julia and it’s sysimage. If not, if I can build it on the Pi Zero, then it is fine. There isn’t any problem to let it run for couple of days building julia. It will also be a very nostalgic moment remembering my days using Gentoo 🙂

> [@johnh](#):
>
> Understood. On my desk - Jetson Nano, Rasp Pi, Arduino Mega (an elegoo clone to be precise). I would not expect Julia to run on the Arduino.

Did you try to build Julia on the Pi Zero or only used the default pkg?

---

<div class="post-metadata">

### Author: ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)
#### Post date: [May 28, 2020, 8:23am UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/72 "2020-05-28T08:23:46Z")

</div>

Slightly off topic. For Raspberry Pi fans there is an 8Gbyte model now

> **[Raspberry Pi 4 Model B](https://thepihut.com/products/raspberry-pi-4-model-b)**
>
> The latest (and by far the greatest!) Raspberry Pi yet! Meet the Raspberry Pi 4 Model B. Available in 1GB, 2GB, 4GB OR 8GB RAM options! Featuring 4K Resolution, a 64-bit Quad-core CPU, Gigabit Ethernet, USB 3.0, WiFi, Bluetooth and USB-C power.

Dual 4K monitors! From a device costing around 80 dollars!

---

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [May 29, 2020, 5:02pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/73 "2020-05-29T17:02:36Z")

</div>

Well, I definitely should make a way to use Julia in Pi Zero. The Pi 4 requires 3.4W, against 0.7W of Pi Zero. For CubeSats, it is common to see the entire power budget be between 3 to 8W. Thus, Pi 4 is definitely a no-go.

---

<div class="post-metadata">

### Author: ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)
#### Post date: [March 16, 2022, 3:34pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/74 "2022-03-16T15:34:26Z")

</div>

Sorry for reviving such an old topic. Did you succeed with Pi Zero?

---

<div class="post-metadata">

### Author: ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)
#### Post date: [March 16, 2022, 4:38pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/75 "2022-03-16T16:38:34Z")

</div>

it would be slightly easier now. 1.8 makes it easier to strip more out of the sysimage.

---

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [March 16, 2022, 10:50pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/76 "2022-03-16T22:50:26Z")

</div>

> [@Iulian.Cioarca](#):
>
> Sorry for reviving such an old topic. Did you succeed with Pi Zero?

Yes! It was very good! However, my Raspberry Pi stopped working and now I am desperately searching for a Pi Zero 2 here in Brazil at a reasonable price to continue the project 😃

---

<div class="post-metadata">

### Author: ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)
#### Post date: [March 16, 2022, 11:14pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/77 "2022-03-16T23:14:43Z")

</div>

I’m also hunting for one with no luck in Romania. As alternative I found the Orange Pi zero 2 or the 3 lts. They have Arm V8 processors, so Julia should run on them.

---

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [March 17, 2022, 12:25pm UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/78 "2022-03-17T12:25:54Z")

</div>

I just found a Pi Zero 2W here! It should be way easier to develop now since we have official binaries for AArch64 🙂

---

<div class="post-metadata">

### Author: ![Ronis\_BR](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ronis_br/32/50999_2.png) [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)
#### Post date: [April 1, 2022, 2:11am UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/79 "2022-04-01T02:11:57Z")

</div>

And we are back in the business! BaremetalPi.jl 0.1.2 is working perfectly with the Raspberry Pi Zero 2W (Manjaro Linux) and the official AArch64 Julia build.

 ![Captura de Tela 2022-03-31 às 23.09.54](https://global.discourse-cdn.com/julialang/original/3X/6/9/69d77afbbed9bdcbcdeb8132508490093b48e6bd.png)

---

<div class="post-metadata">

### Author: ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)
#### Post date: [April 4, 2022, 7:45am UTC](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848/80 "2022-04-04T07:45:28Z")

</div>

I can also confirm that Julia 1.7.2 works on the Pi Zero 2W with 512MB of RAM.  
Precompiling: Interpolations, DataFrames, HTTP, JSON, Statistics, Random, Base64 takes ages (hours), but after that the sailing is surprisingly smooth, at least for the task that I’m throwing at it: basic Dataframes filtering, csv read-write, applying moving averages, min, max, HTTP requests.

I recommend using the Raspbian lite, it’s much more responsive compared to the GUI version. Running Julia and tinkering in another terminal with git/editing text files is great! The GUI version is pretty much unusble on the Pi Zero 2W if you want to do anything with a web browser.

Julia is currently using 60% of the available memory. I increased the swap size to 2GB, just in case.

[Previous page](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848.md?page=3)

[Next page](https://discourse.julialang.org/t/help-to-select-a-raspberry-pi-for-embedding-julia-application/39848.md?page=5)
