Simple solution to connect some sensors to any linux host via USB as a replacement for previously used Raspberry Pi´s GPIOs.

FloKra 73a405161f - added config option 'filterUnchanged' so that filtering on state change can be disabled now (pin state is sent by the MCU every minute by default - now this will be published every time on MQTT if filterUnchanged = False) 1 рік тому
HomeServerIOExt_Arduino 1b6aaed35f initial checkin 1 рік тому
ioext 73a405161f - added config option 'filterUnchanged' so that filtering on state change can be disabled now (pin state is sent by the MCU every minute by default - now this will be published every time on MQTT if filterUnchanged = False) 1 рік тому
CHANGELOG.txt 73a405161f - added config option 'filterUnchanged' so that filtering on state change can be disabled now (pin state is sent by the MCU every minute by default - now this will be published every time on MQTT if filterUnchanged = False) 1 рік тому
README.md 873ec76d6f update README.md 1 рік тому

README.md

HomeServerIOExt

When migrating my home control server from a Raspberry Pi to x86 hardware I needed an interface to connect some sensors (door contact, PIR sensors, temperature sensor) which were previously connected to the RPi´s GPIOs.

This simple solution consists of an Arduino Nano which is connected to the host via USB and a daemon written in Python which publishes the states over MQTT.

  • Arduino reads the sensors/IO-Pins and sends values/state changes via Serial
  • Python program runs as a daemon, receives the serial data and sends values/states to an MQTT broker

Installation

  • download/copy ioext directory to /home/pi/ioext
  • edit ioext.py - change configuration for serial, MQTT etc (serial should be accessed via /dev/serial/by-id/...)
  • if python3 and/or pip is not installed - install it as root: apt install python3 python3-pip
  • install requirements: pip install -r requirements.txt
  • chmod +x /home/pi/ioext/ioext.py
  • test it: ./ioext.py

install systemd service (as root):

  • cp /home/pi/ioext/ioext.service /usr/lib/systemd/system
  • systemctl daemon-reload
  • systemctl enable ioext
  • systemctl start ioext