APPNOTE: PmGateway (aka PmRemoteAgent) Setup Guide

Article ID: 161201sab
Last Reviewed: May 19th 2017

The information in this article applies to:

  • PmGateway ( PmRemoteAgent ) version 3.0.6 and later when used to provide remote access to one of the Power Master Loggers.
  • NOTE: PmGateway was previously called PmRemoteAgent.

Target Audience.

This article is aimed at:

  • All users of PmGateway who wish to extract data or remotely control a Power Master Power Quality Analyser.

Contents.

  1. Before you Start
  2. install PmGateway onto the Android device.
  3. Launch PmGateway.
  4. Setup and Test the connection between PmGateway and the Logger.
  5. Setup and Test the Connection between PmGateway and an e-mail server.
  6. (Optional) Setup and Test the Connection between PmGateway and an FTP server.
  7. Perform a complete system test.
  8. Start the Logger recording and start PmGateway Polling for new data to send.
  9. Known Issues and precautions.
  10. See Also

Summary.

PmGateway is an application that runs on a phone or tablet running the Android operating system. It enables a user to communicate remotely with any Power Master Logger that has a Bluetooth.

PmGateway introduction showing data paths

Communications include timed remote data downloads and active control of a Power Master Logger. The user can setup automatic data download to their email in-box whilst also being able to send commands remotely back to the Logger.

Ranger Power Master analyzers with Bluetooth. It provides timed remote download and control of a Power Master Logger.

Available to use with any Power Master Analyser with Bluetooth, the system uses a ‘Gateway’ mobile ‘phone. Remote control is achieved by sending an SMS message to the ‘phone loaded with the PMGateway App. PMGateway then interprets the SMS message and performs the command requested through Bluetooth communication with the operating analyzer. The ‘Gateway’ mobile ‘phone collects data from the Analyser and sends that data and other information via e mails directly to mobile ‘phones, tablets and PCs over WiFi, 3G/4G or Bluetooth.

Screen-shots shown below are from a phone with a 4.5 inch screen running Android 4.4.4, They will differ somewhat on a device with a larger or smaller screen or running a different Android version.

Before you start.

1) An Android device into which PmGateway will be installed which will be left near the Logger.
This could be a phone, a, tablet or an embedded system running Android.

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

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

4) For remote control over SMS, a device is required from which to send SMS messages.

Step 1. install PmGateway onto the Android device.

Installing PmGateway on Android is very similar to the installation of PmScreen, for reference read the instructions in this application note:
121116an_pmscreen_android_install.htm

Step 2. Launch PmGateway.

After installation, launch PmGateway by clicking on the icon
The Logo for PmGateway
PmGateway will display the main screen below:.
The main screen for PmGateway

Step 3. Setup and Test the connection between PmGateway and the Logger.

It may be convenient to perform this step before going to site to connect up the Logger

1) On the main screen click on ADD LOGGER. This screen will be shown:
PmGateway Setup Logger screen

2) Click on CHANGE CONNECTION SETTINGS, This screen will be shown:
PmGateway connection setup screen

4) For a Bluetooth connection, set the checkbox (you may be prompted to turn on Bluetooth) then click on Scan for devices,
Detected Devices will be displayed in the list as shown in this example:
PmGateway performing a Bluetooth scan for Loggers.

5) Select the Logger to which you want to connect and click on TEST. This tests that the connection can be established with the Logger, (you may be prompted to enter the Bluetooth PIN at this point).
PmGateway prompts for the Bluetooth PIN

6) Look for the message Successfully connected to logger PM7Sxxxx as shown.

PmGateway successfully connected to Logger

7) Finally click on DONE to go back to the Logger connection screen then click on SETTINGS to go back to the main screen.

Step 4. Setup and Test the Connection between PmGateway and an e-mail server.

1) On the main screen click on Change E-mail settings. This screen will be shown:
PmGateway email setup screen

2) Click on Poll interval and select how often the phone checks the Logger to see if there is any new data, The default of 15 minutes is a good compromise between battery consumption and how soon after the end of a recording the data is retrieved.

3) Click on Email address and enter the e-mail address to which you want data to be sent as shown in this example.
PmGateway entering the e-mail address to send data to.

