,

A Gateway to IoT Monitoring

Lake Davenberg Avatar

·

For many businesses, implementing IoT monitoring solutions can be complex and expensive. However, with the Exo Sense Py Modbus and Modbus simulators, you can easily set up a robust IoT monitoring system at a fraction of the cost.

Installation

Installing Exo Sense Py Modbus is straightforward. Simply copy all the files from the repository into the flash memory of your Pycom device. This ensures that the monitoring app is ready to process Modbus requests.

User Guide

Once installed, the Exo Sense Py Modbus app will indicate its status through an LED light. A red light indicates startup, green means it’s ready to receive Modbus requests, and blue signifies that it’s in access point mode. To configure the app, you can access the config.py file through the module’s WiFi network. Connect to the IP address 192.168.4.1, using the specified credentials, to access the file via a web browser or an FTP client application.

Configuration

To configure Exo Sense Py Modbus, make changes in the config.py file and upload it back to the module. You can set it up as a Modbus RTU slave or a Modbus TCP server by modifying the MB_RTU_ADDRESS or MB_TCP_IP respectively. Setting values to both parameters will ignore the TCP configuration. If neither is specified, the app will boot in access point mode.

When configured as a Modbus TCP server, the configuration web interface and/or FTP server will be accessible at the specified IP address. If the module fails to connect to the specified WiFi, it will go into access point mode after the timeout period mentioned in the configuration.

Modbus Registers

Exo Sense Py Modbus provides various registers that support different Modbus functions. Here is a list of some of the available registers and their descriptions:

  • Address 101 and 102: Read digital inputs DI1 and DI2 respectively.
  • Address 201: Read and write digital output DO1.
  • Address 301: Read temperature in degrees Celsius.
  • Address 302: Read relative humidity in permil.
  • Address 303: Read atmospheric pressure in hPa.
  • Address 308: Read the IAQ (Indoor Air Quality) index.
  • Address 401: Write a pulse to the buzzer.

Integrations

Exo Sense Py Modbus can be integrated with various software products to enhance its functionality and compatibility with other systems. Here are three examples of integrations:

  1. Docker Integration:

    • Create a Dockerfile to package Exo Sense Py Modbus into a container.
    • Utilize docker-compose to set up the container along with other related services.
    • Example Dockerfile:
      #dockerfile
            FROM python:3.9
            WORKDIR /app
            COPY requirements.txt .
            RUN pip install -r requirements.txt
            COPY . .
            CMD ["python", "main.py"]
            
    • This integration allows for easy deployment and scalability of the monitoring system.
  2. MongoDB Integration:

    • Use pymongo to store the Modbus data into a MongoDB database.
    • Example Python code snippet:
      #python
            from pymongo import MongoClient
      
            client = MongoClient('mongodb://localhost:27017/')
            db = client['modbus_data']
            collection = db['exosensepy']
      
            # Save Modbus data to MongoDB
            def save_to_mongodb(data):
                collection.insert_one(data)
            
    • This integration enables long-term storage and efficient querying of Modbus data.
  3. FastAPI Integration:

    • Use FastAPI to create a RESTful API for accessing the Modbus data.
    • Example FastAPI code snippet:
      #python
            from fastapi import FastAPI
      
            app = FastAPI()
      
            @app.get("/modbus")
            def get_modbus_data():
                # Retrieve Modbus data from database or other source
                return {"data": "Modbus data"}
      
            @app.post("/modbus")
            def post_modbus_data():
                # Process Modbus data and store it in the database
                return {"message": "Data received and stored"}
            
    • This integration allows for easy data retrieval and integration with other services.

These integrations provide flexibility, scalability, and seamless interaction with other software systems. By combining Exo Sense Py Modbus with Docker, MongoDB, and FastAPI, you can create a powerful, reliable, and extensible IoT monitoring solution.

In conclusion, the integration of Exo Sense Py Modbus with Modbus simulators opens up a world of possibilities for IoT monitoring. With easy installation, user-friendly configuration, and a wide range of available Modbus registers, this solution is ideal for small to mid-sized businesses looking to implement cost-effective and efficient monitoring systems. By integrating with Docker, MongoDB, and FastAPI, you can further enhance the capabilities of Exo Sense Py Modbus and create a flexible, scalable, and future-proof solution for your IoT monitoring needs.

Leave a Reply

Your email address will not be published. Required fields are marked *