SmartSDR v3.8.19 and the SmartSDR v3.8.19 Release Notes | SmartSDR v2.12.1 and the SmartSDR v2.12.1 Release Notes
SmartSDR v1.12.1 and the SmartSDR v1.12.1 Release Notes
Power Genius XL Utility v3.8.8 and the Power Genius XL Release Notes v3.8.8
Tuner Genius XL Utility v1.2.11 and the Tuner Genius XL Release Notes v1.2.11
Antenna Genius Utility v4.1.8
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.
Discovery method for API developers
Hi, so as time allows, I've been playing with the FlexRadio api stuff (both the .net api and the Ethernet api). It was suggested to me that I could use wireshark to sniff the network to just see what the latest commands are that are sent/received from the radio since the documentation isn't always up to date.
I've used wireshark quite a bit in the past for troubleshooting network problems, but the way it displays data sometimes makes it difficult to read the payload data in network packets.
So, several years back when Powershell was very new, I wrote a packet sniffer script, just because I wanted to see if it could be done without compiled code. Turns out, it worked. So I went back to that script to see if that would be useful in this case -- following a conversation to see what the latest commands were for communicating with the 6000 series radios.
Basically, it made the job a little easier on my part. I'll probably write a "packet decode" function to format the data received from the radio so that it is more powershell friendly, but maybe this will help some of the devs out there.
The "get-packet.ps1" script can be grabbed from here: http://poshcode.org/764 and my original blog post about it is here: http://blog.robbiefoust.com/?p=68
And the way to run it is something like this.
PS C:UsersRobbieDocumentsscripts> .get-packet.ps1 | ? { $_.protocol -eq "TCP" -and ($_.source -eq "192.168.1.133" -
or $_.destination -eq "192.168.1.133") } | select source,destination,data | fl
Using IPv4 Address: 192.168.1.149Press ESC to stop the packet sniffer ...
Source : 192.168.1.149
Destination : 192.168.1.133
Data : C7776|ping
Source : 192.168.1.133
Destination : 192.168.1.149
Data : R7776|0|
Source : 192.168.1.149
Destination : 192.168.1.133
Data :Source : 192.168.1.149
Destination : 192.168.1.133
Data : C7777|ping
Source : 192.168.1.133
Destination : 192.168.1.149
Data : V1.1.0.0
HC3114FDF
Source : 192.168.1.133
Destination : 192.168.1.149
Data : M10000001|Client connected from IP 192.168.1.149
Source : 192.168.1.149
Destination : 192.168.1.133
Data :Source : 192.168.1.133
Destination : 192.168.1.149
Data : SC3114FDF|radio slices=8 panadapters=8 lineout_gain=60 lineout_mute=0 headphone_gain=50 headphone_mute=0
remote_on_enabled=0 pll_done=0 freq_error_ppb=-1 cal_freq=15.000
Source : 192.168.1.133
Destination : 192.168.1.149
Data : SC3114FDF|interlock timeout=0 acc_txreq_enable=1 rca_txreq_enable=1 acc_txreq_polarity=0
rca_txreq_polarity=0 tx1_enabled=1 tx1_delay=0 tx2_enabled=1 tx2_delay=0 tx3_enabled=1 tx3_delay=0
acc_tx_enabled=1 acc_tx_delay=0 tx_delay=0
Source : 192.168.1.149
Destination : 192.168.1.133
Data : C1|client program SmartSDR-Win
Source : 192.168.1.149
Destination : 192.168.1.133
Data : C2|sub tx all
C3|sub atu all
C4|sub meter all
C5|sub pan all
C6|sub slice all
C7|sub gps all
C8|sub audio_stream all
C9|info
C10|version
C11|ant list
C12|client udpport 4991
C13|keepalive enable
C14|ping
Source : 192.168.1.133
Destination : 192.168.1.149
Data :Source : 192.168.1.133
Destination : 192.168.1.149
Data : R1|0|
Source : 192.168.1.149
Destination : 192.168.1.133
Data :Source : 192.168.1.133
Destination : 192.168.1.149
Data : M10000001|Client connected from IP 192.168.1.149
Source : 192.168.1.133
Destination : 192.168.1.149
Data : SC3114FDF|radio slices=8 panadapters=8 lineout_gain=60 lineout_mute=0 headphone_gain=50 headphone_mute=0
remote_on_enabled=0 pll_done=0 freq_error_ppb=-1 cal_freq=15.000
Source : 192.168.1.149
Destination : 192.168.1.133
Data :Source : 192.168.1.133
Destination : 192.168.1.149
Data : SC3114FDF|interlock timeout=0 acc_txreq_enable=1 rca_txreq_enable=1 acc_txreq_polarity=0
rca_txreq_polarity=0 tx1_enabled=1 tx1_delay=0 tx2_enabled=1 tx2_delay=0 tx3_enabled=1 tx3_delay=0
acc_tx_enabled=1 acc_tx_delay=0 tx_delay=0
Source : 192.168.1.149
Destination : 192.168.1.133
Data :Source : 192.168.1.133
Destination : 192.168.1.149
Data : SC3114FDF|transmit freq=7.138 lo=100 hi=2900 rfpower=100 tunepower=10 am_carrier_level=100 vox_enable=0
vox_level=50 vox_delay=250 mic_level=40 mic_selection=MIC mic_boost=1 mic_bias=0 mic_acc=0 compander=1
compander_level=30 dax=0 pitch=600 speed=30 iambic=1 iambic_mode=1 swap_paddles=0 break_in=1
break_in_delay=5 monitor=0 mon_gain=80 tune=0 met_in_rx=0 hwalc_enabled=0 inhibit=0
Source : 192.168.1.133
Destination : 192.168.1.149
Data : R2|0|
Source : 192.168.1.149
Destination : 192.168.1.133
Data :Source : 192.168.1.133
Destination : 192.168.1.149
Data : SC3114FDF|transmit freq=7.138 lo=100 hi=2900 rfpower=100 tunepower=10 am_carrier_level=100 vox_enable=0
vox_level=50 vox_delay=250 mic_level=40 mic_selection=MIC mic_boost=1 mic_bias=0 mic_acc=0 compander=1
compander_level=30 dax=0 pitch=600 speed=30 iambic=1 iambic_mode=1 swap_paddles=0 break_in=1
break_in_delay=5 monitor=0 mon_gain=80 tune=0 met_in_rx=0 hwalc_enabled=0 inhibit=0
Comments
-
You can get the same data from wireshark by finding one packet from the TCP/IP stream and then right click on it and select "follow conversation." It will show you everything between the client and radio color coded for each direction.
0 -
Yeah, but the data field in wireshark is hard to read because it shows it in two columns instead of just straight plain text. There might be an option to display it differently but I haven't found it yet.0
-
I'm sorta lazy, I'll put in the work so that it just tells me exactly what I want to know, so that I can do less work later. :-) haha -- If I can type in a command at the prompt and just see exactly want I want, then I'm all for it. I like to make my job obsolete.
0 -
Steve, you were totally right -- I don't think I had gone far enough into the "follow conversation" feature of Wireshark to realize it would highlight the data that way. Very cool! I'll definitely make use of that.Either way, I couldn't help myself (i'm a nerd) so I kept working on my own "data decode" thingy in Powershell. So far this is what I've come up with:
http://screencast.com/t/TFeQUzCsA
(sorry, you'll have to click on the image a few times to zoom in enough to read it)
Basically it displays data real-time. I'm mostly doing this to learn how to decode/translate the data so that I can do some other super-neat stuff but I could also see tweaking this particular function to save the radio language that it "hears" to a version file, then when it detects a new SmartSDR version, show notices for new language words (key/value pairs, I guess) that it didn't know about previously. Sort of a simple way to discover new features that got added that just haven't made it to published documentation/wiki yet.
Also it could keep track of sequence numbers sent/received and if it doesn't hear a reply, display a warning or something.
Why is this useful? Heck if I know, I'm having a blast playing with this stuff and learning. Also I'll be able to use the decode functions to write cmdlets that can (hopefully) save and restore slice receiver and panadapter settings or profiles or something from the command line. Don't know if it'll work till I try it. :-)
Robbie - KI4TTZ
1 -
Nice work.
0 -
Robbie, very neat utility! Is this a Windows program?
james
WD5GWY
0 -
I didn't realize that either Steve, thanks!
0 -
Wow this is an old thread. Thanks James -- it's actually just a shell script. I've included it in the "FlexModule" powershell module, which is now on GitHub.
https://github.com/rfoust/FlexModule
The packet sniffer script drops a lot of data so it isn't very reliable. I haven't figured out a way to get it to process incoming requests faster, all of the UDP packets coming in seem to cause the buffer to drop packets. It's probably just a side effect of using a shell script to process that much data, but it could also be a limitation of my coding skills...
-Robbie
0 -
In the very late 80's I worked with the company who made Bridge for Windows, it was basically an steroid version of the Windows Batch language. PowerShell is likely that product. Where I am going with this Robbie, you could, in theory, write an entire SDR app in it. Kind of like doing it in Python, but not. Actually, that would probably be a very fun project. PythonSDR.
0
Leave a Comment
Categories
- All Categories
- 290 Community Topics
- 2.1K New Ideas
- 536 The Flea Market
- 7.5K Software
- 6K SmartSDR for Windows
- 146 SmartSDR for Maestro and M models
- 360 SmartSDR for Mac
- 250 SmartSDR for iOS
- 231 SmartSDR CAT
- 172 DAX
- 353 SmartSDR API
- 8.8K Radios and Accessories
- 7K FLEX-6000 Signature Series
- 32 FLEX-8000 Signature Series
- 851 Maestro
- 44 FlexControl
- 847 FLEX Series (Legacy) Radios
- 799 Genius Products
- 417 Power Genius XL Amplifier
- 279 Tuner Genius XL
- 103 Antenna Genius
- 243 Shack Infrastructure
- 166 Networking
- 404 Remote Operation (SmartLink)
- 130 Contesting
- 633 Peripherals & Station Integration
- 125 Amateur Radio Interests
- 873 Third-Party Software