Raspberry docker image to sniff and remote control 433mhz sockets by rest interface
8.0K
Raspberry docker image to sniff and remote control 433mhz sockets by rest interface
Before using the service you have to find out the codes that your devices are listening to to make them turn on resp. off. Fire up a container to sniff the codes:
docker run --rm -it \
--name sniffy \
--privileged --cap-add SYS_RAWIO --device=/dev/mem \
hazard/rpi-433rc:latest sniff -g 27
You should see that the sniffing tool has started. If your gpio pin is not 27 (default), you can pass a different one. Push the buttons on your remote control like a madman and note the results for the different devices (on / off codes). If you are done Ctrl + C out of it.
Create a device.json file to configure your devices with the sniffed codes. Content should look similiar than this:
{
"device1": {
"code_on": 12345,
"code_off": 23456
},
"device2": {
"code_on": 66567,
"code_off": 45675
}
}
Where device1 and device2 are the actual names of the devices. Be creative ;-)
code_on and code_off are the actual codes you sniffed before.
docker run --rm \
--name rpi-433rc \
-p "5555:5000" \
-e CONFIG_DIR=/conf \
-e GPIO_OUT=17 \
-v <path/to/your/device.json>:/conf/devices.json \
--privileged --cap-add SYS_RAWIO --device=/dev/mem \
hazard/rpi-433rc:latest serve
You can change the GPIO_OUT if you are using a different one than me. Nicely done. Thanks to host port routing you should see the swagger ui when navigating to the url http://localhost:5555. Feel free to try the different endpoints.
Content type
Image
Digest
Size
90.1 MB
Last updated
over 7 years ago
docker pull hazard/rpi-433rc