APPNOTE: PmGateway (aka PmRemoteAgent) SMS command set

Article ID: 150323sab
Last Reviewed: December 1st 2016

The information in this article applies to:

  • PmGateway version 3.0.1 and later when used to provide remote access to one of the Power Master Loggers
  • NOTE: PmGateway was previously called PmRemoteAgent in older releases.

Target Audience.

This article is aimed at:

Summary.

PmGateway is an application that runs on a phone or tablet running the Android operating system. It provides timed remote download and control of a Power Master Logger. Remote control of PmGateway and the Logger is achieved by sending an SMS message to the phone or tablet which PmGateway receives, interprets and performs the command requested.

Before you start.

You will need all of the following:

1) An Android device to which you can send SMS messages.

2) A copy of PmGateway installed on the Android device.

3) A Power Master PM1000, PM2000, PM3000 or PM7000 with a Bluetooth, USB or Ethernet interface.

4) A device from which to send SMS messages.

Command Format.

All commands have a common format and follow these conventions:

1) A command starts with the period / dot character “.”

2) A single command word immediately follows the period/dot character.

3) The parameters (if required) follow the command word and are space separated.

4) A final optional parameter determines where any response generated should be sent.

5) Commands are not case sensitive so .start .START and .stART are all considered the same.

Command quick reference.

Command Parameter 1 Parameter 2 Parameter 3
.login [phone number] [email | sms | none]
.logout [phone number] [email | sms | none]
.response [email | sms | none]
.start [email | sms | none]
.stop [email | sms | none]
.restart [email | sms | none]
.status [email | sms | none]
.values [email | sms | none]
.registers <location> <count> [email | sms | none]

New commands added in PmGateway 3.0.12

Command Parameter 1 Parameter 2 Parameter 3
.numbers [email | sms | none]
.settings [email | sms | none]
.email <user>@<domain.com> [email | sms | none]
.pollinterval <minutes> [email | sms | none]
.pollstart [email | sms | none]
.pollstop [email | sms | none]
.scan [email | sms | none]
.logger <Logger SN> [email | sms | none]
.config [email | sms | none]

New commands added in PmGateway 3.0.17

Command Parameter 1 Parameter 2 Parameter 3
.alertenable [email | sms | none]
.alertdisable [email | sms | none]
.alertemail <user>@<domain.com> [email | sms | none]
.configupload http(s)://<domain>/<filename>.zip [email | sms | none]
.configlist [email | sms | none]
.configload <filename>.plc [email | sms | none]

Command descriptions.

.Login Command

For security and data integrity reasons PmGateway ignores messages received from a number/phone that is not authorised. The .login command adds a number to the list of authorised numbers. This command needs to be used once for each number/phone authorised to control PmGateway.

There are two ways to use this command to authorise a number.

1) When next to the device running PmGateway, ensure PmGateway is running in the foreground and send the .login command without any parameters from the device you wish to authorise. PmGateway presents a dialog on the screen requesting confirmation. Click Yes to add the number to the authorised number list.

2) When not near the device running PmGateway a number can be authorised, from a second previously authorised number, by sending the .login command followed by the number of the phone to be authorised.

Examples:

.login  012345678910  email     Adds 012345678910 to the authorised numbers list and send response back over email.

.login                                          Add this phones number to the authorised numbers list, local access to the device running PmGateway required to accept.

.Logout Command

Removes a number from the list of authorised numbers.

Examples

.logout 012345678910            Deletes 012345678910 from the list of authorised numbers (this can be sent from 012345678910 but would be the last command accepted from that number).

.Response Command

Sets the default response method, this is how PmGateway is to respond when a command is sent that does not have: <email>, <sms> or <none> appended.

Examples

.response email                    SMS commands received from now on will by default respond over email.

.response none                     no response will be returned from SMS commands.

.Start Command

Starts the Logger recording. If the Logger is already recording this has no effect.

Examples

.start email                        Start the Logger recording, sending the result over email

.start sms                          Start the Logger recording, sending the result back in an SMS

.Stop Command

Stops the Logger recording. If the Logger is not recording this has no effect. Examples

.stop email                         Stop the Logger recording, sending the result over email

