Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
6623537
Made a start at rewriting the thing in Go
Timendus Oct 24, 2024
3963cb9
Refactor receiving messages and get rid of debug files
Timendus Oct 24, 2024
13fa747
Refactor stuff a bit and start parsing incoming mesh packets
Timendus Nov 18, 2024
4eeb834
Decipher Mesh packets into Messages and lots of cleanup
Timendus Nov 18, 2024
accb5f3
Move helpers to their own package
Timendus Nov 18, 2024
9786267
Move the callbacks to a little pubsub system
Timendus Nov 18, 2024
c2a9d1e
Fixing visibility of fields outside of package and made a start at se…
Timendus Nov 18, 2024
114e203
Keep a record of incoming messages in the node that sent them
Timendus Nov 18, 2024
18ca6ab
Add more events to subscribe to
Timendus Nov 20, 2024
cb0c50f
Implement blocking send
Timendus Nov 20, 2024
c6d3324
Nodelist should be a property of a connected node. And fix a bug.
Timendus Nov 20, 2024
d77bdff
Store a node's most recent neighbours on the node for easy access
Timendus Nov 20, 2024
aca15e9
Symplify message types and add traceroute type
Timendus Nov 20, 2024
f343d69
Properly output neighbour list
Timendus Nov 20, 2024
6a3d2d7
Properly finish blocking reply with timeout (could still have race co…
Timendus Nov 20, 2024
41543bb
Rename meshtastic -> meshwrapper to be consistent with Python code an…
Timendus Nov 21, 2024
08216f6
Don't use strings for events, because strings aren't checked at compi…
Timendus Nov 21, 2024
0f99cfa
No need to abort if we can still connect over TCP
Timendus Nov 21, 2024
d94dc0d
...provided we don't mess this up
Timendus Nov 21, 2024
a1d8950
A little cleanup and making things more robust
Timendus Nov 25, 2024
10424c9
Made a start at supporting Lua scripts for the bot plugins
Timendus Nov 25, 2024
b9bc5f4
Make the Lua plugins kinda work
Timendus Nov 27, 2024
0d54faa
Couple improvements
Timendus Nov 27, 2024
70d89cb
Use interface for meshbot package, so we can write a CLI for testing
Timendus Jan 30, 2025
b939c89
Make `tostring(bot)` work
Timendus Jan 30, 2025
86469ed
Move TimeAgo to language
Timendus Jan 30, 2025
dc26695
Implement bridge between Lua and Go
Timendus Jan 30, 2025
805462a
Write a signal reporting plugin, fixing bugs as we go
Timendus Jan 30, 2025
44896ea
Implement finding nodes
Timendus Jan 31, 2025
ced86cc
Write message box plugin, fixing more issues as we go
Timendus Jan 31, 2025
c78ded2
Don't think we need this
Timendus Jan 31, 2025
d038129
Do updates
Timendus Jan 31, 2025
3ee9ca1
Make lua to Go api safer, remove duplication of default timeout value
Timendus Feb 10, 2025
5d6cf84
A few fixes for the message box plugin
Timendus Feb 10, 2025
1a2d7c9
Add method for splitting some random message into Meshtastic messages…
Timendus Feb 10, 2025
1da76f9
Read config from file
Timendus Feb 11, 2025
b949593
Be less verbose
Timendus Feb 11, 2025
10d0c9a
Use a callback in Lua to not block the VM, actually break up messages…
Timendus Feb 11, 2025
76bb2f2
Don't send ANSI color codes over mesh
Timendus Feb 11, 2025
78239f0
Implement listening in channels
Timendus Feb 12, 2025
2ad48c5
Refactor message sending so we don't have our library pollute the con…
Timendus Feb 12, 2025
9d29552
Implement getChannelName
Timendus Feb 12, 2025
5d64dbe
Harden code a bit better against issues
Timendus Feb 12, 2025
b6d562f
Properly clean up channels
Timendus Feb 14, 2025
8e9a2cb
Add build to Makefile
Timendus Feb 14, 2025
90fbbb2
Improve node search
Timendus Feb 14, 2025
37db62f
Bypass Lua and write signal reporter in Go for now
Timendus Feb 14, 2025
a620e67
Add pagination to message breaking
Timendus Feb 14, 2025
0dcd871
Forgot about the hops, added support
Timendus Feb 14, 2025
62abbe7
Dockerize the application
Timendus Mar 10, 2025
baae99d
Clean this up a bit
Timendus Mar 13, 2025
29a6598
Handle config parsing errors
Timendus Mar 13, 2025
390eff1
Add support for announcements, weather and roomservers in Go (after all)
Timendus Oct 18, 2025
d642afc
Refactor some of the connecting, sending and receiving stuff to be mo…
Timendus Oct 18, 2025
659799c
Add weather service
Timendus Oct 18, 2025
ad81955
Clean up all the Lua stuff for now
Timendus Oct 18, 2025
fdce45a
Remove old Python project and move new Go project to the project root…
Timendus Oct 18, 2025
a13f19c
Move open_meteo to a directory that makes sense
Timendus Oct 18, 2025
04f6a67
Update workflow to see if we can test / build this thing
Timendus Oct 18, 2025
434e619
Remove dependency on old meshbot package
Timendus Oct 18, 2025
7480549
Depend build on test, upload artifacts
Timendus Oct 18, 2025
845f515
Add config.json to artifact zips
Timendus Oct 18, 2025
a0dff55
Update README
Timendus Oct 18, 2025
b0945f3
Merge branch 'main' into rewrite-in-go
Timendus Oct 18, 2025
e0bd93a
Remove Lua dependency and bump all the things
Timendus Oct 19, 2025
9f57c58
Move conversion from meshPacket to Message mostly to message.go, feed…
Timendus Oct 22, 2025
b0b8457
Be explicit in conversion for new Go 1.24 rules
Timendus Oct 22, 2025
107dec8
We want to be testing with this version
Timendus Oct 22, 2025
841b200
Add /ping command
Timendus Oct 22, 2025
b9bdb40
Improve logging a bit
Timendus Oct 22, 2025
321f20f
Embed WMO codes instead of loading from file
Timendus Oct 22, 2025
8911834
Create draft release on request, I think..?
Timendus Oct 22, 2025
7cd69e5
Have users have a selected room that they send to, so no more prefixi…
Timendus Oct 22, 2025
f7dd46a
Only send forecast for three days
Timendus Oct 22, 2025
d6d2895
Happy with this, Github?
Timendus Oct 22, 2025
ecbc33d
Change if into guard clause
Timendus Oct 29, 2025
92a5d0e
Add some basic retry logic to sending messages and implement sending …
Timendus Oct 29, 2025
bc9cc60
Allow breaking messages before regular breaking. This is exposed to u…
Timendus Oct 29, 2025
3deabcf
Slightly improve console output of text messages
Timendus Oct 30, 2025
5aab99e
Rewrite how acknowledgements work and make retries more robust
Timendus Oct 30, 2025
18e098c
Solve this issue again
Timendus Oct 30, 2025
5ee6d8d
Improve readme, move manual to its own file
Timendus Oct 30, 2025
1fbbfe3
Reference manual in /help
Timendus Oct 30, 2025
43bfb8b
Rename Message -> IncomingMessage and add OutgoingMessage
Timendus Oct 30, 2025
6219853
Fix acknowledgements and logging and actually use the new OutgoingMes…
Timendus Oct 30, 2025
996aa98
Use new OutgoingMessage type for announcers as well
Timendus Oct 30, 2025
b24232e
Show user available channels on startup, print channel names in log
Timendus Oct 30, 2025
b36d8df
Only trigger message event if the message actually sends
Timendus Oct 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .dockerignore

This file was deleted.

17 changes: 0 additions & 17 deletions .env

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/python-app.yml

This file was deleted.

98 changes: 98 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Test and build Meshbot

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
tag:
description: "Tag name for the release (e.g., v1.2.3)"
required: true
default: ""

permissions:
contents: write # required to create releases & upload assets

jobs:
test:
name: Run tests
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.24.x' ]

steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Run tests
run: make test

build:
name: Build binaries
needs: test
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.24.x' ]

steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Build the application
run: make build

- name: Upload Linux binary
uses: actions/upload-artifact@v4
with:
name: meshbot-linux
path: ./dist/linux/*
- name: Upload Windows binary
uses: actions/upload-artifact@v4
with:
name: meshbot-windows
path: ./dist/windows/*
- name: Upload Raspberry Pi binary
uses: actions/upload-artifact@v4
with:
name: meshbot-raspberry-pi
path: ./dist/raspberry-pi/*
- name: Upload MacOS Intel binary
uses: actions/upload-artifact@v4
with:
name: meshbot-macos-intel
path: ./dist/macos-intel/*
- name: Upload MacOS Apple Silicon binary
uses: actions/upload-artifact@v4
with:
name: meshbot-macos-apple-silicon
path: ./dist/macos-apple-silicon/*
- name: Upload Docker image
uses: actions/upload-artifact@v4
with:
name: meshbot-docker-image
path: ./dist/docker/*

- name: Collect all build artifacts for release
uses: actions/download-artifact@v4
if: github.event.inputs.tag != ''
with:
pattern: meshbot-*
merge-multiple: true
path: release_assets
- name: Create release
uses: softprops/action-gh-release@v2
if: github.event.inputs.tag != ''
with:
draft: true
tag_name: github.event.inputs.tag
generate_release_notes: true
files: |
release_assets/*
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
__pycache__
.DS_Store
development.env
production.env
.venv
dist
46 changes: 46 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# syntax=docker/dockerfile:1

#######################
### Building container

FROM golang:latest AS build
WORKDIR /app

# Install dependencies
COPY go.mod go.sum .
RUN go mod download

# Copy source
COPY . .

# Build the application
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o output/meshbot *.go

######################
### Running container

FROM alpine:latest AS run
WORKDIR /app

# Copy the application executable from the build image
COPY --from=build /app/output /app

# For when we have a web interface:
# EXPOSE 8080

# Have a little runner script that copies the default config and plugins to the
# host directory if not yet present
COPY ./config.json /app/default-config/config.json
RUN cat >./run-meshbot.sh <<EOF
#!/bin/sh
if [ ! -f "/app/config/config.json" ]; then
echo "Copying default config"
cp /app/default-config/config.json /app/config/config.json
fi
ln -sfn /app/config/config.json /app/config.json
./meshbot
EOF
RUN chmod +x ./run-meshbot.sh

# Run the application
CMD ["./run-meshbot.sh"]
40 changes: 27 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,35 @@ SHELL := /bin/bash

all: run

update:
@go get -u
@go mod tidy

run:
@go run *.go

test:
@go test -v ./...

lines:
@find . -name '*.go' | xargs wc -l

build:
@echo "Building docker image..."
@docker build -t timendus/meshbot .
@GOOS=linux GOARCH=amd64 go build -o dist/linux/meshbot *.go
@cp config.json dist/linux/

run-image:
@echo "Running as a docker image..."
@docker run --name=meshbot -d timendus/meshbot
@GOOS=windows GOARCH=amd64 go build -o dist/windows/meshbot.exe *.go
@cp config.json dist/windows/

export-image: build
@echo "Exporting docker image..."
@docker save timendus/meshbot:latest | gzip > meshbot-docker-image.tar.gz
@GOOS=linux GOARCH=arm64 go build -o dist/raspberry-pi/meshbot *.go
@cp config.json dist/raspberry-pi/

dependencies:
@python3 -m venv .venv
@.venv/bin/pip3 install -r requirements.txt
@GOOS=darwin GOARCH=amd64 go build -o dist/macos-intel/meshbot *.go
@cp config.json dist/macos-intel/

run:
@.venv/bin/python3 -m meshbot
@GOOS=darwin GOARCH=arm64 go build -o dist/macos-apple-silicon/meshbot *.go
@cp config.json dist/macos-apple-silicon/

@docker build --quiet -t timendus/meshbot:latest .
@mkdir -p dist/docker
@docker save timendus/meshbot:latest | gzip > dist/docker/meshbot.tar.gz
Loading
Loading