I recently wrote about installing Arch Linux on the Iomega IConnect.
This shows how to get the I2C interface working and have a look at the built in LM63 temperature sensors.
Install lm_sensors.
pacman -S lm_sensors
Have a look and see what the package gives us, binary wise.
pacman -Ql lm_sensors
/usr/bin/fancontrol
/usr/bin/healthd
/usr/bin/pwmconfig
/usr/bin/sensord
/usr/bin/sensors
/usr/bin/sensors-conf-convert
/usr/bin/sensors-detect
We need to load a few kernel modules. i2c-mv64xxx is the driver for the I2C bus and lm63 for the sensors.
[root@biggles ~]# modprobe i2c-mv64xxx
[root@biggles ~]# modprobe lm63
[root@biggles ~]# lsmod
Module Size Used by
lm63 5257 0
hwmon 1187 1 lm63
i2c_mv64xxx 4121 0
i2c_core 15344 2 i2c_mv64xxx,lm63
rt2800pci 7802 0
rt2800lib 39393 1 rt2800pci
rt2x00pci 3661 1 rt2800pci
rt2x00lib 30207 3 rt2x00pci,rt2800lib,rt2800pci
eeprom_93cx6 1150 1 rt2800pci
mac80211 170543 3 rt2x00lib,rt2x00pci,rt2800lib
cfg80211 143659 2 mac80211,rt2x00lib
rfkill 14400 2 cfg80211
ds2490 6254 0
wire 15857 1 ds2490
ipv6 259694 10
mv_cesa 9128 0
autofs4 22074 2
[root@biggles ~]#
[root@biggles ~]# sensors-detect
# sensors-detect revision 6170 (2013-05-20 21:25:22 +0200)
# DMI data unavailable, please consider installing dmidecode 2.7
# or later for better results.
This program will help you determine which kernel modules you need
------------------------ snip -------------------------------------------
Some boring text and all negative, so skipping it
------------------------ snip -------------------------------------------
Module i2c-dev loaded successfully.
Next adapter: mv64xxx_i2c adapter (i2c-0)
Do you want to scan it? (YES/no/selectively):
Client found at address 0x4c
Handled by driver `lm63' (already loaded), chip type `lm63'
Now follows a summary of the probes I have just done.
Just press ENTER to continue:
Driver `lm63':
* Bus `mv64xxx_i2c adapter'
Busdriver `i2c_mv64xxx', I2C address 0x4c
Chip `lm63' (confidence: 6)
Do you want to generate /etc/conf.d/lm_sensors? (YES/no):
ln -s '/usr/lib/systemd/system/lm_sensors.service' '/etc/systemd/system/multi-user.target.wants/lm_sensors.service'
Unloading i2c-dev... OK
[root@biggles ~]# sensors
lm63-i2c-0-4c
Adapter: mv64xxx_i2c adapter
temp1: +38.0°C (high = +70.0°C)
temp2: +38.2°C (low = +0.0°C, high = +70.0°C)
(crit = +85.0°C, hyst = +75.0°C)
All Done
Showing posts with label archlinuxarm. Show all posts
Showing posts with label archlinuxarm. Show all posts
Thursday, June 6, 2013
Sunday, May 5, 2013
Arch Linux Iomega IConnect
I got an iConnect a few years ago. 1 Ghz processor, 256 MB RAM, Gigabit Ethernet, Wireless Card, 4 USB Ports (3 Usable).
Quite a good machine to run embedded Linux on. I had it running various services such as OWFS 1-Wire, XRF Wireless from Ciseco and other testing projects.
Anyway, one day I was tinkering and I broke it. It had to do with the bloody Arch Linux updates and Kernel modules. It was in a heap and was useless. I was busy being distracted by other projects, so the iConnect was put offline and joined the grave yard of stalled/unfinished projects.
One day, recently, I talked to Dr Google about hacking the iConnect.
I came across a couple of interesting links dealing with installing Debian on the iConnect.
http://scriptkiller.de/en/a54/computer_electronics/hacking_the_iomega_iconnect/
http://www.kroonen.eu/wiki/Debian%20iConnect
Really excellent links. You should have a read if you are interested in this type of stuff.
The link that was really the money shot was
http://pawelwozniak.info/index.php/embedded-linux/iconnect/126-install-archarm-linux-on-iconnect
It contains all the information required to install Arch Linux on the iConnect.
I used the Sarkfun FTDI Basic Breakout - 5V which I got from Cool Components to gain console access. I modified it to use 3.3V rather then the hotter 5V. Perfect.
The final update is to set the arcNumber from 1682 to 2870. This gives you access to the specific hardware in the iConnect, such as LEDS and the button.
They are located in:
/sys/class/leds
This is what you get:
iconnect:blue:otb -> ../../devices/platform/leds-gpio/leds/iconnect:blue:otb
iconnect:blue:power -> ../../devices/platform/leds-gpio/leds/iconnect:blue:power
iconnect:blue:usb1 -> ../../devices/platform/leds-gpio/leds/iconnect:blue:usb1
iconnect:blue:usb2 -> ../../devices/platform/leds-gpio/leds/iconnect:blue:usb2
iconnect:blue:usb3 -> ../../devices/platform/leds-gpio/leds/iconnect:blue:usb3
iconnect:blue:usb4 -> ../../devices/platform/leds-gpio/leds/iconnect:blue:usb4
iconnect:led_level -> ../../devices/platform/leds-gpio/leds/iconnect:led_level
iconnect:red:power -> ../../devices/platform/leds-gpio/leds/iconnect:red:power
rt2800pci-phy0::assoc -> ../../devices/pci0000:00/0000:00:01.0/leds/rt2800pci-phy0::assoc
rt2800pci-phy0::quality -> ../../devices/pci0000:00/0000:00:01.0/leds/rt2800pci-phy0::quality
rt2800pci-phy0::radio -> ../../devices/pci0000:00/0000:00:01.0/leds/rt2800pci-phy0::radio
http://archlinuxarm.org/forum/viewtopic.php?f=27&t=2612
Great work. Costs no money, so Woo Hoo!!
I plan to use to use it for Project Janus. It will use an iButton key fob or an RFID card to control some devices. There will also be other sensors in the loop for status updates, PIR and perhaps some audio component. Cool....
Quite a good machine to run embedded Linux on. I had it running various services such as OWFS 1-Wire, XRF Wireless from Ciseco and other testing projects.
Anyway, one day I was tinkering and I broke it. It had to do with the bloody Arch Linux updates and Kernel modules. It was in a heap and was useless. I was busy being distracted by other projects, so the iConnect was put offline and joined the grave yard of stalled/unfinished projects.
One day, recently, I talked to Dr Google about hacking the iConnect.
I came across a couple of interesting links dealing with installing Debian on the iConnect.
http://scriptkiller.de/en/a54/computer_electronics/hacking_the_iomega_iconnect/
http://www.kroonen.eu/wiki/Debian%20iConnect
Really excellent links. You should have a read if you are interested in this type of stuff.
The link that was really the money shot was
http://pawelwozniak.info/index.php/embedded-linux/iconnect/126-install-archarm-linux-on-iconnect
It contains all the information required to install Arch Linux on the iConnect.
I used the Sarkfun FTDI Basic Breakout - 5V which I got from Cool Components to gain console access. I modified it to use 3.3V rather then the hotter 5V. Perfect.
The final update is to set the arcNumber from 1682 to 2870. This gives you access to the specific hardware in the iConnect, such as LEDS and the button.
They are located in:
/sys/class/leds
This is what you get:
iconnect:blue:otb -> ../../devices/platform/leds-gpio/leds/iconnect:blue:otb
iconnect:blue:power -> ../../devices/platform/leds-gpio/leds/iconnect:blue:power
iconnect:blue:usb1 -> ../../devices/platform/leds-gpio/leds/iconnect:blue:usb1
iconnect:blue:usb2 -> ../../devices/platform/leds-gpio/leds/iconnect:blue:usb2
iconnect:blue:usb3 -> ../../devices/platform/leds-gpio/leds/iconnect:blue:usb3
iconnect:blue:usb4 -> ../../devices/platform/leds-gpio/leds/iconnect:blue:usb4
iconnect:led_level -> ../../devices/platform/leds-gpio/leds/iconnect:led_level
iconnect:red:power -> ../../devices/platform/leds-gpio/leds/iconnect:red:power
rt2800pci-phy0::assoc -> ../../devices/pci0000:00/0000:00:01.0/leds/rt2800pci-phy0::assoc
rt2800pci-phy0::quality -> ../../devices/pci0000:00/0000:00:01.0/leds/rt2800pci-phy0::quality
rt2800pci-phy0::radio -> ../../devices/pci0000:00/0000:00:01.0/leds/rt2800pci-phy0::radio
http://archlinuxarm.org/forum/viewtopic.php?f=27&t=2612
Great work. Costs no money, so Woo Hoo!!
I plan to use to use it for Project Janus. It will use an iButton key fob or an RFID card to control some devices. There will also be other sensors in the loop for status updates, PIR and perhaps some audio component. Cool....
Labels:
1-wire,
1-wire switch,
arch linux,
archlinuxarm,
arm,
ds2408,
embedded likux,
home automation,
iconnect,
iomega,
linux,
low power computing,
owfs,
owserver,
plug computer,
wifi,
wireless
Thursday, November 15, 2012
PogoPlug Cheap NAS
I wrote previously about http://blog.thegiblins.com/2012/07/pogoplug-cheap-deal-and-hack.html , a good deal from Pogoplug.
I was really intersted in that there was a Sata port on the inside and it had a Gigabit Ethernet port.
I explored the options available to connect and power a sata drive. I eventually found a "NEON SSD/HDD Stand-alone Duplicator and Docking Station (USB2.0 - eSATA)" on MemoryC.com. Just under €32 and free shipping. What could possibly go wrong? It turns out to be a fairly good product, with USB and eSata ports plus external power. Fits 2.5 and 3.5 inch drives.
OK, so crack open the PogoPlug, easy.
Warning: The power board is on the right of the picture. It has exposed 220V and this can kill. Be afraid. Be very afraid, and careful.
I ordered a Sata to eSata cable from eBay. I am probably going to have to drill a hole in the side of the case to allow the cable to fit properly and exit the case.
I plugged in the Sata side of the cable into the PogoPlug Sata port.
Connected the eSata side of the cable to the Docking Station. I had an old 80Gb drive that I used for testing. Power the Docking Station on and then the PogoPlug.
The happy marrige, PogoPlug meets Docking Station.
When I first turned it all on, it wouldn't boot. Feck I thought. Dr Google was no help.
I thought about it for a while and I thought that perhaps the Sata drives were being initialised first, becoming /dev/sda1. The system was configured to boot from a USB stick as /dev/sda1.
Test 1: Set-up to boot from Hard Disk /dev/sda1
I plugged the USB stick and Docking Station into my trusty Linux Laptop, identified the devices, which were /dev/sdb = Docking Station and /dev/sdc which was the USB drive.
I ran:
[root@wideboy ~]# dd bs=1M if=/dev/sdc of=/dev/sdb
7498+1 records in
7498+1 records out
7862353920 bytes (7.9 GB) copied, 506.336 s, 15.5 MB/s
Cool so far. I plugged out the Docking Station and back in again.
I then ran 'fdisk -l' and got
[snip]
Disk /dev/sdb: 80.0 GB, 80026361856 bytes, 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd9bd8d6f
Device Boot Start End Blocks Id System
/dev/sdb1 21 7827203 3913591+ 83 Linux
So, I had an 80Gb disk with a tinchy partition.
Time to crank up fdisk again.
[root@wideboy ~]# fdisk /dev/sdb
Welcome to fdisk (util-linux 2.22.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sdb: 80.0 GB, 80026361856 bytes, 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd9bd8d6f
Device Boot Start End Blocks Id System
/dev/sdb1 21 7827203 3913591+ 83 Linux
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (1-4, default 2):
Using default value 2
First sector (7827204-156301487, default 7827456):
Using default value 7827456
Last sector, +sectors or +size{K,M,G} (7827456-156301487, default 156301487):
Using default value 156301487
Partition 2 of type Linux and of size 70.8 GiB is set
Command (m for help): p
Disk /dev/sdb: 80.0 GB, 80026361856 bytes, 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd9bd8d6f
Device Boot Start End Blocks Id System
/dev/sdb1 21 7827203 3913591+ 83 Linux
/dev/sdb2 7827456 156301487 74237016 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
All good again.
Create the new file system:
[root@wideboy ~]# mkfs.ext4 /dev/sdb2
mke2fs 1.42.5 (29-Jul-2012)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
4644864 inodes, 18559254 blocks
927962 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
567 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
I then mounted the partitions to check that everything looked OK. It did.
I then connected the Docking Station to the PogoPlug and powered everything on.
Note: the PogoPlug does not have the USB drive attached.
Low and behold, everything booted. The PogoPlug was booting from the eSata attached hard disk. Woo Hoo! Better then I had originally expected.
Test 2: Crack open a cold brew and blow the froth of it
Kick back and watch you favourite movie. You earned it
Love Linux. Love Arch Linux. Love Arch Linux Arm.
Low power computing. Save the world.
What will I use it for? I am going to try OwnCloud and see if it can run in 128Mb of ram. At least I should be able to run Samba and NFS on it.
Labels:
arch linux,
archlinuxarm,
cheap nas,
esata,
nas,
nfs,
plug computer,
pogo plug,
samba
Sunday, July 29, 2012
Arch Linux Raspberry PI Wirelss USB Edimax EW-7811Um
I got an Edimax EW-7811Um a few days ago on eBay from Peats, actually. Nice, really small. Just what I wanted for a wireless project I have for the Raspberry PI (RPI) running Arch Linux.
I had a wrestle with it for a few hours, trying to get it working.
I was able to get it working using a number of different sources.
Here all the sources are combined into one Recipe, that works.
I have two RPIs and used this method to configure the card on the second RPI, after the first one was working. so I know it works
I started with a fully upto date OS, e.g. pacman -Syu will do this.
The life saver link was Edimax EW-7811Un USB-Wifi adapter.
Here is what I did:
Download and compile the drivers
1. wget http://myplugbox.com/rtl8188C_8192C_usb_linux_v3.4.3_4369.20120622.tar.gz
Get the driver
2. tar xzf rtl8188C_8192C_usb_linux_v3.4.3_4369.20120622.tar.gz
Extract the doings
3. cd rtl8188C_8192C_usb_linux_v3.4.3_4369.20120622
Change to the directory
4. nano Makefile
Change KVER to what the current version is. It's currently set to: KVER := 3.1.9-31-ARCH+
I changed mine to 3.1.9-33-ARCH+
If in doubt use 'uname -a' to get the current kernel version.
5. make
This compiles the driver and takes about 10+ minutes
6. cp 8192cu.ko /usr/lib/modules/extramodules-3.1.9--raspberrypi/
Copy the new driver to a place that will be used to load it.
7. depmod -a
This wil find the new modules and write them to a file called something. I don't care.
8. sync ; reboot
9. Log back in and run lsmod
You should see the '8192cu' listed
So far, so good.
Now to configure for automatic loading of the driver and settings.
10. nano /etc/rc.conf and modify the line
MODULES=(8192cu !rtl8192cu)
This stops the rtl8192cu module that does not work for the USB Device and loads the 8192cu
11. nano /etc/rc.local
This makes sure that the required programs are run at boot time.
#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#
wpa_supplicant -B -c /etc/wpa_supplicant/wpa_supplicant_special.conf -i wlan0
ifconfig wlan0 192.168.22.132 255.255.255.0
route add default gw 192.168.22.1
12. nano /etc/wpa_supplicant/wpa_supplicant_special.conf
This is all that is needed for wpa_supplicant. The other default settings are OK, I think.
# WPA-Personal(PSK) with TKIP and enforcement for frequent PTK rekeying
network={
ssid="ESSIDtoUse"
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP
psk="secret agent password in clear text or Hex"
wpa_ptk_rekey=600
}
So far so good again.
13. sync ; reboot
14. Log back in
It might take a few minutes longer to login, as there are two network connection and the RPI may be getting confused.
If you run 'ifconfig', you should see the wlan0 card listed.
15. nano /etc/rc.conf
Comment out the Ethernet settings, so that the wire connection is no longer used.
#interface=eth0
#address=192.168.22.130
#netmask=255.255.255.0
#broadcast=192.168.22.255
#gateway=192.168.22.1
16. sync ; reboot
17. Log back in using the new Wireless IP Address.
Job done. Time for a beer and a quiet smirk.
I had a wrestle with it for a few hours, trying to get it working.
I was able to get it working using a number of different sources.
Here all the sources are combined into one Recipe, that works.
I have two RPIs and used this method to configure the card on the second RPI, after the first one was working. so I know it works
I started with a fully upto date OS, e.g. pacman -Syu will do this.
The life saver link was Edimax EW-7811Un USB-Wifi adapter.
Here is what I did:
Download and compile the drivers
1. wget http://myplugbox.com/rtl8188C_8192C_usb_linux_v3.4.3_4369.20120622.tar.gz
Get the driver
2. tar xzf rtl8188C_8192C_usb_linux_v3.4.3_4369.20120622.tar.gz
Extract the doings
3. cd rtl8188C_8192C_usb_linux_v3.4.3_4369.20120622
Change to the directory
4. nano Makefile
Change KVER to what the current version is. It's currently set to: KVER := 3.1.9-31-ARCH+
I changed mine to 3.1.9-33-ARCH+
If in doubt use 'uname -a' to get the current kernel version.
5. make
This compiles the driver and takes about 10+ minutes
6. cp 8192cu.ko /usr/lib/modules/extramodules-3.1.9--raspberrypi/
Copy the new driver to a place that will be used to load it.
7. depmod -a
This wil find the new modules and write them to a file called something. I don't care.
8. sync ; reboot
9. Log back in and run lsmod
You should see the '8192cu' listed
So far, so good.
Now to configure for automatic loading of the driver and settings.
10. nano /etc/rc.conf and modify the line
MODULES=(8192cu !rtl8192cu)
This stops the rtl8192cu module that does not work for the USB Device and loads the 8192cu
11. nano /etc/rc.local
This makes sure that the required programs are run at boot time.
#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#
wpa_supplicant -B -c /etc/wpa_supplicant/wpa_supplicant_special.conf -i wlan0
ifconfig wlan0 192.168.22.132 255.255.255.0
route add default gw 192.168.22.1
12. nano /etc/wpa_supplicant/wpa_supplicant_special.conf
This is all that is needed for wpa_supplicant. The other default settings are OK, I think.
# WPA-Personal(PSK) with TKIP and enforcement for frequent PTK rekeying
network={
ssid="ESSIDtoUse"
proto=WPA
key_mgmt=WPA-PSK
pairwise=TKIP
group=TKIP
psk="secret agent password in clear text or Hex"
wpa_ptk_rekey=600
}
So far so good again.
13. sync ; reboot
14. Log back in
It might take a few minutes longer to login, as there are two network connection and the RPI may be getting confused.
If you run 'ifconfig', you should see the wlan0 card listed.
15. nano /etc/rc.conf
Comment out the Ethernet settings, so that the wire connection is no longer used.
#interface=eth0
#address=192.168.22.130
#netmask=255.255.255.0
#broadcast=192.168.22.255
#gateway=192.168.22.1
16. sync ; reboot
17. Log back in using the new Wireless IP Address.
Job done. Time for a beer and a quiet smirk.
Wednesday, July 25, 2012
PogoPlug Cheap Deal and Hack
I recently signed up for a PogoPlug Family Backup Offer . It cost €24 in total.
The best thing is that you get a free PogoPlug Pro.
Being a big embedded Linux fan, I was eager to find out if this was one of the hackable devices. It was a cheap price to pay, to find out if it was useful.
It arrived on Friday. The first thing I dis was to crack it open. That was even before I powered it up. I am that sort of guy.
It turns out that it is Model: PogoPlug Pro FCC ID: VUIPOGOPLUG. The one with the Grey/White Symbol on the front. It turns out that it is a hackable device, see Link.
I wanted the smallest USB drive I could get. I went to Power City and got an 8GB drive by someone or other. Picture here:
So, I horsed over to http://archlinuxarm.org/platforms/armv6/pogoplug-provideov3 and followed the recipe to install Arch Linux on the device. It worked like a charm.
Another Arch Linux box joins the Empire.
It has some wireless card and a SATA port and of course a Gigibit Ethernet port. Ultra cool to build some sort of data/file server or anything really.
I think I will investigate the possibility of connecting an SATA drive to it and use for centralized MyDocuments and Photographs.
Only the Windows client can take advantage of independent storage on the PogoPlug cloud. I may incorporate that into a general offloading plan. We will see.
The best thing is 'Cheap PlugComputer' and benefits that could be used.
Win. Win. Win.
The best thing is that you get a free PogoPlug Pro.
Being a big embedded Linux fan, I was eager to find out if this was one of the hackable devices. It was a cheap price to pay, to find out if it was useful.
It arrived on Friday. The first thing I dis was to crack it open. That was even before I powered it up. I am that sort of guy.
It turns out that it is Model: PogoPlug Pro FCC ID: VUIPOGOPLUG. The one with the Grey/White Symbol on the front. It turns out that it is a hackable device, see Link.
I wanted the smallest USB drive I could get. I went to Power City and got an 8GB drive by someone or other. Picture here:
So, I horsed over to http://archlinuxarm.org/platforms/armv6/pogoplug-provideov3 and followed the recipe to install Arch Linux on the device. It worked like a charm.
Another Arch Linux box joins the Empire.
It has some wireless card and a SATA port and of course a Gigibit Ethernet port. Ultra cool to build some sort of data/file server or anything really.
I think I will investigate the possibility of connecting an SATA drive to it and use for centralized MyDocuments and Photographs.
Only the Windows client can take advantage of independent storage on the PogoPlug cloud. I may incorporate that into a general offloading plan. We will see.
The best thing is 'Cheap PlugComputer' and benefits that could be used.
Win. Win. Win.
Thursday, July 5, 2012
Raspberry PI 1-Wire I2C OWFS
I wrote this a few weeks ago and forgot to post it.
I received a Raspberry PI recently. It looks great, nice and small.
I have been playing with PlugComputers, such as the SheevaPlug and the Seagate Goflex series for a few years. They form the basis of my low power computer systems that are on 24x7. The Raspberry PI is just like one of them but with a few extra facilities.
Getting up and running was a breeze. I simply downloaded the image, by bittorrent, if I remember correctly. It only took a few minutes.
I blew it onto an SD card and powered it up. Hey Presto! it worked. I was able to determine it's IP address and ssh in to have a look around. Perfect.
I didn't have a HDMI cable to hand, so I used a composite cable to connect it to the TV. It worked but the quality was not the best. Moved on.
I was wondering what to use the PI for. I still don't know.
I came across an article talking about using the PI with OWFS. http://raspberrypi.homelabs.org.uk/
OWFS stands for One Wire File System. 1-Wire is a technology developed by Dallas Semiconductor (Maxim-IC), that actually uses 2 wires to communicate with devices such as temperature sensors, switches, voltage detectors, a/d converters and so on. I use it extensively throughout the house to measure temperature and control things. One of the great things about the 1-Wire devices is that they are pretty cheap.
On the Raspberry PI, there are a number of input/output pins. The ones of interest in relation to 1-Wire stuff are the I2C pins. I2C is basically a serial protocol. It is the building blocks that USB and SATA are built on.
The good thing is that Maxim-IC make a number of I2C to 1-Wire controllers. These are the DS2482 and DS2483. There are probably others also.
So, the possibility to connect the chips directly to the PI was real.
I was able to acquire a couple of DS2482s from a friend of mine. I had to mount them on a 16 way SOIC to DIP converter.
The OWFS system was easily compiled from source on the Raspberry PI and installed.
I then began the search for the I2C drivers.
This was a hard one. I found many forums that resulted in a dead end. Many kernels were compiled and failed. I couldn't get/build a kernel that would work with the drivers installed.
I found a fella that had a pre-built kernel built for Debian. I use Arch, which is pretty different in it's config, even though it is Linux.Here is the link I used http://www.bootc.net/projects/raspberry-pi-kernel/ I also installed the latest firmware.
Anyhoo, I was able to install the new kernel and modules and boot a workable system. Cool.
All the quick checks were good.
I then wired up the chips, DS2482, and started the main program owserver. Hey presto, it worked.
I wired a couple of DS18B20's and could see them and read temperatures. Success.
I love this embedded Linux crap.
I received a Raspberry PI recently. It looks great, nice and small.
I have been playing with PlugComputers, such as the SheevaPlug and the Seagate Goflex series for a few years. They form the basis of my low power computer systems that are on 24x7. The Raspberry PI is just like one of them but with a few extra facilities.
Getting up and running was a breeze. I simply downloaded the image, by bittorrent, if I remember correctly. It only took a few minutes.
I blew it onto an SD card and powered it up. Hey Presto! it worked. I was able to determine it's IP address and ssh in to have a look around. Perfect.
I didn't have a HDMI cable to hand, so I used a composite cable to connect it to the TV. It worked but the quality was not the best. Moved on.
I was wondering what to use the PI for. I still don't know.
I came across an article talking about using the PI with OWFS. http://raspberrypi.homelabs.org.uk/
OWFS stands for One Wire File System. 1-Wire is a technology developed by Dallas Semiconductor (Maxim-IC), that actually uses 2 wires to communicate with devices such as temperature sensors, switches, voltage detectors, a/d converters and so on. I use it extensively throughout the house to measure temperature and control things. One of the great things about the 1-Wire devices is that they are pretty cheap.
On the Raspberry PI, there are a number of input/output pins. The ones of interest in relation to 1-Wire stuff are the I2C pins. I2C is basically a serial protocol. It is the building blocks that USB and SATA are built on.
The good thing is that Maxim-IC make a number of I2C to 1-Wire controllers. These are the DS2482 and DS2483. There are probably others also.
So, the possibility to connect the chips directly to the PI was real.
I was able to acquire a couple of DS2482s from a friend of mine. I had to mount them on a 16 way SOIC to DIP converter.
The OWFS system was easily compiled from source on the Raspberry PI and installed.
I then began the search for the I2C drivers.
This was a hard one. I found many forums that resulted in a dead end. Many kernels were compiled and failed. I couldn't get/build a kernel that would work with the drivers installed.
I found a fella that had a pre-built kernel built for Debian. I use Arch, which is pretty different in it's config, even though it is Linux.Here is the link I used http://www.bootc.net/projects/raspberry-pi-kernel/ I also installed the latest firmware.
Anyhoo, I was able to install the new kernel and modules and boot a workable system. Cool.
All the quick checks were good.
I then wired up the chips, DS2482, and started the main program owserver. Hey presto, it worked.
I wired a couple of DS18B20's and could see them and read temperatures. Success.
I love this embedded Linux crap.
Raspberry PI Stuff and Building a Case
My Raspberry PI arrived a few weeks ago.
I tried both the Debian and Arch Linux boot images.
I don't have a convenient HDMI TV to play with, so I settled on the Arch version.
It suites me better, as I really wanted to use it as another Plug Computer, to do something with.
What to do with it? I am not sure yet. There will probably be something Home Automation related.
I am a big fan of the 1-Wire technology, for temperature sensors and control, so I compiled the latest version of OWFS on it. It worked fine with the USB 1-Wire controller.
The RPi has an I2C interface, so I decided to get my hands on a couple of DS2482-100s and DS2482-800s. These are I2C to 1-Wire controllers. After a bit of messing about, I was able to address the conrolllers using OWFS.
That will be a furure post, hopefully.
I was looking for a suitable plastic case fir the new toy. There are quite a few about and rather pricy for what they are. I liked the one on SKPANG. Including postage and VAT, it would come in at about €20. As my friend Ber would say 'Balzac' to that.
I came accross a post by Pecker Dunne on raspberrypi.org http://www.raspberrypi.org/phpBB3/viewtopic.php?f=40&t=9165&e=0
I was able to get a small sheet of perspex. Using youtube, I was able to determine that the 'score and snap' method was the best and cleanest way to get the pieces I wanted.
I made a few attempts. Two sheets of perspex and some No4 screws and nuts. I got some plastic washers to hold the board. It was just the job.
Attempt 2. In the presious version, I had put the screws too close to the IO header.
I also decided to make a breadboard version of it, to add breadboards and a USB hub.
I found that 3 screws would hold the RPi quite tightly and was easier to position the top piece.
Add a 10 port powered USB Hub
Some Breadboards
A Nanode and Xino Basic Arduinos for completeness.
I plan to use the slim breadboard for connections from the RPi headers and the larger one for the various components.
I sized the main plate, based on a plastic box with cover I have. Everything fits in and can be safely stored between project activity.
The next investigation will involve the Ciseco Slice of PI and the XRF radio module.
I tried both the Debian and Arch Linux boot images.
I don't have a convenient HDMI TV to play with, so I settled on the Arch version.
It suites me better, as I really wanted to use it as another Plug Computer, to do something with.
What to do with it? I am not sure yet. There will probably be something Home Automation related.
I am a big fan of the 1-Wire technology, for temperature sensors and control, so I compiled the latest version of OWFS on it. It worked fine with the USB 1-Wire controller.
The RPi has an I2C interface, so I decided to get my hands on a couple of DS2482-100s and DS2482-800s. These are I2C to 1-Wire controllers. After a bit of messing about, I was able to address the conrolllers using OWFS.
That will be a furure post, hopefully.
I was looking for a suitable plastic case fir the new toy. There are quite a few about and rather pricy for what they are. I liked the one on SKPANG. Including postage and VAT, it would come in at about €20. As my friend Ber would say 'Balzac' to that.
I came accross a post by Pecker Dunne on raspberrypi.org http://www.raspberrypi.org/phpBB3/viewtopic.php?f=40&t=9165&e=0
I was able to get a small sheet of perspex. Using youtube, I was able to determine that the 'score and snap' method was the best and cleanest way to get the pieces I wanted.
I made a few attempts. Two sheets of perspex and some No4 screws and nuts. I got some plastic washers to hold the board. It was just the job.
Attempt 2. In the presious version, I had put the screws too close to the IO header.
I also decided to make a breadboard version of it, to add breadboards and a USB hub.
I found that 3 screws would hold the RPi quite tightly and was easier to position the top piece.
Add a 10 port powered USB Hub
Some Breadboards
A Nanode and Xino Basic Arduinos for completeness.
I plan to use the slim breadboard for connections from the RPi headers and the larger one for the various components.
I sized the main plate, based on a plastic box with cover I have. Everything fits in and can be safely stored between project activity.
The next investigation will involve the Ciseco Slice of PI and the XRF radio module.
Monday, April 2, 2012
Arch Linux Stora Error - Fixed
I kept getting the following error repeated every gew seconds, filling up the log files like crazy.
unable to receive ctrl connection: Function not implemented
I found this after a bit of research
##in /etc/rc.local add
kill $(pidof udevd)
sleep3
udevd &
A reboot later and no problem.
It seems there was some problem between between different versions of udevd
Tuesday, March 6, 2012
Arch Linux on a Netgear Stora
I got one of these recently.
It is basically a Plug Computer, with the following specs:
My goal is to put Arch Linux on it. It seems that no one has done this yet.
What I am going to do, is set-up the system with Debian, which boots from the hard disk. There a number of recipes around to do this, particularly on the openstora.com site. I am following this one http://www.openstora.com/phpBB3/viewtopic.php?t=217
It did not contain all the information, so I thought about writing this walk through and fill in some blanks.
What you need to start is a USB serial cable. I got a Nokia phone data cable from eBay for a few Euros. Cut the end off the cable and solder some header thing on it. I used and old PC motherboard cable that I chopped up.
You also need some method to access the disk as a USB device. I used an old dismantled external drive controller board, which was handy.
To remove the back panel, you need to remove the two screws behind the Disk Release Latches. There are two of those nasty plastic clips about 5cm in from each side. There are two more of these nasty fellas about 9cm down from the top on the left and right side. Gently prise the panel with a small screw driver and it should pop off. Pop it off from the top as there are two clips on the bottom of the panel. These can be seen when looking at the bottom of the case.
You can see the serial port pins at the top of the board.
The pin-outs are from right to left:
Pin Function Notes
1 3.3Vdc Pin is the farthest from the battery.
2 RXD Recieve Data line from Stora.
3 TXD Transmit Data line from Stora.
4 GND Ground.
I will be using 2, 3 and 4, as I have cable made from an old Nokia USB data cable.
I installed tftp-hpa on the laptop, as the tftp server.
Connect stora to real network
Set-up environment for flashing.
The install the files from your tftp server
This will install Debian to the hard disk.
The disk partitioning takes a long time, 40 minutes or so, so go and have a cup of tea or a beer. I wouldn't recommend reboot at this time, cuz I don't know what state the Stora would be in. Perhaps and expensive brick.
Then, it begins installing the system..............
I then followed the remaining instructions on http://www.openstora.com/phpBB3/viewtopic.php?t=217
I got quite a few errors but kept going.
Presto chango! Debian!
aka FAIL
It wouldn't boot. Feck again.
I scrolled down further on that page and began to experiment a bit with the settings.
setenv bootcmd_ide 'ide reset; ext2load ide 0 0x200000 /boot/uImage; ext2load ide 0 0x800000 /boot/uInitrd'
setenv bootcmd 'setenv bootargs $(console) root=/dev/sda1; run bootcmd_ide; bootm 0x200000 0x800000'
saveenv
reset
Again FAIL. Again Feck.
I took out the drive and connected it via USB to my laptop.
I ended up with a single partition that had some GPT data in the partition table
# fdisk -l /dev/sdb
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk
doesn't support GPT. Use GNU Parted.
Feck again.
I used this link to remove it http://www.rodsbooks.com/gdisk/wipegpt.html
All cool.
Install Arch Linux
My next plan, was to prepare the disk and put an arm version of Arch Linux on it.
What you need is, the board ot whatever to connect your SATA drive to a USB cable. Connect it up.
Mine was /dev/sdb
Partition New Disk
I wanted to have the following disk layout:
/dev/sdb1 = 2Gb plenty of space. I don't want to have to worry that it will fill up and require maintenance at a later date.
/dev/sdb2 = swap of 1Gb
/dev/sdb3 = The rest of the disk
I have taken out some of the disk detail because it just clutters up the page.
> fdisk /dev/sdb
Delete whatever partitions are on the disk.
Command (m for help): p
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
Device Boot Start End Blocks Id System
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-3907029167, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-3907029167, default 3907029167): +20G
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (1-4, default 2):
Using default value 2
First sector (41945088-3907029167, default 41945088):
Using default value 41945088
Last sector, +sectors or +size{K,M,G} (41945088-3907029167, default 3907029167): +1G
Command (m for help): n
Partition type:
p primary (2 primary, 0 extended, 2 free)
e extended
Select (default p): p
Partition number (1-4, default 3):
Using default value 3
First sector (44042240-3907029167, default 44042240):
Using default value 44042240
Last sector, +sectors or +size{K,M,G} (44042240-3907029167, default 3907029167):
Using default value 3907029167
Command (m for help): p
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 2048 41945087 20971520 83 Linux
/dev/sdb2 41945088 44042239 1048576 83 Linux
/dev/sdb3 44042240 3907029167 1931493464 83 Linux
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 82
Changed system type of partition 2 to 82 (Linux swap / Solaris)
Command (m for help): p
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 2048 41945087 20971520 83 Linux
/dev/sdb2 41945088 44042239 1048576 82 Linux swap / Solaris
/dev/sdb3 44042240 3907029167 1931493464 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Done
Set-up the file systems and install Arch and Kernel files
I wanted to have journeling so I setup /dev/sdb1 to ext3. It should be reognised as ext2 on boot.
mkfs.ext3 /dev/sdb1
mkfs.ext4 /dev/sdb3
Mount /dev/sdb1 and cd to the mount point
wget http://archlinuxarm.org/os/ArchLinuxARM-armv5te-latest.tar.gz
extract the Arch linux tarball to the root of /dev/sdb1
e.g.
tar zxvf /location/ArchLinuxARM-armv5te-latest.tar.gz
kernel image: http://dl.dropbox.com/u/1397036/stora_di/uImage
initrd image: http://dl.dropbox.com/u/1397036/stora_di/uInitrd
wget the images and copy them into the boot directory of /dev/sdb1
Almost complete.
Finally put the disk back in the stora in the left slot.
Boot into the uBoot prompt.
Here are the settings I found that worked.
setenv mainlineLinux yes
setenv arcNumber 2743
setenv bootcmd_ide 'ide reset; ext2load ide 0 0x200000 /boot/uImage; ext2load ide 0 0x800000 /boot/uInitrd'
setenv bootcmd 'setenv bootargs $(console) root=/dev/sda1; run bootcmd_ide; bootm 0x200000 0x800000'
saveenv
reset
Let it run and it should boot into Arch Linux.
Woo Hoo !!!
Restore Original Firmware
It seems that the original firmware is stilled in Nand. To restore this use the following:
setenv mainlineLinux=no
setenv arcNumber
setenv bootcmd_ide
setenv bootcmd 'nand read.e 0x800000 0x100000 0x300000; setenv bootargs $(console) $(bootargs_root); bootm 0x800000'
saveenv
reset
Back to Arch Linux
setenv mainlineLinux yes
setenv arcNumber 2743
setenv bootcmd_ide 'ide reset; ext2load ide 0 0x200000 /boot/uImage; ext2load ide 0 0x800000 /boot/uInitrd'
setenv bootcmd 'setenv bootargs $(console) root=/dev/sda1; run bootcmd_ide; bootm 0x200000 0x800000'
saveenv
reset
The End
Now to put it back together, set it up with the services I want and put it into production as a house file server and some other sneaky things.
It is basically a Plug Computer, with the following specs:
My goal is to put Arch Linux on it. It seems that no one has done this yet.
What I am going to do, is set-up the system with Debian, which boots from the hard disk. There a number of recipes around to do this, particularly on the openstora.com site. I am following this one http://www.openstora.com/phpBB3/viewtopic.php?t=217
It did not contain all the information, so I thought about writing this walk through and fill in some blanks.
What you need to start is a USB serial cable. I got a Nokia phone data cable from eBay for a few Euros. Cut the end off the cable and solder some header thing on it. I used and old PC motherboard cable that I chopped up.
You also need some method to access the disk as a USB device. I used an old dismantled external drive controller board, which was handy.
To remove the back panel, you need to remove the two screws behind the Disk Release Latches. There are two of those nasty plastic clips about 5cm in from each side. There are two more of these nasty fellas about 9cm down from the top on the left and right side. Gently prise the panel with a small screw driver and it should pop off. Pop it off from the top as there are two clips on the bottom of the panel. These can be seen when looking at the bottom of the case.
You can see the serial port pins at the top of the board.
The pin-outs are from right to left:
Pin Function Notes
1 3.3Vdc Pin is the farthest from the battery.
2 RXD Recieve Data line from Stora.
3 TXD Transmit Data line from Stora.
4 GND Ground.
I will be using 2, 3 and 4, as I have cable made from an old Nokia USB data cable.
I installed tftp-hpa on the laptop, as the tftp server.
Connect stora to real network
Set-up environment for flashing.
setenv mainlineLinux yes setenv arcNumber 2743 setenv ipaddr XXX.XXX.XXX.XXX #This is the IP of your Stora setenv serverip XXX.XXX.XXX.XXX #This is the IP of your TFTP server saveenv reset
The install the files from your tftp server
tftpboot 0x200000 uImage.di
tftpboot 0x800000 uInitrd.di
setenv bootargs console=ttyS0,115200n8 base-installer/initramfs-tools/driver-policy=most
bootm 0x200000 0x800000
This will install Debian to the hard disk.
The disk partitioning takes a long time, 40 minutes or so, so go and have a cup of tea or a beer. I wouldn't recommend reboot at this time, cuz I don't know what state the Stora would be in. Perhaps and expensive brick.
Then, it begins installing the system..............
I then followed the remaining instructions on http://www.openstora.com/phpBB3/viewtopic.php?t=217
I got quite a few errors but kept going.
Presto chango! Debian!
aka FAIL
It wouldn't boot. Feck again.
I scrolled down further on that page and began to experiment a bit with the settings.
setenv bootcmd_ide 'ide reset; ext2load ide 0 0x200000 /boot/uImage; ext2load ide 0 0x800000 /boot/uInitrd'
setenv bootcmd 'setenv bootargs $(console) root=/dev/sda1; run bootcmd_ide; bootm 0x200000 0x800000'
saveenv
reset
Again FAIL. Again Feck.
I took out the drive and connected it via USB to my laptop.
I ended up with a single partition that had some GPT data in the partition table
# fdisk -l /dev/sdb
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk
doesn't support GPT. Use GNU Parted.
Feck again.
I used this link to remove it http://www.rodsbooks.com/gdisk/wipegpt.html
All cool.
Install Arch Linux
My next plan, was to prepare the disk and put an arm version of Arch Linux on it.
What you need is, the board ot whatever to connect your SATA drive to a USB cable. Connect it up.
Mine was /dev/sdb
Partition New Disk
I wanted to have the following disk layout:
/dev/sdb1 = 2Gb plenty of space. I don't want to have to worry that it will fill up and require maintenance at a later date.
/dev/sdb2 = swap of 1Gb
/dev/sdb3 = The rest of the disk
I have taken out some of the disk detail because it just clutters up the page.
> fdisk /dev/sdb
Delete whatever partitions are on the disk.
Command (m for help): p
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
Device Boot Start End Blocks Id System
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-3907029167, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-3907029167, default 3907029167): +20G
Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (1-4, default 2):
Using default value 2
First sector (41945088-3907029167, default 41945088):
Using default value 41945088
Last sector, +sectors or +size{K,M,G} (41945088-3907029167, default 3907029167): +1G
Command (m for help): n
Partition type:
p primary (2 primary, 0 extended, 2 free)
e extended
Select (default p): p
Partition number (1-4, default 3):
Using default value 3
First sector (44042240-3907029167, default 44042240):
Using default value 44042240
Last sector, +sectors or +size{K,M,G} (44042240-3907029167, default 3907029167):
Using default value 3907029167
Command (m for help): p
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 2048 41945087 20971520 83 Linux
/dev/sdb2 41945088 44042239 1048576 83 Linux
/dev/sdb3 44042240 3907029167 1931493464 83 Linux
Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 82
Changed system type of partition 2 to 82 (Linux swap / Solaris)
Command (m for help): p
Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 2048 41945087 20971520 83 Linux
/dev/sdb2 41945088 44042239 1048576 82 Linux swap / Solaris
/dev/sdb3 44042240 3907029167 1931493464 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
Done
Set-up the file systems and install Arch and Kernel files
I wanted to have journeling so I setup /dev/sdb1 to ext3. It should be reognised as ext2 on boot.
mkfs.ext3 /dev/sdb1
mkfs.ext4 /dev/sdb3
Mount /dev/sdb1 and cd to the mount point
wget http://archlinuxarm.org/os/ArchLinuxARM-armv5te-latest.tar.gz
extract the Arch linux tarball to the root of /dev/sdb1
e.g.
tar zxvf /location/ArchLinuxARM-armv5te-latest.tar.gz
kernel image: http://dl.dropbox.com/u/1397036/stora_di/uImage
initrd image: http://dl.dropbox.com/u/1397036/stora_di/uInitrd
wget the images and copy them into the boot directory of /dev/sdb1
Almost complete.
Finally put the disk back in the stora in the left slot.
Boot into the uBoot prompt.
Here are the settings I found that worked.
setenv mainlineLinux yes
setenv arcNumber 2743
setenv bootcmd_ide 'ide reset; ext2load ide 0 0x200000 /boot/uImage; ext2load ide 0 0x800000 /boot/uInitrd'
setenv bootcmd 'setenv bootargs $(console) root=/dev/sda1; run bootcmd_ide; bootm 0x200000 0x800000'
saveenv
reset
Let it run and it should boot into Arch Linux.
Woo Hoo !!!
Restore Original Firmware
It seems that the original firmware is stilled in Nand. To restore this use the following:
setenv mainlineLinux=no
setenv arcNumber
setenv bootcmd_ide
setenv bootcmd 'nand read.e 0x800000 0x100000 0x300000; setenv bootargs $(console) $(bootargs_root); bootm 0x800000'
saveenv
reset
Back to Arch Linux
setenv mainlineLinux yes
setenv arcNumber 2743
setenv bootcmd_ide 'ide reset; ext2load ide 0 0x200000 /boot/uImage; ext2load ide 0 0x800000 /boot/uInitrd'
setenv bootcmd 'setenv bootargs $(console) root=/dev/sda1; run bootcmd_ide; bootm 0x200000 0x800000'
saveenv
reset
The End
Now to put it back together, set it up with the services I want and put it into production as a house file server and some other sneaky things.
Labels:
arch linux,
archlinuxarm,
arm,
house server,
netgear,
stora
Subscribe to:
Posts (Atom)