Tag Archive: Raspi

Further to several posts about Raspberry Pi Digital Signage driving our office screens (https://tickett.wordpress.com/2014/12/03/anonymous-authentication-sql-server-reporting-services/), we recently restructured SQL Server Reporting Services. We updated the html/javascript file the Pi looks at (which redirects to SSRS) but it continued to try and use the old path.

This was fixed by SSH to the Pi then delete the browser cache;

pi@raspberrypi ~ $ cd /home/pi/.cache/chromium/Default/Cache/
pi@raspberrypi ~/.cache/chromium/Default/Cache $ rm -R *
pi@raspberrypi ~/.cache/chromium/Default/Cache $ sudo reboot

The first project I backed on Kickstarter was delivered some time back but I’ve only recently gotten around to trying to do something with it.

I have a bunch of JeeNodes from JeeLabs and wanted to use them as a starting point so read a few articles about getting the RFM12B on the EVE talking to the Raspberry Pi. They suggest bridging CE1 to SS RFM12 and bridging G21/G27 to the third pin of the chip which appears to be FSK/DATA/nFFS (according to the data sheets I’ve seen)- oh and don’t forget to add an antenna!

I then found some code suggested to be working on the older v1 raspi with an RFM01 chip fitted rather than the RFM12B I have: http://www.susa.net/wordpress/2012/08/raspberry-pi-reading-wh1081-weather-sensors-using-an-rfm01-and-rfm12b/

Another site gave some pointers around modifying the code for the v2 raspi: http://amcc.me.uk/2013/01/eve-alpha-collects-weather-data/

The setup seems to work very well with either revision (1 or 2) of the Raspberry Pi though a couple of additional lines of code in wh1080_rf.c need to be tweaked to suit revision 2:

// RPi (Rev1) Init GPIO21 (on pin 13) as input (DATA), GPIO22 (pin 15) as output (nRES)
*(gpio.addr + 2) = (*(gpio.addr + 2) & 0xfffffe07)|(0x001 << 6);
// RPi (Rev2) Init GPIO27 (on pin 13) as input (DATA)
*(gpio.addr + 2) = (*(gpio.addr + 2) & 0xff1fffff)|(0x001 << 6)
// RPi (Rev1) - GPIO21
status = ((*(gpio.addr + 13)) >> 21) & 1;
// RPi (Rev2) GPIO27
status = ((*(gpio.addr + 13)) >> 27) & 1;

I then went on to comment the RFM01 definition in rfm01.h and uncomment the RFM12B definition:

//#define RFM01
#define RFM12B

I also added the following definitions for the RFM12B as without them the code wouldn’t compile:

#define LNA_20 (3 << 4)
#define LNA_14 (1 << 4)
#define LNA_6 (2 << 4)
#define LNA_0 (0 << 4)
#define LNA_XX (3 << 4)

Remove this line from wh1080_rf.h:

#define USE_BMP085

Then onto the main wh1080_rf.c starting with updating to the correct spi port:

static const char *device = "/dev/spidev0.1";

I then used http://tools.jeelabs.org/rfm12b to get all the hex values to update the following lines:

uint16_t cmd_drate = 0xC606;
uint16_t cmd_freq = 0xA640;
uint16_t cmd_config= 0x80e7;
uint16_t cmd_power= 0x82dd;
uint16_t cmd_sync= 0xced4;
uint16_t cmd_afc= 0xc483;
uint16_t cmd_dcycle = 0xc800;
uint16_t cmd_pll= 0xcc57;
uint16_t cmd_fifo= 0xca83;
uint16_t cmd_dfilter = 0xc2ac;

Now when I:

make clean
sudo ./wh1080_rf

Initialising RFM12b
SPI: mode 0, 8-bit, 1000 KHz
Ctrl+C to exit
LNA_0,RSSI_73 idx 0 0.00 0.00 0.00 0.00 0.00 0.00
LNA_0,RSSI_79 idx 1 0.00 0.00 0.00 0.00 0.00 0.00
LNA_0,RSSI_85 idx 2 0.00 0.00 0.00 0.00 0.00 0.00
LNA_0,RSSI_91 idx 3 0.00 0.00 0.00 0.00 0.00 0.00
LNA_0,RSSI_97 idx 4 0.00 0.00 0.00 0.00 0.00 0.00
LNA_0,RSSI_103 idx 5 4.21 5.32 4.17 3.26 4.21 5.26
LNA_6,RSSI_73 idx 6 0.00 0.00 0.00 0.00 0.00 0.00
LNA_6,RSSI_79 idx 7 0.00 0.00 0.00 0.00 0.00 0.00
LNA_6,RSSI_85 idx 8 0.00 0.00 0.00 0.00 0.00 0.00
LNA_6,RSSI_91 idx 9 0.00 0.00 0.00 0.00 0.00 0.00
LNA_6,RSSI_97 idx 10 0.00 0.00 0.00 0.00 0.00 0.00
LNA_6,RSSI_103 idx 11 4.21 6.32 5.21 4.26 5.38 4.26
LNA_14,RSSI_73 idx 12 0.00 0.00 0.00 0.00 0.00 0.00
LNA_14,RSSI_79 idx 13 0.00 0.00 0.00 0.00 0.00 0.00
LNA_14,RSSI_85 idx 14 0.00 0.00 0.00 0.00 0.00 0.00
LNA_14,RSSI_91 idx 15 0.00 0.00 0.00 0.00 0.00 0.00
LNA_14,RSSI_97 idx 16 0.00 0.00 0.00 0.00 0.00 0.00
LNA_14,RSSI_103 idx 17 5.26 5.26 4.21 5.21 5.26 4.35
LNA_20,RSSI_73 idx 18 0.00 0.00 0.00 0.00 0.00 0.00
LNA_20,RSSI_79 idx 19 0.00 0.00 0.00 0.00 0.00 0.00
LNA_20,RSSI_85 idx 20 0.00 0.00 0.00 0.00 0.00 0.00
LNA_20,RSSI_91 idx 21 0.00 0.00 0.00 0.00 0.00 0.00
LNA_20,RSSI_97 idx 22 0.00 0.00 0.00 0.00 0.00 0.00
LNA_20,RSSI_103 idx 23 4.30 5.26 4.21 5.26 5.26 4.35
RSSI Duty 0.32


So the “interference” I can see suggests that something is hopefully working! I’m still playing around in an attempt to work out what I still need to tweak.


At long last I found the time to get Gambas2 compiled and running on Raspberry Pi with Raspbian Wheezy and DomotiGa (http://domotiga.nl).

Things were made extra hard by my determination to not expand the 2GB rootfs so I had to strip some stuff out- but it does mean you can restore to any SD card 2GB or larger.

SSH is enabled but I didn’t put vncserver on this time.

I didn’t document the process- but essentially kept trying to


gambas2 and each time an error came up I used http://www.debian.org/distrib/packages to try and determine what I needed to install. Because of the lack of free space I had to wget and

dpkg –I

to install many of the packages- I couldn’t use


. I used

df –h

to check on free space as I went and

find / -type f -size +5000k

to find and remove large files (cache/docs etc).

Shell login: pi
Shell password: raspberry
Mysql root password: raspberry





Please let me know how you get on!



As usual- I have far too many projects on the go, but here’s a sneak peak of one that’s currently edged to the top of "the list":

My intention is to try and fit:

  • At least one with a raspberry pi and some for of MAME style emulator and 2 sets of joystick/arcade controllers
  • At least one with a touchscreen running some form of SWP / itbox style pub quiz machine software (monopoly, bullseye, spot the difference etc)
  • Possibly one with a console xbox/playstation as I seem to recall having a fairly successful emulator disc with a ton of games already working without any real work required

Firstly I will be ripping the CRT screen / monitor out of them all, and all/most of the wiring. I have ordered a few different 19" 4:3 flat panel LCD monitors to try fitting, a few different video adapters and a few "arcade style" controllers I hope to be able to re-use. I have only opened one up so far and was pleasantly surprised how accessible everything was:

Also there appears to be a relatively common looking motherboard/hard-drive combination with relatively standard VGA ports etc- so I may even try hooking it up and see if the old thing has any life in it? No idea what operating system/software might be on there (I picked them up as non-working for parts).

There’s a thread on the Raspberry Pi forum I’ve been following: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=35&t=6813 so hopefully it won’t be long before Raspbian has a nice compiled MAME binary and frontend. I have also been playing with some itbox style swp emulators and roms with quite a high level of success (unfortunately they appear to all be for winxp/7):

Who wants to be a millionaire. And:

Spot the difference :)

I eagerly await delivery of my various eBay purchases!


*EDIT* This image has now been succeeded by a Raspbian / Wheezy based image: My raspbian SD image is now available: https://tickett.wordpress.com/2012/08/16/raspbian-wheezy-gambas2-domotiga/

After an earlier post https://tickett.wordpress.com/2012/06/05/domotiga-running-on-raspberry-pi/ I received a few requests for the sd card image. So here it is.

The following are all the login/passwords you may need:

login: pi/raspberry
msql: root/raspberry
vnc: raspberry

This is based on the official Raspberry Pi debian squeeze image, with the following additional items installed:

ssh enabled

It just fits on a 2 GB card:

pi@raspberrypi:~/domotiga$ df -H
Filesystem Size Used Avail Use% Mounted on
tmpfs 98M 0 98M 0% /lib/init/rw
udev 11M 148k 11M 2% /dev
tmpfs 98M 0 98M 0% /dev/shm
rootfs 1.7G 1.5G 60M 97% /
/dev/mmcblk0p1 79M 29M 50M 37% /boot

All packages have been upgraded to their latest stable version from the squeeze repository.

If you don’t know how to get into the guy, you can either login to the console then run:


Or via ssh run:

vncserver :1 –geometry 1024x728 –depth 16

Then use any vnc client to connect to the desktop. Now execute gambas2 from the run menu:

I have already opened the DomotiGa project so just click on it:

Click "Run" from the toolbar, Debug menu or press F5:

Download links:





Let me know how you get on!


Last post today, I promise!

After my breakthrough earlier getting gambas2 working in debian on one of my Raspberry Pis, then getting DomotiGa running I’ve managed to hook a jeenode up to the pi running the rf12demo sketch and it’s automatically picked up my jeenode running the roomnode.3 sketch:

So much to do, so little time!

The great thing is the data is now being stored in mysql hopefully in just the right way to allow the sort of querying & reporting I want to be able to do (and the main reason I ditched home automation hub).


I’m there! After quite a few hours of pain- I’m finally there. I ended up having to compile gambas2 from source- see previous posts:



Hopefully tomorrow I’ll have a few devices up and running!


And as if by magic… several moments after my previous post:

I’m off out for a while but if it’s possible will share the compiled version (I’m not sure how yet… but I’m sure I will work it out!). And then to go back to trying to get DomotiGa up and running!!


I’m currently battling trying to get gambas2 installed on one of my raspis so I can try out DomotiGa http://www.domotiga.nl

sudo apt-get install gambas2

Looks to install AOK but when trying to run from the desktop nothing happens and when trying to run from the terminal gives:

pi@raspberrypi:~$ gambas2
Segmentation fault

Googling around suggested synaptic has better dependency checking so I tried again from scratch. This gave me 3 errors (404 page not found for openssl, libcurl3-gnutls & postgresql). I installed these 3 packages using apt-get, fired synaptic up and was able to complete the gambas2 installation without any errors/warnings.

But alas, firing up gambas2 presents the same lack of activity from the desktop and segmentation fault error from the terminal.

Another search result suggested trying the development / testing version of gambas2 from the wheezy repository. Unfortunately (unless I did something wrong) it appears the same version is in both the stable repository- doh!
*EDIT* I just found out that I could have figured this out pretty easily by browsing: http://packages.debian.org/search?searchon=names&keywords=gambas2 which would also have pointed out the fact that there is a third repository: Unstable (sid). This doesn’t have the latest 2.24 but does have 2.23 (I may try this at some point to see if it is possible to avoid the hassle of compiling yourself)

Next to try compiling from source: http://sourceforge.net/projects/gambas/files/gambas2/ (which is nearly complete- but will inevitably cause me to pull out my hair!)


Now my 2nd Raspberry Pi has turned up I can (re)start work on my home automation project.

Previously I’ve setup a wireless sensor network (WSN) comprised of a number of jeenodes (http://www.jeelabs.org) using the RFM12B to connect back to central jeelink usb plugged into a repurposed orange livebox router (running http://www.homeautomationhub.com). Additionally I installed a number of CurrentCost individual appliance monitors (iams) and a EnviR energy monitor plugged into the home automation hub (hah) to monitor and log household and appliance level energy consumption. Refer to some old blog entries: https://tickett.wordpress.com/category/home-automation/. All of the data was being sent to pachube for logging.

I wasn’t too keen on the home automation hub as I didn’t really fully understand it and couldn’t push it where I wanted to go (although the community was really good and I imagine I will be seeking assistance from them in connection with the new project :)

In my new setup I intend to use a Raspberry Pi the "hub"- with a "full blown" linux distribution (debian?) I should hopefully be able to accomplish everything I am looking for. As python is the first language discussed in conjunction with the raspi I’ve started playing with that, but eventually may move to a LAMP solution (php with mysql backend for logging and apache web front end).

Here’s a high level summary of the steps I’ve covered:

The python example from the link above didn’t produce any output for me so I modified it slightly:

import serial, sys
ser = serial.Serial('/dev/ttyUSB0', 57600)
while 1 :

That’s all I have time for now- watch this space.


%d bloggers like this: