Skip to content

Commit f609604

Browse files
committed
2023-05-15 Node-RED adaptation to expected kernel change - master branch - PR 1 of 3
Background: - SensorsIot#690 – Kernel update may remove /dev/ttyAMA0 Changes: 1. Removes Bluetooth-specific volumes and devices from template. 2. Updates TZ to `TZ=${TZ:-Etc/UTC}` syntax. 3. Realigns build arguments (yamllint). 4. Adds documentation to Node-RED wiki page (master branch) to explain how to re-add volumes and devices if Bluetooth support is required on a Raspberry Pi: - This means Node-RED will launch successfully on non-Pi hardware. - Documentation references `/dev/serial1` rather than `/dev/ttyAMA0`. Signed-off-by: Phill Kelley <34226495+Paraphraser@users.noreply.github.com>
1 parent 96f4297 commit f609604

File tree

2 files changed

+27
-10
lines changed

2 files changed

+27
-10
lines changed

.templates/nodered/service.yml

+3-10
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,14 @@ nodered:
33
build:
44
context: ./services/nodered/.
55
args:
6-
- DOCKERHUB_TAG=latest
7-
- EXTRA_PACKAGES=
6+
- DOCKERHUB_TAG=latest
7+
- EXTRA_PACKAGES=
88
restart: unless-stopped
99
user: "0"
1010
environment:
11-
- TZ=Etc/UTC
11+
- TZ=${TZ:-Etc/UTC}
1212
ports:
1313
- "1880:1880"
1414
volumes:
1515
- ./volumes/nodered/data:/data
1616
- ./volumes/nodered/ssh:/root/.ssh
17-
- /var/run/docker.sock:/var/run/docker.sock
18-
- /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
19-
devices:
20-
- "/dev/ttyAMA0:/dev/ttyAMA0"
21-
- "/dev/vcio:/dev/vcio"
22-
- "/dev/gpiomem:/dev/gpiomem"
23-

docs/Containers/Node-RED.md

+24
Original file line numberDiff line numberDiff line change
@@ -1455,3 +1455,27 @@ All remaining lines of your original *Dockerfile* should be left as-is.
14551455
### Applying the new syntax { #july2022build }
14561456

14571457
Run the [re-building the local Node-RED image](#rebuildNodeRed) commands.
1458+
1459+
## Bluetooth support { #bluetoothSupport }
1460+
1461+
If you enable the `node-red-contrib-generic-ble` add on node, you will also need to make the following changes to the Node-RED service definition in your `docker-compose.yml`:
1462+
1463+
* Add the following mapping to the `volumes:` clause:
1464+
1465+
```yaml
1466+
- /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
1467+
```
1468+
1469+
* Add the following `devices:` clause:
1470+
1471+
```yaml
1472+
devices:
1473+
- "/dev/serial1:/dev/serial1"
1474+
- "/dev/vcio:/dev/vcio"
1475+
- "/dev/gpiomem:/dev/gpiomem"
1476+
```
1477+
1478+
Notes:
1479+
1480+
* These changes are *specific* to the Raspberry Pi. If you need Bluetooth support on non-Pi hardware, you will need to figure out the details for your chosen platform.
1481+
* Historically, `/dev/ttyAMA0` meant "the serial interface" on Raspberry Pis. Subsequently, it came to mean "the Bluetooth interface" where Bluetooth support was present. Now, `/dev/serial1` is used to mean "the Bluetooth interface".

0 commit comments

Comments
 (0)