Skip to main content

Gsm

This I/O Server provides services for sending and receiving SMSs and events generation for incoming calls via GSM modem.

The employed protocol complies with the AT commands set specified by the GSM standard set. It has been tested on the following modems:

  • GenPro 16e and GenPro 18e modems by Erco&Gener
  • AirLink FXT009 modem by Sierra Wireless
  • RB800/RB900 series modems by Teleorigin

Communication

Employ a RS-232 straight cable to connect the modem directly to HSYCO or to an Ethernet/RS-232 gateway.

RS-232 parameters:

Baud rate9600 (GenPro modems)
115200 (default setting on other modems)
Data bits8
Stop bit1
Paritynone
Flow controlRTS/CTS

HSYCO Configuration

Add a GSM I/O Server in the I/O Servers section of the Settings and set its parameters:

Communication

  • Comm ID: select the comm port the device is connected to.

High Availability

  • Shutdown when inactive: defaults to true.

Options

IDDefaultValuesDescription
pin<code>4-digits PIN code of the SIM card (if used)
guitruetrueenable support for the UI object, UISET actions and USER commands
falsedisable UI support
inboxsize10n ≥ 0the number of incoming messages to display in the UI object
countrycode<code>the default country code (e.g. 39, for Italy) to be used when not otherwise specified. If omitted all provided numbers shall include the country code
srvc<number>phone number of the SMS service center (use the international format, e.g. +393492000200). If not specified, the default number saved on the SIM card will be used. If not available, the driver will not be able to send SMS messages
resend4n ≥ 0number of sending attempts on an outgoing SMS in case of error
simphase2falsetrueenable SIM phase 2+ compatibility
falsedefault

Datapoints

IDValueR/WDescription
connectiononlineRconnection established
offlineRHSYCO can't connect to the modem
sms.<num><text>Ran SMS message has been received form the number <num>(2) with <text> as body
Wsend an SMS message to the number <num>(1) with <text> as body
call<num>Rincoming call from number <num>(2) in progress. An event is generated for each ring during the call
Wstart a voice call to number <num>(1)
endWend the ongoing voice call
unknownRincoming call from an unknown number in progress
call.statestartRa voice call has been started
alertingRthe ongoing voice call is in the alerting state, i.e. the phone on the other end is ringing
activeRthe ongoing voice call is active, i.e. the call has been answered from the other end
heldRthe ongoing voice call is being held
diallingRthe modem is dialling the number
waitingRthe ongoing voice call is waiting
endRthe voice call has ended
sms.<num>.sent<mr>Ra message has been successfully sent to the number <num> and the message reference number is <mr>
sms.<num>.errors<val>Ran error occurred while sending a message to number <num>. The value <val> is an increasing counter of the occurred errors since the I/O Server started
signal{0 ... 31}Rthe GSM signal level has the reported value (ranging from 0 to 31)
unknownRthe GSM signal level is unknown

Note 1

If the option 'countrycode' is used, then the country code will be automatically added to the specified numbers, unless the latter begins with a '+' character. For instance, assuming the option 'countrycode' is set to 39, the addressee number 3480077000 will be automatically changed to +393480077000, while the number +46765007700 will remain unchanged. If, on the other hand, no default country code has been specified, then the addressee numbers must always be provided prepending the country code.

Note 2

The numbers are reported as sent from the modem and the format may vary depending on the number itself and the modem settings. If the reported number is an international number, then a '+' will be prepended to it, unless the country code is equal to the value of the 'countrycode' option. In the last case the country code will be omitted. In some cases, the sender number field might also be replaced by an alphanumeric string.

User Interface

UISET Actions

IDAttribute
inboxvalue
connection.label.onlinevisibletruewhen datapoint connection = online
falsewhen datapoint connection = offline
connection.label.offlinevisibletruewhen datapoint connection = offline
falsewhen datapoint connection = online
signal.label.0visibletruewhen the GSM signal level is equal to 0
falsewhen the GSM signal level is not 0
signal.label.1visibletruewhen the GSM signal level is between 1 and 8
falsewhen the GSM signal level is not between 1 and 8
signal.label.2visibletruewhen the GSM signal level is between 9 and 16
falsewhen the GSM signal level is not between 9 and 16
signal.label.3visibletruewhen the GSM signal level is between 17 and 24
falsewhen the GSM signal level is not between 17 and 24
signal.label.4visibletruewhen the GSM signal level is above 24
falsewhen the GSM signal level is below 25
signal.label.unknownvisibletruewhen the GSM signal level is unknown
falsewhen the GSM signal level is known
sending.labelvisibletruewhen the modem is sending a message
falsewhen the modem is not sending a message
error.labelvisible
blink
truefor 5 seconds after there’s been an error sending a message
falsedefault value

USER Commands

UI ObjectID
input<ioserver_id>.sms.number
input<ioserver_id>.sms.text
submit<ioserver_id>.sms.send

From the resulting interface, digit the addressee number (or comma-separated list of numbers) in the input field with ID <ioserver_id>.sms.number and the body text in the input field <ioserver_id>.sms.text, then press the submit button.

N.B. If the option 'countrycode' is used, then the country code will be automatically added to the numbers, unless the latter begins with a '+'. For instance, assuming the value of the option 'countrycode' is set to 39, the addressee number 3480077000 will be automatically changed to +393480077000, while the number +46765007700 will remain unchanged. If, on the other hand, no default country code has been specified, then the addressee numbers must always be provided prepending the country code.

GSM UI Object

GSM UI Object

The GSM object is listed in the Project Editor’s new object list only when at least one GSM I/O Server is defined.

PUK-locked SIM

In case the SIM card used for the GSM modem is PUK-locked, it is required to provide the PUK code and a new PIN to set on the SIM card. To this end, create in the root folder of HSYCO a file named <ioserver_id>.puk, where <ioserver_id> is the ID of the corresponding I/O Server (e.g. gsm.puk). In this file add a single line containing the PUK code and the new PIN code separated by a comma, for instance:

12345678,1234

The file will be automatically deleted after it has been used by the I/O Server.

Examples

Sending an SMS

Assuming that we are sending an SMS at 12 o' clock to number 777123456 located in Italy (International prefix code: +39) and the option "countrycode" of the GSM IO server is not specified, this is the corresponding EVENTS programming declaration:

time = 1200 : io gsm.sms.+39777123456 = "I'm sending an sms to the world"

You can send multiple SMSs to different numbers using this syntax:

time = 1200 : io gsm.sms.+39777123456 gsm.sms.+39777654321 = "I'm sending an sms to the world"

Receiving an SMS

Hsyco can receive SMSs through the GSM IO server and perform actions according to the text contained in the SMS.

io gsm.sms.777123456 = "Help" : io gsm.sms.777123456 = "I accept the following commands: Open, Status"
io gsm.sms.777123456 = "Open" : io knx.1/1/2 = 1, wait = 1, io knx.1/1/2 = 0

Release Notes

3.6.0

  • new "simphase2" option to enable support for SIM phase 2+ on some modems
  • bug fix: fixed hang on high traffic conditions

3.5.0

  • added voice call functionality
  • improved stability for Teleorigin modem

3.4.0

  • fixed bug occurring when sending messages containing the '=' character
  • minor fixes to the sms UI object

3.3.0

  • added resend server option
  • improved AT commands compatibility
  • added PUK-unlock functionality

3.2.1

  • added srvc server option
  • bug fix: user.IOStartupEvent() was not called at startup

3.1.0

  • initial release

GenPro 16e, GenPro 18e, and Erco&Gener are registered trademarks of Erco&Gener.