Sunday, April 22, 2012

Icon USB GSM Modem Driver Startup Problems

Sometimes when rebooted Angstrom does not create the GSM modem devices /dev/ttyHS0-3. By removing the USB modem and reinserting it it seems to work, but we can't always do this, as when power fails and comes back up and we aren't there.

The device can also be created by inserting the module hso.ko into the kernel explicitly:

# insmod /lib/modules/3.2.13/kernel/drivers/net/usb/hso.ko

This can be tested by removing it first with 'rmmod hso'.

I will place the insmod command in the crontab shell script that starts the monitor tclsh program and see what happens.

....

Later: That did not work reliably (the ttyHS0-3 did not get created unless I unplugged the modem and plugged it in again.) 

So to investigate what's happening on reboot, I went to the web site http://www.draisberghof.de/usb_modeswitch/ and turned on logging in the config file /etc/usb_modeswitch.conf. This should place log statements in the file  /var/log/usb_modeswitch_<interface name>. We will see.
...
Later: logging only happens when hot plugging modem, not at boot time, and usb modeswitch seems to work when hot plugging. How does the usb modeswitch command work at boot time? Do I have to add a delay and manually call usb modeswitch?

Thursday, April 19, 2012

Beaglebone GSM modem program endurance test

This is a quick update. I've been running the home monitor program for around a week on the Beaglebone embedded Linux (Angstrom) system, with the Option Icon modem connected via a powered USB hub, and the board entirely on its own. "On its own" means not connected to the network or the host USB bus on the PC, so it cannot communicate other than via SMS (text) messaging. It has not stopped by itself yet, so it appears very likely that the USB power was an issue in earlier failures.

It starts automatically on reboot (power cycling.) I have set a crontab job (shell script) scheduled for @reboot, that runs the tclsh interpreter on my monitor program after an initial 120 second delay after reboot to let the GSM modem be recognized by the OS.

In testing, I have temporarily interrupted power to both the powered hub and board to make sure it restarts OK, and no problems yet. This is important since if I'm away and it fails I can simply have someone cycle power to get it going. Also, I can build a simple external "keep-alive" circuit the monitor program must periodically 'ping' with a GPIO bit level change. In the absence of  the pulse the circuit will cause power to be recycled via maybe a relay (optically isolated, naturally.)

Of course Beaglebone also cannot set its clock since it has no internal battery-backed clock, so I'll have to figure out a way of doing this. Maybe by having it send itself a text message, and getting the time from the received message.


Monday, April 9, 2012

Google Document with Beaglebone notes

Before I started this blog, I wrote some detailed notes as I brought up the Beaglebone. They are in the form of a Google document. I hope to keep further notes in this blog, but I wanted to mention it here to keep from having to copy this document into this blog.

Underpowered USB port may have caused the GSM Modem dropout

I suspected that the Option Icon 322 GSM modem dropout (timeout on 'at' commands) may have been due to USB power supply capabilities. So, as a test I have been running the GSM modem with the Beaglebone Linux board, but attached to a powered USB hub instead of directly attached to the host USB port on the Beagleone. My simple program that reports temperatures and power status has been running without a hitch for more than a day now, so it is looking likely that this is the problem. I'll let it run overnight as a further check before enabling the full range of monitor capabilities, which include replying to SMS senders instead of simply tweeting the SMS and running commands sent in the SMS text.

Friday, April 6, 2012

Upgrade summary

I will summarize my experience upgrading my beaglebone angstrom system from the A5 version to the hopefully latest. It was painful and may not have solved any problems. Here are the steps:

1. Did an 'opkg update', followed by an 'opkg upgrade'.

This failed with the previously mentioned perl problems:

Collected errors:
 * pkg_get_installed_files: Failed to open //var/lib/opkg/info/perl-module-build.pm.list: No such file or directory.
 * pkg_get_installed_files: Failed to open //var/lib/opkg/info/perl-module-load.pm.list: No such file or directoryroot@beaglebone:/home#

Fixed this using the solutions found on this page.

Did another update/upgrade sequence which seemed to work.

2. Moved the new kernel 3.2.13 to the boot partition of the microSD card, since this is required to use it on  booting (see gigamegablog.)

3. Rebooted, and did an 'ifup eth0' from a logon via the usb console connection to get the ethernet running.

4. Re-installed the usb-modeswitch-data_20120120-r0_all.ipk and usb-modeswitch_1.2.2-r0_armv7a.ipk packages to get the gsm modem running.

Other angstrom upgrade bugs/fixes

Upgrades (opkg upgrade) fail after updating (opkg update), and the following link has essential steps to correct the issue:

https://groups.google.com/forum/?fromgroups#!msg/beagleboard/4PDEnRXy7aA/jezLduIk90cJ

In essence file names need to be changed in several places via links and edits. This indicates beaglebone angstrom is in a state of extreme flux at this time.

Make sure to move kernel to boot partition after upgrade

To boot with the latest kernel, be sure to follow directions on the gigamegablog, quoted here, to boot using it:

When opkg delivers the kernels, it doesn’t install them.   To start using a new kernel, you need to manually install it onto the boot partition of the SD card – you can easily do this right from the Beaglebone command prompt.

Begin by mounting the boot partition.  You need to use a directory as a mount point: I’m using one called tmp:

root:~# mkdir tmp
root:~# mount /dev/mmcblk0p1 tmp
 
If you look at the mount point, you should see the following files:

root:~# ls tmp
Docs     LICENSE.txt  README.htm    u-boot.img  uImage
Drivers  MLO          autorun.inf  info.txt    uEnv.txt
 
Overwrite the uImage with the latest kernel file from /boot:

root:~# cp /boot/uImage-3.2.9+ tmp/uImage
 
Unmount to make sure everything is nicely tucked away on the SD card, then reboot:

root:~# umount tmp
root:~# shutdown -r now