jimsynz
Ash Core Team
Hi folks. I just got my hands on a pi zero 2W and decided to have a play with nerves on it. I ran mix nerves.new, enabled the nerves_system_rpi_0_2, statically configured a wifi SSID and wrote the SD card with mix firmware.burn. I wanted to validate that my dev env was set up correctly and working.
I configured the network thusly:
config :vintage_net,
regulatory_domain: "NZ",
internet_host_list: [{"harton.dev", 443}],
config: [
{"usb0", %{type: VintageNetDirect}},
{"eth0",
%{
type: VintageNetEthernet,
ipv4: %{method: :dhcp}
}},
{"wlan0",
%{
type: VintageNetWiFi,
vintage_net_wifi: %{
networks: [
%{
key_mgmt: :wpa_psk,
ssid: System.fetch_env!("DEFAULT_WIFI_SSID"),
psk: System.fetch_env!("DEFAULT_WIFI_PSK")
}
]
},
ipv4: %{method: :dhcp}
}}
]
As far as I understand it, VintageNet will automatically start and connect without any further configuration, right? Looking at the logs in the UniFi console it doesn’t even appear to be trying to connect.
The actual code (such as it is) is available here.
I’m using MIX_TARGET=rpi0_2 and setting the DEFAULT_WIFI_SSID and DEFAULT_WIFI_PSK with an environment variable at build time.
Pointers appreciated.
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
Anyone here using Honeybadger?
My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of
Bandit.HTTPError...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
There are three potential reasons for members of this forum to have a look at https://vutuv.de
You are tired or annoyed of LinkedIn.
Yo...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
jimsynz
Well this explains much. It’s not even booting. I connected a serial cable and this is what I see:
jimsynz
Okay, so I built and flashed an
rpi0image to an older Zero W I had sitting on my desk and it booted and connected to the wifi fine, so it’s not a problem with the app config, it’s definitely therpi0_2nerves system not bootingjimsynz
I managed to get it to boot with the
rpi3anerves system, so I guess I’m unblocked for now.jjcarstens
Well I don’t think I have much helpful info for you. I tried the linked repo without modifications and was able to burn a new firmware and update an existing using
MIX_TARGET=rpi0_2One thing to not is the
EXT4-fs (mmcblk0p3): VFS: Can't find ext4 filesystemis fairly normal for the first time boot. The/datapartition is not formatted until the first boot and it gets formatted shortly after. So there might be other clues in the startup logsAnd this might be a silly question, but you’re absolutely positive it is a zero 2W? (Not just a zero W). The main difference between
rpi3aandrpi0_2is the latter is 64bit, but I’m not sure what else might be causing your device to fail bootingmix upload
mix burn
jimsynz
Thanks for trying. I’ll reconnect the serial console and try flashing and booting a
rpi0_2image again and get back to you.jimsynz
Okay, so here’s the output. First I booted it with the
rpi3aimage and randmesgto get the output:Next I powered off, inserted a freshly built
rpi0_2image and tried to boot, but it just keeps looping:And just for your gratification, here’s a photo proving that it is indeed a RPi Zero 2. The device underneath is a UPS-Lite V1.2 which contains an I2C connected MAX17040 and a connection to GPIO4.
simpers
Did you ever work this out?
I want to make a thread about the Raspberry Pi Zero 2W collecting all the lessons and experiences everybody has with this device. Maybe even add docs for it to the system upstream.
Issue
It seems like there are a lot of pitfalls when it comes to getting started on this particular Raspberry Pi, and I am experiencing similar things to what you describe here. However, I cannot confirm one way or another what it is actually getting stuck on.
I rely on it managing to establish a USB connection in order to access it, as it cannot connect to WiFi either, unless the USB connection is also there. So, it’s this all or nothing thing going on.
Since I cannot access it, and it does not look like HDMI is configured on the Nerves System RPi0 2 @ GitHub, or at least it does not work for me, I cannot debug it in any meaningful way. The LED flashes green once in a while indicating a reboot loop. It gets warm, also indicating some kind of activity, but it eventually just stops flashing. I guess that either it dies or starts to idle, not producing noticeably/any heat.
Every now and then though, it does “stabilise”, allowing me to connect over the USB. The last time it did I tried to build a firmware update that added the RamoopsLogger in an attempt to see if it could reveal anything from a previous boot attempt, but I haven’t even been able to upload it, as it died when I ran
mix upload <HOST-NAME>, like this:Troubleshooting
Below is a non-exhaustive list of things I have tried, or planning to try.
Nerves Systems
I’ve tried the Nerves system for the RPi0 2W @ GitHub, but I will see if the one for the RPi3a+ behaves similarly.
I forked the RPi0 2W system, as I mean to adapt the image for the use-case, but as of now it does not differ much. I have only added the
iwpackage and experimented with settings when trying figure this out. The last attempts has been with the official RPi0 2W system.SD-cards
I have tried the following SD-cards:
I also have this one, though I haven’t tried it with this device:
While the Samsung ones probably push 10 years old at this point, they seem to work just fine when used before and with my Raspberry Pi 4B, so I do not think it is a matter of a faulty SD-card.
Cables
I have tried more than 5 different micro-USB cables. I have also tried various USB-C cables with adapters. No difference in stability. It does not work to have a separate power supply either, as I tried various ones, including one official Raspberry Pi one with a micro-USB connector.
WiFi
Two different WiFi-networks, same rate of connection success as when the USB connection stabilises.
Raspbian
I flashed the latest Raspbian on one of the SD-cards, and that boots. It starts the whole install/setup-process, so the device seems to behave well, but I have not attempted to pair a keyboard or mouse with it to go through the rest of the setup. If I need to do that to do some debugging that Raspbian can provide, I could try.
jimsynz
So I just ran into this problem again with a Pi 0 2W and discovered that it was running out of RAM on boot. If your project is contains a lot of dependencies then you want to switch off the emulators embedded mode in your
vm.args.eex. This will cause slower boots but it will actually boot without running out of RAM.simpers
Interesting! I had wondered whether or not the RAM usage would be something to optimise for later, as I can see that it lands around 250 MB, the few times that I could connect to it.
Branching in vm.args.eex
Is it possible to branch in this config file? I suppose one way could be Eex, as it is an
.eexfile, but would it also be possible to provide different files completely for different targets?I have to intended hardware targets for the same Elixir Application, the RPi4B and the RPiZ2W.
The first will act like a server and is based on the Kiosk System RPi4, and the latter a more optimised RPiZ2W image as described earlier.
For more clarity I’d want to have separate files for them, rather than put code in it, though I will do that for now to test and see if I can get it working.
Another option would be that I have another repo/Elixir app for the Kiosk version of the app, but if possible I’d prefer to keep it in one repo and just configure two different releases, to keep testing and CI simpler.
simpers
This seems to have done it, as far as I can see! I still need to do some more testing, but it booted instantly (compared to me previous experience where it took an eternity
) and so far it is possible to work with the device reliably now!