This bot will upload every repeater or room server to the map when companion hears new advert
You will need Meshcore device with Companion USB connected to your machine or Companion WiFi on the same network.
- Install Node.js 22 or higher(most recent LTS recommended)
- Clone this repo & install dependencies via npm
git clone https://github.com/recrof/map.meshcore.dev-uploader
cd map.meshcore.dev-uploader
npm install .- Connect working MeshCore companion usb into the computer
- run
node index.mjs (usb_port)ornode index.mjs (host:port)
After cloning the repo, build and run the docker image with
docker-compose build
docker-compose upYou will be able to inspect the logs. Once everything is working correctly, run the container with docker-compose up -d to run it in the background.
To avoid running with priveledged mode, podman can be used to build and run this image.
The magic for avoiding prveledged is to add --group-add keep-groups to the podman run command.
This blog post explains it well: https://www.nite07.com/en/posts/podman-group-share/
podman build . -f Dockerfile -t localhost/map-reporter
# Update the `-e DEVICE=` and `--device` lines below to match your meshcore
# usb companion usb device path.
podman run --restart=unless-stopped -d \
--device /dev/ttyUSB0:/dev/ttyUSB0 \
-e DEVICE=/dev/ttyUSB0 \
--group-add keep-groups \
--name meshcore-map-reporter \
localhost/map-reporterSince podman runs in the user context, it doesn't run a daemon by default like Docker does. To have your container start at boot time, we can leverage systemd to start podman at boot.
See Also: https://www.redhat.com/en/blog/container-systemd-persist-reboot
# Use the container that we created in the previous step as a template to generate the systemd unit file.
# No changes need to be made to the unit file
podman generate systemd --new --files --name meshcore-map-reporter
mkdir -p ~/.config/systemd/user/
cp -Z container-meshcore-map-reporter.service ~/.config/systemd/user
systemctl --user daemon-reload
# Stop and remove the template container
podman stop meshcore-map-reporter
podman rm meshcore-map-reporter
# Enable and start the container via systemd
systemctl --user enable container-meshcore-map-reporter.service
systemctl --user start container-meshcore-map-reporter.servicejournalctl --user -efu container-meshcore-map-reporter
or
podman logs -f meshcore-map-reporter- Build the container image with the same tag
- Restart the systemd service:
systemctl --user restart container-meshcore-map-reporter.service