- This topic has 28 replies, 3 voices, and was last updated 5 years, 5 months ago by Aaron, N3MBH.
-
AuthorPosts
-
December 2, 2018 at 9:06 pm #2639Aaron, N3MBHForum 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 / WRFV871OpenRepeater is offered free of charge. Find out how you can support us.
December 5, 2018 at 1:51 am #2644Gregg, WB6YAZUserThanks 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)
December 5, 2018 at 10:45 am #2646Dan, KG7PARForum AdministratorHow are you interacting with the rigctl currently?
If you can use the console you could use system calls to call the commands from tcl.
December 5, 2018 at 5:28 pm #2647Gregg, WB6YAZUserDan,
Running rigctl through a bash shell. Have any suggestions for a good tcl tutorial?
Thanks,
-Gregg (WB6YAZ)
December 5, 2018 at 5:53 pm #2648Dan, KG7PARForum AdministratorI 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
}December 5, 2018 at 8:59 pm #2649Aaron, N3MBHForum AdministratorGregg,
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 / WRFV871OpenRepeater is offered free of charge. Find out how you can support us.
December 5, 2018 at 9:13 pm #2653Aaron, N3MBHForum AdministratorI’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 / WRFV871OpenRepeater is offered free of charge. Find out how you can support us.
December 6, 2018 at 3:55 am #2655Gregg, WB6YAZUserThanks 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 $rigfreqI 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)
December 6, 2018 at 11:41 am #2656Dan, KG7PARForum AdministratorGregg, 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 6 years ago by Dan, KG7PAR.
December 10, 2018 at 3:37 am #2659Gregg, WB6YAZUserDan,
The following works:
set RigType IC7100
set MemoryToRecall 06proc RadioRecallMemory {a b} {
switch $a {
IC7100 {
exec rigctl {*}{-m 370 -r /dev/ttyUSB0 E} $b
}
}
}RadioRecallMemory $RigType $MemoryToRecall
puts $MemoryToRecallThe rigctl get_mem (‘e’) function is not implemented.
-Gregg (WB6YAZ)
-
AuthorPosts
- You must be logged in to reply to this topic.