View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 4 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Tue Apr 15, 2014 10:56 pm 
Offline
Joined: Tue Oct 03, 2006 12:31 am
Posts: 11
Just to document what I did, I followed the instructions here: http://ubuntuforums.org/showthread.php?t=1578375 but I modified the /etc/sv/lirc/run script to fit my needs:

Code:
#since what we do may not be enough
#if your one of those people, this is where you place your stuff
#This means place your lirc stuff in /etc/runit/lirc.sh.
#Anything in that file will be used and the rest of this file is ignored

if [ -f /etc/runit/lirc.sh ]
then
    #program must not terminate.

    stat_runit "Starting lirc"

    /etc/runit/lirc.sh
else
    . /etc/systemconfig
    stat_runit "Starting lirc"

    in_kernel_support "disable"

    [ -e /etc/sv/lircd/.runtime ] || mkdir -p /etc/sv/lircd/.runtime
    [ -e /var/run/lirc ] || mkdir -p /var/run/lirc

    function dvico_detect {
        if [[ x$Remotetype = xdvico* ]] || [ x$Remotetype = "xDvico-Dual-Digital4-rev2" ]
        then
            RunDvico=true
        else
            RunDvico=false
        fi
    }

    num_lirc=`ls -la /dev/lirc[0-9] 2>/dev/null |wc -l `
    num_lirc=$((num_lirc-1))

    serial_port="ttyF0"

    if [ x$ReceiverType = xSerial ]
    then
        serial_port=$ReceiverSerialport
    elif [ x$HostBlasterType = xSerial ]
    then
        serial_port=$HostSerialPort_blasterlirc
    fi

    if [ -n "$serial_port" ]
    then
        #/dev/ttyS0 (COM1), port 0x3f8, irq 4
        #/dev/ttyS1 (COM2), port 0x2f8, irq 3
        #/dev/ttyS2 (COM3), port 0x3e8, irq 4
        #/dev/ttyS3 (COM4), port 0x2e8, irq 3

        case $serial_port in
        ttyS0)
               FLAGS="io=0x3f8  irq=4"
               ;;
        ttyS1)
               FLAGS="io=0x2f8  irq=3"
               ;;
        ttyS2)
               FLAGS="io=0x3e8  irq=4"
               ;;
        ttyS3)
               FLAGS="io=0x2e8  irq=3"
               ;;
        ttyF0)
                FLAGS="io=0xcc00 irq=16 share_irq=1"
                ;;
        ttyF1)
                FLAGS="io=0xc880 irq=17 share_irq=1"
                ;;
        esac
        /usr/bin/setserial /dev/$serial_port uart none
        sleep 0.5
        /sbin/modprobe lirc_serial $FLAGS
        sleep 0.5
    fi

    dvico_detect

    if [ x$HostBlasterType = xCommandIR -o x$ReceiverType = xCommandIR ]
    then
        CMD="/usr/sbin/lircd -r -n  --driver=commandir"
        printhl "   Using commandir"
        $CMD >>$LOG 2>>$LOG
        #echo $CMD
    elif [  x$HostBlasterType = xiguanaIR-usb -o x$ReceiverType = xiguanaIR-usb ]
    then
        sv start igdaemon
        CMD="/usr/sbin/lircd -r -n  --driver=iguanaIR"
        printhl "       Using iguanaIR usb"
        #echo $CMD
        $CMD >>$LOG 2>>$LOG

    elif [ x$ReceiverType = "xSiliconDust_HDHR" ]
    then
        # if using the SiliconDust_HDHR as an I/R Receiver
        printhl "   Using SiliconDust on port 5000"
        CMD="/usr/sbin/lircd -H udp -d 5000 -n"
        exec $CMD >>$LOG 2>>$LOG
    else
        LASTCMD=""

        for i in `seq 1 $num_lirc`
        do
            CMD="/usr/sbin/lircd -r -d /dev/lirc$i --output=/var/run/lirc/lircd$i --pidfile=/var/run/lircd$i.pid --listen=876$i"
            printhl "   Device $i"
            #echo $CMD
            $CMD >>$LOG 2>>$LOG
            LASTCMD="--connect=localhost:876$i   $LASTCMD    "
        done

        if [ $RunDvico = "true" ]
        then
            if [[ x$Remotetype = xdvico* ]]
            then
                LCMD="/usr/sbin/lircd -r -n -d /dev/usb/dvicoIR --driver=dvico  --output /var/run/lirc/lircd"
            else
                LCMD="/usr/sbin/lircd -r -n -d /dev/input/irremote --driver=devinput  --output /var/run/lirc/lircd"
            fi

            if [ $num_lirc -lt 0 ]
            then
                # Only run Dvico
                printhl "   Device $Remotetype"
                #echo $LCMD
                exec $LCMD >>$LOG 2>>$LOG
            elif [ $num_lirc -gt -1  ]
            then
                i=$((i+1))
                CMD="$LCMD --output=/var/run/lirc/lircd$i --pidfile=/var/run/lircd$i.pid --listen=876$i"
                $CMD >> $LOG
                LASTCMD="--connect=localhost:876$i   $LASTCMD    "
                printhl "   Device Dvico"
                /usr/sbin/lircd -r -n -d /dev/lirc0 --output /var/run/lirc/lircd  $LASTCMD  >>$LOG 2>>$LOG
            fi
        else
            LCMD="/usr/sbin/lircd -r -n -d /dev/lirc0 --output /var/run/lirc/lircd  $LASTCMD"
            #echo $LCMD
            exec $LCMD >>$LOG 2>>$LOG
        fi
    fi
