This tiny app lets an iOS user control a relay board. To achieve this, it has a python part that uses the rpi.gpio library to control the GPIO of a RaspberryPI and NodeJS part that handles interfacing with the Homekit app.
There are a few prerequisites one that should be done first:
- make sure node & npm are installed
- make sure python is installed
- for out-of-the-box PIs I recommend you do an
crontab -efirst. That creates a crontab file for the user who executes it. - checkout the source at /home/pi/Desktop/workspace
- navigate to /home/pi/Desktop/workspace/rolling-shutter-homekit-controller/scripts
- give the installation file executing permissions (the +x part)
chmod +x install.sh - execute the install script with sudo rights (which the pi user usually already has)
Completely possible if you have node+npm and python installed. However, the rpi.gpio library is not available on Mac, so if you like to debug:
- checkout all the source;
- update the relay.py file:
- comment out the import of the library in relay
- comment out the GPIO calls
- start the python backend with
python app.py - install the packages with
npm install - start the node client
npm start
There are two outstanding issues as far as I know, but I don't have found the time yet to resolve those.
- Add node installation to install script
- When the pipe between Node and Python gets broken during an adjustment, the adjustment fails, and since the position is stored after the adjustment, the position is off.