Closed ohadpr closed 6 years ago
Hmmm... not one I’ve seen before! 9 should be an integer!
Can you try stopping Homebridge, deleting the cachedAccessories file and restarting?
(Other closed issues describe how to do this in more detail)
Thanks, the pin should indeed have been an integer, homebridge now runs and doesn't complain.
My challenge now I suppose is pin mapping or perhaps I'm doing something else incorrectly.
I previously used the onoff GPIO library and utilized pin 21 (also pin 21 physically on the board).
Here's the readout from gpio readall
:
+-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| | | 3.3v | | | 1 || 2 | | | 5v | | |
| 2 | 8 | SDA.1 | IN | 1 | 3 || 4 | | | 5v | | |
| 3 | 9 | SCL.1 | IN | 1 | 5 || 6 | | | 0v | | |
| 4 | 7 | GPIO. 7 | IN | 1 | 7 || 8 | 0 | IN | TxD | 15 | 14 |
| | | 0v | | | 9 || 10 | 1 | IN | RxD | 16 | 15 |
| 17 | 0 | GPIO. 0 | IN | 0 | 11 || 12 | 0 | IN | GPIO. 1 | 1 | 18 |
| 27 | 2 | GPIO. 2 | IN | 0 | 13 || 14 | | | 0v | | |
| 22 | 3 | GPIO. 3 | IN | 0 | 15 || 16 | 0 | IN | GPIO. 4 | 4 | 23 |
| | | 3.3v | | | 17 || 18 | 0 | IN | GPIO. 5 | 5 | 24 |
| 10 | 12 | MOSI | IN | 0 | 19 || 20 | | | 0v | | |
| 9 | 13 | MISO | OUT | 0 | 21 || 22 | 0 | IN | GPIO. 6 | 6 | 25 |
| 11 | 14 | SCLK | IN | 0 | 23 || 24 | 1 | IN | CE0 | 10 | 8 |
| | | 0v | | | 25 || 26 | 1 | IN | CE1 | 11 | 7 |
| 0 | 30 | SDA.0 | IN | 1 | 27 || 28 | 1 | IN | SCL.0 | 31 | 1 |
| 5 | 21 | GPIO.21 | IN | 1 | 29 || 30 | | | 0v | | |
| 6 | 22 | GPIO.22 | IN | 1 | 31 || 32 | 0 | IN | GPIO.26 | 26 | 12 |
| 13 | 23 | GPIO.23 | OUT | 0 | 33 || 34 | | | 0v | | |
| 19 | 24 | GPIO.24 | IN | 0 | 35 || 36 | 0 | IN | GPIO.27 | 27 | 16 |
| 26 | 25 | GPIO.25 | IN | 0 | 37 || 38 | 0 | IN | GPIO.28 | 28 | 20 |
| | | 0v | | | 39 || 40 | 0 | OUT | GPIO.29 | 29 | 21 |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM |
+-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+
From what I understand I need to specify the BCM pin which in my case corresponds to pin #9 (I also tried #13 to no avail).
Here's how I used to trigger this with onoff:
var gpio = require('onoff').Gpio;
var sig = new gpio(21, 'out');
...
sig.writeSync(1);
setTimeout(function(){
sig.writeSync(0);
}, 5000);
Any hunch on what I may be doing incorrectly? tnx
AFAIK, onoff uses the same pin notation as this module - so try setting 21 in your config
You can also try with the wiringPi gpio tool, which can be easier than restarting homebridge each time. (And clearing cachedAccessories if you’ve changed the pin). The -g option let’s you specify BCM numbers:
gpio -g mode 21 out
gpio -g write 21 1
Couldn't have been easier, thanks.
It is surprising though that the documentation for this module mentions multiple time that the pin specification should be BCM and informed by running gpio readall
while it ends up accepting the physical pin notation.
At any rate thanks for the help and I'm glad this is documented for other people.
Initialization works great
But as loading process unfolds I get a crash:
Here's my config:
And here are the versions I have of all the packages: