Share My Creation Radio Frequency Channel Monitor - Logger for Tine Spectrum Analyzer (TSA)

Hi,

I've built an app that uses the tiny spectrum analyzer to monitor preset channel amplitudes and logs them to an sqLite database.

Snag_18dedf20.png



Before running the program open up B4J and set the parameters for your system in the networkPars module.


Network Pars module:
'Static code module
Sub Process_Globals
    Private fx As JFX

    'Clock Test Database file Path
    Dim Const CLOCK_TEST_DB_FILEPATH1 = "C:\Eng\RF_Projects\RFChannelMonitorDB" As String
    Dim Const CLOCK_TEST_DB_FILEPATH2 = "G:\RFProjects\RFChannelMonitorDB" As String
    
    Dim Const COMPORT1 As String = "COM13"
    Dim Const COMPORT2 As String = "COM4"
    
    Dim Const NO_CHARS_IN_SCAN_RESPONSE_PER_LINE As String = 38
    Dim Const NO_CHARS_IN_SCAN_RESPONSE_TERMINATION As String = 4
    
    Dim BaudRate As Int = 115200
    Dim DataBits As Int = 8
    Dim StopBits As Int = 1
    Dim Parity As Int = 0
    Dim readingThreadInterval  As Int = 100
    
    Dim MainBarGraphMinValue As Double = -135
End Sub


You can set two database paths and two default comm ports.

The program tries number 1 first and number 2 second for the paths and comm ports


Basically you do the following:

  1. Connect the TSA to your antenna being careful the antenna has no static charges that can destroy the TSA input, use a 3 dB attenuator to protect the input. Connect the attenuator to the antenna, ground the attenuator then connect the attenuator to the TSA.

  2. Connect the TSA to the PC using its USB.

  3. Turn the TSA on using its on-off switch.

  4. Start the RF Monitor App

  5. Using the following config screen (Config Tab) set up the app config for the signals you wish to monitor.
Snag_18e31d20.png





Set up the signal source first. Tooltips are used to assist with filling the fields. Use the save button to save the signal source to the db

Then set up the Monitored bands and save. The monitored bands are children of the selected signal source.

Whenever you edit a signal source and save it or select it in the Signal Source table, it becomes the "active" record at the top of the list. I didn't use in-table editing because its complicated especially with data validation and not justified in this application. The values entered in the various fields are validated and change background color when edited i.e. dirty.

The application attempts to automatically connect to COM13 which my TSA uses, but you can change this in the status bar or go into the program and change the default to your TSA in the networkPars module.


To run the analyser switch to the "Dashboard" tab

- Check the Log Data checkbox to log to the database and push the Run toggle button. Hopefully it will start scanning.

The data is monitored against five threshold from top to bottom:

- Max 2, Max 1, Min 1, Min 2, No Signal.

If the signal crosses any of these an exception is recorded in tblChannelExceptionData. You can set a "Logging Ratio" which forces a scan independent of threshold transitions so you can gather stats on the channels when they are operating in the "normal" range of amplitudes.

The extra files for the app are specified in the application header:

Reqired additional .jar files:
#Region Project Attributes
    'Version 4.0.1
    #MainFormWidth: 1360
    #MainFormHeight: 860
'    #AdditionalJar: sqlite-jdbc-3.36.0.3
    #AdditionalJar: sqlite-jdbc-3.43.2.06
'    #AdditionalJar: charts-11.8
'    #AdditionalJar: bluecove-2.1.1
'    #AdditionalJar: bluecove-2.1.1-SNAPSHOT
'    #AdditionalJar: javafx.controls
    
    #PackagerProperty: IconFile = ..\Files\full-spectrum256.ico
    #PackagerProperty: IncludedModules = java.sql

You only need sqlite-jdbc-3.43.2.06 for this app.

The two sqLite tools I use for analysis and DB design and query testing are:

sqLite Studio: https://sqlitestudio.pl/

and

dbBrowser: https://sqlitebrowser.org/

Both of these are excellent, however only db browser provides graph which can grapg raw table data or query outputs.


I couldn't get the packager to work, that's work in progress.

Regards
Rob
 

Attachments

  • RF_Monitor_V4.0.1_032_B4x_Forum.zip
    322.6 KB · Views: 30
Top