Go to file
noah metz ab2e203b8c Removed delay 2023-02-05 20:19:39 +00:00
src Removed delay 2023-02-05 20:19:39 +00:00
.gitignore Changed can function calls to get passed arena instead of arena members. Added ncurses simulator. 2023-01-18 13:00:33 -07:00
.gitmodules Added score json parsing and removed pahomqtt submodule in favor of system package 2023-01-17 03:26:05 +00:00
Makefile.am Changed can function calls to get passed arena instead of arena members. Added ncurses simulator. 2023-01-18 13:00:33 -07:00
README Added systemd service to README and verified can_gateway.service 2023-01-18 13:46:50 -07:00
can_gateway.service Made can_gateway.service wait for network and restart 2023-01-26 03:17:02 +00:00
configure.ac Changed can function calls to get passed arena instead of arena members. Added ncurses simulator. 2023-01-18 13:00:33 -07:00

README

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