4) Click on EMAIL INTERVAL to select how often you want e-mails sent to the in-box as shown.
For Email every poll interval, email will be sent regardless of whether new data is available or not.
For Email every hour, again email will be sent regardless of whether new data is available.
For Email when a recording finishes, e mails will only be sent when new data is available.
If you are intending to run the test detailed below in step 5 Select Email every poll interval.
For normal use, either every hour or when a recording finishes as you prefer,
PmGateway, selecting the email sending interval

4) Test the entered e-mail address by clicking on TEST, PmGateway should show the message as below
PmGateway showing message: Email successfully sent.

5) Check your in-box to verify the message was received (this may take a few minutes depending on network load).
TIP: try not to send multiple messages over a short period as this may trigger the spam filter for your in-box (depends on the server configuration).

6) Click on Done to save changes to the email settings and return to the main screen.

Step 5. (Optional) Setup and Test the Connection between PmGateway and an FTP server.

This is step only necessary if you want PmGateway to transfer data extracted from the Logger to an FTP / FTPS server rather than over e-mail.

1) On the main screen click on Change E-mail settings. This screen will be shown:
PmGateway email setup screen

2) Set the Use FTP checkbox then click on FTP Settings button. PmGateway will display the screen below:

3) Click on each of Server Address, Server Port, Username and Password and enter the details for the server you want PmGateway to upload files to. For Internet FTP Servers, for security reasons, use the FTPS protocol by setting the check box.

4) Enter the root directory into which PmGateway will save recordings.  PmGateway will create this directory if it does not already exist on the server. Recordings from an individual Logger will be placed in a subdirectory below that directoory. For example if the root directory is “PmGateway” then recordings from PM7000 serial number 678 will be saved to “/PmGateway/PM7S0678/” .

4) Click on Click on TEST and PmGateway will test the connection to the FTP server by uploading (then removing)  a small text file.

5) Click on DONE to save changes to the FTP settings and return to the email settings screen.

Step 6. Perform a complete system test.

This step tests all of the data path, from the Logger to PmGateway, then from PmGateway via the Internet to the server hosting your e-mail in-box.
To minimise the time taken for the test, the Logger should be empty and not recording although a single small recording of no more than a couple of 100 kB won’t impact the time too much.

1) On the main screen click on Change E-mail settings. This screen will be shown:
PmGateway email setup screen

2) Click on EMAIL INTERVAL and set the interval to Email every poll interval. Use this setting only for the duration of this test,

3) Click on DONE and return to the main screen.

4) On the main screen click on the Logger tab to go to this screen:
PmGateway prepare to start polling
at the bottom of the screen, click on RUN NOW.

4) The Bluetooth indicator LED on the Logger will go solid to indicate a connection has been made, The test is complete once the Bluetooth LED goes back to flashing normally. Check your in-box for a status message

5) Go back to the main Settings screen then on the Email Settings screen return the Email interval to the final desired setting.

Step 7. Start the Logger recording and set PmGateway Polling the Logger looking for completed recordings.

1) Start the Logger recording in the normal way using its user interface,

2) Ensure the Logger is recording.

3) On the main screen click on the Logger tab to go to this screen:
PmGateway prepare to start polling
at the bottom of the screen, click on START POLLING.

4) Check the status text indicates the time to the next poll as below
.PmGateway showing the time to the next poll.

Known Issues and precautions.

1) Ideally start the Logger with its memory empty, If there are any superfluous recordings left over in the Logger, PmGateway has to download these first which will delay the time before new data is extracted.

2) As with any wireless communication method interference is possible, the following precautions should help reduce the risk of problems.
a) Position the Logger and phone away from sources of Radio Frequency ( RF) noise. For example large electrical machinery or IT equipment.
b) Keep the Logger and phone away from very active Wifi or Bluetooth devices as these share the same frequency. In particular a Wifi access point or router that sees significant traffic will cause problems.
c) If not needed for access to the Internet turn off Wifi on the phone, this also helps conserve power.
d) If not in use turn off the 3G/4G interface on the phone for the same reason.

3) Try and ensure the phone power supply is not going to be disconnected by other site visitors needing a power point.

See also:

APPNOTE: Installing PmScreen on an Android Device.

APPNOTE: PmGateway (aka PmRemoteAgent) SMS command set.