My tips on raspberry (it works great for me!).
I have no particular problems with this environment... rtl_433 works just great!
Do a
> apt-get update; apt-get upgrade; apt-get dist-upgrade;
> rpi-upgrade
Add a user to dialout (I like to run rtl_433 as a user)
sudo adduser my_rtl433_user dialout
I add my script in a crontab (crontab -e)
@reboot /home/my_rtl433_user/startRtl433.sh >>/tmp/rtl433.log
Not the "best way" to do it... but I'm quite happy with it.
In my startRtl433.sh, I have
--------------
#/usr/bin/sh
cd /home/my_rtl433_user/
while true; do
echo "starting command"
rtl_433 -F "mqtt://10.0.0.60,events=/gabpi2/events,devices=/gabpi2/devices"
sleep 5
done
---------------
Another "magical" command is
nohup
In my "root" crontab, I have 2 useful commands not directly related.
@reboot /root/data/boot-lowenergy.sh > /dev/null
30 * * * * /root/data/check-inet.sh > /dev/null
----------------
This script shut down the hdmi interface (0.5 watts...)
in boot-lowenergy.sh
#/usr/bin/sh
#echo date
now=`date +%Y.%m.%d\ %H:%M:%S`
echo $now >"/root/reboot.txt"
# Shutdown TV service
/opt/vc/bin/tvservice -o
# Stop swap
swapoff -a
# Don't work on old RPB - Switch off power led - may be reversed on some RPI!!
# See:
http://www.jeffgeerling.com/blogs/jeff-geerling/controlling-pwr-act-leds-raspberry-piecho 0 | sudo tee /sys/class/leds/led0/brightness
echo 0 | sudo tee /sys/class/leds/led1/brightness
# Create ramdisk
rm -rf /tmp/ram
mkdir /tmp/ram
mount -t ramfs -o size=16M ramfs /tmp/ram
--------------------
This script restart the wlan interface if disconnected (I have issues with some of the RPI).
in check-inet.sh
Don't forget to change the IP of your router.
#/usr/bin/sh
ping -c1 10.0.0.1 > /dev/null
if [ $? != 0 ]
then
# If you want to restart the RPI.
#sudo /sbin/shutdown -r now
/sbin/ifdown 'wlan0'
sleep 5
# you can remove this line... create a "blinking red" led effect on my RPI
# python /root/bin/led/lederror.py
/sbin/ifup --force 'wlan0'
sleep 5
fi
# Update local time
ntpdate
pool.ntp.org-------------------
It's a set of "tips"... but resolve some issues for me!
(I have some RPI cameras running since 4-5 years...)
It will keep you process in the background if you run it manually.
Best regards,
Gab