Designed 2014, Steve Jones, VK2YLD.

Material Copyright 2007-2015, VL2YLD

Material on this site is for informational purposes ONLY, whilst all reasonable steps have been taken to ensure accuracy, errors and omissions do happen, but it wasn't me and I didn't do it!

Please feel free to copy, print, repost anything you find useful.

 

Home 

 

Site Map

 

Gallery

 

About

 

Contact

IRLP

Radio

Vintage

VK2YLD

Steve...                        

Kurri Kurri,

New South Wales

Australia

email - vk2yld at dodo.com.au

REAL radios glow without smoke.

Designed 2014, Steve Jones, VK2YLD.

Material Copyright 2007-2014, VL2YLD

Material on this site is for informational purposes ONLY, whilst all reasonable steps have been taken to ensure accuracy, errors and omissions do happen, but it wasn't me and I didn't do it!

Please feel free to copy, print, repost anything you find useful.

  Anything you read here is free for you to dowload, mash, destroy etc, use as you see fit.   Read carefully and then read again. (then run away!)  If any of the links don't work, they're broken! (sorry!)  I will attach scripts as I go along.  As this page is new, expect a few 'broken bits'..  Any script I used or modified will still contain the original 'whos who' at the start.  I DO NOT remove other peoples header info, names, or otherwise.  Credit where credit's due!   For those of you who are interested enough, this link will take you to a copy of the '/home/irlp/custom', so you can see 'what gives' without wading through this stuff.  Note that all the scripts have a '.txt' stuck on them as I have heard some people say that a double-click on a file causes some machines to attempt to run the script! If you want anything, download it and remove the '.txt' extension first... make sure the file has not been Microslopped, then play...

 

  ---== REMEMBER - BACKUP REGULARLY ==---

 

  Before I get too carried away, the '/home/irlp/custom' link will display a list of files as will clicking on 'Tux' above..  I will give a quick blurb about some of the files here, but most of them should be pretty straight forward.  If you have any questions or need any help, feel free to email me and I will be happy to try to help you out where I can.  I have documented a few scripts below, but not by any means ALL of them.  Most (!) scripts have a header explaining what, why and how etc..  Please browse and play...

Go Directly to the scripts directory

Go Directly to the Audio directory

**Update 13/05/2013:- Is your CentOS-4 yum busted?? Mine was.. fixed now though!  follow Tux and download Centos-Base.repo and yum.conf.  Rename your old ones and drop these in, yum.conf into /etc, and Centos-Base.repo into /etc/yum.repos.d  then 'yum makecache' and 'yum update' (the makecache takes a while)..

CEntOS-4 Yum

  I have had a snoop around at quite a few other nodes and followed some of their ideas reguarding custom decodes, features, programming etc.  The first priority as I see it, is to let people know the node is here!!  I got a copy of the IRLP Clock script and, as usual, re-hashed the code. That's how this whole mess began....

  I am a part-time programmer (a wanna' be I guess) and learn the way all GOOD programmers learn.... error recovery method! (could also be called 'crash management')  Having said that, every thing you read here, unless otherwise noted, works fine on MY node, but may break yours. (depending on hardware, software, your lunching habits, facial expressions, phase of the moon etc etc, and your OS..)

 

   ** My node is running the CentOS 4 Kernel - If you enter 'cat /proc/version' at the terminal, you will see..

 

Linux version 2.6.9-42.0.10.plus.c4 (mockbuild@builder4.centos.org) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)) #1 Tue Feb 27 16:27:24 EST 2007

Now a quote from another programmer, (from one of the scripts I adapted, thanks Tony ,VK3JED)

 

"If you try something and it works, excellent! if it breaks, you get to keep both pieces, and if you manage to fix it after it breaks, please document your experience so others can benefit.  it will be appreciated by someone."

In the Beginning..

LogOnLog..

