#!/bin/bash # 6 march 2018 # Wrote a small script to get the shittie PTS to a file where its belongs. # Yes you can also use the agw driver from Direwolf for Jnos. # Now its also possible to "sed" the right PTS to your ax25 start file # # socat -d -d -lf /tmp/socat.pts PTY,link=/tmp/kisstnc TCP4:127.0.0.1:8001 & # sleep 2 # grep -o "/dev/pts/." /tmp/socat.pts > /tmp/devs.pts # attachthem () { # read PTS1 # sed -i "s,kissattach -m 256 /dev/.*$,kissattach -m 256 $PTS1 ax0 44.137.31.73," /etc/ax25/ax-start # # } # # tail -n 1 /tmp/devs.pts | attachthem # rm /tmp/socat.pts # rm /tmp/devs.pts # sleep 3 # # Or use it with (X)net. # sed -i "s,attach sdev4 kiss 4 1 19200 /dev/.*$,attach sdev4 kiss 4 1 19200 $PTS1," /usr/local/xnet/AUTOBOOT.NET # # Or with BPQ # sed -i "s,COMPORT=/dev/.*$,COMPORT=$PTS1," /usr/local/linbpq/bpq32.cfg # # Oo well maybe work this better # IPADDR=127.0.0.1 # TCPPORT=8001 # # Yes there are many way`s to do this, but i had some fun to play with it. # Maybe it is useful for someone. #################################################################################################
The scipt…. Small but work quit well
#!/bin/bash echo "Starting direwolf with socat for jnos/ax25" # Set the path to direwolf and some stuff PATH=/direwolf:/usr/bin:/bin:/usr/local/bin # Start Direwolf direwolf -c /direwolf/direwolf.conf &> /var/log/direwolf.log >/dev/tty3 & sleep 3 # Socat kisstnc link with a PTS socat -d -d -lf /tmp/socat.pts PTY,link=/tmp/kisstnc TCP4:127.0.0.1:8001 & sleep 2 grep -o "/dev/pts/." /tmp/socat.pts > /home/pd2lt/jnos/spool/ptmx_radio.cfg echo "Direwolf is connect to" `cat /home/pd2lt/jnos/spool/ptmx_radio.cfg` echo "Now Jnos is ready to Rock and Roll :)" rm /tmp/socat.pts # Dont delete ptmx_radio.cfg before starting Jnos rm /home/pd2lt/jnos/spool/ptmx_radio.cfg sleep 1
This is what i found in the change.log of Jnos
Better support for PTY98 (/dev/ptmx, /dev/pts/N) pseudo devices. Bob (VE3TOK) asked for this a long time ago, so I figured I better get it implemented. Note : Technically one can use the new jnos 'attach baycom' and go direct to a kernel KISS type interface, meaning you don't need to run an intermediary program (kissattach or net2kiss) anymore. Try it, let me know how it works. COMPILE : Make sure '#define JNOSPTY98' exists in your config.h file. The best way for me to show how this feature works is by example. One way of getting JNOS to use a linux AX25 device is through the 'kissattach' program, but get the one from F6BVP (it has a mod that actually outputs the name of the slave device after you run the program). The stock ax25 utilities will not tell you that (you have to look for a new /dev/pts/N to appear then). kissattach /dev/ptmx radio > /jnos/spool/ptmx_radio.cfg The issue here is you don't know what slave device you will get, it could change each time you run kissattach, there may be no consistent device name for you to depend on when running 'attach asy' in the JNOS autoexec.nos. Now in JNOS (autoexec.nos), suppose we have this entry below : attach asy ptmx_radio - ax25 ax0 4096 256 9600 I have added a feature where if the 3rd argument starts with 'ptmx_', then JNOS will look for a corresponding *.cfg file, and extract the slave device name from it, and then attach using that instead of the original argument.
This is some monitor output of Direwolf.
Dire Wolf version 1.3
Reading config file /direwolf/direwolf.conf
Audio device for both receive and transmit: plughw:0,0 (channel 0)
Channel 0: 1200 baud, AFSK 1200 & 2200 Hz, E+, 44100 sample rate.
Ready to accept AGW client application 0 on port 8000 …
Use -p command line option to enable KISS pseudo terminal.
Ready to accept KISS client application on port 8001 …
Connected to KISS client application …
[0L] PD2LT-2>NODES:<0xfe>
[0L] PD2LT-9>NODES:<0xff>LAPNOS
[0L] PD2LT-9>NODES:<0xfe>LAPNOS
PD2LT-2 audio level = 14(3/3) [NONE] |||||||__
[0.3] PD2LT-2>NODES:<0xfe>
PD2LT-9 audio level = 14(3/3) [NONE] ||||||||_
[0.3] PD2LT-9>NODES:<0xff>LAPNOS