.stop sms                           Stop the Logger recording, sending the result back in an SMS

.Restart Command

Stops and then starts the Logger recording. If the Logger is not recording this will start the Logger recording.

Examples

.restart email                      Stop the current recording and start the next session, sending the result over email

.restart sms                        Stop the current recording and start the next session, sending the result back in an SMS

.Status Command

Reads the Loggers status and returns the results.

Examples

.status email                      Get the Logger status, sending the result back in an email

.status sms                         Get the Logger status, sending the result back in an SMS

Example Response

PM1S0651
Status: Recording
Battery Volts: 5.979 V
Ambient Temp: 32.8 deg
Firmware: 1.025
Free Memory: 3.89 %

.Values Command

Reads the Loggers channel values and returns the results.

Examples .values email           Get the channel values and send the results back over email

.values sms                             Get the channel values and send the results back over SMS

Example Response

Channels:
01=230.8 Vac
02=  8.1 Aac
03=  2.0%
04=  2.2 Aac
05= 0.00 Pfs
06= 1.00 Flg
07= 0.37 Pst
08= 0.33 Plt
09= 0.49 Vac
10=50.05 Hz

.Registers Command

reserved for development not for use by end users.

.Numbers Command

returns a list of registered phone numbers.

Examples

.numbers email                   return list of registered number by email

.Settings Command

returns the current settings for PmGateway.

Examples

.settings email                   return PmGateway settings by email

Example Response

poll.period=15
email.address=<user>@<domain.com>
email.interval=every hour
upload=email
PM7S0363.connection=bluetooth

.Email Command

specifies the e-mail to send data and responses too.

Examples.

.email john.doe@example.com                   sets the email for results to: john.doe@example.com

.Pollinterval command

specifies the interval in minutes at which to poll the logger.

Examples.

.pollinterval 15                   sets the poll interval to 15 minutes

.PollStart command

starts PmGateway polling the Logger.

Examples.

.pollstart                    First poll will occur on the next interval boundary

.PollStop Command

stops PmGateway polling the Logger.

Examples.

.pollstop                       Finish any poll in progress then do no more polling

.Scan Command

Performs a Bluetooth scan and report any Loggers found.

Examples.

.scan                              PmGateway will scan for nearby loggers (unless a poll is in progress).

Example Response

Bluetooth devices detected:
PM7000sn0501
PM7000sn1107
PM7000sn1065
PM7000sn0363
PM3000sn0850

.Logger Command

Select which Logger to use for further commands.

Examples.

.logger PM7S0123                   Select PM7000 serial number 0123 for any subsequent commands.

.Config Command

Extracts the current configuration from the Logger and sends it to the registered email address.

Examples.

.config                                  send the current configuration from the selected Logger to the registered e-mail address.

.AlertEnable Command

Some Loggers include an Alert flag which is checked when the Logger is polled. If enabled and the alert flag is set when a poll occurs an e-mail is sent immediately, rather than waiting for the next email interval.

Examples.

.alertenable                            turn on alert e-mails.

.AlertDisable Command

Turns off alert emails.
If supported the alert status is still checked and reported with the normal e-mails.

Examples.

.alertdisable                     turn off alert emails.

.AlertEmail Command

Sets a different e-mail to which to send alert e-mails.

Examples.

.alertemail jane.doe@example.com                   sets the email for alerts to: jane.doe@example.com

.ConfigUpload Command

Allows a configuration to be uploaded from a URL.
The URL must point to a zip file containing a single .plc file and must be accessible by the PmGateway device using http or https.
URL’s containing spaces must be quoted.

Examples.

.configupload “http://www.example.com/loggers/3p4wYconfig.zip”                 download the zip file from the specified URL to the phone, unzip it and transfer the included .plc file to the Logger.

.ConfigList Command

Get a list of configs present in the Logger and send it to the registered email address.

Examples.

.configlist                               send a list of configurations by email.

.ConfigLoad Command

Load a specified configuration into Logger.

Examples.

.configload “3p4w Y Std PQ 8MB 400A 7day.plc”           load the specified configuration into the Logger.

See also:

APPNOTE: Installing PmScreen on an Android Device.

APPNOTE: PmGateway (aka PmRemoteAgent) Setup Guide.