Here is a little number I created to take the last 10 lines of the system log file and present them to you when you log into the node.  Instantly see what has been happening recently.  See the setup page for some additional info, or cron will email you with errors!  
The clock routine got bent to tell real time.  No... not UTC, time like "The time is 20 to 2" instead of "The time is one fourty". You know, Real time! The basics from the standard IRLP clock remain, but sequence and calculation is altered to ..

 

   read RTC (date ...)

   store Hour, store minute

   change Hour to 12Hr time (if >12 then -12 etc)

   test if minute >30?

          - if yes, increment hour, min=60-min, hand="to"

          - if no, hand="past" and leave figures alone

 

  When the routine says the time, it keys up and says "The time is", Minute, hand, hour.  If date= 14:53, 14 gets ripped back to 2, minute test results in hour up to 3, minute set to 23 and hand set at "to", so when the speak routine executes, the node says "The time is 23 to 3".  As the clock is called by CRON at 10 minute intervals, the figures are not usually this ugly (!), but you get the drift (but It does get this ugly when called from custom_decode though).  I created new audio files with the SWIFT voice 'Allison' from Cepstral (see links page), but reduced it to 1-20, 30, 40, 50, to, past, the time is. Using pre-recorded files makes the clock's response somewhat quicker than using the TTS engine. 

  I also added a couple of flag tests to the code...

    first flag is ~/stopmsgs - if this flag is present the clock won't send out the welcome sprook on the hour (or 1/2 hour). 

    second flag is ~/weathertime - this one triggers the 'bom' script each clock run with the '99' parameter, and the 'bom' script gets the local river level and speaks it.  great for 'flood watching' or cyclone watching... needs some more work though..

 

IRLP Clock - time-cron..

  I have a SB-128 PCI in this node and although it has an on-board synth, for some reason unknown to me, it does'nt work with Alsa.  I get no 'synth' slider in aumix and it won't generate cw either ...bummer.... so...enter the KK7AV CW-ID script.  As you have probably guessed by now, refinements, tweaks etc... gotta' do it.  I didn't use the auto install for this as I like to see what kills the node before resuscitation is required. (no offence intended) The only change I had to this one was running in repeater's cron table instead of root's.  Now the 'bendy' bit.  The ID is triggered after the time-cron script reads the time. The trigger file is touched about line 91 of time-cron to trigger an ID sequence.

  I have done two mods to this file.  Firstly, makes a log entry after sending IDs, then another mod that removed the id_file from the config list and added a check for a flag of $LOCAL/id_voice.  This flag file passes the WAVE file to play.  The log entry either says "CWID Transmitted" or Voice ID File Played", so the log knows what went to air.  To use the mod manually, type something like...

   echo "/home/irlp/custom/info/dial9.wav" >> $LOCAL/id_voice

         (passes file name (use absolute path) inside flag)

   touch $LOCAL/id_trigger

         (trigger the ID sequence to play the file)

  If you want the CW sent after the announcement, add a sleep 1, then touch $LOCAL/id_trigger again.  The id_voice flag is removed after playback to auto switch back to CW.  A quick mod to the time-cron file says 'if minute = 30 or 00 then echo....' to setup the voice and the trigger gets set anyway so you get a voice announcement on the half hour without mashing a conversation in progress. (if there is one).  Now a truly multi-purpose script.. thanks Rob...

CW-ID KK7AV style plus..

PlayRemoteData..

  This script was a real teaser to write, maybe challenge is a better way of describing it...  There are a few scripts out there to do something like this, however, as usual, less is more, more or less... right?

  Started with a remote time script and it accessed a database for it's response, either time or status, but the status only read 'idle' etc and not 'how long'.  I looked at the status page from http://status.irlp.net and it has all the guff I wanted,so.....  A total re-write ensued...

  The script still has config at the start, that MUST match the codes in custom_decode and MUST have the whole received DTMF passed to it from custom_decode as before.  It now responds to 3 codes to play remote time, status and location.  Ever heard a call come in from node XYZZ and wondered, 'where the xxx is that?'.  Well here's the answer...  I set the codes to 1*xxxx, 2*xxxx and 3*xxxx being time, status and locality so, want to know where a node is? Dial 3*nnnn and the box replies with the city, country, callsign and operating frequency details for that node.  2*nnnn to find out if it's idle or not and how long it's been this way.  1*nnnn to find out if anyone will be awake if you try to call it back!

  All this data is fished from the status page, but this turned out to be more of a challenge than I first thought because the page is known to have been dumped in at least 5 different formattings!  Although they all look the same in a browser, the command "lynx -source page.psp" dumps a different output format... hmmm, puzzling.  Now it's figured out, the script is reliable.. phew!

  As you can imagine, this requires a bucket load of audio files so... a TTS engine is the way to go..  Notice how IDLE is actually read as 'eyedle'. Looks shocking but sounds right... Mechanical voices - go figure! (just eyedling along...)

News Broadcasting..

