Opentx: crossfireTelemetryPush function cause emergency mode on T16

Created on 20 Jan 2020  Â·  12Comments  Â·  Source: opentx/opentx

Describe the bug
crossfireTelemetryPush function cause to crash openTX 2.3.5 (T16 will go into emergency mode / X9D will not properly execute function) when send 23 byte.

To Reproduce
Steps to reproduce the behavior:

  1. Add/setup model with external Crossfire (no module required)
  2. Add following lua on the SD card
local function run(event)
    lcd.clear()
    if event == EVT_ENTER_LONG then
        lcd.drawText(10, 20, "23 byte - PID change", 0)
        local result = crossfireTelemetryPush(0x78, {234,200,67,18,11,184,0,35,39,16,11,184,0,35,39,16,31,64,0,50,19,136,135})
        lcd.drawText(10, 35, "done", 0)
    end
    return 0
end

return { run=run }
  1. Launch lua and hold ENTER key to trigger (T16 will go into emergency mode / X9D will not send out command) - https://youtu.be/ImHcW7YLh1A

Expected behavior
Command should be executed and send to Crossfire module

General information

  • OpenTX version (2.3.4 and 2.3.5 tested)
  • Hardware (Frsky X9D+, Jumper T16 both tested.)

Most helpful comment

We will extend the buffer to 64 and put safeguards

All 12 comments

Anything above 16 (the size of the buffer) will get you into trouble I think. Will double check with TBS, and add a safety mechanism

TBS packet is up to 64 bytes. It was ok on OTX 2.2.

If you where sending 64 bytes in 2.2, you where probably massively exceeding buffer size (#define TELEMETRY_OUTPUT_FIFO_SIZE 16)

Great… Well… There are specs for crossfire protocol, and buffer must be extended to 64 bytes. Sorry.

On 20 Jan 2020, at 09:08, 3djc notifications@github.com wrote:

If you where sending 64 bytes in 2.2, you where probably massively exceeding buffer size (#define TELEMETRY_OUTPUT_FIFO_SIZE 16)

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/opentx/opentx/issues/7310?email_source=notifications&email_token=AAQBCCVW4METUE2V4SGTWBDQ6VLWVA5CNFSM4KI4FZ32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJLW4AY#issuecomment-576155139, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQBCCXZ2BEQWM5FM7NR6BDQ6VLWVANCNFSM4KI4FZ3Q.

Not sure we have the memory available for that, we will have a look, not commiting to that

Well, telemetry receiving buffer is 256 bytes if i am not mistaken. which is quite a lot. can be smaller? ;)

We can't control when we receive stuff, but we can control when we send stuff. Normal to have RX bigger.

Yes, thats true. But specs are specs.

Meanwhile, i patched device.lua so it will work with float numbers that kiss uses a lot. That DOESNT let you guys off the hook with buffer size ;)

...Meanwhile, i patched device.lua ...

Where can i find it?

...Meanwhile, i patched device.lua ...

Where can i find it?

Here, https://www.patreon.com/posts/33299763

We will extend the buffer to 64 and put safeguards

perfect! thank you from all kiss users.

Was this page helpful?
0 / 5 - 0 ratings