Uncategorized – layer zero labs https://l0l.org.uk.archived.website make it, break it, fix it, hack it, own it Sun, 24 May 2015 10:29:59 +0000 en-GB hourly 1 https://wordpress.org/?v=4.5.14 Headaches whilst upgrading to Raspberry Pi 2 https://l0l.org.uk.archived.website/2015/02/headaches-whilst-upgrading-to-raspberry-pi-2/ https://l0l.org.uk.archived.website/2015/02/headaches-whilst-upgrading-to-raspberry-pi-2/#comments Wed, 18 Feb 2015 13:39:16 +0000 https://l0l.org.uk.archived.website/?p=706 So we’ve been having difficulty getting the underwater fish cam streaming reliably – and now that there is a higher-powered Pi around I thought that I’d try upgrading the basestation of our Aquaponics control system to see if the extra ooomph helps. But of course, there are new problems – such as our old way of […]

The post Headaches whilst upgrading to Raspberry Pi 2 appeared first on layer zero labs.

]]>
So we’ve been having difficulty getting the underwater fish cam streaming reliably – and now that there is a higher-powered Pi around I thought that I’d try upgrading the basestation of our Aquaponics control system to see if the extra ooomph helps.

But of course, there are new problems – such as our old way of getting kernel headers doesn’t seem to work. Why the foundation have rolled their own kernel and then made it so hard for people to get kernel headers is beyond me, surely they want people to hack on the thing??!! If anyone can explain this please leave a comment – it seems like an obvious gaff, and a longstanding one too. The Pi forums are full of people struggling with this, as they have been since 2012! I just don’t get why they have done this, it makes my life harder and what does it accomplish? Grrrrrr…

Anyway, I’ve been searching and experimenting and I think I’ve got a new way to get the headers, so that we can compile the drivers for various things such as the rfm12b driver. It’s as simple as adding ‘2’ to the install of linux-image-rpi-rpfv and linux-headers-rpi-rpfv to make them linux-image-rpi2-rpfv and linux-headers-rpi2-rpfv.

Also, the new device-tree may cause issues – using the raspi-config utility handles this automagically – see here for an excellent explanation of the issue.

The post Headaches whilst upgrading to Raspberry Pi 2 appeared first on layer zero labs.

]]>
https://l0l.org.uk.archived.website/2015/02/headaches-whilst-upgrading-to-raspberry-pi-2/feed/ 3
thethingbox.io image – testing and extending https://l0l.org.uk.archived.website/2014/08/thethingbox-io-image-testing-extending/ https://l0l.org.uk.archived.website/2014/08/thethingbox-io-image-testing-extending/#respond Tue, 26 Aug 2014 08:13:23 +0000 https://l0l.org.uk.archived.website/?p=564 I’ve started investigating the http://thethingbox.io/ image – they say ‘Just download and write a Raspberry-Pi binary file on a SD card to get it ready!’ Well, that’s mostly true – but I found a few issues once I logged on to it via ssh that I’ve documented here, mostly easy to fix once you know how. […]

The post thethingbox.io image – testing and extending appeared first on layer zero labs.

]]>
I’ve started investigating the http://thethingbox.io/ image – they say ‘Just download and write a Raspberry-Pi binary file on a SD card to get it ready!’ Well, that’s mostly true – but I found a few issues once I logged on to it via ssh that I’ve documented here, mostly easy to fix once you know how.

So after booting from the card, I ssh’d into it – as root with a password of ‘raspberry’. I change this immediately:
passwd

set the locale, timezone and keyboard:
dpkg-reconfigure locales
echo 'Europe/London'>/etc/timezone && dpkg-reconfigure -f noninteractice tzdata
dpkg-reconfigure console-data

Now some updates:
rpi-update
aptitude update
aptitude upgrade -y
aptitude install sudo

Follow the code in the first post here: http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=64843 for a recent copy of fsck.vfat to fix the errors on the boot partition.

I prefer to work as a normal user so I’ll create one
adduser pi

Answering various questions about the new user pi got me a home directory, then on to joining a few extra groups (not sure if all are needed, tbh!):
usermod -a -G pi,adm,dialout,cdrom,sudo,audio,video,plugdev,games,users,netdev pi

Finally change the hostname to ‘whateveryoucallyoursystem’ by changing the hostname and /etc/hosts files:
echo '127.0.1.1 whateveryoucallyoursystem'>>/etc/hosts
echo 'whateveryoucallyoursystem'>/etc/hostname

and reboot.

Now we can log in as normal user pi!

The post thethingbox.io image – testing and extending appeared first on layer zero labs.

]]>
https://l0l.org.uk.archived.website/2014/08/thethingbox-io-image-testing-extending/feed/ 0
Node-Red on Raspberry Pi with RFM12B support https://l0l.org.uk.archived.website/2014/05/commands-get-node-red-controller-raspberry-pi-rfm12b-support/ https://l0l.org.uk.archived.website/2014/05/commands-get-node-red-controller-raspberry-pi-rfm12b-support/#comments Mon, 19 May 2014 16:54:17 +0000 https://l0l.org.uk.archived.website/?p=424 You can find these rfm12b modules on sale on ebay – I paid about £10 with delivery and it arrived promptly, the seller chacal_zoom seems to have a number of interesting little circuits, specialising in minimum parts and tiny boards! (avoid the bedini circuit tho he he he!!!) After seemingly endless weird problems getting the […]

