No description
  • C 97.4%
  • CMake 1.6%
  • Shell 1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-08-09 08:29:11 +02:00
.vscode feat: add doxygen headers to all functions 2025-07-19 09:10:05 +02:00
boards feat: Implement Homeassistant MQTT Gateway 2025-07-20 08:30:33 +02:00
src feat: Implement Homeassistant MQTT Gateway 2025-07-20 08:30:33 +02:00
.gitignore Initial commit: Set up Zephyr MQTT project 2025-07-17 08:49:06 +02:00
CMakeLists.txt feat: add doxygen headers to all functions 2025-07-19 09:10:05 +02:00
Kconfig feat: add doxygen headers to all functions 2025-07-19 09:10:05 +02:00
prj.conf feat: Implement Homeassistant MQTT Gateway 2025-07-20 08:30:33 +02:00
README.rst feat: Implement Homeassistant MQTT Gateway 2025-07-20 08:30:33 +02:00
run_sim.sh feat: Implement Homeassistant MQTT Gateway 2025-07-20 08:30:33 +02:00
test.x test 2026-08-09 08:29:11 +02:00

.. SPDX-License-Identifier: Apache-2.0

############################
Modbus MQTT Gateway
############################

Overview
********

This Zephyr application serves as an MQTT gateway, primarily designed to bridge Modbus devices with a Home Assistant instance. It connects to a WiFi network, obtains an IP address, and communicates with an MQTT broker.

Features
********

- **WiFi Connectivity**: Connects to a specified WiFi network using credentials provided via Kconfig.
- **Network Configuration**: Supports both DHCP and static IP addressing for flexible network integration.
- **MQTT Integration**: Configured to communicate with an MQTT broker, with specific options for Home Assistant discovery.
- **Configurability**: All major parameters, including WiFi, network, and MQTT settings, are configurable through Kconfig.
- **Simulation Support**: Includes a script and configuration for running in a simulated environment (`native_sim`).

Configuration
*************

The application is configured using Kconfig. Key options can be found in the "Home Assistant MQTT Options" menu.

- **WiFi Settings**:
  - `CONFIG_WIFI_SSID`: The SSID of the WiFi network.
  - `CONFIG_WIFI_PASSWORD`: The password for the WiFi network.

- **Network Settings**:
  - `CONFIG_NET_DHCP`: Enable or disable DHCP.
  - `CONFIG_NET_IP_ADDR`: Static IP address.
  - `CONFIG_NET_IP_MASK`: Static IP netmask.
  - `CONFIG_NET_IP_GATEWAY`: Static IP gateway.
  - `CONFIG_NET_DNS_SERVER`: Static DNS server.

- **MQTT Broker Settings**:
  - `CONFIG_HA_MQTT_BROKER_HOSTNAME`: Hostname or IP of the MQTT broker.
  - `CONFIG_HA_MQTT_BROKER_PORT`: Port of the MQTT broker.
  - `CONFIG_HA_MQTT_USERNAME`: Username for MQTT authentication.
  - `CONFIG_HA_MQTT_PASSWORD`: Password for MQTT authentication.

- **Home Assistant Device Info**:
  - `CONFIG_HA_MQTT_NAME`: Device name.
  - `CONFIG_HA_MQTT_MANUFACTURER`: Manufacturer name.
  - `CONFIG_HA_MQTT_MODEL`: Model name.

Building and Running
********************

**Building for Hardware (e.g., ESP32-C6)**

.. code-block:: shell

   west build -b esp32c6_devkitc_hpcore

**Running in Simulation**

A simulation can be run using the provided script:

.. code-block:: shell

   ./run_sim.sh

This will build and run the application for the `native_sim` target.