- Forum
- Software discussions
- Arduino Code
- Connecting Geiger Counter for Arduino and Raspberry Pi to radmon.org
Connecting Geiger Counter for Arduino and Raspberry Pi to radmon.org
5 years 9 months ago - 5 years 9 months ago #4326
by pilovis
Replied by pilovis on topic Connecting Geiger Counter for Arduino and Raspberry Pi to radmon.org
Just to improve the system and get notification every time the CPM reading goes above a certain limit.
I choosed to get notification by XMPP since I've got my own personal XMPP server, but you can easily change the code and get notification by SMS or/and by email.
To install a simple XMMP client on Raspberry do the following:
then create config file for sendxmpp:
note: change "This email address is being protected from spambots. You need JavaScript enabled to view it." and "mypassword" with your credentials
Bash code modified (see previous posts):
I choosed to get notification by XMPP since I've got my own personal XMPP server, but you can easily change the code and get notification by SMS or/and by email.
To install a simple XMMP client on Raspberry do the following:
su - root
apt-get install sendxmpp
then create config file for sendxmpp:
su - root
echo "me@myjabberserver.com mypassword" >> ~/.sendxmpprc
chmod 700 ~/.sendxmpprc
cp -v ~/.sendxmpprc /etc/sendxmpprc
Bash code modified (see previous posts):
#!/bin/bash
# send data to radmon.org and send notification for alarm state
#
# SBM-20 tube conversion factor from uSv/h to CPM
conv=361
# read last value from csv file generated by the instrument
line="$(/usr/bin/tail -n 1 /tmp/readings.csv | cut --complement -c 1-31 | cut --complement -c 9-14 | sed -e 's/,/ /g')"
# calculations to get CPM from uSv/h
line2="$(echo "$line*$conv" | bc)"
line3="$(echo $line2 | awk '{print int($1+0.5)}')"
# send data to radmon.org
user="my_radmon_username"
password="mypasswd"
exec=`wget -O /dev/null "http://radmon.org/radmon.php?function=submit&user=$user&password=$password&value=$line3&unit=CPM"`
/bin/sleep 5
##### alarm notification section #####
# notify alarm by XMPP if CPM > 75
alarm=75
if [ $line3 -gt $alarm ];
then
echo "Alarm CPM = "$line3 | sendxmpp -s hello me@myjabberserver.com
else
echo "everything is normal" > /dev/null 2>&1;
fi;
Last edit: 5 years 9 months ago by pilovis.
The following user(s) said Thank You: mw0uzo
Please Log in or Create an account to join the conversation.
2 years 7 months ago - 2 years 7 months ago #6098
by pilovis
Replied by pilovis on topic Connecting Geiger Counter for Arduino and Raspberry Pi to radmon.org
Last edit: 2 years 7 months ago by pilovis.
The following user(s) said Thank You: mw0uzo
Please Log in or Create an account to join the conversation.
Moderators: Gamma-Man
- Forum
- Software discussions
- Arduino Code
- Connecting Geiger Counter for Arduino and Raspberry Pi to radmon.org
Time to create page: 0.142 seconds