Issue #325: Infrared Scan with NEC candle remote crashes Bus Pirate 5

Infrared Scan with NEC candle remote crashes Bus Pirate 5:
Image

I recently got a bus pirate 5 from blinkinlabs and updated the firmware to e2429e0. I have these Infrared controlled candles at my sisters place that I wanted to analyse the remote signals with, but irrx crashes the bus pirate and it blinks red and becomes unresponsive, as soon as I use the remote. I think it is NEC and it looks like sigrok / pulseview is able to decode it here (see screenshot).

I don’t have another RPi with me for debugging and I can not take the remote home sadly, so debugging this further might get complicated for me. I did use it successfully on something else that is infrared (great wolf lodge IR wand) and in logic analyzer mode I was able to get the screenshot above and added a sigrok file of one signal.

infrared session remote candle.sr.zip

Issue opened by: davedarko

1 Like

we have a suit of fixes in for this, please give me a few days to apply them.

Bot-copy from GitHub comment by: DangerousPrototypes

2 Likes

@dreg do you think your fixes will cover this use case?

1 Like

Your capture has one NEC frame: 34 mark/space pairs, about 290 characters in irrx. That is below both irrx limits that #323 fixes (512 characters of text, 128 pairs), so this frame alone shouldn’t crash it.

irrx only ends a signal after a 65.5 ms gap. If the remote sends the whole frame again every 108 ms while the button is held, two frames make 68 pairs and 585 characters, and on e2429e0 (same IR code as 322c452) that writes past the text buffer. An 84 pair signal did that on a Bus Pirate 6 here: “AIR packet too long”, then it hung on x with the LEDs red. #323 fixes that case.

Could you tell us:

  • the commands you ran before the crash
  • whether the terminal printed “AIR packet too long” or a packet before the LEDs started blinking
  • whether a short tap crashes it too, or only holding the button

Bot-copy from GitHub comment by: therealdreg

1 Like

Don’t worry @ian

I’ll take care of this issue.

2 Likes

Here’s a infrared scan of a short button press, it looks like it is actually sending three packets, not just the one. I was pressing three buttons before and thought it’s from that, but I got it wrong.

infrared session remote candle short.sr.zip

Here is my console output with the commands from start to crash, I don’t see a message like that in the console that the packet is too long:

HiZ> m INFRARED


Mode: INFRARED

Use previous settings?
 Protocol: RAW (aIR format)
 RX sensor: 36-40kHz demodulator
 TX modulation: 38 kHz

y/n, x to exit (Y) > n

Protocol
 1. RAW (aIR format)*
 2. NEC
 3. RC5
x to exit (1) > 2



NEC TX modulation: 38kHz
RX sensor
 1. 38kHz barrier
 2. 36-40kHz demodulator*
 3. 56kHz demodulator
x to exit (2) > 2


INFRARED-(NEC)> W 5

5.00V requested, closest value: 5.00V
300.0mA requested, closest value: 300.0mA
Undervoltage limit: 4.50V (10%)

Power supply:  Enabled
Vreg output: 5.1V, Vref/Vout pin: 5.0V, Current: 3.9mA

INFRARED-(NEC)> irrx

No file specified, packets cannot be saved
RX sensor: 36-40kHz demodulator

Listening for IR packets (x to exit)...

Bot-copy from GitHub comment by: davedarko

Thx! Let me check!

Bot-copy from GitHub comment by: therealdreg

I think I already have it. I’ll upload a dev .uf2 shortly and you can tell me if it solves the problem or not.

Bot-copy from GitHub comment by: therealdreg

Your short press is three full NEC frames 108 ms apart, with 40 ms gaps (00 FF 00 FF, 00 FF 01 FE and 08 B7 00 FF). irrx only ends a signal after 65.5 ms without IR, so it takes the three as one signal of 102 pairs, and on e2429e0 that overflows its 512-character text buffer.

I sent the same three frames into an IR Toy plank on a Bus Pirate 6 with e2429e0: the text ran to the end of RAM, the LEDs blinked red and nothing was printed, like on your board. I couldn’t try it on a Bus Pirate 5.

#323 as it was (c09d201) stopped the crash but only said “AIR packet too long”. It now prints the whole signal: your press comes out as one packet of 102 pairs, and with irrx -f <file> the s key saves it. Could you try this dev build and tell us if it works with your candles? The .uf2 files are in the next comment. Pick the file that matches i: bus_pirate5_rev10.uf2 for a REV10, bus_pirate5_rev8.uf2 for a REV8, bus_pirate5_xl.uf2 for a 5XL.

Bot-copy from GitHub comment by: therealdreg

try this firmware @davedarko

4b4daa5-dev-uf2.zip

Bot-copy from GitHub comment by: therealdreg