{"id":24988359,"url":"https://github.com/protolux-electronics/soleil_system_rpi0_2","last_synced_at":"2025-04-12T00:04:39.964Z","repository":{"id":267766830,"uuid":"872131451","full_name":"protolux-electronics/soleil_system_rpi0_2","owner":"protolux-electronics","description":"Nerves system for the Soleil board with a Raspberry Pi Zero 2W","archived":false,"fork":false,"pushed_at":"2025-01-23T19:32:58.000Z","size":1919,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-12T00:04:35.331Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/protolux-electronics.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-13T21:18:28.000Z","updated_at":"2025-03-03T05:58:54.000Z","dependencies_parsed_at":"2024-12-12T10:36:47.163Z","dependency_job_id":null,"html_url":"https://github.com/protolux-electronics/soleil_system_rpi0_2","commit_stats":null,"previous_names":["gworkman/soleil_system_rpi0_2","protolux-electronics/soleil_system_rpi0_2"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protolux-electronics%2Fsoleil_system_rpi0_2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protolux-electronics%2Fsoleil_system_rpi0_2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protolux-electronics%2Fsoleil_system_rpi0_2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protolux-electronics%2Fsoleil_system_rpi0_2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/protolux-electronics","download_url":"https://codeload.github.com/protolux-electronics/soleil_system_rpi0_2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248497807,"owners_count":21113984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-04T12:03:55.918Z","updated_at":"2025-04-12T00:04:39.922Z","avatar_url":"https://github.com/protolux-electronics.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Soleil Raspberry Pi Zero 2W (64-bit)\n\n[![Hex version](https://img.shields.io/hexpm/v/soleil_system_rpi0_2.svg \"Hex version\")](https://hex.pm/packages/soleil_system_rpi0_2)\n\nThis is the base Nerves System configuration for the Soleil power management and \nsleep control board mounted on the Raspberry Pi Zero 2 W.\nIt has the USB port running in gadget mode, and is similar to\n[nerves_system_rpi3a](https://github.com/nerves-project/nerves_system_rpi3a)\nexcept that it runs the ARM Cortex-A53 in 64-bit mode to support the [Erlang\nJIT](https://www.erlang.org/doc/apps/erts/beamasm).\n\n![Raspberry Pi Zero 2 W image](assets/images/soleil.jpg)\n\u003cbr\u003e\u003csup\u003e[Image credit](#rpi)\u003c/sup\u003e\n\n| Feature              | Description                      |\n| -------------------- | -------------------------------- |\n| CPU                  | 1.4 GHz quad-core ARM Cortex-A53 |\n| Memory               | 512 MB DRAM                      |\n| Storage              | MicroSD                          |\n| Linux kernel         | 6.1 w/ Raspberry Pi patches      |\n| IEx terminal         | UART `ttyAMA0` Can be changed to HDMI |\n| GPIO, I2C, SPI       | Yes - [Elixir Circuits](https://github.com/elixir-circuits) |\n| ADC                  | No                               |\n| PWM                  | Yes, but no Elixir support       |\n| UART                 | 1 available - `ttyAMA0`          |\n| Display              | HDMI or 7\" RPi Touchscreen       |\n| Camera               | Official RPi Cameras (libcamera) |\n| Ethernet             | No                               |\n| WiFi                 | Yes                              |\n| Bluetooth            | [See Bluetooth](#bluetooth)      |\n| Audio                | HDMI out                         |\n\n## Using\n\nThe most common way of using this Nerves System is create a project with `mix\nnerves.new` and to export `MIX_TARGET=rpi0_2`. See the [Getting started\nguide](https://hexdocs.pm/nerves/getting-started.html#creating-a-new-nerves-app)\nfor more information.\n\nIf you need custom modifications to this system for your device, clone this\nrepository and update as described in [Making custom\nsystems](https://hexdocs.pm/nerves/customizing-systems.html).\n\n## Supported WiFi devices\n\nThe base image includes drivers for the onboard Raspberry Pi Zero 2 wifi module\n(`brcmfmac` driver).\n\n## Camera\n\nThis system supports the official Raspberry Pi camera modules via\n[`libcamera`](https://libcamera.org/). The `libcamera` applications are included so it's\npossible to replicate many of the examples in the official [Raspberry Pi Camera\nDocumentation](https://www.raspberrypi.com/documentation/computers/camera_software.html).\n\nHere's an example commandline to run:\n\n```elixir\ncmd(\"libcamera-jpeg -n -v -o /data/test.jpeg\")\n```\n\nOn success, you'll get an image in `/data` that you can copy off with `sftp`.\n\nSince `libcamera` is being used instead of MMAL, the Elixir\n[picam](https://hex.pm/packages/picam) library won't work.\n\n## Bluetooth\n\n[BlueHeronTransportUART](https://github.com/blue-heron/blue_heron_transport_uart)\nsupports Bluetooth on the Raspberry Pi Zero 2 W using `ttyS0`. The details are\nsimilar to the [RPi Zero W]\n(https://github.com/nerves-project/nerves_system_rpi0/issues/224#issuecomment-913799838).\n\n## Audio\n\nThe Raspberry Pi has many options for audio output. This system supports the\nHDMI and stereo audio jack output. The Linux ALSA drivers are used for audio\noutput.\n\nThe general Raspberry Pi audio documentation mostly applies to Nerves. For\nexample, to force audio out the HDMI port, run:\n\n```elixir\ncmd(\"amixer cset numid=3 2\")\n```\n\nChange the last argument to `amixer` to `1` to output to the stereo output jack.\n\n## Gadget mode on the 3A+!\n\nThe Raspberry Pi 3 Model A+ is supported by the official\n[nerves_system_rpi3](https://github.com/nerves-project/nerves_system_rpi3), but\nthe USB port is configured to work as a host only. This Raspberry Pi can be\nconnected directly to your computer via a USB cable like the Raspberry Pi Zeros.\nTo do this, you'll need a USB A to USB A connector like\n[this](https://www.monoprice.com/product?p_id=5443) or\n[this](https://www.microcenter.com/product/431166/usb-a-to-a-high-speed-development-board-cable).\n\n\n## Linux's preempt_rt patches\n\nIf you need better real-time performance from the Linux kernel, the `preempt_rt`\npatch set may help. Be aware that we do not test with the patches so this may\nnot work. To enable it, make a custom system using this one as a base and add\nthe following to the `nerves_defconfig`:\n\n```text\nBR2_LINUX_KERNEL_PATCH=\"http://cdn.kernel.org/pub/linux/kernel/projects/rt/4.19/patch-4.19.25-rt16.patch.xz\"\n```\n\nPlease verify the patch version since these instructions may be out-of-date.\n\nNext, update the Linux configuration to use it. Review the Nerves documentation\nfor running `make linux-menuconfig` and enable `PREEMPT_RT_FULL`. Alternately,\nmake the following change to the Linux configuration:\n\n```text\n-CONFIG_PREEMPT=y\n+CONFIG_PREEMPT_RT_FULL=y\n ```\n\nBuild the system and you should now have a preempt_rt kernel.\n\n## Provisioning devices\n\nThis system supports storing provisioning information in a small key-value store\noutside of any filesystem. Provisioning is an optional step and reasonable\ndefaults are provided if this is missing.\n\nProvisioning information can be queried using the Nerves.Runtime KV store's\n[`Nerves.Runtime.KV.get/1`](https://hexdocs.pm/nerves_runtime/Nerves.Runtime.KV.html#get/1)\nfunction.\n\nKeys used by this system are:\n\nKey                    | Example Value     | Description\n:--------------------- | :---------------- | :----------\n`nerves_serial_number` | `\"12345678\"`      | By default, this string is used to create unique hostnames and Erlang node names. If unset, it defaults to part of the Raspberry Pi's device ID.\n\nThe normal procedure would be to set these keys once in manufacturing or before\ndeployment and then leave them alone.\n\nFor example, to provision a serial number on a running device, run the following\nand reboot:\n\n```elixir\niex\u003e cmd(\"fw_setenv nerves_serial_number 12345678\")\n```\n\nThis system supports setting the serial number offline. To do this, set the\n`NERVES_SERIAL_NUMBER` environment variable when burning the firmware. If you're\nprogramming MicroSD cards using `fwup`, the commandline is:\n\n```sh\nsudo NERVES_SERIAL_NUMBER=12345678 fwup path_to_firmware.fw\n```\n\nSerial numbers are stored on the MicroSD card so if the MicroSD card is\nreplaced, the serial number will need to be reprogrammed. The numbers are stored\nin a U-boot environment block. This is a special region that is separate from\nthe application partition so reformatting the application partition will not\nlose the serial number or any other data stored in this block.\n\nAdditional key value pairs can be provisioned by overriding the default\nprovisioning.conf file location by setting the environment variable\n`NERVES_PROVISIONING=/path/to/provisioning.conf`. The default provisioning.conf\nwill set the `nerves_serial_number`, if you override the location to this file,\nyou will be responsible for setting this yourself.\n\n## Linux kernel and RPi firmware/userland\n\nThere's a subtle coupling between the `nerves_system_br` version and the Linux\nkernel version used here. `nerves_system_br` provides the versions of\n`rpi-userland` and `rpi-firmware` that get installed. I prefer to match them to\nthe Linux kernel to avoid any issues. Unfortunately, none of these are tagged by\nthe Raspberry Pi Foundation so I either attempt to match what's in Raspbian or\ntake versions of the repositories that have similar commit times.\n\n[Image credit](#rpi): This image is from [raspberrypi.org](https://www.raspberrypi.com/products/raspberry-pi-zero-2-w/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotolux-electronics%2Fsoleil_system_rpi0_2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprotolux-electronics%2Fsoleil_system_rpi0_2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotolux-electronics%2Fsoleil_system_rpi0_2/lists"}