WebThingsIO / gateway-docker

Legacy docker image for WebThings Gateway - now moved to main gateway repo at https://github.com/WebThingsIO/gateway
Mozilla Public License 2.0
72 stars 25 forks source link

Cannot run arduino CLI in container on Pi 4b #42

Closed tatemz closed 4 years ago

tatemz commented 4 years ago

I'm attempting to use the Candle-manager-addon, which uses the arduino-cli to manage plugged in arduinos.

The Candle manager addon comes packaged with an arduino-cli that can run natively on my Raspberry Pi 4b, but that cannot be run on my Raspberry Pi 4b using the mozillaiot/gateway Docker image.

Below is output from my attempt at running the cli from the Raspberry pi:

pi@raspberrypi:/ $ uname -s && uname -m
Linux
armv7l

pi@raspberrypi:/ $ /home/pi/Development/iot/data/addons/Candle-manager-addon/arduino-cli/linux-arm/arduino-cli version
arduino-cli Version: 0.9.0 Commit: e4d02b4

Below is output from my attempt at running the cli from inside the container: (Host volume is mapped using -v /home/pi/Development/iot/data:/home/node/.mozilla-iot).

pi@raspberrypi:/ $ docker exec -it webthings-gateway sh

# uname -s && uname -m
Linux
armv7l

# ls -lha /home/node/.mozilla-iot/addons/Candle-manager-addon/arduino-cli/linux-arm/arduino-cli
-rwxr-xr-x 1 node node 14M Jul 18 08:32 /home/node/.mozilla-iot/addons/Candle-manager-addon/arduino-cli/linux-arm/arduino-cli

# /home/node/.mozilla-iot/addons/Candle-manager-addon/arduino-cli/linux-arm/arduino-cli version
sh: 1: /home/node/.mozilla-iot/addons/Candle-manager-addon/arduino-cli/linux-arm/arduino-cli: not found

As a note, I am opting to run the gateway in a docker container so that I can use my Pi for multiple purposes (as a desktop, Pi-Hole, and iOT Gateway) so using the Pi iOT Gateway image is not a preferred solution.

tatemz commented 4 years ago

After looking into it further. It is likely a problem with the arduino-cli that is installed with the addon. I got around this issue, by overriding the cli tool within the addon using the binary from https://arduino.github.io/arduino-cli/installation.

mrstegeman commented 4 years ago

I’m glad you got it working, but can I suggest filing an issue against the add-on: https://github.com/createcandle/Candle-manager-addon

tatemz commented 4 years ago

Ya will do as soon as I get a clean workaround script :+1: