Showing posts with label plug computer. Show all posts
Showing posts with label plug computer. Show all posts

Thursday, June 6, 2013

Arch Linux Iomega IConnect I2C Sensors

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

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....

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.

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.