fi


lspci -v

Code:
01:00.0 Serial controller: NetMos Technology Device 9922 (prog-if 02 [16550])
        Subsystem: Device a000:1000
        Flags: fast devsel, IRQ 16
        I/O ports at cc00 [size=8]
        Memory at feaff000 (32-bit, non-prefetchable) [size=4K]
        Memory at feafe000 (32-bit, non-prefetchable) [size=4K]
        Capabilities: <access denied>

01:00.1 Serial controller: NetMos Technology Device 9922 (prog-if 02 [16550])
        Subsystem: Device a000:1000
        Flags: fast devsel, IRQ 17
        I/O ports at c880 [size=8]
        Memory at feafd000 (32-bit, non-prefetchable) [size=4K]
        Memory at feafc000 (32-bit, non-prefetchable) [size=4K]
        Capabilities: <access denied>


/etc/modprobe.d/lirc_serial.conf

Code:
options lirc_serial io=0xcc00 irq=16
options lirc_serial io=0xc880 irq=17
alias char-major-61 lirc_serial
options lirc_serial share_irq=1


I added the /ttyF0 and F1 connectors. It did turn out that the lower connector on the board was actually F0.

I did have to compile the driver so I had to do a pacman -S kernel26-headers.

This is all thanks to TWC changing the DCT2000 serial port so it is not working any longer. I grew tired of waiting and GoT has started. Time to fix the MythBox.

If you need any help, just post here and I will follow up as best I can.


Top
 Profile  
 
PostPosted: Wed Apr 16, 2014 11:50 am 
Offline
Joined: Fri Jul 21, 2006 11:12 pm
Posts: 999
Location: SC
Just a warning that if you update runit-scripts your modifications to /etc/sv/lircd/run will be overwritten.


Top
 Profile  
 
PostPosted: Thu Apr 17, 2014 3:40 am 
Offline
Joined: Tue Oct 03, 2006 12:31 am
Posts: 11
Thanks,
I did read that but rather than write my own runit script, it seemed to me that it would be easier and more accurate to modify the run script. Also, the Net Mos chip is supported in the 3.0 kernels and so the change I made should probably a permanent change in LinHes.


Top
 Profile  
 
PostPosted: Thu Apr 17, 2014 9:53 am 
Offline
Joined: Fri Jul 21, 2006 11:12 pm
Posts: 999
Location: SC
dweeks wrote:
Also, the Net Mos chip is supported in the 3.0 kernels and so the change I made should probably a permanent change in LinHes.
Please open a issue at http://linhes.org/projects/linhes/issues/new


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu