Home‎ > ‎


Robotic Lawn Mover Logging & Control

posted 24 May 2015, 00:09 by Jan Larsson

The mission was to log the activity for the Robotic Lawn Mover to a database, to have a graph of the data and to be alerted by mail when needed, also to show the status on a wallmounted LCD.

A micro switch with a spring extention arm was mounted on the docing station. A cable run into the house and connects to a 1-wire DS2406 I/O board with pull-up resistor, reading the switch state open or closed. A bash script checks the status every 60s and compare the last state, when a change is detected a json command by curl is sent to update a Dummy Device in Domoticz representing the work activity for the Robotic Lawn mover.

Judo Score board DAT

posted 20 Jan 2014, 04:49 by Jan Larsson   [ updated 25 Jan 2014, 10:32 ]

Ett enkelt Excel program för att räkna poäng i Judo med tävlingssystemet DAT. (Douglas Alternativ Tävling)
Programmet kräver Microsoft Office Excel

Version 0.3
-extra tavla för extern skärm

Version 0.2
-markerar med rött när poängskillnaden överstiger 30p.
-Startar med 5 poäng för båda spelarna.

Fancy DoorBell

posted 15 Nov 2013, 11:11 by Jan Larsson

Ever wanted a more fancy doorbell? This is how to do it. You only need

1 Rasberry Pi with Domoticz
1 RFXcom
1 Nexa 433 MHz wireless doorbell.
1 HTPC with yaVDR

We will skip some parts and assume you got all the other stuff installed already. The Nexa Doorbell is installed in the Domoticz and named as a swtich 'DoorBell'.

1. set up ssh private and public keys so we don't need passwords.

2. From Domoticz server create a LUA script to trigg on the DoorBell

-- Jan Larsson 2013-11-15
-- Info@janlarsson.net

commandArray = {}

        if (devicechanged['DoorBell']) then
                print ('Door bell script executed')
                os.execute('sudo ssh root@ /home/user/door.sh')
return commandArray

3. On the yaVDR TV box create a script to notify about the doorbell, this script will mute the TV and echo a text on the screen. TV box IP is

svdrpsend VOLU mute
sleep 1
svdrpsend MESG "Door Bell!!!!"
svdrpsend MESG "Go open the door"
sleep 5
svdrpsend VOLU mute

4. done!

Splunk in the Cloud

posted 31 Jul 2013, 04:40 by Jan Larsson   [ updated 27 Sep 2013, 01:52 ]

Now you can use the logserver Splunk not only for free but also as a cloud service. If you're not familiar with splunk, it's the best log server ever created.

Check it out at http://www.splunkstorm.com

Using curl in a cronjob I now upload my 'access_combined' log every hour to get it indexed, very smooth and convenient.


ACCESS_TOKEN='<value from splunk API>'
PROJECT_ID='<value from splunk API>'
curl -u x:${ACCESS_TOKEN} ${ADDRESS} -H "Content-Type: text/plain" --data-binary @$FILENAME

Save the code as 'send_to_splunk.sh' and create a cronjob

# sudo crontab -e
# make it run every hour
00 * * * *    /path/send_to_splunk.sh

Android vulnerability CVE-2013-4787

posted 22 Jul 2013, 04:06 by Jan Larsson   [ updated 22 Jul 2013, 04:07 ]

A new nasty vulnerabilty has been found on all Andriod devices. The signature check can be bypassed allowing a malicious user to gain full control of the device.

Android version affected:  ALL versions from 1.6 


Download and install this app to check if your device is vulnerable and if you got any infected apps installed.


Lesson learned

posted 28 Feb 2013, 07:17 by Jan Larsson   [ updated 17 Jun 2013, 00:28 ]

My logging webpage is offline, due to hw crash. It seems like SD card can break, and that if you don't have backup all your coding work is lost. Sad but true, and all db with logs too. I'm a bit frustrated right now that I have not created a cronjob that takes backup of my db and my code.

#¤"!&/%(@@@#"! is what I have to say about that.

yaVDR 5.0

posted 18 Feb 2013, 04:47 by Jan Larsson   [ updated 18 Feb 2013, 07:02 ]

Reinstalled my HTPC with the latest version of yaVDR 5.0
Mounted a new SSD disk with more capacity. So far so good. A minor issue with the startup taking too long, the VDR-frontend process keeps respawning for 2 minutes before stabilize.

Protect yourself son, as mothers use to say.

posted 8 Feb 2013, 06:10 by Jan Larsson

Installed and configurerd fail2ban to protect my SSH deamon from attacks. It will check for failed password and user attempts and build  a iptable rule to block that IP for [bantime] minutes.

# sudo apt-get install fail2ban

Make som tuning in /etc/fail2ban/
fail2ban.conf - set log level
jail.conf - set bantime and maxretry

Attacks are logged in /var/log/fail2ban.log

Outdoor temp added

posted 28 Jan 2013, 13:35 by Jan Larsson   [ updated 29 Jan 2013, 06:47 ]

The outdoor temp is now in the system and being graphed. I also write the temp to a file that Switch King kan read as an external source and present in its app. Worked like a charm when the temp was below zero. When my 1-wire network presented positive numbers no + sign was written in the log and Switch King did not understand this... hmmm SMOP sloved it. (Small matter of programing)

#write to file for SwitchKing, add + if positive temp.
if [ ${Temp_ute:0:1} == "-" ]; then
        # Negative temp with minus sign already
        echo $Temp_ute > /var/www/temp_ute.log
        # positive temp without + sign  that we now add.
        echo $pos_temp_ute > /var/www/temp_ute.log

Light Sensor

posted 19 Jan 2013, 05:33 by Jan Larsson   [ updated 19 Jan 2013, 05:36 ]

The stage environment is now upp and running on a secondary Raspberry Pi with OWFS and 1-wire as well. One TSL252R Dallas 1-wire light sensor is now mounted and calibrated.

-Drill a hole in the concret wall from the computer room to the downstair toilet
-Drill a hole in the concret wll from the entrance to the heating pump room
-complete the 1-wire network from the computer room, through the toilet, via the entrance and into the heating room.
-mount an outdoor temperature sensor in the heating room via the old pipes for the oiltank.
-mount temperature sensors in the toilet.
-mount a fan to move air from the computer room into the toilet and control the fan by the temperature.

1-10 of 15