I cleaned up the code, mostly re-factoring the code for INI file configuration by removing the boost program_options version and substituting my own. Works out a lot simpler. Here is the relevant INI file sections –
LogDirectory = /home/futuretab/Logs/%Y%m%d-$app$.log
PortName = /dev/ttyS1
PortSettings = 115200,8,N,1,N
TestMode = true
MQTTServerUri = tcp://192.168.156.116:1883
MQTTClientId = SMSINTERFACE
Time for testing – with the SIM card installed this time. Here is the new log, with a few added bits for debugging – name of the serial port, test mode status, etc.
I sent two messages out to different numbers and all is working as expected.
Next up – I only have one SIM card so I need to figure out a way for the alarm panel interface to publish MQTT messages.