Requirements:
- libncurses, libpaho-mqttc, libjson-c, libpthread
Setting up virtual CAN:
# modprobe vcan
# ip link add ${CAN_INTERFACE} type vcan
# ip link set ${CAN_INTERFACE} up
- CAN_INTERFACE is the name of the virtual interface
Building:
# autoreconf -if
# ./configure
# make
Running the CAN gateway:
# ./can_gateway ${CAN_INTERFACE} ${MQTT_HOST} ${ARENA_MAPPINGS}
- ARENA_MAPPINGS is a space seperated list of ${MQTT_ID}:${CAN_ID} mappings
Running the virtual panel:
# ./vpanel ${CAN_ID}
Running the gateway systemd service:
# make install
- If you configured the binaries to install anywhere but /usr/local/bin, modify the service file to reflect that
- Create /etc/can_gateway.conf with the following lines(replacing variables with their values):
GATEWAY_CAN_INTERFACE=${CAN_INTERFACE}
GATEWAY_MQTT_HOST=${MQTT_HOST}
GATEWAY_ARENA_MAPPINGS="${ARENA_MAPPINGS}"
- Copy the service file to the systemd directory, reload systemd, and start/enable the service
# cp ./can_gateway.service /etc/systemd/system/
# systemctl daemon-reload
# systemctl enable --now can_gateway