WiNRADiO Future of radio
   

Source Codes

Note:

These source codes are provided here under GNU public license. For more information about this license, please click here.
WiNRADiO does not guarantee correctness of these source codes. For any enquiries, please contact the authors directly.

LinRADiO toolkit 0.4 by P. Brisset, works with WR-1550 and WR-3150 series of receivers.

LinRADiO wrkit-0.1 signal strength patch by Ralph Billes, which fills a gap in the Tcl wrkit package. The code has been tested on RedHat 6.2 Linux.

The first LinRADiO application with a GUI by P. Brisset. This works on 1000, 1500 and 3100 Series of internal receivers.

The very first LinRADiO submission was written by Yuri ("George") Muzyka, a long-term WiNRADiO user, who thus reserved for himself a place in history. He developed the very first Linux application for WiNRADiO receivers. This program was originally developed for the WR-1000i receiver card (if you are a newcomer to wide-band communication receivers, you might also like to read some introductory information about WR-1000i) and has been later upgraded to cover serial-port controlled models as well, including the WR-1500e and WR-3100e models.


LinRADiO Toolkit 0.4

Copyright © 2000 P. Brisset.
Portions derived from dr-isa © 1999 Yuri ("George") Muzyka.
Low-level receiver interface code © 2000 WiNRADiO Communications.

This package allows you to use WiNRADiO receivers with Linux. It has been reported to work with WR-1000i, WR-1500i, WR-3150i, WR-1500e and WR-1550e devices on various x86 Linux systems.

Downloads

 linradio-toolkit-0.7.tar.gz
 linradio-toolkit-usermode-0.7-1.i386.rpm
 linradio-toolkit-module2.4.19-0.7-1.i386.rpm

Contents

  • A port of driver source code provided by WiNRADiO Communications (directory ./wrlib).
    This is a standard C library/header package which can be used for other GPL'ed applications.

  • Tcl bindings for controlling WiNRADiO receivers.
    Documentation is in man1/tclradio.1. Example:
          # ./tclradio 
          % winradio wr 0x180
          % wr -p 1 -f 100e6 -m FMW -a 0 -u 0 -v 50
    
    (Detect ISA card at I/O 0x180, power up, tune to 100MHz FMW, DX, mute off, volume 50 %)

  • A Tcl/Tk graphical control panel.
    Run "./wrpanel.tcl". Documentation is in man1/wrpanel.1.

  • Miscellaneous TCL scripts.
    minipanel.tcl, ssrecord.tcl, sweep.tcl

  • A kernel module driver providing:
    • mutual exclusion
    • persistent state
    • no initialization delay
    • file permission-based access control.
    This is under development and might crash your machine. (Currently available for internal receivers only.)

Screenshot

Installation

Minimum requirements (might work with other versions):

  • Linux 2.0.34
  • gcc 2.7.2.3
  • Tcl 8.0
  • Tk 8.0

Run "./configure", "make"
Try "./wrpanel.tcl"
Install with "make install"

Reporting bugs

Read the file "KNOWN-PROBLEMS" first.
Send bug reports to wr_kit@hotmail.com

FURTHER INFORMATION


LinRADiO wrkit-0.1 signal strength patch

This is a patch file with signal strength additions for wrkit-0.1. The code has been ported from the wr4linux/Dr-Isa package and filled a gap in the Tcl wrkit package.

 Download source code -- ss-wrkit-0.1.zip

The code has been tested on RedHat 6.2 Linux but the signal strength measurements have not been calibrated.

Ralph Billes
Systems Integrator, Nautronix Ltd.
Email: ralph@nautronix.com.au


WiNRADiO toolkit for Linux

Copyright © 1999 P. Brisset
Portions derived from dr-isa © 1999 Yuri ("George") Muzyka.
Low-level receiver interface code © 1999 WiNRADiO Communications.
Please read the disclaimers in file "COPYING".

This package is intended for users of internal WiNRADiO receivers (wr1x00i, wr3x00i) on Linux machines. It has been tested on a RedHat 5.1 (kernel 2.0.34) Pentium PC with a WR-1500i ("Vers 1.0.11, 29 May 1995").

CONTENTS

* A rewrite of Yuri Muzyka's "dr-isa" C++ program.

dr-isa was ported from a Windows C++ program. I wanted plain C, without Microsoft naming conventions, because this should ultimately become a Linux kernel module.

* Tcl bindings for controlling Winradio receivers.

Start the wr-enabled tcl shell as root:
# ./tclradio
Detect receiver at port 0x180 and call it "wr":
% winradio wr 0x180
Power up, tune to 15MHz AM, DX, mute off, volume at 50 %:
% wr -p 1 -f 15e6 -m AM -a 0 -u 0 -v 50
Print current frequency:
% wr f (returns "15000000")
Print current state:
% wr (returns "-p 1 -f 15000000 -u 0 -a 0 -v 51 -m AM -b 0")

wishradio is a Tck/Tk shell (wish) with WiNRADiO bindings.

* A graphical control panel with spectrum display, in 400 lines of Tcl/Tk.

Start ./wrpanel.tcl .
Legal syntax: "15000000", "15e6", "15000k", "15 Mhz", "15 m", ...
"Exit" : Saves current state in ~/.wrstaterc .
"Scan" : Runs a signal strength scan between the specified bounds.
Subsequent scans will display maximum signal strengths.
"<<" : Shifts the scan range down.
"<>" : Enlarges the scan range.
">>" : Shifts the scan range up.
"<[]>" : Widens the spectrum display.
"[><]" : Shrinks the spectrum display.
"SS delay": Sets delay between SS measurements, in ms.
Button 1 : Tunes.
Button 2 : Scrolls the spectrum display.
Button 3 : Selects a frequency range.

DOWNLOAD

 Download source code -- wrkit-0.1.tar.gz (Unix tar.gz archive)

SCREEN SHOT

WR-Kit Screen Shot

INSTALL

Type "make" in the wrkit directory.

KNOWN PROBLEMS

- Signal strength measurements look strange, except in FMN.
- SS not supported on WR-3x00.
- ~/.wrstaterc must be deleted by hand if corrupted.

FUTURE WORK

