Perseus PHP Kit
I've been experimenting reading out Perseus graphical data via PHP. The first tool is for offset spectrum analysis. It will load the Perseus main spectrum into the browser, shift it according to the calibration and give you a list of all peaks with the exact frequencies and dB values.
The second main tool can read the HF spectrum data from RFSpan.
Download Perseus PHP Kit
This is an experimental pre-release. I've already got many ideas to extend this kit: converters, userlist.csv integration for FM etc., userlist sort options etc. It will be announced in the Perseus SDR group at Yahoo.
If you want to use it on your own PC you must install the Apache server with PHP:
Previous versions could only read XP fonts (reading out frequency from Perseus graphic). Since Nov-2014 it also works on Windows 7 (at least on my personal setup). It's still possible that problems occur with other systems/fonts or with other Perseus versions than 4.0, 4.1 and 5.0
The PHP version problems have been solved since Jan 2015. The kit should at least be comatible with all versions from PHP4 to PHP5.6.3.
- download and install XAMPP
- start Apache via the control panel
- create the subdirectory 'c:\xampp\htdocs\perseus' and unpack the PerseusPHPKit.zip there
- com0com must be installed for COM port access. If you use other ports than COM11 you must configure the civ function in pcontrol.php (part of the Kit). For offset detection, the software will alternatively try to read the frequency from the display with a mini OCR algorithm (see below).
- If you are on a 64 Bit operating system com0com needs signed drivers. In this case, install this com0com 64 bit version instead!
- If you save a userlist1.csv from FMSCAN.org in the PHP Kit directory it will show up frequency information with some additional columns:
distance, azimuth, maximum level, offsets, language, times and days.
- start your Perseus software
- type http://localhost/perseus into your browser
Calibration with the tool will be much more precise because now you can
set the calibration as exact as 0,03 Hz while the Perseus software only allows 1 Hz steps. Put off the internal calibration by the Perseus software (press CalClr). For the best results go to a reference signal (like 5000 KHz),
choose the most exact span, leave calibration fields empty and check the deviation. After that put in the values. Now you can start analyzing.
Just start with the index file or access these files directly:
- readspec6.php can be accessed directly for the live mode. It can also analyze spectrum image files captured with perseusgrab.php. The write mode is not supported (only works with my local database).
- perseusgrab.php captures ans saves the spectrum and changes the frequency according to a few parameters in the script. It regularly will capture a reference frequency (after 20 pics).
Lateron, redspec.php will automatically check for the spectrum pics and calibrate the images accordingly.
- hfspan-spec.php analyzes a 40 MHz HF span spectrum (10 and 20 MHz not supported yet). The attenuation will be detected automatically.
You can access various converter options. Values are in dBµV which I prefer for FM.
Please feel invited to use and adapt the PHP code to your needs. Here is what you might find helpful:
CI-V access with PHP
Unfortunately serial port access in PHP is limited. COM10 and above do not work. That's why I've written and compiled a univeral tool for serial port access that can be called by PHP via the shell extension.
Given this you can control the Perseus via any browser (remote or localhost with Apache running in the background).
For that purpose I'm working on a set of functions for easier CI-V access. Until now, you can retrieve and set the frequency, the mode and read the S-Meter.
But it is easy to extend this. The C++ tool is called comxs, the according Perseus fuctions can be found in pcontrol.php. Both are part of the download.
Here is a documentation that explains the commands for virtual serial port (COM11) more comprehenseive than the provided pdf.
Automatic HWND detection
The whole spectrum analysis is based on the imagegrabwindow function which requires the HWND Window handle. Another C++ tool will detect the magic number automatically for your Perseus.
More info here.
New: Now you can even read the frequency from the Perseus image with the readfreqbyim function in pcontrol.php. It just grabs
a few distinctive pixels, some kind of OCR light. This is a workaround for the FM+ which has no COM port support.
Handewitt Perseus site
Questions? Corrections? Ideas? Comments? PeerAxel@aol.com
This site is based at: radiovibrations.com/perseus/phpkit.htm