Skip to content
Set of python scripts to allow interactive SMS with an Openspot.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Place these files in the same folder as the shark-py files. shark-py must be the version here ( to work these scripts. This will work with Openspot firmware 0101 or later as all versions after 0101 use JSON Web Tokens.

This is the main script and contains all the core functionality. (It runs in a loop, so there is no need for a scheduled cron job.)

Current Status - 12/6/2019

Just implimented DMR SMS to APRS gateway. Any DMR SMS that contains "A-" will be routed to APRS. "A-" must contain APRS station, including. Example: "A-N0CALL-5 This is a test message." This will send an APRS message to N0CALL-5 (fiticious call) with a message of "This is a test message."


Just uploaded "Version 1.1". This contains alot of bug fixes, a restructuring of the code, and implemented APRS to DMR SMS functionality, complete with APRS ack of message. Current installation instructions may need some changinging. Hopefully someone will find this usefull. Next up, DMR SMS to APRS message.


Just upload initial script, still a little buggy.

Upon starting, script will check Openspot for a new message, then it process any received SMS for a command. Next, it will check for any new email, send any emails in Inbox to DMR radios, before waiting 5 seconds to repeat.

*Please note, it is reccomended to have a dedicated email account for this script. The script will look for any emails with subject "TO-", then process and send SMS to modem. Next, it will delete the email. In other words, any email with subject line beginning with "TO-" will be deleted.

To send an email via configured SMTP server, SMS must begin with "TO-" and have email address attached with no space. The rest of the message is sent in the email body. (example " This is a test." will result in an email to containing " This is a test." in the body.

Currently working to implement some type of APRS functionality and Openspot control commands.

Currently, script is configured by default to send SMS replies to Talkgroup 9.

This is due to an issue with the Anytone D878 used during testing. Sometimes the radio will not send an acknowledgement packet to the Openspot fast enough, resulting in 2-4 SMS messages. Further implimentation required for private SMS to be fully functional.

This script should also theoretically respond to SMS sent from the DMR network, however, I only have 1 hotspot and have not been able to test this. Will fully impliment response to network SMS in the future. At present, this capability is "half implimented."


  • SMS to E-Mail
  • E-Mail to SMS
  • APRS to DMR SMS gateway (12/5/2019)
  • DMR SMS to APRS gateway (12/6/2019)
  • Current Time
  • Several minor commands

Currently working on implementing:

  • DMR SMS to APRS 12/5/2019 - Sucessfully implimented APRS to DMR SMS. 12/2/2019 - Sucessfully filtering packets from specific callsigns. Next, need to filter packet further for processing...

  • Commands to control Openspot 12/5/2019 - Not yet started...

Future possible features:

  • Some sort of XMPP implimentation.
  • METAR info
  • Have any ideas?


  • Finish cleaning up email functions.
  • Start coding APRS messaging functionality using APRS lib.


Commands are in CAPS.

  • HELP - displays help message
  • ECHO - replies eniter message back to user'
  • TIME - current local time
  • UPTIME - uptime of host system
  • PING - replies with pong
  • ID - returns your DMR ID
  • If "TO-" and "@" are in message, will send email to address.


First and formost, my modified shark-py "library" is required. I took the shark-py code, originally published by battlehax (, and updated the authentication mechanism to support JSON Web Tokens, as Openspot firmware 0101 and later requires this to use the Shark API. I have also updated some of the code to make it compatable with Python 3.7. #### *Find it at .

This script also requires the follwing Python modules: re, binascii, shark, time, os, datetime, smtplib, email, poplib

which should be included on any modern Linux distrobution.

Openspot setup

The source id under the DMR SMS page must match the "hotspot_id" in SMS messages must be sent to that DMR ID, private SMS.

"tdma_channel" in must match the DMO channel in the connectors page, and the TDMA channel to which the openspot sends traffic to the network. TDMA channel = slot.

SMS page appears to only send on slot 1.

When using in example, and every thing configured for Slot 2, it appears that Openspot sends group SMS to network in MMDVM mode... Hmm, interesting...


Download this repository into the same folder as shark-py, found at

  1. Create folder for shark-py-sms

mkdir shark-py-sms

  1. Download the modified shark-py, found at

git clone shark-py-sms/

  1. Download shark-py-sms.

git clone py-sms

  1. Move shark-py-sms files into same folder as shark-py.

cp -r py-sms/* shark-py-sms/

  1. Open and edit neseccary lines: "ip", "passwrd", and "hotspot_id" to match your Openspot.

  2. Open and modify to match your email account and other settings.

  3. Run:


Install all necessary python modules if it complains about import errors.

That should be it.


Find the section of code in the "box" near the top of and change to your settings.

Next, open and change the values, located near the top of the file, and fill in your Openspot ip address and password.

Now run: python3.7

You should be set. - NWS Weather Alert to SMS

Broken in Python 3.7...

Appears to be an issue with the required module, will work on later...

This script will check for moderate, severe, or extreme weather alerts and send them to the configured sms receiver. Setting this up to send to a talk group will allow multiple users to receive severe weather alerts.

Requires the python module WeatherAlerts.

You can’t perform that action at this time.