Acts as a message gateway for cellular modems (see branches for different models). Accepts messages via POST and interacts with the modem to attempt to send over network to Hologram messaging API. Use something like https://github.com/aneisch/cellular_bridge or a CloudFlare Worker to bridge the connection to your messaging platform.
To transmit a message:
curl -vvv -X POST -d '{"message":"hi there from a cellular network!"}' localhost:9999/send_message
version: '3.2'
services:
cellular_message_relay:
container_name: cellular_message_relay
image: ghcr.io/aneisch/cellular_message_relay:sim7080g
ports:
- '9999:9999'
environment:
# Optional MODEM_PATH - defaults to /dev/cellular_modem
#- MODEM_PATH=/dev/cellular_modem
# SIM key from Hologram Device dashboard
- SIM_KEY=XXXX
# Set a max queue size to limit usage in case we think we need to send 10,000 messages or something
- MAX_QUEUE_SIZE=5
devices:
- /dev/cellular_modem:/dev/cellular_modem
restart: always
Works great with RESTful Notifications to relay messages.
# configration.yaml
notify:
- name: gsm_message
platform: rest
resource: http://10.0.1.22:9999/send_message
method: POST_JSON
data:
priority: "{{ data.priority }}"