|
|||||||||||||||
This is for older 2.4.x kernels and older IRDA-utils versions. This does not seem to work with newer kernels and newer Linux distributions.
Also works with Ericsson T68i
irtty/ircomm/irda/..etc worked well with kernel 2.2.12/2.2.13 and irda/irtty. (SuSE 6.3 worked fine)
Later kernel versions does not work, there has been some major changes with irda, that made it impossible to use SH888 through the serial cabel. Problems are:
After a lot of experimenting, I gave up on irtty.c . Instead I tried irport.c which accesses the serial port hardware directly, and does not use the serial.o module/driver.
This actually works! :)
Before irport can be loaded:
# IrDA
alias char-major-161 ircomm-tty
alias irda0 irport
# alias tty-ldisc-11 irtty
# set to IO and IRQ of the used serial port (here ttyS0) :
options irport io=0x3f8 irq=4
setserial /dev/ttyS0 uart none port 0
For SuSE the followingl /sbin/init.d/irda could be used:
#!/bin/sh
#
# irda This shell script takes care of starting and stopping
# IrDA support
# Source function library.
#. /etc/rc.d/init.d/functions
. /etc/rc.config
PIDFILE=/var/run/irattach.pid
# Source IrDA networking configuration.
#. /etc/sysconfig/irda
IRDA=yes
DEVICE=/dev/ttyS0
DEVICE_IRPORT=irda0
DISCOVERY=yes
IRATTACH=/usr/local/sbin/irattach
# The echo return value for success (defined in /etc/rc.config).
RETURN=$rc_done_up
# Check that irda is up.
[ ${IRDA} = "no" ] && exit 0
[ -f $IRATTACH ] || exit 0
ARGS=
if $DONGLE ; then
ARGS="$ARGS -d $DONGLE"
fi
if [ "$DISCOVERY" = "yes" ];then
ARGS="$ARGS -s "
fi
PID=
test -f $PIDFILE && PID=`cat $PIDFILE`
# See how we were called.
case "$1" in
irport|start)
# Attach irda device
ARGS=-s
echo -n "Starting IrDA: irport "
# first remove serial driver!
setserial $DEVICE uart none port 0
#modprobe -r serial
modprobe -r irtty
modprobe irda
modprobe irport
echo 0 > /proc/sys/net/irda/debug
if startproc -v ${IRATTACH} ${DEVICE_IRPORT} ${ARGS} ; then
echo "IRDA: irattach is running"
sleep 2
else
RETURN=$rc_failed_up
echo "IRDA: could not start irattach"
fi
touch /var/lock/subsys/irda
echo
;;
serial)
# Attach irda device
echo -n "Starting IrDA: "
modprobe irda
echo 1 > /proc/sys/net/irda/debug
if startproc -v ${IRATTACH} ${DEVICE} ${ARGS} ; then
echo "IRDA: irattach is running"
sleep 2
else
RETURN=$rc_failed_up
echo "IRDA: could not start irattach"
fi
touch /var/lock/subsys/irda
echo
;;
stop)
# Stop service.
echo -n "Shutting down IrDA: "
if killproc $IRATTACH ; then
echo "IRDA: irattach is down"
while kill -0 $PID 2>/dev/null ; do sleep 2 ; done
else
RETURN=$rc_failed_up
fi
rm -f /var/lock/subsys/irda
modprobe -r irtty
modprobe -r ircomm-tty
modprobe -r ircomm
modprobe -r irport
setserial /dev/ttyS0 uart 16550A port 0x3F8 irq 4
echo
;;
status)
#status $IRATTACH
echo "IRDA: Checking for services: "
## Check status with checkproc(8), if process is running
## checkproc will RETURN with exit status 0.
# -f $PID
checkproc $IRATTACH \
&& echo "IRDA: irattach is running" \
|| { echo "IRDA: services not available" ; \
RETURN=$rc_failed_up ; }
;;
restart|reload)
$0 stop
$0 start
;;
*)
echo "Usage: irda {start|stop|status}"
exit 1
esac
echo -e "$RETURN"
test "$RETURN" = "$rc_done_up" && exit 0
exit 1
Start with /sbin/init.d/irda start, and unload with /sbin/init.d/irda stop.
For other linux distributions the file must be adapted, and moved to appropriate location (debian: /etc/init.d/irda ).
Set port to /dev/ircomm0, and set to a speed >9600. Usually a speed of 115200 will work fine, since it is a "virtual" speed. Setting speed to 9600 or less will not give a good perfomance.
#!/bin/sh exec chat -v -r /var/log/ppp-chat.log \ REPORT CONNECT \ REPORT OK \ REPORT BUSY \ REPORT 'NO CARRIER' \ REPORT 'NO DIALTONE' \ TIMEOUT 25 \ '' 'ATZ' \ OK "AT+CBST=71" \ OK ATDT$PHONE \ ABORT 'NO CARRIER' \ ABORT 'BUSY' \ ABORT 'NO DIALTONE' \ ABORT 'WAITING' \ TIMEOUT 45 \ CONNECT
PHONE=NNNNNNNN
pppd /dev/ircomm0 115200 connect /etc/ppp/chatscript \
user PPPUSER noauth ....extra pppd options ....
|
||||||||||||||
|
||||||||||||||