- WR driver as a Linux kernel module (see http://www.ozemail.com.au/~mccormack/technical.html#WinRadioAPI)
- Stations database (upper-right frame in wrpanel)
- Signal processing tools, digital mode decoders

FURTHER INFORMATION

WR-Kit home page: http://perso.wanadoo.fr/pascal.brisset/WR
WiNRADiO home page: http://www.winradio.com
About Linux: http://www.linux.org
About free software: http://www.fsf.org


WiNRADiO for Linux/Unix/*nix
(program suite Version 0.9.1)

© 1999 Yuri ("George") Muzyka
(high-level user interface code)

© 1999 WiNRADiO Communications
(low-level receiver interface code)

Free software under the GNU General Public License.

Receiver control screen

Fig. 1. Sample wr-text program output (as seen from an X-windows xterm)

Serial receiver control program

Fig. 2. Sample dr-serial program output (as seen from an X-windows xterm)

 Download source code -- wr4linux-0.9.1.tar.gz (Unix tar.gz archive)
 Download source code -- wr4l-091.zip (DOS style ZIP archive)

Contents

1. HISTORY of program development
2. README
3. KEYBOARD commands list
4. REMOTE commands list
5. TODO list
6. PROBLEMS

1. History of program development

May 1999

Began work on the WiNRADiO for Linux program suite.

22 June 1999

Added keyboard commands to control the Wr-text program. See the KEYBOARD file for a list of key commands and their functions.

23 June 1999

Added in Wr-text/Wr-text2 program system("stty -echo") to turn off terminal echo so that keyboard commands do not echo to the screen, and added system("stty sane") to turn it back on before program exits. Created a REMOTE commands summary text file.

24 June 1999

Reduced some of the if() statement overheads in Wr-text/Wr-text2 by adding a if( pressed == 1 ) { } statement around many if() statements for the keys/buttons. This has sped the program up.

Scanning now mutes the WiNRADiO temporarily, getting rid of the annoying multiple "chuf" tuning sounds.

30 June 1999

Wrote up more documentation including headers for each source file.

4 July 1999

Created a Wr-config.h file which can contain user preferences for program startup (in the form of C #define statements) which includes a REMOTE option, as well as settings for ATTENUATOR, BAND,

FREQUENCY, MODE, STEP and VOLUME. More settings are to come.

Added program loop counters for the time/date display updates as well as the signal strength display updates, so that these items aren't displayed every time the program loops. Hopefully this reduces program runtime overheads a little.

6 July 1999

Added a remote buttons C include header file (Wr-remote.h) which allows for customisable infrared (IR) remote button values and labels (depending on the IR remote being used).

14 July 1999

Added WiNRADiO I/O address port configuration #define option "IO_ADDR" in the Wr-config.h file and made all other C source files use this setting.

19 July 1999

Wr-text now displays the real-time year in its full 4-digit form (eg 1999, or 2000, etc) from the "date" shell command output. Wr-text2 also updated. If the native Linux "date" command is Y2K compliant then Wr-text and Wr-text2 will also be.

20 July 1999

Removed the need for compiler optimisation by adding "#define extern" before the "#include " line in the various C source files. This suggestion comes thanks to the author of the Linux IO-Port-Programming mini HOWTO (Riku Saikkonen). The Wr-text2 program now loops properly.

The Wr-ResetRadio program/function now uses the usleep() function for its two 20 millisecond delays when resetting the WiNRADiO.

28 July 1999

Added colour to the Wr-text & Wr-text2 screen display (using vt100 escape characters executed by the "echo -e" command). Added a VT100_COLOUR #define option in the Wr-config.h file used for enabling colour.

6 August 1999

Scanning is now interruptible (other keyboard/remote commands can be processed).

Mid August - Mid September 1999

Ported the dosradio C++ source to Linux. Ended up with two derivatives, dr-isa and dr-serial (for the ISA card and Serial port WiNRADiO models). Both programs are command line driven and use all the original command parameters and includes the original built-in help.

September 28 1999

Corrected a number of minor programming goofs which showed up as numerous compile warnings when using the more strict -Wall compiler switch with g++. Thanks to Pascal Brisset of France for pointing this out to me.

2. README

Thank you for taking time out to read this!

There are now 3 separate directories of source files. The main directory contains the WR-1000i source, the Dr-Isa directory contains the dosradio ISA source and the Dr-Serial directory contains the dosradio serial source.

The programs dr-isa and dr-serial will control any of the WiNRADiO communications receiver models, namely the WR-1000i/e, WR-1500i/e, WR-3000i/e and WR-3100i/e. These are both command-line driven programs with built-in help (type for example: "dr-serial /h"). The serial port can be configured by editing the file wr-config.h in the Dr-Serial directory before compiling the source with "make" (uncomment the lines that suit your serial port and comment out the rest of the lines). A simple Makefile has been provided in each directory so you can just type "make" to compile the source, or "make clean ; make" if you want to recompile it. A "make install" facility will come later.

The Wr-* programs only support the WR-1000i at this stage. I plan to get these programs working with the other WiNRADiO receiver models shortly, using the dr-isa and dr-serial source as an include library. Please stay tuned!

The two programs Wr-text and Wr-text2 are essentially the same program (implemented two different ways) which should hopefully provide you with a simple text front-end for controlling your WiNRADiO WR-1000i ISA communications receiver card. Wr-text requires the other Wr-xxx programs (eg Wr-PowerOn ), while Wr-text2 does not (it uses a built-in library instead).

The file KEYBOARD contains a list of the keyboard key commands and the file REMOTE contains a list of the IR remote button commands for controlling the WiNRADiO from within either of the Wr-text or Wr-test2 programs. If you have a serial port connected IR remote setup (eg for a TV tuner card) then you may find you can alter the button values/labels accordingly (good luck!); the include header file Wr-remote.h contains the remote button values and labels (change according to your own remote). Otherwise you will have to simply use your keyboard. :-)

The smaller programs can be used to control your WiNRADiO one commandline at a time (you could also use them in your own shell script file!). Here are the command-line programs you can choose from...

Wr-AttenOff -- Turn the Attenuator Off (for DX)
Wr-AttenOn -- Turn the Attenuator On (for LOCAL)
Wr-MuteOff -- Turn the Mute Off (so audio can output)
Wr-MuteOn -- Turn the Mute On (turn audio output off)
Wr-PowerOff -- Turn off the WiNRADiO
Wr-PowerOn -- Turn on the WiNRADiO
Wr-ResetRadio -- Reset the WiNRADiO (in case it hangs during operation)
Wr-SetFreqkHz -- Tune the WiNRADiO to the specified frequency (in kHz)
Example: "Wr-SetFreqkHz 15000" (to tune to 15.000 MHz shortwave)
Wr-SetMode -- Set the mode (AM, FMN, FMW or SSB)
Example: "Wr-SetMode SSB" (to set the mode to single sideband)
Wr-SetVolume -- Set the Volume (0 through 31)
Example: "Wr-SetVolume 21" (for approx. 67% volume setting)

The program "Wr-SignalStrengthPoll " does not output the signal strength value (it can be easily modified in the source file if necessary!); instead it just returns the signal strength value back to the calling program or shell environment.

Example:

int sigstrength;
sigstrength = system("Wr-SignalStrengthPoll") >> 8;
printf("Signal strength = %d\n", sigstrength);

The ">> 8" part is to shift-right by 8 bits the returned value (since the returned data appears left-shifted by 8 bits). This peculiarity of the system() C function could simply be that the most significant byte (MSB) is given the data and the least significant byte (LSB) is given maybe error flags (a common trick by some programmers -- to store data and error flags in the same integer variable).

3. KEYBOARD commands list

Keyboard key commands to control the Wr-text/Wr-text2 program:

0 - 9 -- digits for direct frequency entry

<Enter> -- accept entered frequency
a -- attenuator toggle (on = LOCAL; off = DX)
f -- mode change (AM/FMN/FMW/SSB)
m -- mute toggle (ON/OFF)
q -- quit/exit
s -- scan
+ -- up volume
- -- down volume
, -- frequency down
. -- frequency up
[ -- band down
] -- band up

Example: "15240<Enter> " will tell the WiNRADiO to tune to 15240 kHz Shortwave.

4. REMOTE commands list

Remote button commands to control the Wr-text/Wr-text2 program:

0 - 9 -- digits for direct frequency entry
ENTER -- accept entered frequency
MORE -- attenuator toggle (on = LOCAL; off = DX)
FUNC -- mode change (AM/FMN/FMW/SSB)
MUTE -- mute toggle (ON/OFF)
EXIT -- quit/exit
ZOOM -- scan
UP VOL -- up volume
DOWN VOL -- down volume
TRACK DOWN -- frequency down
TRACK UP -- frequency up
DISP -- band down
AUDO -- band up

Example: "15240<ENTER> " will tell the WiNRADiO to tune to 15240 kHz Shortwave.

5. TODO list

Functions to still implement: SetBFO()

Get a graphical demo program working with svgalib. Then try to create an X-windows application test version.

Write a user's manual for these programs.

Add to the user preferences file Wr-config.h settings for Timezone (and local time label); Band Labels and Frequency Ranges; WiNRADiO card's hardware address.

Add remote/keyboard/schedulled recording (to .au file format probably) of radio programs, as well as the ability to play them back (through the sound card, ie outputed to /dev/audio). Also the ability to list more than one recorded program, and select one to play back.

Add a radio station name, frequency and time schedule database that can be accessed through the software (storing the mode as well). Add support for the standard WiNRADiO database files.

Add a time delay calibration routine to determine how long a for() function needs to run (in my case 333,333 iterations is approx. 20ms or 1/50th of a second duration). People with different systems will have a faster/slower CPU/hardware hence the need for a run-time "time delay calibration". This is essentially only needed for the Wr-ResetRadio program/function.

Add colour to the text display (colour border, coloured bar graphs and emphasised labels).

Convert/change the lengthy, complex integer to string conversion function int2str() to a simple itoa() function (if possible). This is probably one of the main causes for the slowness in the main program's looping.

6. PROBLEMS

Problems that need to be solved:

Most programs work ok with one write.h, while Wr-ResetRadio requires it's own write2.h in order to work properly. This problem needs to be resolved in order to keep write.h a fixed standard header file.

The change mode routine is failing at some point (SSB mode it seems) by changing the mode. This routine was working fine previously so the problem has crept in at some point recently. The source files Wr-text.c and Wr-text2.c need to be re-examined. The Wr-SetMode program is working fine with no problems.

The dr-serial program (dosradio serial Linux C++ port) talks a little slow with the serial port WiNRADiO. This needs to be sped up.

Happy DXing!

Yuri ("George") Muzyka, ZL1GYM (Email: yuri@win.co.nz)

Updated 3 October 1999