04 February 2015
In my last post Adventures with Arduino part 1 I discussed some of the options of wiring up and getting metrics with Arduino. Here is the work in progress
It then sends those values as a simple comma separated file. Data format I’m using is
device uptime,device name,metric_name=value
with multiple metric values possibly sent in the same packet. On the receiving side I have a Raspberry Pi that follows this work flow.
31 January 2015
Raspberry Pi Revision B+ has 40 pins unlike the original Raspberry Pi. To connect NRF24L01 module to it you need to connect it as follows. This is how NRF24L01 looks like. Pins start with 1 in bottom right.
|NRF Pin||Raspberry Pi|
|1||Ground PIN 4|
|2||3.3 V PIN 1|
01 January 2015
Few months ago I got myself an Arduino Uno board from Adafruit. I have had couple use cases I was going to try to use them for in order of importance
After receiving the board and playing with some of the basic examples I figured it was time to resolve how to push sensor data to a central location. Some of the options I discovered were as follows
XBee and Bluetooth are really nice options however I considered them too overpriced for this particular use case so I went ahead and bought a pair of 433 Mhz and nRF24L01+ modules.
First thing I tried was 433 MHz modules. They were easy to wire and configure since e.g. transmitter has only 3 pins and receiver 4 pins (although you only use 3) and using the rc-switch project libraries I was able to communicate between my Arduino and a Raspberry Pi. The drawback is that it’s fairly low bandwidth and payload size maxes out at 24 bit so pretty limiting.
That said an interesting side benefit of these modules is that large number of remote controlled power outlets out there use either 315/433 Mhz bands e.g. Etekcity outlets. If you have a remote controlled device in your house you can look up what frequency it uses with FCC ID search. There is also the 303 Mhz frequency however I have not been able to find the modules for it yet.
As a result of this tinkering I know am able to turn outlets around my house with my phone :-).
These are a lot more tricky to get going as they have total of 8 pins with one unused and it is easy to mis-wire things. It took me a lot of trying to get these going however I finally got it going and was able to pass data between the Arduino and a Raspberry Pi. Max payload on this is 32 bytes which should be enough for shipping out metric data and you can ship them at a pretty rapid rate. Libraries I ended up using were these
Do note that these may not work with Adafruit’s Trinket.
18 May 2014
As you may have heard Bosnia, Serbia and in smaller part Croatia are facing worst floods ever in recorded history
There are a number of ways to donate. Here are few that are being posted on Twitter from
I have not seen an easy way on those sites for people in the US to make donation. However Croatian Red Cross allows on-line donations with proceeds being transferred to Bosnian and Serbian Red Cross. You can read about it here
The only drawback is donation page is in Croatian :-( so here is a quick guide.
On this page you will need to pick who you are donating to
Pomoć za poplavljena područja u Bosni i Hercegovini - Aid for flooded regions of Bosnia
Pomoć za poplavljena područja u Srbiji - Aid for flooded regions of Serbia
Pomoć za poplavljena područja u Hrvatskoj - Aid for flooded regions of Croatia
Pick the amount and currency e.g. 25 USD.
Click on Autorizacija Kreditne kartice. Next screen will include your confirmation as well as currency exchange into Croatian Kunas e.g.
10 CAD (50.90 KN)
1 Canadian Dollar is about 5 Kunas so don’t despair :-).
Payment info will look like this
Ime is name
Prezime Last Name
Adresa - Address
Grad - City
Poštanski Broj - Postal Code
Država - Country
Telefonski broj - telephone number
Click Doniraj and that should be it.
07 February 2014
Cumulus Networks is a new entrant in the network gear space. What separates them from other players is that they are not selling hardware but their own network focused Linux distribution called Cumulus Linux. Basically you buy a switch from one of their resellers or ODMs then pay Cumulus a yearly support license. There are a number of interesting things you can do like run your own code on the switch as well as use common Linux commands to configure the switch e.g. brctl, ports are exposed as Linux network interfaces etc.
One of the first things we ended up doing is installing Ganglia agent so that we can monitor what’s going on on the switch. Cumulus switch we had was running a PowerPC based control plane so that made things a bit tricky since we couldn’t use any of the amd64 built packages. One way to build PowerPC packages would be to get an old PowerPC based Mac and install Linux on it. Unfortunately that seemed like a lot of work and overkill. I realized we could just use Qemu which is an Open Source machine emulator so I could run PowerPC machine on my own laptop :-). Quickest way to get up and running is as follows.
On Ubuntu you will need to install following packages
apt-get install qemu-system-ppc openbios-ppc qemu-utils
Warning: Under at least Ubuntu 13.10 openbios-ppc doesn’t seem to work well. If you get a blank yellow screen after you start the install you will need to get openbios from other places e.g. https://github.com/qemu/qemu/tree/master/pc-bios
Once you get those you will need to download Debian Squeeze for PowerPC. You will need to download
as well as the netboot image e.g.
Reason why you need initrd.gz and vmlinux is that if you try to do an install straight off the CD-ROM your install will hang here
Once you have those pieces initiate the install with
qemu-img create -f qcow2 squeeze-powerpc.img 10G sudo qemu-system-ppc -m 256 -kernel vmlinux \ -cdrom debian-6.0.8-powerpc-netinst.iso \ -initrd initrd.gz -hda squeeze-powerpc.img -boot d -append "root=/dev/ram" \ -net nic,macaddr=00:16:3e:00:00:02 -net tap
Now follow the installation process as you would if you were installing Debian or Ubuntu from scratch. When you are done with the install shut down the emulator. Now to invoke your PowerPC emulator execute
sudo qemu-system-ppc -m 256 -hda squeeze-powerpc.img \ -net nic,macaddr=00:16:3e:00:00:02 -net tap
Congratulations you are done. What you end up with is this
root@debian:~# cat /proc/cpuinfo processor : 0 cpu : 740/750 temperature : 62-64 C (uncalibrated) revision : 3.1 (pvr 0008 0301) bogomips : 33.14 timebase : 16570400 platform : PowerMac model : Power Macintosh machine : Power Macintosh motherboard : AAPL,PowerMac G3 MacRISC detected as : 49 (PowerMac G3 (Silk)) pmac flags : 00000000 pmac-generation : OldWorld Memory : 256 MB