Open Modem Tools
OpenMT is an attempt to make a suite of programs that will make developing modem firmware and managment tools that are more flexible than current offerings.
This software will take a more modular approach breaking distinct functions out into individual programs. For example most current modem hosts handle everything from modem managemnt to protocol specific encoding and decoding to network gateway management. So if you want to add or remove a protocol you have to edit the host program as well as the firmware.
OpenMT will attempt to make modem firmware with functions that are field programmable so you can add mod/demod types and digital protocols on the fly. This will be the most challenging part of the project and will likly require the higher end modem hardware that is available.
The modem host will manage the hardware much like other existing hosts, sending and receiving packet frames. It will also be responsible for modem configuration and status logging. It will listen for network connections providing or requiring services. The most likely service will be a digital protocol handler. For example an M17 handler that will monitor the host for any incoming M17 frames that need to be delt with. It will provide M17 frames as needed for duplex mode or from a linked reflector. Only one service will be enabled for transmit at any given time. A service can log any data to make it available to the user interface software.
The user interface software can be anything from a web app to a cell phone program. All of the configuration, status and call history will be stored in a database. MariaDB SQL server will be used for this purpose allowing concurrent access by any authorized program. Each program or service will have it's own section in the database for storing configuration and data.
With the exception of the modem host, which must run on the PC with the attached modem, any of the other programs can run on any machine with network access to host.
OpenMT -- project root
docs -- Documentation
db -- Database schema location. MariaDB
dashboard -- Dashboard root
www -- Web base dashboard files
modem -- Host program and related files
tools -- Code for functions used by all programs
protocols
DMR -- DMR protocol service program
gateway -- DMR gateway program
DSTAR -- DSTAR protocol service program
gateway -- DSTAR gateway to IRCDDBGateway daemon
m17 -- M17 open source protocol service program
gateway -- M17 gateway program
P25 -- P25 protocol service program
gateway -- P25 gateway program
FM -- FM repeater service program
gateway -- EchoLink gateway for the FM service
NXDN -- NXDN protocol service program
gateway -- NXDN gateway program
YSF -- YSF protocol service program
gateway -- YSF gateway program
... -- other protocols as needed
***** Some code based on or copied from MMDVM by Jonathan Naylor G4KLX.
***** The OPENMT_HS firmware is a port of MMDVM_HS by Andy Uribe CA6JAU.
An SQL database will be used to store configuration and history data. A .ini file stored in the /etc directory will contain the address and passord to access the database.
The modem host does not talk to a modem. A small bridge program does, and the host
talks to the bridge through a virtual serial port. The host only knows the kind of
packet stream the bridge delivers:
FRAME whole frames, one mode at a time
BIT bit stream frames with a connection id
SAMPLE audio sample frames
Bridges (one per modem family; run the one for your modem, see its INSTALL_SERVICE.txt):
modem/mmdvm-bridge MMDVM and MMDVM_HS boards (FRAME)
modem/openmths-bridge OPENMT_HS firmware for ADF7021 hotspot boards (BIT),
see modem/OPENMT_HS/README.md. It is a port of MMDVM_HS
by Andy Uribe CA6JAU.
modem/openmt-bridge OPENMT firmware that streams ADC/DAC samples (SAMPLE)
modem/sx1255-openmt-bridge SX1255 radio on the Pi itself (SAMPLE)
A bridge keeps its settings in the database, creates the ones that are missing, tells
the modem host its stream type, and reads its settings again when the host tells it
the settings changed. See docs/BRIDGES.md.
The modem host program will handle all data flowing accrose the serial port to and from the modem. It will then route the data to the appropriate protocol service connected to the host via a TCP connection. With MMDVM based modems this will be a simple matter of looking at the frame headers. For the OPENMT types the host will incorporate some of the functions provided by the MMDVM firmware.
These programs will be protocol specific and will handle all the encode and decode functions as well as logging data to the db server. They will connect to the host via a TCP port selected by the host program at connection time based on the modem Id passed at startup and the number of services already connected. Using a network connection will allow the service to be run on an alternate computer if more resources are needed.
The gateway programs will handle the job of communicating to reflectors or reflector services. They will connect via TCP to the relavent protocol service program for traffic relay.
The dashboard currently is a web based, protocol agnostic, display and configuration tool. It gets all of it's data from the database server. It can also update certain things on the database with the appropriate authorization. There is very little static information coded into the dashboard. Most of the content is created on the fly as service programs connect to the host. The config table has columns to intruct the dashboard how to display data for configuration. Such as read or read-only fieids. The dashboard can handle the display of multiple modems if needed.
This project is intended as an alternative to the MMDVM ecosystem but not a replacement. Since this project is primarily for HAM radio use and as such some of the protocol functions may be incomplete as compared to MMDVM and MMDVMHost programs.
As stated above I would like this project to be as flexible as possible with regards to adding new radio protocols and services.
- Service control from the dashboard:
Settings -> Services lists the hosts and gateways kept in the
modem_host.servicestable. A logged in user can start, stop and restart them and choose which start at boot. A root service manager (tools/service_manager) carries out the requests; see its README. - Host list updates from the dashboard:
The "Update host lists" box in Settings -> Services runs
updateHosts.phpfor the lists kept inmodem_host.host_update_sections(created bydb/openmt.sql), either the ticked ones or all, and shows the log while it runs.updateHosts.phpandupdateHostsRun.phponly run from the command line; the web server starts the runner in the background. - Hosts and gateways on other machines:
Every host and gateway takes
-a <address>(dotted IPv4 address or host name, default127.0.0.1). A host uses it to find Modem_Host, a gateway to find its protocol host, so the pieces can run on different machines.
Per-mode RX frequency offsets are stored in the database (modem_host.config, parameter rxOffset) and applied by Modem_Host. Set the modem to Simplex first (a duplex hotspot repeats what it hears and cannot be measured), put a reference carrier on the mode's RX frequency, key it before the measurement and keep it keyed until the result is shown, then either use the dashboard Settings -> Calibration tab or the command line tool built from tools/calibrate:
openmt_cal list show the offsets
openmt_cal measure DMR one reading, nothing saved
openmt_cal auto DMR measure, correct and save until within -t Hz
openmt_cal manual DMR step the offset with the keyboard
openmt_cal raw DMR raw readback words (to check the AFC readback)
openmt_cal sweep DMR AFC word over time and frequency offset (diagnostic)
openmt_cal set DMR 350 save an offset in Hz
openmt_cal reset all clear the offsets
options: -m modem number, -t tolerance Hz, -r readings, -n passes,
-s -u -p -c database options