Skip to content

BeamOS – Modbus

BEAM OS Logo

Summary #

Modbus is a serial communications protocol. Simple and robust, it has become a de facto standard communication protocol and is now a commonly available means of connecting industrial electronic devices. This chapter is an overview of the Modbus TCP functionality for BEAM devices.

Modbus TCP #

Modbus TCP provides users with the possibility to set or get system parameters. The Modbus daemon acts as slave device. That means it accepts connections from a master (client) and sends out a response or sets some system related parameter in accordance with the given query.

The figure below is an example of the Modbus TCP window section and the table below provides information on the fields contained in that window:

BeamOS services modbus modbus tcp screen

Field NameValueDescription
Enableyes | no; default: noTurns Modbus TCP on or off.
Portinteger [0..65535]; default: noneTCP port used for Modbus communications.
Allow Remote Accessyes | no; default: noAllows remote Modbus connections by adding an exception to the device’s firewall on the port specified in the field above.
Mobile Traffic Usage Loggingyes | no; default: noEnables Mobile Traffic Usage Logging (can also be enabled from Status → Mobile Traffic → Configuration).
This is required in order to read mobile data usage information from Modbus registers.

Get Parameters #

Modbus parameters are held within registers. Each register contains 2 bytes of information. For simplification, the number of registers for storing numbers is 2 (4 bytes), while the number of registers for storing text information is 16 (32 bytes). The register numbers and corresponding system values are described in the table below:

required valueregister numbernumber of registersrepresentation
System uptime1232 bit unsigned integer
Mobile signal strength (RSSI in dBm)3232 bit integer
System temperature (in 0.1 °C)5232 bit integer
System hostname716Text
GSM operator name2316Text
Router serial number3916Text
LAN MAC address5516Text
Router name7116Text
Currently active SIM card slot8716Text
Network registration info10316Text
Network type11916Text
Current WAN IP address1391632 bit unsigned integer
data usage values*
Mobile data received today135232 bit integer
Mobile data sent today137232 bit integer
Mobile data received this week141232 bit integer
Mobile data sent this week143232 bit integer
Mobile data received this month145232 bit integer
Mobile data sent this month147232 bit integer
Mobile data received in the last 24 hours149232 bit integer
Mobile data sent in the last 24 hours151232 bit integer
Mobile data received in the last 7 days153232 bit integer
Mobile data sent in the last 7 days155232 bit integer
Mobile data received in the last 30 days157232 bit integer
Mobile data sent in the last 30 days159232 bit integer

 * All received/sent data usage values are returned in kibibytes (KiB), which is an ISQ standard accepted by most major standard organizations.
1 kibibyte (KiB) = 210 bytes = 1024 bytes
1 mebibyte (MiB) = 210 kibibytes (KiB) = 220 bytes = 1 048 576 bytes

Get Parameters #

The Modbus daemon can also set some device parameters. These parameters and explanations on how to use them are described in the table below:

value to setregister numberregister valuedescription
Switch WiFi (ON/OFF*)2101 | 0Turns WiFi ON or OFF
Switch mobile data connection (ON/OFF*)2111 | 0Turns mobile data connection ON or OFF
Change APN213 APN codeChanges APN.
The number of input registers may vary depending on the length of the APN, but the very first byte of the set APN command has to be specified as 1
Reboot2201Reboots the router

* All ON/OFF commands only accept 0 and 1 values, which represent the following:

  • 1 – ON
  • 0 – OFF

Powered by BetterDocs

SAVE

10%

It only takes a few seconds

DON'T MISS OUT

SUBSCRIBE AND SAVE 10%

GET EXCLUSIVE OFFERS AND THE LATEST PRODUCT NEWS.

WE WILL GIVE YOU A 10% OFF VOUCHER CODE FOR YOUR NEXT ORDER AS A THANK YOU!

Website-Subscription-Opt-in