[Klug-general] Raspberry Pi Serial terminal server

Mike Giles mike.giles at gmx.com
Thu Jan 9 08:28:33 UTC 2014


Hi Michael,
Thanks very much for the info, I will give this a go.
I guess I can leave ser2net in rc.local ?

Best Regards,
Mike
----- Original Message -----
From: Michael Miller
Sent: 01/08/14 11:58 PM
To: Kent Linux User Group - General Topics
Subject: Re: [Klug-general] Raspberry Pi Serial terminal server

Hello,

To setup sakis3g
http://lawrencematthew.wordpress.com/2013/08/07/connect-raspberry-pi-to-a-3g-network-automatically-during-its-boot/ 

There is a note about stopping and starting the service without a reboot.

Regards
Michael

 *From:* mike.giles at gmx.com 

 *Sent:* Tuesday, January 07, 2014 1:41 PM
 *To:* kent at mailman.lug.org.uk 
 *Subject:* [Klug-general] Raspberry Pi Serial terminal server

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


_______________________________________________
Kent mailing list
Kent at mailman.lug.org.uk
https://mailman.lug.org.uk/mailman/listinfo/kent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/kent/attachments/20140109/3570bfff/attachment.html>


More information about the Kent mailing list