OK... This one's a real pain... but here goes... There are quite a few dependencies required for this to function.  Before you start, you will need to make sure the following services etc are installed and ready to go :- sendmail - the mailer daemon, mutt - the Email client, mpg123 - mp3 player, bladeenc - an mp3 file encoder/converter.  These packages are available from various repositories on the internet.  If you can't find them, click on 'Tux' above and have a look in the scripts area.  Use Yum to install sendmail, mutt, and mpg123, download bladeenc and use rpm to install it.  The scripts you will need are getnews, playnews, stopnews, my-functions.sh, coswatch and coscounter.  Copy these to /home/irlp/custom ($CUSTOM).  You will also need some audio files in $AUDIO/custom/news. These files can be downloaded from the /home/irlp/custom link (tux) above as 'news_audio_pack.zip'  

 

              Now... this is how it all pieces together....  (I think...)

 

  In your crontabs, add entries to get the program files.  Use the copy of custom.crons in the script directory here as a guide to activating getnews etc..  As user repeater, create the following directories:- /news_archive (for holding copies of downloaded files), /home/irlp/audio/custom/news (where all the work takes place).  I will explain WIA first, but the others are very similar in function.

  When the programmed time arrives as set in crontab, 'getnews wia' is run.  This script uses wget to go to the WIA website and download the program file.  It is saved to $AUDIO/custom/news (created above) and a copy with the current date added to the filename is written to the /news_archive directory.  If you don't add the '> /dev/null 2>&1' to the end of the command in custom.crons (like me!), the screen output during the transfer is saved and emailed to the 'repeater' user from the cron daemon.  If you don't care about the download failing etc, add the pipe, but I like to know the download happened anyway..  At the programmed time, the playnews script is run by cron.  This script is timed to run 1 minute before the actual broadcast so the primer can be transmitted ("please stay tuned .."etc)..  The command line for playnews accepts wia, wiaacb, wiamcb to play the news.  Just wia plays the news and runs away, wiaacb plays the news & does auto callbacks, wiamcb plays the news and halts for a manual callback session with a 'net controller'.  Please don't run wiamcb from cron....when it stops....aaarrghhh.... the node will remain disabled and everyting stops until you manually reset it all.. not good..

Whilst the news is playing, if you want to abort the program, open a terminal and run 'stopnews'.  This will abort the player and re-enable the node bypassing all callbacks etc.  If you run the node as a repeater or full-duplex node, add a decode for stopnews to custom_decode and you can abort playback with DTMF.  Note however, if you have a simplex node, the news will have to run to completion if you can't get to a terminal to stop it!  'getnews qnews' is the same process, but from the VK4WIA site.

  'getnews twiar' does basically the same thing, downloads the TWIAR program from the website and saves a copy for broadcast.  As this program is always called twiar.mp3, we have no way of knowing what the edition number is..  So, with that in mind the edition number is read from the ID3 tag on the file by invoking mpg123 for 20 frames only with the text output captured to file.  As mpg123 spits out the ID3 tag data when it starts to decode the audio file, and 20 frames will run for <100mS, this is perfect for reading the edition number which is then added to the filename that gets written to the archive.. Phew!  **NOTE - TWIAR is currently defunkt and the 'getnews twiar' has been disabled as there is no file on the website...

  'getnews arnl' gets the AR Newsline program from the podcast by using lynx to dump the rss feed page, fish through it and get the current podcast filename, then uses wget to go fetch it.

  'getnews rsgb' goes to the rsgb site and downloads the 4 pieces of the RSGB news as MP3s.  It invokes mpg123 to play them to a wave file, then uses bladeenc to combine the 4 .wavs into one MP3 for playing.

  The other news files are fairly straight forward too, and if you start getnews with no command (./getnews), it will spit out a usage prompt and you can see what it will retrieve for you.

 

My node runs this file every Friday from crontab.  It emails a system status report to my email account using mutt and sendmail to let me know what has been happening in the node.  It reports CPU load, file system status and a log summary complete with the last 200 lines of the current logfile.

 

Logmail..

But Wait!!     As the support for Centos-4 has all but dried up, I have decided to update my systems OS (eventually!).  It took long enough to get a grasp of the file layout etc in Centos, so I have decided to go with CentOS-6 as the update, as CentOS-7 appears to only come in the 64Bit flavour.. 

 

  Sounds like a plan?  I don't like making plans, as they usually fall apart..

 

  We'll see what pans out in the near future.....

More info as I get "a-round-tuit"...