The post Node-Red on Raspberry Pi with RFM12B support appeared first on layer zero labs.

]]>
Raspberry Pi with rfm12b radio
Raspberry Pi with rfm12b radio

You can find these rfm12b modules on sale on ebay – I paid about £10 with delivery and it arrived promptly, the seller chacal_zoom seems to have a number of interesting little circuits, specialising in minimum parts and tiny boards! (avoid the bedini circuit tho he he he!!!)

After seemingly endless weird problems getting the rfmb12 driver working and loaded automatically as well as re-installs, imaging mishaps etc. I’m now getting both more expert at configuring raspian and somewhat bored. Also I’m now convinced that we’ll always be going wireless from now on, so the rfm12b driver is a must. Plus Wiring-Pi and a couple of other nodes added into node-red for completeness, giving a ‘base-system’ setup.

So I’ve decided to go scriptomatic and as a first step I’ll list some commands that you can just paste into the terminal and go away and have a light meal while stuff installs. At the moment you will have to come back after the starter because there is a reboot early on to start using the new kernel.

So, having created an SD card with raspian on it I expand the file-system now rather than later, to make sure I leave a couple of hundred MB for SD block failures. On boot, login with the default username of pi and password raspberry. Run sudo raspi-config to enter the easy config. Change password and then in advanced – change hostname, ensure that the graphics split is 16MB, enable SPI and reboot.
Now you can log back in with your new password and then paste the commands below.

EDIT – NOT YET WORKING ON PI 2!! But you can install headers by replacing the ‘rpi’ with ‘rpi2’ if you are using a Raspberry Pi 2 – and either way don’t forget to update the version numbers in my example e.g. “3.12-1-rpi” with the ones you actually downloaded in /boot – e.g. “3.18.0-trunk-rpi2”.

1st – Kernel with headers – 8 min

echo 'Europe/London' | sudo tee /etc/timezone
sudo dpkg-reconfigure -f noninteractice tzdata
sudo aptitude update
sudo aptitude install -y linux-image-rpi-rpfv linux-headers-rpi-rpfv
echo -e "kernel=vmlinuz-3.12-1-rpi\ninitramfs initrd.img-3.12-1-rpi followkernel" | sudo tee -a /boot/config.txt
sudo reboot

The next set of commands do some config as well as installation of the radio driver, so edit them if you want a different node id by default for example.

2nd – RFM12b driver installation – 1 min

git clone https://github.com/gkaindl/rfm12b-linux.git
cd rfm12b-linux
sed -i rfm12b_config.h -e 's/#define\ RFM12B_BOARD[[:space:]]*0/#define\ RFM12B_BOARD\ 1/g'
sed -i rfm12b_config.h -e 's/#define\ RFM12B_DEFAULT_GROUP_ID[[:space:]]*211/#define\ RFM12B_DEFAULT_GROUP_ID\ 101/g'
sed -i rfm12b_config.h -e 's/#define\ RFM12B_DEFAULT_JEE_ID[[:space:]]*0/#define\ RFM12B_DEFAULT_JEE_ID\ 1/g'
make
sudo cp rfm12b.ko /lib/modules/$(uname -r)/
echo -e "rfm12b" | sudo tee -a /etc/modules
sudo depmod -a
cd examples
make
cd ~

Edit – if you have errors at the make stage then recently I found that there was a test at line 25 of the Makefile that was erroring – as we are past version 3.7 we can remove the test and just always execute the line after it. So delete line 25 from the Makefile – it starts with if [ -f /lib/….

Now to prepare for the big update/install of everything else we install Gordon’s excellent Wiring-pi library.

3rd – Installing wiring-pi – 1 min

git clone git://git.drogon.net/wiringPi
cd wiringPi
./build
cd ~

And finally, for something completely different. Some more installation stuff, this time you shouldn’t rush back …

4th – Main update & installation of packages ~ 30 min

sudo aptitude upgrade -y
sudo aptitude install bootlogd mosquitto
wget http://node-arm.herokuapp.com/node_latest_armhf.deb
sudo dpkg -i node_latest_armhf.deb
rm node_latest_armhf.deb
sudo adduser --system node-red --ingroup pi
sudo chmod 775 /home/node-red
cd /home/node-red
npm install node-red
cd node_modules/node-red
npm install serialport stately wiring-pi

And just add in the startup script from here, edit the init script to use the node-red user and you’re golden.
sudo wget -O /tmp/download https://gist.github.com/Belphemur/cf91100f81f2b37b3e94/download && sudo tar -zxf /tmp/download --strip-components 1 -C /etc/init.d && sudo chmod +x /etc/init.d/node-red && sudo update-rc.d node-red defaults

The post Node-Red on Raspberry Pi with RFM12B support appeared first on layer zero labs.

]]>
https://l0l.org.uk.archived.website/2014/05/commands-get-node-red-controller-raspberry-pi-rfm12b-support/feed/ 2