Closed muscaiu closed 4 years ago
This library uses physical pinout mapping. GPIO17 becomes 11. You were trying to open pin 17 which is a power pin so it throws an error. Consult the pinout for further details
@codedealer thanks for answering!
With the switch in pair mode i tried pins 11, 13, 15 and i got auto-detect fail on all.
Any suggestions?
Maybe i should change something here? Livolo.sendButton(6400, 120);
As i mentioned before i have no clue how those codes work.
Judging from your picture it looks like you have a transmitter wired incorrectly, in particular power goes to data pin for some reason? Please recheck that wires are connected properly, then try writing from pin 11 again.
Would the pins in this diagram be correct? https://www.piddlerintheroot.com/rf-433-mhz/
I rechecked the labels and pins and took a new picture:
I think the pins are ok, since it works with the python code. Please look at the proof: https://vimeo.com/399711675
I don't know how does it work in python, in the scheme you linked the wiring is different. You have mixed up data and vcc wires which basically means instead of transmitting a binary sequence you transmit a steady uniform signal (by giving 5V to the data pin) and turning on and off the transmitter rapidly (by giving binary sequence to vcc pin).
The black wire which is power should go to the middle pin on transmitter, the white wire (physical pin 11) should go to the left pin. Consult the scheme you linked again.
@codedealer thanks for having patience and responding.
I switched the white and black wires like you said:
Pin: 11
WARNING: Hardware auto-detect failed, running in raspi-3 mock mode
sendButton: remoteID: 6400 keycode: 120
Yep, that's the issue. You have rpi 4 which is not supported by this version of library. Can you check if the simple dependency update will work?
Edit the line in package.json to contain "rpio": "^2.1.1"
which is the latest rpio available right now. Then update the library through npm update
. Now it should have rpi 4 in its hardware list.
If it works, I'll update the library.
Wow man i didn't have rpio installed at all. You should update the Readme to make sure ppl install it. I installed 2.1.1 and now i'm getting:
Pin: 11
sendButton: remoteID: 6400 keycode: 120
But the switch is not changing the state. I tested on 2 swicthes same thing.
Edit: I suppose i'm should add some of the codes mentioned in the readme, but like i said i have no clue how they work. Please give me an example of how could i change the state for 1 or even better multiple switches :D
rpio installs automatically when you install livolo package so you don't have to install it by yourself normally. The old version just didn't support rpi 4 which is the problem in your case.
The warning is gone so I'm taking it is working as intended.
remoteID
is the id of the virtual remote control. There are two types: small ones with 4 buttons and fullsized ones. 6400
is the id of a fullsized one. You can see the keycodes for fullsize remote in the very bottom of a readme.
keycode
is the id of a button on a given virtual remote control, so one remoteID
has several valid keycode
s, all of them are listed in the readme.
The typical workflow is the following:
remoteID: 6400 keycode: 120
which corresponds to fullsized virtual remote control and button no. 3.remoteID: 6400 keycode: 120
remoteID: 6400 keycode: 96
would correspond to button no. 2 on the same remote.You can continue adding switches to the same remoteId while you have valid button codes (in the readme). If you exhaust all of those you can always switch to a new remoteId and continue from step 1 with it.
The advantage of having all your switches on one remoteId (although you don't have to) is that you can send remoteID: 6400 keycode: 106
which corresponds to OFF
button and turn off all the switches that were paired to that remoteId simultaneously.
Thanks for the awesome explination man! I managed to have 2 switches working, which was my goal, still have some more tests to do, maybe i will add more questions in another thread if i have any.
Hello again.
I have a similar question to the other one but thought i would post more details here.
Using this exact python code i'm able to pair and switch on/off only one livolo switch by running
spawn('python', ["./livolo.py", 'on']);
from my node server. Still i have no idea what the codes are or how they are being built, but i still can only operate only 1 switch with this code.However i would really like to use a node library instead of python and also i would love to be able to turn pair, turn on/off multiple switches.
So i tried you example with multiple ports: For port 17 i get this error:
For port 22, 27 i get this error:
I don't have any remote, all i have is the receiver transmitter setup that works for the python code.
Can you tell what i'm doing wrong? I bought the damn things for 2 months and i'm still only able to operate only 1 switch and only by python code :( It's frustrating!