User Tools

Site Tools


Sidebar

Kerlink Wiki Home Page

Home

Setups

General information

Wirnet™ iBTS information

Wirnet™ iFemtoCell information

Wirnet™ iFemtoCell-evolution information

Wirnet™ iStation information

System management

Network management

LoRa Features

KerOS customization

Support and resources



www.kerlink.com

wiki:sms

This is an old revision of the document!


SMS

Use of integrated SMS commands

Wirnet iBTS can be configured by sms command. The configuration available via SMS are mostly similar to the feature available in the web interface and rest API.

Command pattern

All SMS command will follow the same pattern :

[login:password] [sms_command_id] sms_command sms_field sms_value
  • login: The login use for the board configuration. The value is admin.
  • password: The password of the configuration user (pwd4admin by default). This password is the same as the web interface password.
  • sms_command_id: ID defined by the customer to identify the SMS command. There is no default value. This ID is mandatory and must be 6 characters long.
  • sms_command: The command to be executed with '/' separated fields.
  • sms_field: The configuration field to be set/get (Optional).
  • sms_value: The value that as to be set to a configuration field (Optional).

SMS response pattern

SMS reponses uses the following syntax:

[sms_command_id:sms_command_status] sms_error_info
  • sms_command_id: ID defined by the customer to identify the SMS command. This matches with the sms_command_id description parameters send in the SMS.
  • sms_command_status: ok or error.
  • sms_error_info: SMS error information (Optional).

System command

System command Description sms_command sms_field sms_value
Halt Halt the board system/halt N/A N/A
Reboot Reboot the board system/reboot N/A N/A
Update Request a board update system/update N/A N/A
Restore Backup Request a backup restore system/restore/backup N/A N/A
Restore Stock Request a stock restore system/restore/stock N/A N/A

Sending SMS commands update, restore stock and restore backup will only set up a flag to record the request.
The action will be triggered only after a board reboot. Reboot the board manually or by sending a reboot SMS command.

Examples:

Reboot command:

#SMS send to the gateway
[admin:pwd4admin] [reboot] system/reboot
#SMS response from gateway
[reboot:ok]

Restore stock command with wrong password:

#SMS send to the gateway
[admin:badpassword] [rstock] system/restore/stock
#SMS response from gateway
[rstock:error] login/password

Configuration commands

Configuration commands are separated in two types: get commands and set commands.

Get commands

Command Description sms_command sms_field sms_value
Get CPU usage configuration/get_value statm.cpu N/A
Get RAM usage configuration/get_value statm.ram N/A
Get userdisk usage configuration/get_value statm.userdisk N/A
Get board temperature configuration/get_value statm.temperature N/A
Get ethernet connectivity state configuration/get_value statm.lan.state N/A
Get ethernet hardware address configuration/get_value statm.lan.hardware.address N/A
Get ethernet IP address configuration/get_value statm.lan.address N/A
Get ethernet broadcast IP address configuration/get_value statm.lan.broadcast N/A
Get ethernet netmask configuration/get_value statm.lan.netmask N/A
Get GSM connectivity state configuration/get_value statm.gsm.state N/A
Get GSM IP address configuration/get_value statm.gsm.address N/A
Get GSM netmask configuration/get_value statm.gsm.netmask N/A
Get CPU board serial number configuration/get_value statm.serialnumber N/A
Get Keros firmware version configuration/get_value statm.version N/A
Get board platform type configuration/get_value statm.platform N/A
Get ethernet connectivity state configuration/get_value sysma.lan.enable N/A
Get ethernet connectivity mode configuration/get_value sysma.lan.ipv4 N/A
Get ethernet IP address configuration/get_value sysma.lan.ipv4_address N/A
Get ethernet netmask configuration/get_value sysma.lan.ipv4_netmask N/A
Get ethernet gateway IP configuration/get_value sysma.lan.ipv4_gateway N/A
Get list of ethernet DNS IP configuration/get_value sysma.lan.ipv4_dns N/A
Get GSM connectivity state configuration/get_value sysma.gsm.enable N/A
Get GSM operator list configuration/get_value sysma.gsm.operators N/A
Get time synchronization mode configuration/get_value timem.mode N/A
Get list of NTP address configuration/get_value timem.ntp N/A
Get timezone use on the board configuration/get_value timem.timezone N/A
Get current date (yyyymmddHHMMSS) configuration/get_value timem.date N/A

Example:

Get GSM IP address:

#SMS send to the gateway
[admin:pwd4admin] [getgsm] configuration/get_value statm.gsm.address 
#SMS response from gateway
[getgsm:ok] "10.172.108.48"

Set commands

Command Description sms_command sms_field sms_value
Set admin user password configuration/set_value sysma.password New password. ex:mynewpassword
Set ethernet connectivity state configuration/set_value sysma.lan.enable true or false
Set ethernet connectivity mode configuration/set_value sysma.lan.ipv4 off,dhcp or static address_ip netmask gateway_ip dns_ip1,dns_ip2 (dns optionnal)
Set ethernet IP address configuration/set_value sysma.lan.ipv4_address IP address. ex:192.168.4.10
Set ethernet netmask configuration/set_value sysma.lan.ipv4_netmask Mask value. ex:255.255.254.0
Set ethernet gateway IP configuration/set_value address sysma.lan.ipv4_gateway IP address. ex:192.168.4.1
Set list of ethernet DNS IP configuration/set_value addresssysma.lan.ipv4_dns IP addresses. ex:192.168.1.1,192.168.1.2
Set GSM connectivity state configuration/set_value sysma.gsm.enable true or false
Add a GSM operator configuration/set_value sysma.gsm.add_operator MNC,MCC,APN,login,user. ex:124,10,myapn,user,pass or 123,10,,,
Remove a GSM operator configuration/set_value sysma.gsm.remove_operator MNC,MCC. ex:124,10
Update a GSM operator configuration/set_value sysma.gsm.update_operator MNC,MCC,APN,login,user. ex:124,10,myapn2,,
Time synchronization mode configuration/set_value timem.mode auto or manual
Set List of NTP address configuration/set_value timem.ntp List of NTP address. ex:0.pool.ntp.org,1.pool.ntp.org
Set Timezone use on the board configuration/set_value timem.timezone Timezone. ex:Europe/Paris
Set a date (yyyymmddHHMMSS) configuration/set_value timem.date Date. ex:20180710192000

Examples:

Use of customs SMS

The Wirnet iBTS is able to send and receive SMS if the mobile network is properly configured. Modems are identified by sierra_X where X is a number. This can vary if the iBTS is a dual-SIM device.

To retrieve the identifier, use the gsmdiag.py command and read the resulting text file:

root@klk-lpbs-060434:~ # gsmdiag.py
Diagnostic written in /tmp/gsmdiag.txt
root@klk-lpbs-060434:~ # cat /tmp/gsmdiag.txt
Number of modems: 2
[Modem:/sierra_1]
  Syspath:/sys/devices/soc0/soc/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb2/2-1/2-1.3
  HardwarePosition:1,1
  Powered:1
  Online:0
  Manufacturer:Sierra Wireless, Incorporated
  Model:MC7304
  Revision:SWI9X15C_05.05.58.00 r27038 carmd-fwbuild1 2015/03/04 21:30:23
  [SimProps]
    Present:0
  Error: no SIM in modem  
[Modem:/sierra_0]
  Powered:1
  Online:1
  Manufacturer:Sierra Wireless, Incorporated
  Model:MC7354
  Revision:SWI9X15C_05.05.58.00 r27038 carmd-fwbuild1 2015/03/04 21:30:23
  [SimProps]
    Present:1
    CardIdentifier:895XXXXXXXXXXXX1015
    SubscriberIdentity:3XXXXXXXXXXXXX3
    LockedPins:dbus.Array([], signature=dbus.Signature('s'), variant_level=1)
    PinRequired:none
  [NetworkRegistrationProps]
    Status:registered
    MobileCountryCode:XXX
    MobileNetworkCode:YY
    Name:ABCD
    Strength:80
  [ConnectionContexts]
    [/sierra_0/context1]
      Name:Internet
      Active:1
      Type:internet
      Protocol:ip
      AccessPointName:apname
      Username:uname
      Password:pass
      AuthenticationMethod:chap

Here there are two modems, and only one has a SIM card present. Its identifier is /sierra_0.

Send

To send an SMS using the modem /sierra_0:

dbus-send --system --print-reply --dest=org.ofono /sierra_0 org.ofono.MessageManager.SendMessage string:"+33XXXXXXXXXX" string:"test sms"

Receive

Receive an SMS using a python test script :

receive-sms
#!/usr/bin/python2
 
from gi.repository import GLib
 
import dbus
import dbus.mainloop.glib
 
def chunkstring(string, length):
	return (string[0+i:length+i] for i in range(0, len(string), length))
 
def incoming_message(message, details, path, interface):
	message_txt = str(message.encode('utf-8'))
	print("Size of message: %d" % len(message_txt))
	print("%s" % (message_txt))
	for line in chunkstring(message_txt, 40):
		print("%s" % line)
 
	for key in details:
		val = details[key]
		print("    %s = %s" % (key, val))
	print("    %s = %s" % ('path',path))
	print("    %s = %s" % ('interface', interface))
 
if __name__ == '__main__':
	dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
 
	bus = dbus.SystemBus()
 
	bus.add_signal_receiver(incoming_message,
					bus_name="org.ofono",
					signal_name = "ImmediateMessage",
						path_keyword="path",
						interface_keyword="interface")
 
	bus.add_signal_receiver(incoming_message,
					bus_name="org.ofono",
					signal_name = "IncomingMessage",
						path_keyword="path",
						interface_keyword="interface")
 
	mainloop = GLib.MainLoop()
	mainloop.run()
wiki/sms.1537277703.txt.gz · Last modified: 2019/01/17 10:01 (external edit)