elksmart/ccrustar NEC commands #2

Closed
opened 2025-07-29 18:52:46 +02:00 by isage · 5 comments

I've captured this

Reading remote control codes.
Press a remote control button from less than a centimeter.
The dongle may be unusable until it returns some data.
If the code fails to replay, retry the capture.
ffff3aff1a25212321232123212321232123212321236423642364236423642364236423202364232023642321236423212321232123212364
23202364232123642364236423ffffffffffffffffffff18ffff4f8822ffffffffffffffffffffffffffffffffffffffffffffff26ffff498922ffffffffff
ffffffffffffffffffffffffffffffffffff29ffff498921ffffffffffffffffffffffffffffffffffffffffffffff2cffff498921ffffffffffffffffffff
ffffffffffffffffffffffffff2bffff498921ffffffffffffffffffffffffffffffffffffffffffffff2bffb1038f892203
Full command:
ffff3aff1a2521232123212321232123212321232123642364236423642364236423642320236423202364232123642321232123212321236423202364232123642364236423ffffffffffffffffffff18ffff4f8822ffffffffffffffffffffffffffffffffffffffffffffff26ffff498922ffffffffffffffffffffffffffffffffffffffffffffff29ffff498921ffffffffffffffffffffffffffffffffffffffffffffff2cffff498921ffffffffffffffffffffffffffffffffffffffffffffff2bffff498921ffffffffffffffffffffffffffffffffffffffffffffff2bffb1038f892203
Attempted pulse decode:
00fea857
Attempted pulse decode:

Attempted pulse decode:

Attempted pulse decode:

Attempted pulse decode:

Attempted pulse decode:

Attempted pulse decode:

And decoded nec command matches https://ircodefinder.wasiliysoft.ru/page/rcbyuser/rcDetail.php?id=2e0d91cf-00f9-463d-be6d-6bdc766c54e4&label=RUBIN+RB-19SE9T2S (POWER)

yet, when i'm trying to send NEC command my tv doesn't seem react

for captured command, pulses are

9088,4496,592,528,560,528,560,528,560,528,560,528,560,528,560,528,560,528,560,1600,560,1600,560,1600,560,1600,560,1600,560,1600,560,1600,560,512,560,1600,560,512,560,1600,560,528,560,1600,560,528,560,528,560,528,560,528,560,1600,560,512,560,1600,560,528,560,1600,560,1600,560,1600,560,41184,9424,2176,544,94448,9328,2192,544,94496,9328,2192,528,94544,9328,2192,528,94528,9328,2192,528,94528,6912,48,2288,2192,544,48

But for NEC they are

8500,4250,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,1650,550,25000,8500,4250,550,1650,550,550,550,1650,550,550,550,1650,550,550,550,550,550,550,550,550,550,1650,550,550,550,1650,550,550,550,1650,550,1650,550,1650,550,550,550,1650,550,550,550,1650,550,550,550,1650,550,1650,550,1650,550,1650,550,550,550,1650,550,550,550,1650,550,550,550,550,550,550,550,25000

Any help is appreciated, as i'm trying to make an app and driver for portable console, and there are a lot of databases for NEC codes, but, obviously, nothing for Ocrustar

I've captured this ``` Reading remote control codes. Press a remote control button from less than a centimeter. The dongle may be unusable until it returns some data. If the code fails to replay, retry the capture. ffff3aff1a25212321232123212321232123212321236423642364236423642364236423202364232023642321236423212321232123212364 23202364232123642364236423ffffffffffffffffffff18ffff4f8822ffffffffffffffffffffffffffffffffffffffffffffff26ffff498922ffffffffff ffffffffffffffffffffffffffffffffffff29ffff498921ffffffffffffffffffffffffffffffffffffffffffffff2cffff498921ffffffffffffffffffff ffffffffffffffffffffffffff2bffff498921ffffffffffffffffffffffffffffffffffffffffffffff2bffb1038f892203 Full command: ffff3aff1a2521232123212321232123212321232123642364236423642364236423642320236423202364232123642321232123212321236423202364232123642364236423ffffffffffffffffffff18ffff4f8822ffffffffffffffffffffffffffffffffffffffffffffff26ffff498922ffffffffffffffffffffffffffffffffffffffffffffff29ffff498921ffffffffffffffffffffffffffffffffffffffffffffff2cffff498921ffffffffffffffffffffffffffffffffffffffffffffff2bffff498921ffffffffffffffffffffffffffffffffffffffffffffff2bffb1038f892203 Attempted pulse decode: 00fea857 Attempted pulse decode: Attempted pulse decode: Attempted pulse decode: Attempted pulse decode: Attempted pulse decode: Attempted pulse decode: ``` And decoded nec command matches https://ircodefinder.wasiliysoft.ru/page/rcbyuser/rcDetail.php?id=2e0d91cf-00f9-463d-be6d-6bdc766c54e4&label=RUBIN+RB-19SE9T2S (POWER) yet, when i'm trying to send NEC command my tv doesn't seem react for captured command, pulses are ``` 9088,4496,592,528,560,528,560,528,560,528,560,528,560,528,560,528,560,528,560,1600,560,1600,560,1600,560,1600,560,1600,560,1600,560,1600,560,512,560,1600,560,512,560,1600,560,528,560,1600,560,528,560,528,560,528,560,528,560,1600,560,512,560,1600,560,528,560,1600,560,1600,560,1600,560,41184,9424,2176,544,94448,9328,2192,544,94496,9328,2192,528,94544,9328,2192,528,94528,9328,2192,528,94528,6912,48,2288,2192,544,48 ``` But for NEC they are ``` 8500,4250,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,1650,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,550,1650,550,25000,8500,4250,550,1650,550,550,550,1650,550,550,550,1650,550,550,550,550,550,550,550,550,550,1650,550,550,550,1650,550,550,550,1650,550,1650,550,1650,550,550,550,1650,550,550,550,1650,550,550,550,1650,550,1650,550,1650,550,1650,550,550,550,1650,550,550,550,1650,550,550,550,550,550,550,550,25000 ``` Any help is appreciated, as i'm trying to make an app and driver for portable console, and there are a lot of databases for NEC codes, but, obviously, nothing for Ocrustar
Owner

