Support for RC-28 USB encoder planned?

I got RC-28 up and running on Pi4/Raspbian and Wfview 1.59 today. The LEDs for transmit and Link are not working but the buttons can be programmed OK.
I prefer “step-” and “step+” and PTT toggle.

Nice work, thanks.
/Tommy SM6NZB

1 Like

Yes the LED control is a bit tricky without an ‘actual’ RC-28 to test it on. I thought that I had it working, but it seems not, as somebody else has told me the same thing.

Glad the rest is working for you though.

73 Phil M0VSE

Sounds perfect… when will the first official build with this
functions enabled be released ? Can’t wait to try it out…

BOFH mode: when its ready.

We’re at 1.59 and sorting/squeezing out the bugs we find and other brave people that build from source.

If all is well, version bump. documentation bunp, official builds and …

so 1.60… this year. Before June (;-))

Hmm…
I haven’t seen an implementation of LED’s in the code nor I was adding it…

You can find more details on implementation here:

if you could just make placeholders for that I can do the rest…

@roeland I havent seen any BOFH for so long! Thanks;)

1 Like

LED support has always been in there, I have added some more support for the LEDs based on available information from rc28_emulator, so please see if that works.

EDIT: in the band-switching branch

Phil

Doesnt work.
I will trace the code in the evening. But maybe you can point me to shorten that?:slight_smile:

It’s all done within the ledControl() function of usbController. One possibility is that the RC-28 is expecting 64 bytes of data, even though it only uses 6?

I have updated the band-switching branch to try this.

It is expecting two bytes:

def write_to_hid(dev, cmd):
try:
num_bytes_written = dev.write(cmd)
except IOError as e:
print (‘Error writing command: {}’.format(e))
return None

return num_bytes_written

write_to_hid(h,[0x01,0b0000111]); // turn on only LINK led
time.sleep(1);
write_to_hid(h,[0x01,0b0000110]); turn on LINK and TRANSMIT led
time.sleep(1);
write_to_hid(h,[0x01,0b0000111]); // turn on only LINK led
time.sleep(1);
write_to_hid(h,[0x01,0b0001111]); // turn off all leds
time.sleep(1);

And this is the structure of command in general:

write_to_hid(h,[0x01,0b000ABCD]); 0b0000 + A=LINK B=F2 C=F1 D=TX

Sent one by one.

That is the code i use and works.

The c++ hidapi works slightly differently, but try that now.

Phil

Works!
Except for F-1 button;)

Does the F1 button work at all? The rc28_emulator code suggests that F1 sends 0x7d (0b01111101) which is quite different to the other buttons:

#define F1_MOMENTARY 0b01111101
#define F2_MOMENTARY 0b00000011
#define TX_MOMENTARY 0b00000110

If you can, could you try pressing the button and see what data[5] contains when it is pressed?

Thanks

Phil

All buttons work on my python code;)

[0x01,0b0001110] TX on
[0x01,0b0001101] F-1 on
[0x01,0b0001011] F-2 on
[0x01,0b0000111] LINK on
[0x01,0b0001111] all off
[0x01,0b0000000] all on

Ha!
Found an error;)
You’ve reverted something I asked to merge;)

else if (butf1 != Q_NULLPTR && ((unsigned char)data[5] == 0x7d) && ((unsigned char)lastData[5] != 0x7d))
else if (butf1 != Q_NULLPTR && ((unsigned char)data[5] != 0x7d) && ((unsigned char)lastData[5] == 0x7d))

F-1 = 0x7, not 0x7d;)

It’s not an error as such as it disagrees with what Gareth GI1MIC found when he created rc28_emulator. I suspect he has F1 configured as latching which probably adds 0x70 to the value?

I have pushed this now.

No no wait…
I was too fast;)

7d is incorrect for sure;)

[1, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] (F1 down)
[1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] (all up)
[1, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] (F2 down)
[1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] (all up)
[1, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] (TRANSMIT down)
[1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] (all up)

there are also combinations like:

[1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] (F1 + F2 down)

But I do not think you want to implement those cases?

I know, I have changed it to 0x03 for F1!

What I am saying is that the buttons can be programmed to be LATCHING this will likely send 0x70 + current value, but we won’t bother about that at the moment.

Technically all those buttons are push buttons, momentarily switched up and down with no physical lock.
So of koz maybe it can be programmed (but I havent seen this option anywhere to program their behaviour)

Don’t forget that everything I have done on the RC-28 has been done blind, without an actual RC-28 and only the source code for rc28_emulator for reference, which is quite likely incorrect :slight_smile: