Re: Virtual Serial Port


That's a lot to take in. It'll take me a while to study it all. I may need more help.

Thanks, Max KG4PID

On Thursday, April 12, 2018, 12:18:59 PM CDT, Niels Ruiter <pd9q@...> wrote:

Hi Max,

You can use kissnetd of socat…


       # link local pi8lap (xnet)

        echo "Starting ax2 "

        if grep ax2 /etc/ax25/axports ; then


        kissnetd -p 2 > "$tmpfile" &

        sleep 2

        attachthem () {

                read PTS1 PTS2

                kissattach -l $PTS1 ax2 || return=$rc_failed

                ifconfig ax2 netmask up

                sleep 1

                sed -i "s,attach sdev3 kiss 3 1 19200 /dev/.*$,attach sdev3 kiss 3 1 19200 $PTS2," /usr/local/xnet/A$



        tail -n 1 $tmpfile | attachthem

        rm $tmpfile

        sleep 3


                echo  "Error ax2 not found in the file axports"



        echo "$1 $return"


Now socat


        # create axudp device

        socat -d -d -ly PTY,link=/dev/ttyq2 PTY,link=/dev/ptyq2 &

        sleep 2

        echo "Starting ax4 "

        if grep ax4 /etc/ax25/axports ; then

                kissattach -m 256 /dev/ptyq2 ax4 || return=$rc_failed

                ax25udp -c /etc/ax25/ax25ipd-10093.conf > /tmp/axudp

                ifconfig ax4 netmask up

        sleep 1


                echo  "Error ax4 not found in the file axports"



        echo "$1 $return"


So little simpler…


socat -d -d -ly PTY,link=/dev/ttyq2 PTY,link=/dev/ptyq2 &


This create two virtual comports.


Hope its helps.


73 Niels PD9Q



Van: [] Namens Max via Groups.Io
Verzonden: donderdag 12 april 2018 15:22
Aan: Raspberry 4-Ham RADIO
Onderwerp: [RaspberryPi-4-HamRadio] Virtual Serial Port


I need a virtual serial port, let me explain. For some time now I have been sending weather data to aprx by using a Microchip Pic connected to a TTL to USB converter. The Pic receives the weather data from my Davis weather station and adds a kiss header so that it looks like it was received via a tnc. That data was then fed into aprx. In aprx I just added a fake tnc port and it didn't know the difference.


I'm slowing building my own weather station with sensors and python on a Pi. For now it is on a separate Pi and I'm using two TTL to USB converters connected back-to-back. First I would like to replace the serial link with a network connection if possible. If / when I get the software finished I would like to move it to the same Pi that aprx is running on and will need two virtual serial ports also connected back to back. Socat or Netcat may work but I don't know how to set this up. It must be able to pass a kiss packet unaltered.


Is all this clear as mud? 





Join to automatically receive all group messages.