First local addon is up and running, see below, canbus.py , didnt post yet, still testing with it, i am already reading messages, thats working, now testing with some rest api calls…
that host_network, priviliged, kernel_modules, is needed to bring up the hardware in the container
also in run.sh, you see i bring down the can0 interface first, while testing and a lot of restarts of the add-on, it was more stable to bring it first down , when it was already up after a restart of the container
Dockerfile file
ARG BUILD_FROM
FROM $BUILD_FROM
ENV LANG C.UTF-8
RUN apk add --no-cache python3 py3-pip
RUN pip install python-can
COPY run.sh /
COPY canbus.py /
RUN chmod a+x /run.sh
CMD [ "/run.sh" ]
run.sh file
#!/usr/bin/with-contenv bashio
lsmod
ifconfig -a | grep can0
ip link set can0 down
ip link set can0 up
ip link | grep can0
python3 canbus.py
config.json file
{
"name": "Dobiss CAN",
"version": "3",
"slug": "dobiss",
"description": "Doobiss CAN system",
"startup": "application",
"arch": ["aarch64", "amd64", "armhf", "armv7", "i386"],
"kernel_modules": false,
"host_network": true,
"privileged": ["NET_ADMIN"],
"homeassistant_api": true,
"hassio_api": true,
"options": {},
"schema": {}
}