AlphaMon’s Software Services
The AlphaMon Platform incorporates a number of hardware features and technologies which are linked together by software services to perform specific tasks such as sharing energy metering data over the LoRa mesh network covering your property or site/s or forwarding your data to an external MQTT server.
The term software service generally refers to a software-based functionality that can be easily reused or repurposed to perform specific tasks.
This section provides a brief description of each of the following software services and how you can configure them to meet your needs.
The primary AlphaMon services are as follows;
- Configuration File Management
- LoRa spread spectrum, mesh radio networking
- Bluetooth Low Energy (BLE)
- WiFi client and access point
- MQTT message forwarding and subscriptions
- International time keeping & time zones
- Modbus RTU
- Graphical displays
- Static and Dynamic timers
- microSD Card Storage sub-system
- Event Logging
- MOSFET Switching
- Security
- Speech Recognition
The following sections describe each of these services in more detail.
Configuration File Management
The AlphaMon Platform uses a s small configuration file stored on each device in your installation to store important start-up information such as your WiFi SSID and password, your LoRa radio settings, links to external servers such as MQTT and international time keeping.
You can read more about Config Files and how they work here. You cal also read about tips and tricks for editing Config Files here.
However, before getting down to that level of detail, you’ll probably need to find or install a terminal emulator app to connect to the serial data streams coming from the USB-C port on your AlphaMon module/s.
LoRa Mesh Radio
The AlphaMon Platform includes a variety of services to manage data telemetry over the LoRa mesh network that is automatically created at your site when LoRa is enabled through settings in the Config File of each AlphaMon module.
The range of LoRa services include:
- Data Packet Transmission (LoRaTx)
- Data Packet Reception (LoRaRx)
- Radio configuration
- Cyclical Redundancy Checks of transmitted and received data (CRC)
- Data logging, including time and date stamping
- White-listing of other recognized AlphaMon LoRa devices
- Advanced scheduling of priority telemetry data transmissions
Orchestration of these services is automatically managed by the AlphaMon Platform. However, you can also use your own or third-party LoRa-enabled devices to tap into your mesh network.
Note that LoRa is essentially designed for low data-rate transmissions, typically requiring around 2 seconds to transmit the details of a single energy meter register (such as the grid voltage). Thus. the AlphaMon includes an advanced scheduling system to prioritize transmission of the most important registers.
You can find some useful information about installing your LoRa antennas for best reception here.
Bluetooth LE
The AlphaMon Platform modules include Bluetooth LE (BLE) radio transmitter and receiver hardware. BLE is a sub-set of the full Bluetooth Standard and many of the features in the full standard, such as audio streaming, aren’t available in BLE.
Further, the AlphaMon modules share an antenna between WiFi and BLE, so that only one can operate at a time. Since WiFi connectivity has a higher priority for data telemetry than short-range BLE signalling the BLE services are normally disabled during normal operation.
However, The AlphaMon Platform includes the software required to support BLE and it can be enabled for specific applications such as iBeacon recognition and tracking. That’s why you may notice support for Bluetooth beacon pairing in the Config Files.
WiFi
The AlphaMon modules support WiFi (2.4GHz only) for both the creation of local Access Points and also for connecting to your household or office WiFi-enabled routers. However, contrary to what may expect, WiFi is not used for communications between AlphaMon modules at your site or installation.
When an AlphaMon module is powered up or restarted, it performs a scan for all 2.4Ghz WiFi signals in the immediate vicinity and lists those, together with the signal strength, to help you decide which should be your preferred WiFi connection point.
The connection credentials are supplied by the Config File stored on the device, so be sure to check these are correct before finalizing your installation. Note that the credentials are displayed in the log output
The AlphaMon Platform is designed to operate without a reliable WiFi signal and Internet connection however, if a connection isn’t available then the following software services are automatically disabled:
MQTT
AlphaMon’s built-in MQTT messaging services are designed to support AlphaMon users who need remote monitoring, including multi-site installations and country-wise and/or international monitoring.
You can specify the target MQTT broker server’s URL and login credentials in the Config File settings.
By default, AlphaMon is designed to connect to Solargy’s cloud-based Mosquitto server but you can easily disable this feed or connect to your own MQTT server/s.
The MQTT services automatically maintain two main topics:
- Devices:
- Example: Your Entity->Your AlphaMon devices
- Accounts:
- Example: Your Entity->Your Accounts->Your Devices
The Account-based data feed is specifically designed to support the reporting requirements of large (enterprise) organizations. Talk to us at Solargy if you have more specific requirements.
There is considerable information online about MQTT workflow automation and this blog post contains a good general introduction.
Time Keeping
The AlphaMon modules contain a highly accurate, temperature compensated crystal controlled clock that can maintain the correct time over many months with little drift; similar to the performance of a digital watch.
In addition, if there is an Internet connection available via WiFi then AlphaMon’s time-keeping services are designed to lock onto a global time-keeping signal delivered by highly accurate NTP time servers.
If your site installation doesn’t include a reliable WiFi and Internet signal you may prefer to configure and time-sync your AlphaMon at a location where the Internet can be reached to enable an initial, start-up time-sync.
The AlphaMon Time-keeping Service also includes automatic daylight savings and local time zone adjustments. The URL of the global time server is http://worldtimeapi.org and you can find a list of the global time zones supported by this server at http://worldtimeapi.org/api/timezone. Select the relevant time zone for your area from this list and cut-and-paste it into the Config File as per the following example:
- LOCAL_TIME_ZONE, “Australia/Sydney”
You can find a more generic summary of this section here.
Modbus RTU
The AlphaMon Platform includes a proprietary table-driven design for managing communications with inverters, smart meters, energy storage systems and other energy management devices.
The Solargy development team creates a table for each Modbus RTU device to be connected to an AlphaMon. Each row in the table fully describes a single Modbus register, including:
- The register name
- It’s function/s
- The port number, hexadecimal address and size
- Where the data from the register needs to be sent
- How often the register should be polled
You can see an example of a table designed for the AlphaESS SMILE5 inverter and home battery system here. AlphaESS design a range of inverters and battery systems, all with a similar register structure.
This blog describes some of the many advantages of a table-driven design for non-technical users.
If you’re unfamiliar with installing Modbus enabled devices then this blog is your best starting point.
Graphical Displays
The AlphaMon Platform is currently hosted on Expressif ESP32-S3 “system on a chip” or SoC modules. The primary module presently used in AlphaMon devices is the Heltec LoRa ESP32 V3 product which incorporates the Expressif ESP32 chip, but this may change as more powerful modules and processors become available.
The Heltec modules incorporates a monochrome OLED display, shown right, with an active area of just 26mm x 14mm
Support for larger, external OLED displays is planned soon.
Whilst the Heltec OLED display is somewhat small, The AlphaMon’s Graphical Display Services have been carefully optimized to allow meaningful information to be displayed from a distance of up to 4 meters.
There are a number of graphical display types as listed below, each displayed on a rotational basis for a few seconds.
A horizontal Bar Chart, showing Battery SoC%, Solar %, Load % and Grid %.
A “Waiting…” message is displayed on the bar if the required data is unavailable at any time.
A Pie Chart, showing Battery state-of-charge. The displayed % is adjusted for any Reserve Capacity that may have been programmed into the system.
Whilst the OLED display is quite small, the layout of this display is visible from a few meters away.
A configurable Time Series Chart.
The data source (Battery Soc%, Solar or Grid Import/Export), the time span (up to 24h), scaling and peak/average/minimums are configurable.
The grid fills from right-to-left. In this example, the frame width represents 2 hours of solar activity.
The Local and GMT times, synchronized to Internet NTP time servers and adjusted for daylight savings.
The display also the local time zone.
Static & Dynamic Timers
The previous section focuses on AlphaMon’s precision time-keeping services, whilst this section describes how AlphaMon keeps track of numerous internal functions that need regular updates. AlphaMon does this using both Static and Dynamic Timers; whichever is the most appropriate for the task at hand.
At the time of writing, AlphaMon includes support for 60 Static Timers and 25 Dynamic Timers.
One of the most important examples of an internal function that needs regular monitoring and updates is the polling of Modbus registers. Whilst an inverter or smart energy meter may have dozens of internal registers, each storing vital data such as grid voltage, battery state-of-charge or charge rate, there are often many other registers that change less frequently, such as the inverter’s operating temperature.
In order to prioritize the more important registers, we can create some timers (much like an egg-timer) of various durations and allocate a timer to each register that best reflects the importance; fast-changing registers will be polled more frequently and slower-changing registers will be polled at longer intervals.
Since we may not know in advance how often each timer needs to be checked we need a mechanism to create new timers of random duration on demand. We call that feature the Dynamic Timer Service. AlphaMon’s Table Driven Design allows each register to be allocated separate Dynamic Timers for each of LoRa and MQTT polling intervals.
Other internal functions occur at more predictable intervals, such the the refresh of the graphical display. For these predictable functions we can utilize Static Timers, since Static Timers require less internal housekeeping than the Dynamic variety.
Both Static and Dynamic Timers Services are a core part of The AlphaMon Platform and they keep everything running smoothly in a carefully orchestrated fashion.
microSD Card Storage
The average microSD card has a staggering amount of storage and, whilst seeming very simple, is actually a complex device with its own communication protocol and embedded processor. The technical details of how SD and microSD cards operate is defined in standards maintained by The SD Association.
The AlphaMon Platform embodies the key features of those standards; sufficient to allow AlphaMon to read and write to microSD cards of up to 32GBytes of capacity.
The AlphaMon also implements a basic file management system that can create and manipulate files following an 8.3 file naming convention. In short, AlphaMon file names are case-insensitive, must be no longer than 12 characters (including the period), the first part of the file name must be no longer than 8 characters and the last part no longer then 3 characters and the file names must not contain special characters other than an underscore “_”.
AlphaMon’s microSD Card Service includes various sub-services, including:
- Directory Listing
- File Renaming
- File Creation and Deletion
- File Sizing
- File Copying
- Text File Display
The AlphaMon Platform predominantly uses these services to read a Configuration File on power-up and initialize key operating parameters such as the user’s local time zone and WiFi settings.
AlphaMon also uses those same file management services to maintain an internal (SPIFFS) file storage area within the processor’s memory area.
To differentiate between the two, files located on a microSD card are prefixed with “SD” (such as “SD:/AlphaMon.cfg”) whilst files located in the SPIFFS memory ares are prefixed with “SP” (such as “SP:/AlphaMon.cfg”). SPIFFS is an acronym for (Serial Peripheral Interface Flash File System)
Event Logging
The AlphaMon Platform incorporates an Event Logging Service to facilitate installation, maintenance and fault finding.
The log contains only printable text, including the time and date stamp at the start of each line, and each logged event is displayed on a new line.
The time and date stamp is reported using your local time zone, such as “Australia/Sydney”, which you can set by editing your Config File during installation. You can find a list of valid time zones for your location at http://worldtimeapi.org/api/timezone. The local time is automatically adjusted for daylight savings.
Access to the Event Logging Service is via the USB-C connector on the Heltec sub-board. Simply connect your PC, laptop or other USB-Serial enabled device into the connector, set your baud rate to 115200, 8 bits, no parity and 1 stop bit.
You may need to install a “terminal emulation” app such as PuTTy, as described here unless your device already has a similar feature, as discussed here. Once connected your device should display a stream of data describing each event as it occurs on the AlphaMon.
Some terminal emulation apps allow you to save the data stream to a file for later analysis which can be useful for locating random and hard-to-trace events using the search functions of text editor apps.
Note that the Event Log Rx packet stream also includes both the raw and decoded LoRa data events, including the Received Signal Strength Indicator (RSSI) and Signal-to-Noise ratio (SNR), both of which are useful for checking antenna placement and AlphaMon spacing.
MOSFET Switching
The AlphaMon Outdoor Module contains a 0-5V DC MOSFET Switch which is turned on and off by AlphaMon’s MOSFET Switching Service.
Whilst the switch can deliver sufficient current (25mA) to turn on a LED it is primarily designed as a voltage switching device. Many inexpensive brands and sizes of solid state relay are available that can use the small 0-5V voltage change to switch much larger loads and voltages, including 120V and 230V AC. Alternatively, your application may be able to use a conventional mechanical relay if the required current is sufficiently low and you ensure a reverse, transient protection diode is fitted to the circuit.
The following Config file entries define the function and polarity of the MOSFET Switch:
RELAY_MODE //Set to "LOCK", "EXPORT", "IMPORT" or "SOC"
RELAY_TRIGGER //Number of Watts that triggers the switch to the ON state
RELAY_OFF //Normally "LOW" but set to "HIGH" for reverse polarity
The positive and negative screw terminals of the installed N-Type MOSFET are located at the front-right of the PCB and is labelled “GENSTART-01”. The “-ve” terminal is always held at the PCB’s ground voltage (0V DC) whilst the “+ve” terminal switches between +5V DC and the ground voltage.
Should you need to directly access the MOSFET, it is a type 2N7000, installed at the front right of the PCB near the 5.5mm, 12V barrel inlet socket.
Security
The AlphaMon Platform includes a number of features designed to enhance security, including:
- LoRa WhiteListing
- Beacon Detection and Whitelisting
- User Accounts and Passwords
LoRa Whitelisting is typically used to ensure your mesh network only receives and accepts messages from pre-registered AlphaMon LoRa transmitters and rejects radio traffic from other AlphaMon or non-AlphaMon transmitters operating in the same area.
Each AlphaMon chip has an internal, 48-bit MAC address set by the chip manufacturer which uniquely identifies the device. The device’s MAC address is displayed by the AlphaMon’s Event Logging Service on start up and the full MAC address is also periodically sent in the LoRa transmission (Tx) data stream.
In addition, the least significant 16 bits of the transmitting AlphaMon’s MAC address is encoded into the header of each LoRa Tx data packet, as shown in the following Log example in which the “6B2C” is the sender’s abbreviated MAC address:
07Jan25 14:12:43 LoRaRx: DataIn=[6B2C:2:39:59.20:3A] RSSI=-95.00dBm SNR=10.75dB
If LoRa Whitelisting used at your site, each AlphaMon receiving (Rx) device should have a list of authorized MAC addresses in its Config File. The listed MAC addresses are loaded on start-up and checked against the LoRa radio traffic. Any data packets received from devices other than those approved MAC addresses are automatically rejected. You can learn how to edit your AlphaMon’s Config File here.
Although the LoRa chips (manufactured by Semtech) incorporated in the AlphaMon modules feature end-to-end AES128 encryption, mutual authentication and integrity protection, The AlphaMon Platform doesn’t currently enable these features. However, feel free to talk to us if your application and/or company policies require these features to be enabled.
Speech Recognition
The AlphaMon Platform includes a Speech Recognition Service which is capable of detecting and checking both spoken PIN numbers and Pass Phrases. When enabled, the service is used for authenticating user access to Config File settings.