Skip to main content
Modbus Setup Guide

This guide explains how to set up Atmocube for Modbus connectivity.

Updated over 2 weeks ago

Overview

Modbus is a widely used serial communication protocol known for its ease of deployment and maintenance. It is commonly found in industrial automation, building management systems (BMS), and environmental monitoring applications.

Atmocube supports two Modbus implementations:

  • Modbus TCP/IP – Operates over Ethernet (via the Ethernet port) or Wi-Fi.

  • Modbus RTU – Operates over an RS-485 connection via the dry contact input module on the back of the device.

The minimum frequency of Modbus requests is 1 second and the recommended frequency is 2 seconds or more.


1. Enabling Modbus on Atmocube

By default, Modbus is disabled. You can enable it using either (click to enlarge):

Method 1: Via USB using the Atmocube Configuration Tool

Enabling Modbus RTU

  1. Open the configuration menu and click on the RS-485 tab.

2. Check the Enabled option.

3. Configure the following parameters:

  • Device ID (1-247, must be unique within the RS-485 line).

  • Baud Rate

  • Data Bits

  • Parity (Options: Odd, Even, None—default is "None").

  • Stop Bits

4. Ensure all devices on the RS-485 line have the same settings, except for Device ID.

Enabling Modbus TCP/IP

1. Open the configuration menu and click on the Modbus IP tab.

2. Check the Enabled option.

3. Enter the Modbus IP (TCP) port (default: 502, allowed range: 0–65535).

Note: If you intend to use Modbus on a local network without an internet connection, disable MQTT by going to the MQTT tab and unchecking the Enabled option.

Applying Configuration via USB

Once Modbus configuration settings using the Atmocube Configuration Tool are ready, follow these steps to apply the configuration using a USB flash drive:

  1. Select the Atmocube model code (SKU) in the Configuration Tool.

  2. Click Generate Config to create a config.json file.

  3. Save the config.json file to the root of a USB flash drive (formatted as FAT).

  4. Disconnect Atmocube from power.

  5. Insert the USB flash drive into the USB-A slot on the device.

  6. Reconnect Atmocube to power.

  7. Wait for the power status LED to turn solid purple, indicating the USB has been detected.

  8. Remove the USB flash drive.

Method 2: Using the Atmotube Dashboard (requires registering the device first)

You must first register your Atmocube device on the Atmotube Dashboard. Follow these steps outlined in: Atmocube Cloud Dashboard

1. Go to Atmotube Dashboard > Devices.

2. Click Edit Device.

3. Navigate to Device Diagnostics.

4. Check Enable for Modbus RTU and Modbus IP.

5. Fill in the required configuration details.


2. Testing the Modbus TCP/IP and RTU connection via Python Script

Please find the example code and input register format at the link here: https://github.com/atmotube/atmocube-levoit-demo


3. Testing the Modbus connection via Modbus Poll (Windows only)

Download and install Modbus Poll.

3.1 Modbus TCP/IP connection settings

Open the Connection menu and choose Connect from the submenu. Configure the Modbus TCP/IP connection in the following way:

3.2 Modbus RTU connection settings

Open the Connection menu and choose Connect from the submenu. Configure the Modbus RTU connection in the following way:

3.3 Reading data

Download the template file here for setup and open it by going to the File menu and choosing Open from the submenu. Or set up registers manually.

For manual setup, open the Setup menu and choose Read/Write Definition… from the submenu.

All data will be fetched in raw format:

The user manual for Modbus Poll is available here.

Did this answer your question?