Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devgianlu/go-coap-mqtt
A CoAP <-> MQTT gateway written in Go.
https://github.com/devgianlu/go-coap-mqtt
coap mqtt
Last synced: 6 days ago
JSON representation
A CoAP <-> MQTT gateway written in Go.
- Host: GitHub
- URL: https://github.com/devgianlu/go-coap-mqtt
- Owner: devgianlu
- Created: 2023-06-09T18:58:23.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-06-09T21:48:08.000Z (over 1 year ago)
- Last Synced: 2024-11-13T09:39:31.589Z (2 months ago)
- Topics: coap, mqtt
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-coap-mqtt
`go-coap-mqtt` is a CoAP <-> MQTT gateway written in Go.
Messages can be sent and received from both MQTT and CoAP. The following ways of exchanging messages are supported:
- Publishing an MQTT message to a particular topic
- Making a CoAP `POST /pub` request with a JSON body containing the topic and payload
- Subscribing to a particular MQTT topic
- Observing the CoAP `GET /sub/{topic}` endpointThis project was developed as part of the university course
of [Telematica](https://corsi.unipr.it/it/ugov/degreecourse/191394).## Testing
The `test` container has two CLI tools installed for interacting with the gateway and MQTT
broker: [mqtt](https://github.com/hivemq/mqtt-cli) and [coap-cli](https://github.com/mainflux/coap-cli).
You can get an interactive shell inside the container with `docker compose exec test bash`.To make a CoAP request of the `/pub` endpoint use:
```shell
coap-cli post pub -h gateway -p 5688 -d '{"topic":"test","payload":"hello from coap"}'
```To make a CoAP request to the `/sub` endpoint use:
```shell
coap-cli get sub/test -h gateway -p 5688 -o
```To publish an MQTT message use:
```shell
mqtt pub --host mqtt-broker --topic test -m "hello from mqtt"
```To subscribe to MQTT messages use:
```shell
mqtt sub --host mqtt-broker --topic test
```