Viewing 10 posts - 11 through 20 (of 29 total)
  • Author
    Posts
  • #2639
    Aaron, N3MBH
    Forum Administrator

    Thanks Dan for the template. This is the start of a framework for a module that will be installable, it is currently missing some of the UI features, but I am sure that will be coming as we are still developing that.

    We are working on building out what we refer to as the Module Framework in OpenRepeater and that is a new feature we are working on for an upcoming release (likely version 2.1.0). It will facilitate much easier install of SVXLink modules along with UI elements to allow for simpler configuration of the modules from within ORP.

    73,
    Aaron – N3MBH / WRFV871

    OpenRepeater is offered free of charge. Find out how you can support us.

    #2644

    Thanks Dan / Aaron,

    I have hamlib 3.0.1 (rigctl) working with my spare RPi 3 + 2018-11-13-raspbian-stretch-lite and IC-7100.

    There is a Tcl library, but I have yet to find any documentation on it.

    I am looking through Dan’s template module and am not quite sure if there is a way to make rigctl calls from the Tcl.

    -Gregg (WB6YAZ)

    #2646
    Dan, KG7PAR
    Forum Administrator

    How are you interacting with the rigctl currently?

    If you can use the console you could use system calls to call the commands from tcl.

    #2647

    Dan,

    Running rigctl through a bash shell. Have any suggestions for a good tcl tutorial?

    Thanks,

    -Gregg (WB6YAZ)

    #2648
    Dan, KG7PAR
    Forum Administrator

    I can’t say that I have found anything useful, although I have not really looked much. I pretty much studied some existing code (Remote Relay) and counted on my script programming background to get through it on the ones I have done so far.

    I have heard the nutshell series are pretty decent in general, but can’t comment from personal experience. The dummies series might be a consideration as well, depending on your background with code.

    One thing I would warn you about is the use of spaces. TCL uses white spaces as code breaks, so while normally this “}{” would be okay, it will break TCL. You instead need to put the space between them like this “} {“. This took me a painful amount of time and trial/error to figure out and find in the code.

    I would say keep it crude for now, get what you want working and it can always be improved later if someone else wants additional functionality, or if you come across a better reference for the TCL library for rigctl.

    Functional before pretty 🙂

    For executing system/console calls, you can do something like this, note that I have ignored the stderr response so it wouldn’t know if something went wrong or not, the console portion below starts at “sudo…”, exec is TCL version of making a console type call.

    if {$cmd == “999”} {
    # restart the service
    exec -ignorestderr sudo /usr/sbin/service svxlink restart
    }

    #2649
    Aaron, N3MBH
    Forum Administrator

    Gregg,
    Glad that you’ve gotten the hamlib/rigctrl working on the Pi. Sounds like it will be a cool module once we can put all the pieces together.

    In the meantime, now that you have rigctrl working on your pi, you can connect it to the outside world if you can punch a hole in your firewall or use a VPN or something then you can ssh into the pi to control your rig.

    Pretty neat stuff.

    73,
    Aaron – N3MBH / WRFV871

    OpenRepeater is offered free of charge. Find out how you can support us.

    #2653
    Aaron, N3MBH
    Forum Administrator

    I’ve also moved this into a new forum created for module development as that will be a thing in the upcoming release.

    73,
    Aaron – N3MBH / WRFV871

    OpenRepeater is offered free of charge. Find out how you can support us.

    #2655

    Thanks Aaron,

    Slowly learning tcl. Being a retired microwave engineer, learning a new programming language is a challenge. I am familiar with Matlab and Python and to a lesser extent bash scripting, so it will take me some time to understand the tcl structure.

    I have loaded tcl8.6 onto my Pi and was able to get the following to run:

    set rigfreq [exec rigctl -m 370 -r /dev/ttyUSB0 f]
    puts $rigfreq

    I think I will start with creating rigctl functions for simply changing memory locations. I can see that trying to do too much with dtmf commands will be difficult and hard to remember without carrying around a cheat sheet.

    The impetus for this project was to be able to access my IC-7100 and Echolink while riding my bike around the area. So far so good, fun stuff. Thanks again for your help.

    -Gregg (WB6YAZ)

    #2656
    Dan, KG7PAR
    Forum Administrator

    Gregg, I think your approach is the best one for now. Build out some limited scope functions in TCL that are discrete and easily testable in isolation. Once you have the basics in place, we can put them into a framework where the DTMF gets involved for higher level integrations.

    As you write your functions, try to include control variables that will enable abstraction to other rigs later, something like this as a prototype (note the syntax is likely wrong, and will need to be adjusted based on the RigCtl functionality):

    #start with constants, these can be abstracted later when integrated
    set RigType IC7100
    set MemoryChannelToRecall 5
    
    func RadioRecallMemory { $RigType $MemoryChannelToRecall } {
      switch $RigType {
        IC7100 {
           #send command to recall the memory channel $MemoryChannelToRecall
        }
      }
    }
    • This reply was modified 5 years, 4 months ago by Dan, KG7PAR.
    #2659

    Dan,

    The following works:

    set RigType IC7100
    set MemoryToRecall 06

    proc RadioRecallMemory {a b} {
    switch $a {
    IC7100 {
    exec rigctl {*}{-m 370 -r /dev/ttyUSB0 E} $b
    }
    }
    }

    RadioRecallMemory $RigType $MemoryToRecall
    puts $MemoryToRecall

    The rigctl get_mem (‘e’) function is not implemented.

    -Gregg (WB6YAZ)

Viewing 10 posts - 11 through 20 (of 29 total)
  • You must be logged in to reply to this topic.