{"id":19610482,"url":"https://github.com/valiot/valiot_system_rpi3","last_synced_at":"2025-10-08T07:41:45.776Z","repository":{"id":69841482,"uuid":"171527007","full_name":"valiot/valiot_system_rpi3","owner":"valiot","description":"This is the base Nerves System configuration for the Raspberry Pi 3 Model B for Valiot.","archived":false,"fork":false,"pushed_at":"2025-07-04T03:45:03.000Z","size":3698,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-02T04:50:02.120Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/valiot.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSES/CC-BY-4.0.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-02-19T18:27:42.000Z","updated_at":"2025-07-04T03:43:12.000Z","dependencies_parsed_at":"2025-06-07T14:03:09.849Z","dependency_job_id":"4f2c2117-de06-4718-ac5c-0870f2ea6ed7","html_url":"https://github.com/valiot/valiot_system_rpi3","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/valiot/valiot_system_rpi3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valiot%2Fvaliot_system_rpi3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valiot%2Fvaliot_system_rpi3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valiot%2Fvaliot_system_rpi3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valiot%2Fvaliot_system_rpi3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valiot","download_url":"https://codeload.github.com/valiot/valiot_system_rpi3/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valiot%2Fvaliot_system_rpi3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278909715,"owners_count":26066887,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2024-11-11T10:29:32.715Z","updated_at":"2025-10-08T07:41:45.739Z","avatar_url":"https://github.com/valiot.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raspberry Pi 3 Model B / B+\n\n[![Hex version](https://img.shields.io/hexpm/v/nerves_system_rpi3.svg \"Hex version\")](https://hex.pm/packages/nerves_system_rpi3)\n[![CI](https://github.com/nerves-project/nerves_system_rpi3/actions/workflows/ci.yml/badge.svg)](https://github.com/nerves-project/nerves_system_rpi3/actions/workflows/ci.yml)\n[![REUSE status](https://api.reuse.software/badge/github.com/nerves-project/nerves_system_rpi3)](https://api.reuse.software/info/github.com/nerves-project/nerves_system_rpi3)\n\nThis is the base Nerves System configuration for the Raspberry Pi 3 Model B for Valiot.\n\n![Fritzing Raspberry Pi 3 image](assets/images/raspberry-pi-3-model-b.png)\n\u003cbr\u003e\u003csup\u003e[Image credit](#fritzing)\u003c/sup\u003e\n\n| Feature              | Description                                                 |\n| -------------------- | ----------------------------------------------------------- |\n| CPU                  | 1.2 GHz quad-core Cortex-A53 (ARMv8)                        |\n| Memory               | 1 GB DRAM                                                   |\n| Storage              | MicroSD                                                     |\n| Linux kernel         | 6.1 w/ Raspberry Pi patches                                 |\n| IEx terminal         | HDMI and USB keyboard (can be changed to UART)              |\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               | Yes - via rpi-userland                                      |\n| Ethernet             | Yes                                                         |\n| WiFi                 | Yes                                                         |\n| Bluetooth            | [See Bluetooth](#bluetooth)                                 |\n| Audio                | HDMI/Stereo 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=rpi3`. 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 3 wifi module\n(`brcmfmac` driver).\n\n## Bluetooth\n\n[BlueHeronTransportUART](https://github.com/blue-heron/blue_heron_transport_uart)\nsupports bluetooth on the Pi 3A using `ttyS0`. The details are similar 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## 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## Linux kernel configuration\n\nThe Linux kernel compiled for Nerves is a stripped down version of the default\nRaspberry Pi Linux kernel. This is done to remove unnecessary features, select\nsome Nerves-specific features, and to save space. To reproduce the kernel\nconfiguration found here, do the following (this is somewhat tedious):\n\n1. Start with `arch/arm/configs/bcmrpi_defconfig`. This is the kernel\n   configuration used in the official Raspberry Pi images.\n1. Turn off all filesystems except for `ext4`, `squashfs`, `tmpfs`, `proc`,\n   `sysfs`, and `vfat`. Squashfs only needs ZLIB support.\n1. `vfat` needs to default to `utf8`. Enable native language support for\n   `ascii`, `utf-8`, `ISO 8859-1`, codepage 437, and codepage 850.\n1. Disable all network drivers and wireless LAN drivers except for Broadcom\n   FullMAC WLAN.\n1. Disable PPP and SLIP\n1. Disable the WiFi drivers in the Staging drivers menus\n1. Disable TV, AM/FM, Media USB adapters, DVB Frontends and Remote controller\n   support in the Multimedia support menus.\n1. Go to `Device Drivers-\u003eSound card support`. Disable `USB sound devices` in\n   ALSA. Disable `Open Sound System`.\n1. Go to `Device Drivers-\u003eGraphics support`. Disable `DisplayLink`\n1. In `Kernel Features`, select `Preemptible Kernel (Low-Latency Desktop)`,\n   disable the memory allocator for compressed pages.\n1. In `Userspace binary formats`, disable support for MISC binaries.\n1. In `Networking support`, disable Amateur Radio support, CAN bus subsystem,\n   IrDA subsystem, Bluetooth, WiMAX, Plan 9, and NFC. (TBD - this may be too\n   harsh, please open issues if you're using any of these and it's the only\n   reason for you to create a custom system.)\n1. In `Networking options`, disable IPsec, SCTP, Asynchronous Transfer Mode,\n   802.1d Ethernet Bridging, L2TP, VLAN, Appletalk, 6LoWPAN, 802.15.4, DNS\n   Resolver, B.A.T.M.A.N, Open vSwitch, MPLS, and the Packet Generator in Network\n   testing.\n1. In `Networking support-\u003eWireless`, enable \"use statically compiled regulatory\n   rules database\". Build in `cfg80211` and `mac80211`. Turn off `mac80211` mesh\n   networking and LED triggers. Turn off `cfg80211` wireless extensions\n   compatibility.\n1. In `Kernel hacking`, disable KGDB, and Magic SysRq key.\n1. In Device Drivers, disable MTD support. In Block devices, disable everything\n   but Loopback and RAM block device. Disable RAID and LVM.\n1. In `Enable the block layer`, deselect everything but the PC BIOS partition\n   type (i.e., no Mac partition support, etc.).\n1. In `Enable loadable module support`, select \"Trim unused exported kernel\n   symbols\". NOTE: If you're having trouble with an out-of-tree kernel module\n   build, try deslecting this!!\n1. In `General Setup`, turn off `initramfs/initfd` support, Kernel .config\n   support, OProfile.\n1. In `Device Drivers -\u003e I2C -\u003e Hardware Bus Support` compile the module into\n   the kernel and disable everything but `BCM2708 BSC` support.\n1. In `Device Drivers -\u003e SPI` compile in the BCM2835 SPI controller and User\n   mode SPI device driver support.\n1. In `Device Drivers -\u003e Staging` disable `Support for small TFT LCD modules`\n1. In `Device Drivers -\u003e Dallas's 1-wire support`, disable everything but the\n   GPIO 1-Wire master and the thermometer slave. (NOTE: Why is the thermometer\n   compiled in? This seems historical.)\n1. Disable `Hardware Monitoring support`, `Sonics Silicon Backplane support`\n1. In `Device Drivers -\u003e Character devices -\u003e Serial drivers`, disable 8250 and\n   SC16IS7xx support. Disable the RAW driver.\n1. In `Networking support-\u003eNetwork options`, disable `IP: kernel level\n   autoconfiguration`\n1. In `Networking support-\u003eNetwork options-\u003eTCP: advanced congestion control`\n   disable everything except for `CUBIC TCP`.\n1. Disable `Real Time Clock`.\n1. Disable everything in `Cryptographic API` and `Library routines` that can be\n   disabled. Sometimes you need to make multiple passes.\n1. Disable EEPROM 93CX6 support, PPS support, all GPIO expanders, Speakup core,\n   Media staging drivers, STMicroelectronics STMPE, anything \"Wolfson\".\n1. Disable most ALSA for SoC audio support and codecs. NOTE: We probably should\n   support a few, but I have no clue which ones are most relevant and there are\n   tons of device drivers in the list.\n1. Disable IIO and UIO.\n1. Disable NXP PCA9685 PWM driver\n\n[Image credit](#fritzing): This image is from the [Fritzing](http://fritzing.org/home/) parts library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaliot%2Fvaliot_system_rpi3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaliot%2Fvaliot_system_rpi3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaliot%2Fvaliot_system_rpi3/lists"}