[iConnect] Post-install customization

Install Arch Linux ARM on other devices.

[iConnect] Post-install customization

Postby igorert » Thu Mar 15, 2012 6:28 am

Here are some post-install steps you may want to perform after installing Arch on iConnect. All of these assume you have set the arcNumber to 2870.

Controlling LEDs

All LED controls are in /sys/class/leds. The relevant ones are:
$this->bbcode_second_pass_code('', '
/sys/class/leds/iconnect:red:power
/sys/class/leds/iconnect:blue:power
/sys/class/leds/iconnect:blue:otb
/sys/class/leds/iconnect:blue:usb1
/sys/class/leds/iconnect:blue:usb2
/sys/class/leds/iconnect:blue:usb3
/sys/class/leds/iconnect:blue:usb4
/sys/class/leds/iconnect:led_level
')

Their functions are fairly obvious from the above directory names. The structure of all LED direcotires is identical, e.g.,

$this->bbcode_second_pass_code('', '
$ ls /sys/class/leds/iconnect:blue:usb1
brightness device max_brightness power subsystem trigger uevent
')

Two files there are of interest, "brightness" and "trigger". Write a non-0 value into "brightness" to turn on the corresponding LED, e.g., do the following (as root) to turn on USB LED 1:
$this->bbcode_second_pass_code('', '
echo 255 > /sys/class/leds/iconnect:blue:usb1/brightness
')

Write 0 to turn LED off, e.g. the following will turn off USB LED 1:
$this->bbcode_second_pass_code('', '
echo 0 > /sys/class/leds/iconnect:blue:usb1/brightness
')

"trigger" allows you to trigger turning on of the corresponding LED based on some events:
$this->bbcode_second_pass_code('', '
$ cat /sys/class/leds/iconnect:blue:usb1/trigger
[none] nand-disk timer heartbeat default-on rfkill0 phy0rx phy0tx phy0assoc phy0radio
')

The current trigger is in square brackets. To change the trigger, write one of the above values into the "trigger" file under corresponding LED, e.g., the following will blink USB LED 1:
$this->bbcode_second_pass_code('', '
echo timer > /sys/class/leds/iconnect:blue:usb1/trigger
')

"timer" and "heartbeat" are both pseudo triggers that blink the LED with different patterns. "nand-disk" blinks when there is NAND activity. rfkill0 and phy* trigger blinking on the corresponding wireless card activity; e.g., the following will cause the OTB LED to blink whenever a transmission happens on the wireless interface:
$this->bbcode_second_pass_code('', '
echo phy0tx > /sys/class/leds/iconnect:blue:otb/trigger
')

/sys/class/leds/iconnect:led_level is special - it controls the brightness of all LEDs, just as the name suggests. Write 0 to /sys/class/leds/iconnect:led_level to dim the LEDs:
$this->bbcode_second_pass_code('', '
echo 0 > /sys/class/leds/iconnect:led_level/brightness
')
Write any non-0 value to "undim". You can also use led_level triggers to change the LED brightness based on trigger events if that suites your fancy.


Temperature sensor

Install lm_sensors package:
$this->bbcode_second_pass_code('', '
pacman -S lm_sensors
')

Load the modules needed to detect the temperature sensor:
$this->bbcode_second_pass_code('', '
modprobe -a lm63 i2c_mv64xxx hwmon i2c_core
')

Run sensors-detect; answer "yes" to all questions. This should create "/etc/conf.d/lm_sensors" file with the needed configuration. Add "sensors" to the DAEMONS line in your /etc/rc.conf; it will automatically load the needed modules on reboot.

You can now run "sensors" command to check iConnect temperature:
$this->bbcode_second_pass_code('', '
$ sensors
lm63-i2c-0-4c
Adapter: mv64xxx_i2c adapter
temp1: +40.0°C (high = +70.0°C)
temp2: +39.4°C (low = +0.0°C, high = +70.0°C)
(crit = +85.0°C, hyst = +75.0°C)
')


OTB (front) and reset (back) buttons

See this post for some ideas on how to trigger actions when you press the OTB or reset buttons. If you'd like to perform different actions depending on which of the buttons was pressed, here is what you need to know about the data you read from /dev/input/event0:
$this->bbcode_second_pass_code('', '
inputEventFormat = 'iiHHi'
time1, time2, ev_type, code, value = struct.unpack(inputEventFormat, event)
')

  • time1 - time in seconds since Jan 1, 1970 UTC (aka Unix time)
  • time2 - useconds after time1. That is, time1.time2 is the time when the event occurred.
  • ev_type - event type. "5" corresponds to button events so that's the only value you need to pay attention to.
  • code - event code. 0 corresponds to reset button (the one on the back), 1 corresponds to OTB button on the front of iConnect.
  • value - 1 when a button is pressed, 0 when it's released.
igorert
 
Posts: 35
Joined: Sun Jun 26, 2011 5:31 pm
Location: aka chalkbag on irc

Re: [iConnect] Post-install customization

Postby Conn » Mon Mar 19, 2012 7:43 pm

Hello,

My iConnect installation and upgrades are done %100. I've added lm63 module too. Even though my system is up to date sensors-detect and sensors commands do not exist. When I lsmod I can see lm63 on the list.

What have I done wrong?

TIA,
Conn
Conn
 
Posts: 27
Joined: Sat Mar 10, 2012 7:34 pm

Re: [iConnect] Post-install customization

Postby Conn » Fri Mar 23, 2012 9:12 pm

Tried it again and it worked... Thanks.

I have two more questions, if I may :

1. How can I be sure which package can be run on iConnect? For example; I've tried to install an editor but when I installed it I realized that it was an X11 application. The explanation was not enough and I am not that experienced with Linux for that matter.

2. I want to write simple scripts and a serial communication software on iConnect but I don't know what to install and use for Python. Most of the packages are not for iConnect and/or console use. (I don't mind to use another easy to use language or interpreter)

Sorry if those questions were repeats.

Thanks in advance,
Conn
Conn
 
Posts: 27
Joined: Sat Mar 10, 2012 7:34 pm

Re: [iConnect] Post-install customization

Postby igorert » Mon Mar 26, 2012 5:00 pm

$this->bbcode_second_pass_quote('Conn', '1'). How can I be sure which package can be run on iConnect? For example; I've tried to install an editor but when I installed it I realized that it was an X11 application.

Just about everything you see in the repo will run on iConnect. In particular, X applications run fine. Whether you want to use them is another story.

$this->bbcode_second_pass_quote('', '.').. I don't know what to install and use for Python.

$this->bbcode_second_pass_code('', 'pacman -S python2')
You may want to link it to just python after install:
$this->bbcode_second_pass_code('', 'ln -s /usr/bin/python2 /usr/bin/python')
You'll need to read up on python to figure out how to use it...
igorert
 
Posts: 35
Joined: Sun Jun 26, 2011 5:31 pm
Location: aka chalkbag on irc

Re: [iConnect] Post-install customization

Postby WarheadsSE » Mon Mar 26, 2012 5:38 pm

Or, better yet, update your code's #! to (properly) point to python2
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: [iConnect] Post-install customization

Postby Conn » Tue Apr 03, 2012 9:48 am

Thank you all... I've uninstalled python and reinstalled all libs with python 2. Linked it to python and works like a charm now.

Now, I've installed samba, Lighttpd and set up my first web site, now I'm working on some cgi to control my arduino robot.

While I was working on all these stuff, I realized that I had to use a HDD instead of a USBflash. I've ripped a 40GB HDD off an old notebook and copied everything from the USB Stick (which is 4GB). My installation is 1,5 GB and I've used tar as I've tried others(dd,cp) and failed :

$this->bbcode_second_pass_code('', 'tar cf - . | (cd /media/disk; tar xf -)')

When I tried to boot my iConnect it skipped booting from USB HDD and jumped back to NAND. The USB Stick works but USB HDD doesn't. (formatted to ext2, copied properly)


Any ideas?

TIA,
Conn
Conn
 
Posts: 27
Joined: Sat Mar 10, 2012 7:34 pm

Re: [iConnect] Post-install customization

Postby igorert » Tue Apr 03, 2012 6:01 pm

It's hard to tell not seeing your logs and not knowing what directory "." is in your case. In general, you probably do not want to copy /proc and /sys. But take a look at your /var/log/messages, it may tell you what goes wrong if your boot process proceeds far enough for the log to get written.
igorert
 
Posts: 35
Joined: Sun Jun 26, 2011 5:31 pm
Location: aka chalkbag on irc

Re: [iConnect] Post-install customization

Postby Philoo » Tue Apr 03, 2012 8:23 pm

I had a similar thing when I first tried a usb hdd.
I solved it by increasing the delay before uboot starts searching for the uImage file from 10sec to 30sec.
Just allow for the spinning rust to spin properly.
Philoo
 
Posts: 102
Joined: Wed Aug 10, 2011 9:20 pm

Re: [iConnect] Post-install customization

Postby Conn » Tue Apr 03, 2012 9:26 pm

@igor : "." is the root of my source USB Stick. "Tar"ring the system to copy seemed fine but I think some links/files/devices were not copied properly. I did smth else and it partially worked; I used clonezilla to copy flash to HDD.

The system boots but I get a minor error :

$this->bbcode_second_pass_code('', ':: Waiting for UDev uevents to be processed [BUSY] ata_id[115]: HDIO_GET_IDENTITY failed for '/dev/sda'')

The system boots and seems OK this time. Is there a way to check all the system parameters including the fileystem when everything is mounted?

Cheers,
Conn
Conn
 
Posts: 27
Joined: Sat Mar 10, 2012 7:34 pm

Re: [iConnect] Post-install customization

Postby igorert » Wed Apr 04, 2012 3:32 pm

Dunno, I'd try copying like this:
$this->bbcode_second_pass_code('', '
mkdir /tmp/foo
mount --bind / /tmp/foo
')
Then copy over /tmp/foo directory the way you did (note that /proc and /sys are empty - this is as it should be). Or just do a fresh install to the hard drive directly...

P.S. HDIO_GET_IDENTITY is a request to identify the drive so if everything other than this works, I probably wouldn't worry too much...
igorert
 
Posts: 35
Joined: Sun Jun 26, 2011 5:31 pm
Location: aka chalkbag on irc

Next

Return to [Please read announcement] Community-Supported Devices

Who is online

Users browsing this forum: Google [Bot] and 1 guest