Welcome to the new FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
If you are having a problem, please refer to the product documentation or check the Help Center for known solutions.
Need technical support from FlexRadio? It's as simple as Creating a HelpDesk ticket.

Spot API "trigger_action"

Alan
Alan Member ✭✭✭✭

Question

I am trying to build a API command to add a spot with a trigger action.

Adding spots to the panadapter works just fine, but I have been unable to structure the API to have the spot do something when I click on it.

The API WiKi appears to have two options:

  • "trigger_action=tune" - to tune to the spot's frequency, and
  • " trigger_action=none" - to implement a custom behavior.

I have tried both. Here are my test API Spot commands. The spots appear, but clicking on the spot does not cause an action:

spot add rx_freq=14.220 callsign=KE5DTO mode=USB color=#FF5733 source=N1MM spotter_callsign=N5AC timestamp=1533196800 lifetime_seconds=3600 priority=4 comment=thanks trigger_action=tune

and

spot add rx_freq=14.220 callsign=KE5DTO mode=USB color=#FF5733 source=N1MM spotter_callsign=N5AC timestamp=1533196800 lifetime_seconds=3600 priority=4 comment=thanks trigger_action=none

Question, what am I missing with making the "trigger_action" API work?

Alan. WA9WUD

Tagged:

Answers

  • KD0RC
    KD0RC Member, Super Elmer Moderator

    Hi Alan, it looks like it is working for me.

    If trigger_action=none, then I get the fact that the spot was triggered, but the slice does not move to that frequency.

    R25|0||
    S55FD333D|spot 157 callsign=KE5DTO rx_freq=7.220000 tx_freq=0.000000 mode=USB color=#FF5733 background_
    color= source=N1MM spotter_callsign=N5AC timestamp=1533196800 lifetime_seconds=3600 priority=4 comment=thanks trigger_action=none
    R26|0|157|
    S0|interlock tx_client_handle=0x00000000 state=READY reason= source= tx_allowed=1 amplifier=
    S1603B860|spot 157 triggered pan=0x40000000
    

    On the other hand, if trigger_action=tune, the active slice goes right to the spot frequency.

    R25|0||
    S55FD333D|spot 157 callsign=KE5DTO rx_freq=7.220000 tx_freq=0.000000 mode=USB color=#FF5733 background_
    color= source=N1MM spotter_callsign=N5AC timestamp=1533196800 lifetime_seconds=3600 priority=4 comment=thanks trigger_action=tune
    R26|0|157|
    
    S1603B860|spot 157 triggered pan=0x40000000
    

    So, I think that the idea is that you intercept the spot status message, get the spot number and the fact that it was triggered, and if you need it, which panadapter it was triggered from. With that info, you can take whatever action you want.

    In the case of my repeater spots app, I leave trigger_action set to tune, then take my own action of setting the mode and repeater options.

  • Alan
    Alan Member ✭✭✭✭

    Len

    I look like you are trigger a specific spot number, 157. What happens if you use "spot add....."

    Alan

  • Alan
    Alan Member ✭✭✭✭

    Neve mind.....i just notice you displayed the status message.

    Alan

  • Alan
    Alan Member ✭✭✭✭

    Len

    Problem solved. It appears MacSmartSDR does not support the Spot "trigger-action" command.

    I tested the same on Windows SmartSDR and it worked just fine. On MacSmartSDR, the icon does not change when I hover on the spot, a good indication that Mac does not recognize the action.

    Alan. WA9WUD

  • KD0RC
    KD0RC Member, Super Elmer Moderator

    Hi Alan, I'm glad you got that figured out. You might want to drop a note to Marcus to see if he has plans to add this functionality.

  • SA6TUT
    SA6TUT Member ✭✭

    Hello,

    I hope it's acceptable for me to contribute to this thread. I might be in the process of developing an application that places spots on the SmartSDR's panadapter. At this stage, I am exploring what is feasible.

    For testing purposes, I am connecting to the FlexRadio using PuTTY, and I have some questions:

    1 ) Test Command Line and Control Characters:

    Here is my test command line:

    C19|spot add rx_freq=14.029175 tx_freq=14.029175 callsign=QS6RS mode=CW color=#FF0000FF background_color=#7FFFFFFF source=Wavelog spotter_callsign=OV8UT timestamp=1726569803 lifetime_seconds=3600 priority=4 comment=Helloworld trigger_action=tune

    I understand that I cannot enter Hello\0x7FWorld in PuTTY. However, the program I am developing will be able to insert that control character. This is more of an observation than a question.

    2) Intercepting Spot Clicks and Retrieving Callsign in SmartSDR API:

    Is there any way to intercept when a spot is clicked and retrieve the callsign using the SmartSDR API or any other method?

    3) Communicating with SmartSDR Application:

    Would it be possible to communicate with the SmartSDR application for sending spots instead of directly to the radio?

    I would appreciate any guidance or information you can provide on these matters.

    Thank you for your assistance.

  • KD0RC
    KD0RC Member, Super Elmer Moderator

    Hi SA6TUT, I have already done something similar. Here is a link to the Flex Repeater Spots Utility thread on this community:

    Here is a link to my GitHub page where you will find the utility, the source code and a user manual:

    https://github.com/KD0RC/FlexRepeaterSpots

    In my utility, I use C# and .net with FlexLib. You can also use any language you like if you use the native, text-based API. I find that using FlexLib makes using the API much easier.

    To answer your last question first, you don't communicate with SmartSDR, you only communicate with the radio. The radio is a server and things like SmartSDR, the Maestro and the Flex Repeater Spots Utility are all clients. SmartSDR and the Maestro are a special kind of client, called a GUI Client because they bring back the panadapter, waterfall and audio from the radio. Non-GUI clients like the Flex Repeater Spots Utility need to bind to a GUI client to make some functionality work.

    Question 2: Yes, in FlexLib, there is a SpotTriggered event. You can get all of the properties of the spot including spot callsign and spotter callsign.

    Good luck with your project, and I hope this info helps. Please feel free to keep this discussion alive or start a new thread for your project. I am looking forward to seeing your progress.

  • SA6TUT
    SA6TUT Member ✭✭
    edited September 18

    Thanks, Len @KD0RC, for your kind help, it has been incredibly useful.

    I’ll definitely start a new thread for my project once I’ve figured out a few more things. First, I need to decide where the app will run (e.g., on a server or a local workstation) and whether to use FlexLib or the text-based API. I may end up with two applications. In short, the goal is to streamline DX spotting, logging, and tracking DXCC needs between Wavelog (an amazing browser based logging software) and SmartSDR.

    EDIT: I can now track clicked spots by command
    c1|sub spot all

    However I do not get detailed info when a spot is clicked, just an index and I have found no way to get the Flexradio to tell me more details about the spot using the text based API.
    S374A5545|spot 6 triggered pan=0x40000000

    TU es 73

  • KD0RC
    KD0RC Member, Super Elmer Moderator

    Hi Mikel, When a spot is posted to the radio, you will get a status response based on your subscription (sub spot all):

    S30DE1C66|spot 60 callsign=VE1RPX rx_freq=14.240000 tx_freq=14.240000 mode=SSB color=#FF00FF00 background_color= source=N3FJP spotter_callsign= timestamp=1726671286 lifetime_seconds=1500 priority=3 comment= trigger_action=TUNE
    

    You need to capture this info in a table indexed or searchable by spot number (60 in this example). Then when you click on the spot, you will get the following status:

    S5B9D59C5|spot 60 triggered pan=0x40000000
    

    Now use the triggered spot number to find the associated spot info in your table. This is how I do it in my Flex Repeater Spots Utility. Because I use a fixed set of spots that do not time out, I do not have any memory management issues. In your case, you will need to be more dynamic as spots come in, live for a while, then disappear. Once a spot times out, you get this status:

    S0|spot 60 removed
    

    Notice that in my example, the handles are different. The handle ending in "C66" is the client handle of my N3FJP logging program (i.e. the client that sent the spot). The handle ending in "9C5" is the client handle of SmartSDR (i.e. the client that triggered the spot). Spots that time out apparently get a handle of "0". Spots that are removed using the API get the handle of the client that did the removal.

    Sidenote: It looks like "sub spot all" is equivalent to "sub spots all". This subscription is not listed in the API Wiki, so I just took a guess and found that spots got me what I needed… "sub spot all" is more in keeping with the naming convention, and I have now switched to it. I am glad you put that in your post, or I never would have found it!

  • F4BPO
    F4BPO Member, Unconfirmed ✭✭
    edited September 23

    Guys,

    You saved my with this thread.

    I have been developping an app in golang for my personnal use.

    The program connects to a DX Cluster and check my Log4OM sqlite database to see if call is a new dxcc, new mode, new band and put different background colors and colors and send them to SmartSDR / Maestro panadapter.

    The app also acts as a Cluster server so Log4OM connects to it and the server just echo all the spots received from the DX Cluster the app is connected to.

    One of the goal was for me to be able to fill the callsign field in Log4OM when a spot was clicked on Maestro/SmartSDR and I could not solve this until I saw this thread.

    I did not find anywhere the sub spot all command in the wiki, maybe I am blind !!!!!

    Thank you so much guys.

    By the way @KD0RC Len, on your github I do not see the source code, only the binaries.

    Not sure if this is intended but would love to have a look at your code.

    Thanks

    72 de Greg XV9Q

  • KD0RC
    KD0RC Member, Super Elmer Moderator

    Hi Greg, you are right - the Wiki is missing "sub spot all". I found it by taking an educated guess.

    My FlexRepeaterSpots source code is in GitHub under releases:

    I created the C# .net code in Visual Studio 2019. Take a look and I will try to answer any questions.

  • F4BPO
    F4BPO Member, Unconfirmed ✭✭

    Oh yeah indeed in the binaries part

    thanks a lot !! :)

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.