Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
70 changes: 61 additions & 9 deletions .github/workflows/m17-gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Run tests
run: go test .

- name: Build for Raspberry Pi (ARM64)
- name: Build m17-gateway for Raspberry Pi (ARM64)
run: |
cd cmd/m17-gateway
echo "Building M17 Gateway for ARM64 architecture (64-bit Raspberry Pi OS)..."
Expand All @@ -55,32 +55,64 @@ jobs:
ls -la m17-gateway
file m17-gateway

- name: Make build script executable
- name: Make m17-gateway build script executable
run: |
cd cmd/m17-gateway
chmod +x ./packaging/scripts/build-deb.sh

- name: Build .deb package
- name: Build m17-gateway .deb package
run: |
cd cmd/m17-gateway
./packaging/scripts/build-deb.sh ${{ steps.version.outputs.VERSION }}

- name: List build artifacts
- name: List m17-gateway build artifacts
run: |
cd cmd/m17-gateway
ls -la build/

- name: Upload .deb package
- name: Upload m17-gateway .deb package
uses: actions/upload-artifact@v4
with:
name: m17-gateway-debian-package
path: cmd/m17-gateway/build/*.deb

- name: Build m17-bridge for Raspberry Pi (ARM64)
run: |
cd cmd/m17-bridge
echo "Building M17 Gateway for ARM64 architecture (64-bit Raspberry Pi OS)..."
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o m17-bridge .
echo "Build completed successfully"
ls -la m17-bridge
file m17-bridge

- name: Make m17-bridge build script executable
run: |
cd cmd/m17-bridge
chmod +x ./packaging/scripts/build-deb.sh

- name: Build m17-bridge .deb package
run: |
cd cmd/m17-bridge
./packaging/scripts/build-deb.sh ${{ steps.version.outputs.VERSION }}

- name: List m17-bridge build artifacts
run: |
cd cmd/m17-bridge
ls -la build/

- name: Upload m17-bridge .deb package
uses: actions/upload-artifact@v4
with:
name: m17-bridge-debian-package
path: cmd/m17-bridge/build/*.deb

- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: cmd/m17-gateway/build/*.deb
files: |
cmd/m17-gateway/build/*.deb
cmd/m17-bridge/build/*.deb
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -92,20 +124,40 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Download .deb package
- name: Download m17-gateway .deb package
uses: actions/download-artifact@v4
with:
name: m17-gateway-debian-package
path: ./

- name: Test package info
- name: Test m17-gateway package info
run: |
# Install dpkg tools
sudo apt-get update
sudo apt-get install -y dpkg-dev

# Check package info
DEB_FILE=$(ls m17-gateway*.deb)
echo "Package contents:"
dpkg -c "$DEB_FILE"

echo "Package info:"
dpkg -I "$DEB_FILE"

- name: Download m17-bridge .deb package
uses: actions/download-artifact@v4
with:
name: m17-bridge-debian-package
path: ./

- name: Test m17-bridge package info
run: |
# Install dpkg tools
sudo apt-get update
sudo apt-get install -y dpkg-dev

# Check package info
DEB_FILE=$(ls *.deb)
DEB_FILE=$(ls m17-bridge*.deb)
echo "Package contents:"
dpkg -c "$DEB_FILE"

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cmd/bridge/bridge
cmd/bridge/bridge.ini
cmd/m17-text-cli/m17-text-cli
cmd/m17-gateway/m17-gateway
cmd/m17-gateway/m17-gateway.ini
Expand All @@ -10,3 +12,4 @@ cmd/m17-message/m17-message.apk
cmd/modem-emulator/modem-emulator
misc/
.DS_Store
.vscode/
33 changes: 15 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# M17 library, gateway and clients, written in Go

M17 Packet Mode is defined in the [spec](https://spec.m17project.org), and messaging is one obvious application. This project started as a set of tools to jumpstart messaging and data communications using the [M17 ham radio mode](https://m17foundation.org/). It has evolved to provide more general tool and library support for M17.
M17 Packet Mode is defined in the [spec](https://spec.m17project.org), and messaging is one obvious application. This project started as a set of tools to jump-start messaging and data communications using the [M17 ham radio mode](https://m17foundation.org/). It has evolved to provide more general tool and library support for M17.

There are several tools and a library here:

## Tools

### M17 Messaging Bridge

[m17-bridge](./cmd/m17-bridge/) is an experimental network service that bridges M17 SMS messages to and from other messaging protocols. It speaks the [M17 Internet protocol](https://github.com/M17-Project/M17_inet/blob/main/M17%20Internet%20Interface.md), so it looks like a reflector to hotspots/repeaters that connect to it.

It bridges to these systems:
* **Discord:** An M17 module letter is connected to a Discord channel. All M17 messages are send to the channel and all channel messages are sent to connected hotspots/repeaters. Since all received traffic is sent over the air, membertship in the Discord channels should be restricted to licensed hams.
* **IRC:** An M17 module letter is connected to an IRC server and allows sending and receiving private messages via M17 SMS. Because received traffic is sent over the air, accounts on the server should probably be restricted to licensed hams.
* **APRS:** An M17 module letter is connected to an APRS-IS server. Radios can use M17 SMS messaging to send APRS messages. When it sees M17 GNSS data, the bridge will also send periodiic APRS position reports. The bridge will send APRS messages to connected radios. A radio must send a message in order to register to receive APRS messages.

### M17 Gateway

[m17-gateway](./cmd/m17-gateway/) bridges between RF clients and relays/reflectors. It currently supports the [CC1200 Pi HAT](https://github.com/M17-Project/CC1200_HAT-hw). When run on a Raspberry Pi with a CC1200 HAT, it can forward M17 voice and packet traffic to and from a reflector/relay, making the Pi/CC1200 HAT an M17 voice and packet hotspot.
[m17-gateway](./cmd/m17-gateway/) allows a computer and modem to act as a repeater/hotspot. It also connects RF clients to Internet services such as reflectors. It currently supports the [CC1200 Pi HAT](https://github.com/M17-Project/CC1200_HAT-hw) and MMDVM-compatible hotspots and modem. When run on a Raspberry Pi with a CC1200 HAT, it can forward M17 voice and packet traffic to and from a reflector, making the Pi/CC1200 HAT an M17 voice and packet hotspot.

The easiest way to get a working CC1200 hotspot, including `m17-gateway` and a [web dashboard](https://github.com/M17-Project/rpi-dashboard) is using DK1MI's [excellent installer script](https://github.com/DK1MI/cc1200-hotspot-installer). Highly recommended!

Expand All @@ -17,24 +26,12 @@ Another way to install just the gateway is using the APT package from a release
1. Copy the URL for the latest `deb` package from https://github.com/jancona/m17/releases
2. From a shell on the Pi do:
```
wget <latetst deb URL>
wget <latest deb URL>
sudo dpkg -i m17-gateway_<version>_arm64.deb
```

To build it just run `go build` in the `m17-gateway` directory. Because Go natively supports cross-compilation, you can build a Raspberry Pi executable on any machine by running `GOOS=linux GOARCH=arm64 go build`, the using `scp` to copy the resulting executable to the Pi.

<!--
It can also accept a stream of float samples (as generated by [m17-packet-encode -f](https://github.com/M17-Project/M17_Implementations/tree/main/SP5WWP/m17-packet)) and forward that on to a relay/reflector. It also does the reverse, receiving messages from a relay/reflector and encoding them as M17 samples suitable for a client like `m17-packet-decode`.

Example: `./gateway -debug -server relay.kc1awv.net <testdata/message.flt`

If you have an instance of `m17-text-cli` connected to the same relay with callsign `AB1CDE`, a message should appear in that client.

Or in the other direction, `./gateway -debug -server relay.kc1awv.net | ./m17-packet-decode` will use `m17-packet-decode` to display messages received from the reflector.

It can also do both encoding and decoding at the same time.
-->

```
Usage of gateway:
-config string
Expand All @@ -52,21 +49,21 @@ Bu default, the gateway looks for configuration in `gateway.ini` in the working

### GUI Messaging Client

[m17-message](./cmd/m17-message/) is a cross-platform GUI network messaging client. It's based on [Fybro](https://github.com/andydotxyz/fybro), a messaging app built using [Fyne](https://fyne.io/), a fraemwork for building multi-platform GUI apps in Go. To build the client just run `go build` in the `m17-message` directory. For more packaging options, see the [Fyne docs](https://docs.fyne.io/started/packaging).
[m17-message](./cmd/m17-message/) is a cross-platform GUI network messaging client. It's based on [Fybro](https://github.com/andydotxyz/fybro), a messaging app built using [Fyne](https://fyne.io/), a framework for building multi-platform GUI apps in Go. To build the client just run `go build` in the `m17-message` directory. For more packaging options, see the [Fyne docs](https://docs.fyne.io/started/packaging).

### CLI Messaging Client

[m17-text-cli](./cmd/m17-text-cli/) is a rudimentary network messaging client--think Droidstar but for text messages (and not nearly as nice looking). Note that since I started writing this a number of tools (including DroidStar) have added M17 messaging support.

To build the client just run `go build` in the `m17-text-cli` directory.

Example: `./m17-text-cli -server relay.kc1awv.net -callsign N1ADJ`
Example: `./m17-text-cli -server m17.openquad.net -callsign N1ADJ`

The program will respond with a prompt `> `. To send a message, enter `callsign: message`. Incoming messages for you will appear starting with `< `. To quit, enter `/quit`.

Sample session:
```
$ ./m17-text-cli -server relay.kc1awv.net
$ ./m17-text-cli -server m17.openquad.net
> N1ADJ: Hi from my other window!
>
2025-02-06 14:45:45 N0CALL>@ALL: Hi back
Expand Down
Loading