Loading ...
Sorry, an error occurred while loading the content.

Setting serial port /dev/ttyAMA0 KISS parameters on a TNC-Pi failed

Expand Messages
  • f6bvp@free
    Hello all, I have installed a TNC-Pi on my Raspberry Pi for packet radio on a VHF radio. After starting GUI environment with startx command, I could run Xastir
    Message 1 of 12 , Jul 15, 2013
    • 0 Attachment
      Hello all,

      I have installed a TNC-Pi on my Raspberry Pi for packet radio on a VHF
      radio.
      After starting GUI environment with startx command, I could run Xastir
      and soon get a full map of APRS stations around me.
      I configured TNC-Pi jumpers in order to use serial connection as I did
      not want to use more than one TNC.
      Thus Xastir was configured to use directly /dev/ttyAMA0 port without any
      kissattach.
      My APRS beacon was sent regularly by the TNC-Pi with correct TxDelay and
      other AX.25 frame parameters.

      I also followed TNC-Pi documentation to kissattach /dev/ttyAMA0 to an
      AX.25 port with no error message.
      But I failed to connect a local station on a radio port with call
      application (same as ax25_call).
      Listening to the packet radio on a second receiver I could hear that
      SABM packet were very short.
      I tried to change KISS parameters using kissparms again with no error
      message but without any effect.

      kissparms -p port -l txtail (millisec) -r persist (0-255 -s slottime
      (millisec) -t txdelay (millisec)

      I then removed kissattach and performed an Unix98 style attachment of
      ttyAMA0 with a script derived from
      Charley's K4GBB :

      =============

      # Attach TNC-Pi in kiss mode - on device /dev/ttyAMA0 at 19200 bauds for
      ---> ax0 = vhfdrop (in /etc/ax25/axports)
      /usr/local/sbin/mkiss -s 19200 -x 1 /dev/ttyAMA0 > /tmp/unix98
      export PTS3=`more /tmp/unix98 | grep -w /dev | cut -b -11`
      /usr/local/sbin/kissattach $PTS3 vhfdrop > /tmp/ax25-config.tmp
      awk '/device/ { print $7 }' /tmp/ax25-config.tmp > /tmp/ax25-config2-tmp
      read Device < /tmp/ax25-config2-tmp
      #
      /usr/local/sbin/kissparms -p vhfdrop -r 250 -s 10 -l 20 -t 220
      # Check for Device
      if [ -d /proc/sys/net/ax25/$Device ]
      then echo "Port vhfdrop attached to $Device"
      cd /proc/sys/net/ax25/$Device/
      else echo "** Error setting $Device parms **"
      fi
      /bin/sleep 4
      # Port end

      ===============

      Again kissparms parameters settings did not succeed in changing packet
      duration, both steps gave no error message.

      I wonder if someone could tell me how to set correctly TNC-Pi kiss
      parameters and what I am doing wrong ?

      73's de Bernard, f6bvp
    • John Wiseman
      Bernard, The TNC-PI should accept normal KISS set parameters frames, but you can use pitnc_setparams to set them. You can also use a pot on the board to set
      Message 2 of 12 , Jul 16, 2013
      • 0 Attachment
        Bernard,
         
        The TNC-PI should accept normal KISS set parameters frames, but you can use pitnc_setparams to set them. You can also use a pot on the board to set TXDELAY. This will be used if the TXDELAY parameter is set to zero (using pitnc_setparams). The TXDELAY value set using a KISS command or pitnc_setparams is in 10mS units.
         
        73, John 
         

        From: Raspberry_Pi_4-Ham_RADIO@yahoogroups.com [mailto:Raspberry_Pi_4-Ham_RADIO@yahoogroups.com] On Behalf Of f6bvp@free
        Sent: 15 July 2013 22:16
        To: Raspberry_Pi_4-Ham_RADIO@yahoogroups.com
        Cc: k4gbb
        Subject: [Raspberry_Pi_4-Ham_RADIO] Setting serial port /dev/ttyAMA0 KISS parameters on a TNC-Pi failed

         

        Hello all,

        I have installed a TNC-Pi on my Raspberry Pi for packet radio on a VHF
        radio.
        After starting GUI environment with startx command, I could run Xastir
        and soon get a full map of APRS stations around me.
        I configured TNC-Pi jumpers in order to use serial connection as I did
        not want to use more than one TNC.
        Thus Xastir was configured to use directly /dev/ttyAMA0 port without any
        kissattach.
        My APRS beacon was sent regularly by the TNC-Pi with correct TxDelay and
        other AX.25 frame parameters.

        I also followed TNC-Pi documentation to kissattach /dev/ttyAMA0 to an
        AX.25 port with no error message.
        But I failed to connect a local station on a radio port with call
        application (same as ax25_call).
        Listening to the packet radio on a second receiver I could hear that
        SABM packet were very short.
        I tried to change KISS parameters using kissparms again with no error
        message but without any effect.

        kissparms -p port -l txtail (millisec) -r persist (0-255 -s slottime
        (millisec) -t txdelay (millisec)

        I then removed kissattach and performed an Unix98 style attachment of
        ttyAMA0 with a script derived from
        Charley's K4GBB :

        =============

        # Attach TNC-Pi in kiss mode - on device /dev/ttyAMA0 at 19200 bauds for
        ---> ax0 = vhfdrop (in /etc/ax25/axports)
        /usr/local/sbin/mkiss -s 19200 -x 1 /dev/ttyAMA0 > /tmp/unix98
        export PTS3=`more /tmp/unix98 | grep -w /dev | cut -b -11`
        /usr/local/sbin/kissattach $PTS3 vhfdrop > /tmp/ax25-config.tmp
        awk '/device/ { print $7 }' /tmp/ax25-config.tmp > /tmp/ax25-config2-tmp
        read Device < /tmp/ax25-config2-tmp
        #
        /usr/local/sbin/kissparms -p vhfdrop -r 250 -s 10 -l 20 -t 220
        # Check for Device
        if [ -d /proc/sys/net/ax25/$Device ]
        then echo "Port vhfdrop attached to $Device"
        cd /proc/sys/net/ax25/$Device/
        else echo "** Error setting $Device parms **"
        fi
        /bin/sleep 4
        # Port end

        ===============

        Again kissparms parameters settings did not succeed in changing packet
        duration, both steps gave no error message.

        I wonder if someone could tell me how to set correctly TNC-Pi kiss
        parameters and what I am doing wrong ?

        73's de Bernard, f6bvp

      • f6bvp
        Charley, I agree. TNC-Pi is definitively not compatible with kissattach. After killing kissattach task related to /dev/ttyAMA0 I used /pitnc_getparams 0 0 and
        Message 3 of 12 , Jul 16, 2013
        • 0 Attachment
          Charley,

          I agree. TNC-Pi is definitively not compatible with kissattach.
          After killing kissattach task related to /dev/ttyAMA0 I used  pitnc_getparams 0 0 and got the configuration.
          TxDelay was set to a value different from 0 and apparently too short.
          Then I set TXDelay to 0 with  pitnc_setparams 0 0 1 0  command.
          This enabled adjusting hardware TXDelay, which I did by turning R6 potentiometer full clockwise.
          I kissattached again /dev/ttyAMA0 to AX.25 port and TXDelay was fine.

          I wonder if kissattach should be patched in order to detect if it is talking to a TNC-Pi  and send it the specific codes ?

          By the way, Michel F3KT sent me some more precision about changing TNC-Pi i2c address, that I include here :

          =================================

          Using TNC-PI via i2c Interface

          Enabling i2c on PI

          Note. On Version 1 boards (without the two mounting holes) the i2c bus on the main header is number 0. On Version 2 boards it is number 1.

          To use i2c, (which you need if you want to run more than one TNC-PI) you need to enable loading of the Kernel i2c module, and load the i2c userspace interface

          Edit /etc/modprobe.d/raspi-blacklist.conf, and remove line blacklist i2c-bcm2708.

          Edit /etc/modules and add line i2c-dev

          Install i2c tools - not essential, but useful when testing sudo apt-get install i2c-tools

          Reboot the PI

          By default user PI won't have access to the i2c bus. You can run everything as root using sudo, but it is better to give pi access to the i2c bus by adding user pi to group i2c

          sudo usermod -a -G i2c pi

          You'll need to log in again to pick up the new groups. If all this has worked you should be able to run the command

          i2cdetect 1    (or i2cdetect 0 if using a Version 1 board). This lists all devices sound on the bus.

          Configuring TNC

          The TNC is shipped configured to use the serial port. To enable i2c you have to change the value in location 7 of the NVRAM.
          If you have more than one TNC you have to do one at a time - you cant have two TNCs using the serial port at the same time.
          So plug in one of the TNCs, and run

          ./pitnc_getparams 0 0 - you should get something like

          01 TXDelay - Zero means use ADC  00
          02 Persistance                   64
          03 Slottime (in 10 mS)           10
          04 TXTail                         0
          05 Full Duplex - Not used         0
          06 Our Channel (Hex)             00
          07 I2C Address (0 = async) Hex   00
             ADC Value                     28
          8 0 00 40 a 0 0 0 0 1c 74 c0 sum 2
          
          Set the i2c address - I usually start from 16 (for no very good reason)

          Warning - the i2c address must be between 3 and 119.

          ./pitnc_setparams 0 0 7 16   This should now show that location 7 is 16 (10 hex) Confirm with another get_params. Note that it wont switch to i2c mode till the TNC is reset. To do this set reg 15 to 2

          ./pitnc_setparams 0 0 15 2   The leds should flash, but you wont get a response (as the program is still in serial mode). Now read the params in i2c mode

          ./pitnc_getparams 1 16  (assuming it is a Version 2 board (with the mounting holes). It should now respond.

          You can also use i2cdetect to check that the TNC is visible on the i2c bus.

          John Wiseman G8BPQ
          22/3/2013

          =============

          73 de Bernard, f6bvp

          Le 16/07/2013 00:22, k4gbb a écrit :
          Bernard,
            Apparently the TNC-PI does not adhere to the normal KISS standards.
          John Wiseman, G8BPQ wrote the interface.
          He also wrote two utilities to Set and Read the interface.

          To configure the TNC-Pi you will need the configuration programs pi_tncsetparams and pi_tncgetparams.
          The getparams program reads the parameters from the TNC-Pi while the setparams program allows you to set them.
          These programs are available at:  www.tnc-x.com/params.zip

          I used getparms and setparms to setup my TNC-PI for I2C.
          I don't remember the defaults, they may have been close enough for my radio.

          Here are my Notes:
          TNC-Pi i2c


        • W8LM
          I have been having trouble trying to figure out USB sound card to GMPSK and GPSK31. My sound card happens to be a Tigertronics Signallink USB and like you
          Message 4 of 12 , Jul 17, 2013
          • 0 Attachment
            I have been having trouble trying to figure out USB sound card to GMPSK and GPSK31. My sound card happens to be a Tigertronics Signallink USB and like you works fine with FLDIGI, but FLDIGI uses resources to where my mouse even is erratic.

            So what is the magic. I've gotten as far as it seems I need to create /dev/dsp by loading snd_pcm_oss, but find gobly gook on the internet about it..

            Help would be appreciated...

            --- In Raspberry_Pi_4-Ham_RADIO@yahoogroups.com, Aaron Melton <aaron@...> wrote:
            >
            > Pat,
            >
            > The USB sound card I've been using is a Philips model U-108. It uses the C-Media chipset (according to dmesg). It took me a long while to figure out how to use it with gmfsk, but I got it working.
            >
            > Fldigi picked it up without any problems but I've arrived to the conclusion that even when over clocking, the RPi doesn't have enough horsepower to decode reliably. I never bothered transmitting... Therefore using gmfsk, but I'm still casually testing it. I know some folks have said they've used fldigi; I'm apparently not going to join that club.
            >
            > I'd be interested to hear your results...
            >
            > As far as rig control... I've used rigctrld (part of hamlib) to control my KX3 and its worked well. Never tried flrig though...
            >
            > Aaron
            > de KK4LOV
            >
            > On Jul 14, 2013, at 12:22 PM, "Pat" <wilson.pr.gm@...> wrote:
            >
            > > My question has to do with using the RPi as a digital mode computer. I would like to get some suggestions for what sort of usb sound card would be good for use with the RPi for this application. I intend to use fldigi and possibly flrig to control my IC746.
            >
          • Aaron Melton
            W8LM, Here are the two changes I made to my system to get gmfsk to work with my USB sound card. I suspect the same changes may work for you: Create a file:
            Message 5 of 12 , Jul 17, 2013
            • 0 Attachment
              W8LM,

              Here are the two changes I made to my system to get gmfsk to work with
              my USB sound card. I suspect the same changes may work for you:

              Create a file: /etc/asound.conf containing:
              defaults.ctl.card 1
              defaults.pcm.card 1
              defaults.timer.card 1

              and this command:
              modprobe snd_pcm_oss (creates /dev/dsp or /dev/dsp0 link)

              I *think* you can make it permanent by with this command:
              echo "modprobe snd_pcm_oss" >> /etc/modules

              Aaron
              de KK4LOV

              On 7/17/13 7:57 AM, W8LM wrote:
              > I have been having trouble trying to figure out USB sound card to GMPSK
              > and GPSK31. My sound card happens to be a Tigertronics Signallink USB
              > and like you works fine with FLDIGI, but FLDIGI uses resources to where
              > my mouse even is erratic.
              >
              > So what is the magic. I've gotten as far as it seems I need to create
              > /dev/dsp by loading snd_pcm_oss, but find gobly gook on the internet
              > about it..
              >
              > Help would be appreciated...
            • W8LM
              Aaron- Great advice and it helped. But it was not the fix for me. I all ready had DSP and DSP1 in my /dev directory. I created the /etc/asound.conf file you
              Message 6 of 12 , Jul 18, 2013
              • 0 Attachment
                Aaron-

                Great advice and it helped. But it was not the fix for me.
                I all ready had DSP and DSP1 in my /dev directory.

                I created the /etc/asound.conf file you speak about but discovered there was a /etc/asound.conf.disabled file in that directory. It was different than yours, it looked like C or C++.

                I enabled it by using this command:
                sudo cp asound.config.disabled asound.conf

                Then I rebooted and plugged in my TIGERTRONIC SignalLink USB and ran GMFSK. GMFSK opened with a configuration message regarding PTT, but I was seeing an active waterfall. I verified the waterfall was coming from my SignalLink by unplugging the USB and it was...So I moved on..
                **UPDATE-Investigation determined the signallink USB is on DSP1!! you have to restart GMFSK every time you change the device settings.**

                GPSK31- This is what I get when I start gpsk31 in the LXterm screen.
                -init_audio: can't open /dev/dsp
                -Hint: you may want to try to load snd_pcm_oss kernal module
                -Cannot initialize audio device: /dev/dsp -1

                So the program does not run any further. I checked for snd_pcm_oss:

                lsmod | grep snd_pcm_oss

                and it is there and linked..
                snd_pcm_oss 35690 0
                snd_mixer_oss 13856 1 snd_pcm_oss
                snd_pcm 77560 3 snd_bcm2835,snd_pcm_oss,snd_usb_audio
                snd 58447 12 snd_bcm2835,snd_pcm_oss,snd_seq_device,snd_mixer_oss

                So even though the only hint I have with gpsk31 says I'm missing the module, I have it.. So Scratch gpsk31 unless someone else knows the fix to that. I have to get back to work...
                **UPDATE -I know the problem is my device is DSP1!!****
                **UPDATE - gpsk31 -h gives help screen.
                -c <file> loads a configuation file..
                I bet the answer is there. I am going to email author luc@... but I found the README in /usr/share/gpsk31 and it askes to email pg4i@... for questions..

                End of UPDATE**

                But I now have FLDIGI that is glitchy and GMFSK which I need to test.

                Look for me at the Kansas Veterans Reunion Special Event Station this weekend W0VFW.. VFW post 3115 Amateur Radio Club- the 1st post sponsored ham radio club in the US. (See QST for details)

                Larry W8LM

                @yahoogroups.com, Aaron Melton <aaron@...> wrote:
                >
                > W8LM,
                >
                > Here are the two changes I made to my system to get gmfsk to work with
                > my USB sound card. I suspect the same changes may work for you:
                >
                > Create a file: /etc/asound.conf containing:
                > defaults.ctl.card 1
                > defaults.pcm.card 1
                > defaults.timer.card 1
                >
                > and this command:
                > modprobe snd_pcm_oss (creates /dev/dsp or /dev/dsp0 link)
                >
                > I *think* you can make it permanent by with this command:
                > echo "modprobe snd_pcm_oss" >> /etc/modules
                >
                > Aaron
                > de KK4LOV
                >
                > On 7/17/13 7:57 AM, W8LM wrote:
                > > I have been having trouble trying to figure out USB sound card to GMPSK
                > > and GPSK31. My sound card happens to be a Tigertronics Signallink USB
                > > and like you works fine with FLDIGI, but FLDIGI uses resources to where
                > > my mouse even is erratic.
                > >
                > > So what is the magic. I've gotten as far as it seems I need to create
                > > /dev/dsp by loading snd_pcm_oss, but find gobly gook on the internet
                > > about it..
                > >
                > > Help would be appreciated...
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.