This project is ultimately an expansion of existing projects that are around the house. Currently I have a Raspberry Pi that is a control hub for IR devices and RF switches. This control hub hosts a rest api that can take commands as http post requests. This is nice, because any device (i.e. my phone) can post to the control hub and end up controlling the device. This was originally really nice, and still is, but having been in use now for a year or so, I have found that I rely on this system more and more. So, I wanted to build a free standing remote that could be used anywhere in the house and still communicate with the control hub. Hence, the omega_mote...
omega_mote is a node js application that utilizes a few different classes.
The omega_mote contains a gpio wrapper (customGPIO) written in JavaScript that interacts with the /sys/class/gpio path and files. These files allow you to change the direction of the gpio, read the value, set the value, lock and unlock the pin.
There is a config.json file that defines the user buttons and the address to http post to.
The omega_mote main class loads the configuration file, and controls the customGPIO class. Using the configuration file the omega_mote initializes the gpio pins specified and listens on those pins, when a change is detected, the omega_mote performs an http post to the address that is specified in the config file.
Improvements
- Detect double clicks on buttons as that would effectively double the number of buttons you had.
- Config file could specify high or low pin.