Arch Linux on the Raspberry Pi 2

Yes, I already have a couple of Raspberry Pi, but I had to get one of the new Raspberry Pi 2 (model B), to check out its increased processing power with OpenCV and image processing.

So, lets install it. The Arch Linux install page is here. This new RPi2 has a new ARMv7l Cortex-A7 quad-core! Arch Linux has a new distro page dedicated to it. If you want to install the previous RPi model you can also follow my notes, you just have to get the correct SD image here.

Continue reading “Arch Linux on the Raspberry Pi 2”

LIDAR lite with Beaglebone Black and Arch Linux

Its been a few months now since I received my new LIDAR lite from the crowd funded campaign on Dragon Innovation but only now I have some time to play with it. I got interested in range finder hardware after doing this great Udacity course on Artificial Intelligence for Robotics by Sebastian Thrun (the new one is here). One of the key hardware components is a good inexpensive range finder and Pulsedlight is doing it.

I want to try it out on my Beaglebone Black, the first challenge are the data pins voltage, the LIDAR is working at 5V and the Beaglebone at 3V3.

(EDIT) Well, figures out that I was wrong about LIDAR lite I2C levels, even thought it works with the logic levels converter, it is not necessary to use it, check my new post here.

I have hanging around a 4-channel I2C-safe Bi-directional Logic Level Converter – BSS138 from Adafruit. It is perfect for this. Here are some photos of the connections, I’ll publish the wiring in a few days when I have more time:

lidarlitewiringConnection to the Beaglebone via ssh.
The Beaglebone is running Arch Linux, to install the i2c tools:

# pacman -S i2c-tools

Check if the LIDAR is there:

# i2cdetect -r -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- UU UU UU UU -- -- -- -- -- -- -- --
60: -- -- 62 -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Looking good! LIDAR Light detected at address 0x62.  Now, from its manual, we need to write 0x04 at its address 0x00 to make a measurement:

# i2cset -y 1 0x62 0x00 0x04

and wait for a couple of seconds to make sure the measuring is finished, then read the measured value:

# i2cget -y 1 0x62 0x8f w

so I’m getting 117cm. It works! And the distance from it to my wall is around that value. Can’t find my meter so I can’t check its precision right now. I made a simple script to make it run for a while and save the measuring in a file, I’ll let you know my findings about repeatability later. Here is the script:

date >> lidar.txt

while :
i2cset -y 1 0x62 0x00 0x04

sleep 2

i2cget -y 1 0x62 0x8f w
i2cget -y 1 0x62 0x8f w >> lidar.txt

I couldn’t use the i2cdump command. Each time I do:

# i2cdump -y 1 0x62

I get an answer the first time with some values but if I do the i2cdump again the result is all zeros, it looks like something gets stuck and the LIDAR no longer responds. The only way to make it work again is to power down / up the LIDAR. I’ll investigate this another day.

Arch Linux install on Virtualbox VM

I’ve installed Arch Linux in a few VM’s (Virtualbox / Windows 7) and each time it is slightly different. These are my notes from a successful install. Virtualbox v4.3.22, Arch Linux 2015/02/01.

Start by downloading the ISO image of the latest Arch Linux distro, use the torrent link to go faster. You can use Deluge, an open source torrent client. Burn it to a CD so it can have it at hand. InfraRecorder works great and it is open source.

Start Virtualbox and create a VM, if you type “Arch” in the new VM name it will automatically change the type to linux and the version to Arch linux 64 bit, nice! I want a small VM so I just configure 1024Mb of RAM and 50Gb of virtual hard drive.

Insert your Arch Linux CD and start the new VM, sometimes you need to go to Devices menu and set your CD reader, sometimes it is already done for you.

Boot your system from the CD /first option) until you get the shell prompt, then using fdisk create new partitions in your new virtual drive. There are lots of info on how to create partitions so I wont get into details. Anyway I was following the Arch Linux documentation, the installation guide is great.

Continue reading “Arch Linux install on Virtualbox VM”