[Klug-general] Raspberry Pi Serial terminal server

Mike Giles mike.giles at gmx.com
Tue Jan 7 13:41:53 UTC 2014


Good Afternoon,
I'm working on an HNC assignment using a Raspberry Pi model B running 
wheezy-raspian.
I'm a Linux Novice.
The Kernel is:
pi at raspberrypi /usr/bin/modem3g $ cat /proc/version
Linux version 3.6.11+ (dc4 at dc4-arm-01) (gcc version 4.7.2 20120731 
(prerelease) (crosstool-NG linaro-1.13.1+bzr2458 - Linaro GCC 2012.08) ) 
#538 PREEMPT Fri Aug 30 20:42:08 BST 2013

I have been using sakis3g and ser2net to connect the RPi to the cellular 
network and act as a serial terminal server. (based on various posts and 
blogs)
I have added the following to rc.local in an attempt to connect to the 
mobile network and configure the serial terminal server.
****
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

(sleep 2;sudo /usr/local/sbin/ser2net -c /etc/ser2net.conf -n) &
#sudo /usr/bin/modem3g/sakis3g connect
(sleep 5;sudo /home/pi/connect.sh) &
exit 0

****
connect.sh
****
#!/bin/bash
# script to connect to mobile network
echo "Running Sakis3g"
sleep 10
sudo /usr/bin/modem3g/sakis3g connect --console APN=CUSTOM_APN 
CUSTOM_APN='apn' APN_USER='user' APN_PASS='password' USBDRIVER=option 
USBMODEM=12d1:1003 OTHER=USBMODEM MODEM=OTHER
****
This normally works from a power on but often doesn't from a reboot.
I would like to debug the boot sequence to try and make this more reliable 
however I'm not sure how to enable/capture the debug output, I can't see 
anything in /var/logs.
Is there any debug I can enable or re-direct the console output to a file ?

I have found that the 3g modem is not always listed in lsusb.

I also experience random hangs/crashes and a power cycle is required to 
recover. I'm not sure if this is hardware related. I have a 2A power adapter 
and a powered USB hub that has the 3g modem, wifi adapter, mouse and 
keyboard connected to it. The RPi will run for varying lengths of time.
Any debug help would be much appreciated.
Best Regards,
Mike 




More information about the Kent mailing list