Closed mjalafoo closed 6 years ago
Try making your script files executable so one does not need to execute with bash command. chmod +x on.sh chmod +x off.sh chmod +x state.sh
It worked. Thanks a lot.
I had to do the following:
sudo chmod 777 on.sh
sudo chmod 777 off.sh
sudo chmod 777 state.sh
sudo chmod 777 on.py
sudo chmod 777 off.py
modified my config.json to have the full path for the files (/home/pi/on.sh) instead of (~/on.sh)
glad it worked! i added a note to make sure executable in the instructions. Might also add to make sure it's accessible by homebridge user.
Followed the guide exactly (example 1)
Placed the "on.sh" "off.sh" in "/home/pi/"![screen shot 2017-09-25 at 12 13 26 am](https://user-images.githubusercontent.com/31849948/30786432-08598556-a17e-11e7-9491-22f921f6f94a.png)
Both ON and OFF scripts are triggering a Python script to trigger PIface Digital 2 board (example below from ON script)![screen shot 2017-09-25 at 12 15 56 am](https://user-images.githubusercontent.com/31849948/30786446-543efcb2-a17e-11e7-8c83-178360d7500e.png)
Tested the scripts with BASH commands and they work just fine, they also create the "script.flag" file when running ON and delete that file when running OFF (python script runs ok too)![screen shot 2017-09-25 at 12 18 14 am](https://user-images.githubusercontent.com/31849948/30786469-c744c05c-a17e-11e7-8aab-15e40eb6cc22.png)
This is my config.json settings![screen shot 2017-09-25 at 12 24 36 am](https://user-images.githubusercontent.com/31849948/30786503-99478a58-a17f-11e7-97da-e814c2fc3dc4.png)
Below is a view on my debugging log in this one I switch on the accessory and I switch off the accessory (but of coarse the scripts do not run, as the IO in the Pi Face doesn't change state)![screen shot 2017-09-25 at 12 27 40 am](https://user-images.githubusercontent.com/31849948/30786525-03d1302c-a180-11e7-8ed2-8bceb6f3dcce.png)
It is worth noting that when I run the scripts using the BASH command (for example ON script) and it creates the "script.flag" the HomeKit accessory holds the ON STATE, and when I run the Off script using the BASH command and it deletes the "script.flag" the HomeKit Accessory changes to OFF state.
I am running Rasbian Jessie, below are the versions of the stack:
Please let me know if I am doing anything wrong.