Try different computers and USB ports, the gadget can be annoying. It has to quite visibly flash green when transmitting.

Also remember to use the --nec switch. If it is actually NEC-coded.

Otherwise I have no idea.

Try different computers and USB ports, the gadget can be annoying. It has to quite visibly flash green when transmitting. Also remember to use the --nec switch. If it is actually NEC-coded. Otherwise I have no idea.
Author

I mean, yeah, light is flashing. And transmitting captured command as-is succeeds (so it isn't pc / port issue. plus dumped with debug flag pulses differ between captured command and decoded one).

I mean, yeah, light is flashing. And transmitting captured command as-is succeeds (so it isn't pc / port issue. plus dumped with debug flag pulses differ between captured command and decoded one).
Author

Mkay, looking closely at the code it makes sense why NEC pulses don't match captured pulses (because their values are fixed)
Guess i'm out of luck then

Mkay, looking closely at the code it makes sense why NEC pulses don't match captured pulses (because their values are fixed) Guess i'm out of luck then
Owner

Another piece of information: those numbers are (light on, light off) pairs and receivers are very tolerant.
If you can graph these, that's how you should compare them.
The NEC protocol is rather well defined.
Try cutting off trailing pulses until it no longer works. You can take the encoded string as you got it, including any ff prefix pairs.

Another piece of information: those numbers are (light on, light off) pairs and receivers are very tolerant. If you can graph these, that's how you should compare them. The NEC protocol is rather well defined. Try cutting off trailing pulses until it no longer works. You can take the encoded string as you got it, including any ff prefix pairs.
Author
Learned (minimal working):
ffff3bff182620242024202420242024202420242024632463246324632463246324632420246324202363242023632420232023202420246324202363242023632463246324ffffffffffffffffffff15

9104,4464,
608,512,  576,512,  576,512,  576,512,  576,512,  576,512,  576,512,  576,512,
576,1584, 576,1584, 576,1584, 576,1584, 576,1584, 576,1584, 576,1584, 576,512,
576,1584, 576,512,  560,1584, 576,512,  560,1584, 576,512,  560,512,  560,512,
576,512,  576,1584, 576,512,  560,1584, 576,512,  560,1584, 576,1584, 576,1584,
576,41136

0 0 0 0 0 0 0 0    // 0x00
1 1 1 1 1 1 1 0    // 0xFE
1 0 1 0 1 0 0 0    // 0xA8
0 1 0 1 0 1 1 1    // 0x57

Oh, in learned sequence there's no inverted bytes (except that 0x57 is an inverted 0xA8), so it's just NEC variation (NECx2 ?), i guess.
And indeed, after rewriting encoding as

                p = encode_nec_byte(p, code->str[i + 0]);
                p = encode_nec_byte(p, code->str[i + 1]);
                p = encode_nec_byte(p, code->str[i + 2]);
                p = encode_nec_byte(p, code->str[i + 3]);

it now works

``` Learned (minimal working): ffff3bff182620242024202420242024202420242024632463246324632463246324632420246324202363242023632420232023202420246324202363242023632463246324ffffffffffffffffffff15 9104,4464, 608,512, 576,512, 576,512, 576,512, 576,512, 576,512, 576,512, 576,512, 576,1584, 576,1584, 576,1584, 576,1584, 576,1584, 576,1584, 576,1584, 576,512, 576,1584, 576,512, 560,1584, 576,512, 560,1584, 576,512, 560,512, 560,512, 576,512, 576,1584, 576,512, 560,1584, 576,512, 560,1584, 576,1584, 576,1584, 576,41136 0 0 0 0 0 0 0 0 // 0x00 1 1 1 1 1 1 1 0 // 0xFE 1 0 1 0 1 0 0 0 // 0xA8 0 1 0 1 0 1 1 1 // 0x57 ``` Oh, in learned sequence there's no inverted bytes (except that 0x57 is an inverted 0xA8), so it's just NEC variation (NECx2 ?), i guess. And indeed, after rewriting encoding as ``` p = encode_nec_byte(p, code->str[i + 0]); p = encode_nec_byte(p, code->str[i + 1]); p = encode_nec_byte(p, code->str[i + 2]); p = encode_nec_byte(p, code->str[i + 3]); ``` it now works
isage closed this issue 2025-07-29 21:39:47 +02:00
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: p/usb-drivers#2
No description provided.