Jnos start with screen

Jimmy K3CHB, Was looking at how he could get a restart option in Jnos in combination with “screen”.

Below how he did it.

Startnos

#!/bin/bash
echo "Starting [JNOS-2.0n.beta-IHM$]"
screen -d -m -S jnos-console ./nos.loop exit 0

Nos.loop

#!/bin/bash
# JNOS 2.0 Loop script by K3CHB

exit_code=-1
killall -KILL jnos 2> /dev/null
 
while [ $exit_code -ne 0 ]
do
     cd /jnos
     rm -f /jnos/spool/mqueue/*.lck 2> /dev/null
     rm -f /jnos/spool/mail/*.lck 2> /dev/null
     rm -f /jnos/spool/ptmx_direwolf.cfg 2> /dev/null
     sleep 2
     grep -o "/dev/pts/." /jnos/direwolf.log > /jnos/spool/ptmx_direwolf.cfg 
     sleep 2
     export TZ=EST5EDT
     export TERM=xterm-color
     /jnos/jnos -g2 -i -d/jnos && exit_code=0
done
 
exit 0

 

Jnos snmpd

Autoexec.nos

start snmpd
snmp ro pd9q 192.168.79.

sudo apt-get install mrtg
mkdir /var/www/html/mrtg/jnos
cd /var/www/html/mrtg/jnos
sudo nano mrtg.cfg

Mrtg.cfg

#
WorkDir: /var/www/html/mrtg/jnos
#
options[_]: noinfo,nobanner,growright,logscale
XSize[_]: 300
YSize[_]: 100
#
EnableIPv6: no
NoMib2: yes
#
# JNOS tun0 (3) interface
#
Target[tun0]: 3:pd9q@192.168.79.110:
MaxBytes[tun0]: 1000000
PNGTitle[tun0]: Internet and some LAN traffic
Title[tun0]: tun0
#
# JNOS axu0 (2) interface
#
Target[axu0]: 2:pd9q@192.168.79.110:
MaxBytes[axu0]: 1000000
PNGTitle[axu0]: axu0
Title[axu0]: axu0
#
# JNOS hf (1) interface
#
Target[ax0]: 1:pd9q@192.168.79.110:
MaxBytes[ax0]: 50
PNGTitle[ax0]: 144.850Mhz @ 1200 Baud
Title[ax0]: ax0
#
# JNOS netrom (0) interface
#
Target[netrom]: 0:pd9q@192.168.79.110:
MaxBytes[netrom]: 50
PNGTitle[netrom]: Netrom (excluding RIF frames)
Title[netrom]: netrom
#
sudo indexmaker --output index.html -section=title --show=day --columns=1 mrtg.cfg

sudo nano /etc/cron.d/mrtg

*/5 *   * * *   root    if [ -x /usr/bin/mrtg ] && [ -r /var/www/html/mrtg/jnos/mrtg.cfg ] && [ -d "$(grep '^[[:space:]]*[^#]*[[:space:]]*W$

Jnos NNTP(s) Server

Jean VE2PKT helpt me to get things going. Thank you Jean. I really appreciate it.

I first have to compile a new Jnos version with the NNTP(s) enabled, edit your config.h and define NNTPS.
(#define NNTPS   /* Netnews client and server */)
I had problems if I wanted to connect the NNTP server. Jnos crached right away. After a distro update of my linux version from “Stretch” to “Buster” all went fine.

Autoexec.nos

# NNTP server/client
start nntp
nntp profile fullname "Niels PD9Q"
nntp profile host jnos.packet-radio.nl
nntp profile organ "Amateur Radio"
nntp profile reply pd9q@jnos.packet-radio.nl
nntp profile user pd9q
#
nntp access off
nntp firstpoll 5
nntp ihave 0
nntp lzw on
nntp quiet 2

Fist create newsgroups on the Jnos prompt

jnos>
jnos> nntp create ng.bpq y
jnos>

nntp create <news.group.name> [y|n]

Updates the /spool/news/active file, which must have an entry for each news group you wish to receive.  Choose y to permit posting to this group, or n to deny posting.  y is assumed if nothing is specified.  The /spool/news/pointer file is also updated with the path to the directory which will contain the articles. Articles will be stored as separate files, named by an integer corresponding to their arrival order.

The NNTPS software includes a mail-to-news feature, such that email with a To: address that begins with “!” is passed to the NNTPS module.  The remainder of the To: address is interpreted as a newsgroup name, with the name truncated at the first occurrence of one of “%@.,/”, and with “!” translated to “.” and “+” to “,”. An alias is usually used to provide this special name. For example, to route all NLD bulletins to both the NLD area, and the NG.NLD newsgroup, use the alias:

/jnos/alias
#News groups
nld     nld     !ng!nld

My alias file looks like this
nld     nld     !ng!nld
bpq     bpq     !ng!bpq
7plus   7plus   !ng!7plus
ww      ww      !ng!ww
eu      eu      !ng!eu
aprs    aprs    !ng!aprs
local   local   !ng!local
prop    prop    !ng!prop

The NNTPS software includes a news-to-mail feature, such that news articles can be emailed to local or remote destinations after they are processed by nntp. This would allow, for example, emailing to a public area, so that BBS users too could read news articles. JNOS must be compiled with NNTPS and NEWS_TO_MAIL #define’d and a file /spool/news/gateway must exist to define the mapping from a newsgroup to an SMTP To: address. Each non-comment line in the gateway file must begin with a newsgroup name (starnames OK), followed by spaces or tabs, followed by the email To: address.

/jnos/spool/news/gateway
ng.nld  aprs@nld
ng.nld  prop@nld
ng.nld  all@nld
ng.nld  7plus@nld
ng.7plus        all@7plus
ng.ww   all@ww
ng.eu   all@eu
ng.local        all@local
ng.bpq  all@bpq

Expire time of bulletins or newsgroup messages.

/jnos/spool/expire.dat
# bulletins received from AX25 network
#
nld 90
bpq 60
7plus 30
eu 30
check 45
ww 30
prop
#
#  NNTP
!ng.nld 90
!ng.bpq 60
!ng.7plus 30
!ng.check 30
!ng.eu 30
!ng.prop 30
!ng.ww 30

I’m using Thunderbird to read and post messages as bulletin and newsgroup mail.

mail.log

Fri Feb 21 20:22:46 2020 queue job 2333 To: !ng!local From: pd9q@jnos.packet-radio.nl
Fri Feb 21 20:22:46 2020 queue job 2333 To: local From: pd9q@jnos.packet-radio.nl
Fri Feb 21 20:26:50 2020 deliver Msg-Id: 2335@jnos.packet-radio.nl To: local From: pd9q@jnos.packet-radio.nl Subject: Test ng.local
Received: by jnos.packet-radio.nl with NNTP
        id AA2332 ; Fri, 21 Feb 2020 20:22:46 CET
Newsgroups: ng.local
From: Niels PD9Q <pd9q@jnos.packet-radio.nl
Subject: Test ng.local
Message-ID: <2331@jnos.packet-radio.nl>
Date: Fri, 21 Feb 2020 20:22:41 +0100
Errors-To:  sysop
To: all@local

Test the ng.local newsgroup.
Newsgroups: ng.local
X-Mozilla-News-Host: news://192.168.1.101:119
From: Niels PD9Q <pd9q@jnos.packet-radio.nl>
Path: jnos.packet-radio.nl!not-for-mail
Subject: Test ng.local
Message-ID: <2331@jnos.packet-radio.nl>
Date: Fri, 21 Feb 2020 20:22:41 +0100
User-Agent: Thunderbird/60.9.1
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: nl
Content-Transfer-Encoding: 7bit
Lines: 1

Test the ng.local newsgroup.
Path: jnos.packet-radio.nl!NNTP_GATE@jnos.packet-radio.nl!jnos
From: pd9q@jnos.packet-radio.nl
Newsgroups: ng.local
Subject: Test all@local
Message-ID: <c00aaec4-9b7f-b803-b9cd-adc1941ba8b9@jnos.packet-radio.nl>
Sender: NNTP@jnos.packet-radio.nl
Comments: Article created from mail
X-Mozilla-News-Host: news://192.168.1.101:119
To: all@local
Date: Fri, 21 Feb 2020 20:53:28 +0100
User-Agent: Thunderbird/60.9.1
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: nl
Content-Transfer-Encoding: 7bit

Test all@local bulletin

73 Niels

That’s look pretty cool, isn’t it?

 

Jnos colors are back

For the Raspberry Pi users among us, Maiko has found a solution for the Colors in Jnos and the NNTP server and probably even more stability issues.
For a long time we had to miss the colors, but I immediately imagine myself back in the 90s.

The Solution…..

JNOS is doing strange things on PI platforms. Because gcc in the ARM processors are forcing CHAR variables to be UNSIGNED, not SIGNED!

Until I find a better solution (long term), you must add :

     -fsigned-char

to the CFLAGS in the makefile.

CFLAGS = -DUNIX $(DEBUG) $(PATCHES) $(WARNINGS) -fsigned-char
make clean
./configure
make

Thank you Maiko….

Jnos White Page (WP) Support

Jnos White Page processing.

Create a directory /jnos/spool/wp

This directory consists the following files.
1. wpages                                                                   # links a user call to a bbs call.
2. wpagebbs                                                               # contains the full hierarchical address of a bbs call.
3. wpages.new, wpagebbs.new, wpages.tmp            # new entries waiting to be merged into the above (MAIN) files during processing.
4. update.wp                                                              # tracks updates to our database – used for sending white page updates to other systems.

Autoexec.nos

# WP Database
wp age 0			# number of days after which white page entries expire - default 30 days.
wp client on			# turn this on to allow WP lookup at the bbs prompt 
wp server on			# treat incoming WP bulletins (wp@ww) as updates to the white page database - default is off.
wp destinations pi8lap		# use the wp destinations console command to specify the systems you want updates sent to
wp timer 60			# interval at which JNOS processes the white page database - default is 0 (never)
wp support on			# turn on or off (completely) the use the white page database - default is on
wp temporaryage 30		# number of days an entry has to wait in the wpages.tmp file before it can be merged into the main files.
wp update 60			# interval at which JNOS should do the update runs - default is 0 (never)

Rewrite

# Handle wp messages
wp@ww					whitepages
wp@eu					whitepages
wp@pd9q					whitepages
wp@pd9q.#zl.nld.eu		whitepages
#
*@pd9q.#zl.nld.eu pd9q

How SP command interacts with WP database.

By default, there is no WP prompt. You have to create a preference before any WP interaction occurs when using the ‘SP’ command to send a message.
Use ‘XW’ (without arguments) to display current setting, for example :

WP options for ‘SP’ – 1=disable, 2=show/prompt, 3=show/noprompt, 4=force it
option 2 is currently set

To set your option, simply do something like ‘xw 2’, that’s all there is to it.

If you enter the command ‘wp pd9q’ and you might get this below :

wp routing ‘PD9Q@PD9Q.#ZL.NLD.EU

If I enter ‘sp pd9q’ on my system, I might be prompted like below :

wp routing ‘PD9Q@PD9Q.#ZL.NLD.EU’ – use ? (Y/n)

Start Jnos with Systemd

# Starting Jnos at boot, and restart when fail
# Jnos is running in the background

cd /lib/systemd/system
sudo nano jnos.service

Add to the file

[Unit]
Description=Jnos Daemon
After=network.target
After=sound.target
After=syslog.target

[Service]
Type=simple
Restart=always
RestartSec=5
ExecStart=/bin/bash /home/pd9q/jnos/startnos
WorkingDirectory=/home/pd9q/jnos

[Install]
WantedBy=multi-user.target
Alias=jnos.service

save

sudo systemctl enable jnos.service

startnos

# Jnos start file
cd /home/pd9q/jnos
sleep 2
rm -f /home/pd9q/jnos/spool/mqueue/*.lck 2> /dev/null
rm -f /home/pd9q/jnos/jnos/spool/mail/*.lck 2> /dev/null
sleep 1
TZ='Europe/Amsterdam'; export TZ
export TERM=linux
exec ./jnos2.0m.1rc -C -wf+b -u3 -fnos.cfg -i  </dev/tty2>/dev/tty2 2>&1

sudo apt-get install conspy
sudo conspy 2

And there is jnos….. Hit a couple off times [esc] to exit conspy

sudo systemctl status jnos

pd9q@packet-jnos:~/jnos/logs $ sudo systemctl status jnos
● jnos.service - Jnos Daemon
Loaded: loaded (/lib/systemd/system/jnos.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2020-02-08 07:36:44 CET; 6h ago
Main PID: 525 (jnos2.0m.1rc)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/jnos.service
└─525 ./jnos2.0m.1rc -C -wf b -u3 -fnos.cfg -i

Feb 08 07:36:44 packet-jnos systemd[1]: Started Jnos Daemon.
pd9q@packet-jnos:~/jnos/logs $

 

Jnos2.0m.1rc

Maiko has been busy again to make some adjustments in Jnos. A friend of mine had asked if it was possible to save a Most Heard list. A few days later it was already done. Fantastic. It is also possible to leave the file ftpusers and use hashed passwords.

Read change.2.0m.1.txt for al the new options.

Jnos Download

Save and Load ax25 Heard List
 -----------------------------

 The ax25 heard list can now be saved to a file or loaded (restored) from a file.

 Decided to also revamp the 'ax heard' command at the JNOS console, since there are
 now several commands available, all of which really should be categorized as being
 subcommands of 'ax heard' - so with this update, the new syntax is as follows :

     Usage : ax heard < show | dest > [<iface>]
             ax heard < save | load >

 The 'dest' and 'hearddest' commands are gone, absorbed by the above syntax.

 The heard data is kept in a new 'AxHeardFile' in the JNOS root directory.

 There are two files to update (ax25cmd.c and axheard.c), they have been added
 to the patch file noted further down (under the Password Management section),
 so if you're not interested in the password code, just extract the 2 files.

 Add '#define BACKUP_AXHEARD' to your config.h, then :

    rm ax25cmd.o axheard.o ; make

 

Write to Jnos UDP port.

I was reading in the release notes of NOSAprs and found something to play with.

Release 1.15b5 (patch)
======================

  • June 24, 2003
  •  DID YOU KNOW – You can send aprs data to NOSaprs using UDP port 16161, and it will go out the APRS rf port. It’s actually been like that for quite some time.

This are two ways to write data to the udp port 16161

#!/bin/bash
exec 3<>/dev/udp/192.168.1.101/16161
echo -e "writing to udp port 16161 Jnos" >&3
exec 3>&-

Sun Dec 22 20:59:52 2019 – ax0 sent:
KISS: Port 0 Data
AX25: PD9Q-10->APZ200 v WIDE1-1 UI pid=Text
0000 …writing to udp port 16161 Jnos…

#!/bin/bash
ver=$(uptime)
echo -n “$ver” | nc -4u -w1 192.168.1.101 16161

Sun Dec 22 20:59:56 2019 – ax0 sent:
KISS: Port 0 Data
AX25: PD9Q-10->APZ200 v WIDE1-1 UI pid=Text
0000 … 20:59:56 up 6:03, 2 users, load average: 0.16, 0.17, 0.17…

Nice let`s think about that

Jnos aprs setup

I running Jnos2.0m with the Aprs server enabled. This is the configuration that I use.

# NOSAPRS
#==================
aprs log /home/pd9q/jnos/aprs/master.log
aprs interface ax0
#
aprs logon call PD9Q-10
#
# I want the APRS Internet System to only send me traffic
# for stations that are within 300 KM, of my location. In my
# case, the city of Winnipeg is roughly 49d54m (Latitude)
# and -97d7m (Longitude).
#
#aprs logon filter r/51.3352/3.4815/50
#
# Configure the Position and Status texts that are broadcast
# out to the APRS Internet System (APRS IS).
#
aprs bc stat "Jnos inet/aprs gateway PD9Q-10"
aprs bc pos "5133.52N/00348.15E & JNOS https://packet-radio.net"
aprs bc timer 720
#
# Configure the Position and Status texts that are broadcast out
# the default APRS RF port (set by the aprs interface command).
#
aprs bc rfstat "Jnos inet/aprs gateway PD9Q-10"
aprs bc rfpos "5133.52N/00348.15E & JNOS https://packet-radio.net"
aprs bc rftimer 10
#
# APRS route add
ax25 route add apz200 ax0 WIDE1-1
ax25 route add id ax0 WIDE1-1
#
# I don't use WX - following for development purposes only
#
aprs wx call PD9Q-13
aprs wx stat "Weather Station - Kortgene JO11VN"
aprs wx pos "5133.52N/00348.15E_METEO packet-radio.nl:14501"
aprs wx data "/home/pd9q/jnos/wx/current.wx"
aprs bc rftimer 10
#
# Heard table
#
aprs hsize 10
#
# Turn on digi
#
aprs flags +digi +debug
#
# Stuff for the 14501 status page
#
aprs contact m "pd9q@packet-radio.net"
aprs locator "JO11VN"
#
# Connection to APRS internet system
#
aprs server add pa4tw.nl 10152
#
# Potential APRS Clients
#
#aprs client add 44.135.124.62 14825
#
# IF you want to gate traffic to RF - BE VERY CAREFULL
# with these filters. You don't want to FLOOD your local
# frequencies with solid traffic. You've been warned !!
#
#aprs calls fwdtorf VE4 VA4 VE3JJ VE3HDU
#aprs calls postorf VE4 VA4 VE3JJ VE3HDU
#aprs calls stattorf VE4 VA4 VE3JJ VE3HDU
#aprs calls wxtorf VE4 VA4 S VE3JJ VE3HDU
#
# This next entry gives specific IP address(s) permission to use the
# browser based APRS message center to it's full capacity. By default,
# the message center allows READ-ONLY access (ie, you can't send).
#
aprs calls ip45845 192.168.1.186
#
aprs email local
#
# Activate the core NOSaprs service
#
aprs listen on
#
# If you want the NOSaprs status page to be available,
# for example, 'http://localhost:14501'.
#
start aprs 14501
#
# If you want the NOSaprs browser based message center
# for example, 'http://localhost:14845'.
#
start aprs 45845