Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
Locked Help please. Quisk modifications for our rig (Multus SDR, LLC - Proficio Mark II)
Hi Folks,
?
Jim was very gracious and provided the code modifications to integrate our product (Multus SDR, LLC. - Proficio Mark II) into Quisk.? The rig functions perfectly particularly in CW mode.? The Mark II has a built in CW keyer and Jim did a great job of allowing the rig to be QSK capable.? The Mark II also has a PTT connector so that a switch (foot switch, etc) may set the rig into TX mode.? This was not implemented so I have decided to attempt to do implementation.?? Jim's implementation of CW polls the rig to determine if the key is active via polling the rig via its USB connection.? I need to do something similar to poll the rig to determine if the PTT connection is active.? Jim provided the basics of do this and it works as I can see the rig being polled when I put the rig firmware into debug mode.?
?
OK, I have almost zero experience with Python.? I am an old school C programmer with some C# experience.? We (Multus SDR) have our own application called MSCC which is a combination of C# (for the GUI) and C for the back end servers, but for a number of reasons we are dropping support which I will not bore you with in favor of Quisk.? Quisk is now our preferred SDR host application.? So, I am asking for help with implementing the PTT function.? I have included our quisk_hardware.py file.? The short of what needs to be accomplished is Quisk needs activate the PTT button and display TX in the button immediately to right of it.? Also Quisk needs to placed into TX mode.? The question is: how do I do that?
?
Below is are snippets of the hardware file where Quisk is polling the rig for the state of the PTT connection.? I have "piggy backed" on the function Jim provided for polling the rigs CW key connection.? I admit this might be the completely wrong place to do this, but it does work for polling the rigs PTT connection.
?
previous_ptt = 0?
ptt_count = 200 ?
def TransferIN(self, address, message):
? ? # If message is an int, convert it to bytes ? ? if isinstance(message, int): ? ? ? ? message = message.to_bytes(1, 'big') ? ?? ? ? # Here, message is mutable (bytes), so we can modify it ? ? if self.usb_dev: ? ? ? ? # Assuming IN is defined somewhere as a constant for the direction ? ? ? ? result = self.usb_dev.ctrl_transfer(IN, address, self.si570_i2c_address + 0x700, 0, message) ? ? ? ? # Update message with the result if needed ? ? ? ? message[:] = result ?# This updates the original message in place ? ? return message ?# Return the potentially modified message ?
def PollCwKey(self): ?# Called frequently by Quisk to check the CW key status
? ? global previous_ptt ? ? global ptt_count ? ? ptt = bytearray(1) ?# Start with a mutable bytearray ? ? ptt_count -+ 1 #NO NEED TO POLL THE PTT CONNECTION AS FAST AS POLLING FOR THE CW KEY ? ? if ptt_count == 0: ? ? ? ?self.TransferIN(0xA5, ptt) ?# ptt will be modified in place. THIS IS WHERE QUISK POLLS THE RIGS PTT CONNECTION ????? #IF PTT EQUALS ONE (1) PLACE QUISK INTO PTT MODE (AND TURN ON THE PTT BUTTON AND DISPLAY TX IN BUTTON NEXT TO IT
????? #IF PTT EQUALS ZERO (0) TAKE QUISK OUT OF PTT MODE
? ? ? ?ptt_count = 200 ? ? #if ptt != previous_ptt: ? ? ? ?#print ("PTT") ? ? ? ?#print ("ptt:{}, previous_ptt:{}".format(ptt, previous_ptt)) ? ? ? ?#previous_ptt = ptt[0] ? ? return ? ?# Quisk is always in Rx ?
Thanks,
Ron
W4MMP |
¿ªÔÆÌåÓýRon: You'll love Python. It is a great language, The language is very friendly and very expressive with lots of ways to implement any given idea. To make your journey even more pleasant load up Microsoft Visual Studio as your development environment. It is commonly referred to as VS Code. It does everything!
73
flash
On 9/27/24 06:47, Ron / W4MMP via
groups.io wrote:
|
Group Moderator
Hello Ron,
?
Your TransferIn() method is not correct. Please start with the hardware file multuspkg/quisk_hardware.py so we are working from the same file. Use the TransferIn() from that file instead of writing a new one. Add the call to PollCwKey() to see if the correct value is returned.
?
def PollCwKey(self):
? ?ptt = self.TransferIn(0xA5, 1)
? ?print (ptt)
?
Jim
N2ADR
?? |
Hello Jim,
Attached is the corrected hardware file.? Quisk will run for a bit and crash with a segmentation fault:? Here is a snippet of the log output:
?
I/Q Tx Sample Output: ?Buffer average ?2.50
Stream cork/uncork Radio Sound Output success Stream started Radio Sound Output Change from state Starting to Receive TransferIn got 0 TransferIn got 0 Segmentation fault; ?
Here are snippets of the hardware file:
?
DEBUG = 1?
ptt_previous = 1? ptt_count = 200? ptt_on = 0 ?
def TransferIn(self, address, length):
? ? if self.usb_dev: ? ? ? recv = self.usb_dev.ctrl_transfer(IN, address, self.si570_i2c_address + 0x700, 0, length) ? ? ? return recv ?
def PollCwKey(self): ?# Called frequently by Quisk to check the CW key status
? ? global ptt_count ? ? global ptt_on ? ? # now = datetime.now()? ? ? ptt_count -= 1 ? ? if ptt_count == 0: ? ? ? # print(now)? ? ? ? reply = self.TransferIn(0xA5, 1) ? ? ? ptt_count = 200? ? ? ? print ("TransferIn got", reply[0]) ? ? return ? ?# Quisk is always in Rx ?
Regards,
Ron |
¿ªÔÆÌåÓýHi Bob, Yes, you are correct and I should have said near
QSK.? The operator needs to pause for a few milliseconds to listen
for the QSO partner. 73, Ron / W4MMP On 9/28/2024 02:32, R.J. Butcher via
groups.io wrote:
|
to navigate to use esc to dismiss