==== Red Spring Remote Controller ====
* Raspberry Pi v2
* NooElec NESDR Nano 2+ Tiny RTL-SDR
* IEEE802.3af PoE 48V to 5V (2.4A) Micro USB adapter
* [[https://www.waveshare.com/wiki/RPi_Relay_Board|Waveshare PRi Relay Board]]
==== BCM2835 ====
> wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.68.tar.gz
> tar zxvf bcm2835-1.68.tar.gz
> cd bcm2835-1.68/
> sudo ./configure && sudo make && sudo make check && sudo make install
> cd ~
==== wiringPi ====
> git clone https://github.com/WiringPi/WiringPi
> cd WiringPi
> ./build
> gpio -v
==== Demo ====
> wget https://www.waveshare.com/w/upload/0/0c/RPi_Relay_Board.zip
> unzip -o RPi_Relay_Board.zip -d ./RPi_Relay_Board
> sudo chmod 777 -R RPi_Relay_Board
> cd RPi_Relay_Board
> cd shell
> sudo ./Relay.sh CH1 ON
> sudo ./Relay.sh CH1 OFF
> cd ..
> cd bcm2835
> make
> sudo ./Relay_Module
> cd ..
> cd wiringPi
> make
> sudo ./Relay_Module
> cd ..
> cd python
> sudo python Relay_Module.py
==== rtl-sdr ====
> sudo apt-get install -y cmake pkg-config libusb-1.0
> sudo apt-get install git
> git clone git://git.osmocom.org/rtl-sdr.git
> cd rtl-sdr/
> mkdir build
> cd build
> cmake ../ -DINSTALL_UDEV_RULES=ON
> make
> sudo make install
> sudo ldconfig
Edit /etc/modprobe.d/raspi-blacklist.conf
blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830
Edit /etc/rc.local
sleep 10
_IP=$(hostname -I) || true
if [“$_IP”]; then
printf”My IP address is %s\n” “$_IP”
/usr/local/bin/rtl_tcp -a $_IP &
fi
exit 0
Create firewall service for rtl_tcp
> sudo nano /etc/firewalld/services/rtl_tcp.xml
rtl_tcp
rtl_tcp
> sudo chmod 640 /etc/firewalld/services/rtl_tcp.xml
> sudo firewall-cmd --permanent --add-service=rtl_tcp
Create firewall service for MQTT
> sudo nano /etc/firewalld/services/mqtt.xml
mqtt
mqtt
> sudo chmod 640 /etc/firewalld/services/mqtt.xml
> sudo firewall-cmd --permanent --add-service=mqtt