Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual events #257

Merged
merged 4 commits into from
Oct 13, 2019
Merged

Virtual events #257

merged 4 commits into from
Oct 13, 2019

Conversation

mikeller
Copy link
Member

Merge #253 and #254 into master.

@RipperDrone
Copy link
Contributor

RipperDrone commented Oct 13, 2019

@raphaelcoeffic @mikeller It seems the Virtual Events / OTX mismatch confusion is going on: Downloaded lua 1.4.0, overwrote with https://github.com/betaflight/betaflight-tx-lua-scripts/tree/virtual-events, then tested on Taranis X9D+ --> different result now: When decrementing e.g. a PID value, it stays decremented for like 1-2 secs, then changes back to what it was before. As if the script was re-reading the number from Taranis without taking the change into consideration. Plus: Sometimes when hitting ENTER to edit one parameter, the edit field does not flash / get enabled. When switching back and forth btw 1st lua page (display) and 2nd lua page (edit BF parms), it becomes editable... in general, parameters take very long to show up in edit fields, it sometimes takes 10secs!? :-/

@mikeller mikeller merged commit 1dc5e28 into master Oct 13, 2019
@mikeller mikeller deleted the virtual-events branch October 13, 2019 08:39
@mikeller
Copy link
Member Author

@RipperDrone: Not sure why you are using a hodgepodge of different versions and not just the released version that is working.

@RipperDrone
Copy link
Contributor

RipperDrone commented Oct 13, 2019

@mikeller Released version is not working. I haven't been able to identify any version working with OTX 2.3.1 on Taranis X9D+. Which one is expected to work ok? Lua 1.4 is not... :-/

@mikeller
Copy link
Member Author

@RipperDrone: 1.4.0 is working fine for me with OpenTX 2.3.1 on X9D+. What does not work for you?

@RipperDrone
Copy link
Contributor

RipperDrone commented Oct 13, 2019

@mikeller Same behavior like described before:

  • BF4.1RC6, OTX 2.3.1, Lua 1.4.0 --> When changing values in lua script (e.g. decrementing Roll P), the decremented value stays for some time, then it swaps back into previous / unchanged value. Same when pressing ENTER to leave edit mode.
  • occurs first time only, when re-doing same procedure, parameter is changed consistently and doesn't jump back
  • happens every time you start the lua script / enter the 'edit values' pages

@mikeller
Copy link
Member Author

@RipperDrone: This works fine for me. Are you starting the script as a telemetry page? If so, can you try clearing / re-formatting the SD card in your X9D+ and reinstalling the OpenTX contents and then the Betaflight TX lua scripts? There's an off chance that there are some leftovers from past versions.

@RipperDrone
Copy link
Contributor

RipperDrone commented Oct 13, 2019

@mikeller yes, starting it as a telemetry page (page 2, when page 1 is just displaying a selected telemetry values matrix). Will try...

@RipperDrone
Copy link
Contributor

RipperDrone commented Oct 13, 2019

@mikeller test done:

  • formatted SD on Taranis X9D+ (2013)
  • flashed 2.3.1 OTX firmware from OTX Companion
  • dumped OTX 2.3.1 SD content on SD
  • copied Lua 1.4.0 files to SD
  • long press PAGE for telemetry display page (configured as page 1)
  • short press PAGE for lua parms edit pages (configured as page 2)
  • press ENTER to edit Roll P
  • decrement Roll P and wait --> it jumps back to unchanged value

Same behavior when hand-executing the lua script from /BF sub-dir 'bf.lua', instead of executing as page 2 of my telemetry pages

Still doesn't work on my setup.

@mikeller
Copy link
Member Author

@RipperDrone: That's weird - exactly the same behaviour works fine for me, and my setup is the same as yours. Maybe @raphaelcoeffic can reproduce the problem?

@RipperDrone
Copy link
Contributor

RipperDrone commented Oct 13, 2019

@mikeller - I'm baffled. Can repeat on any lua parameter page, with any value - always on editing the page for the first time.

There has been a working version in between the PRs addressing virtual events, I think it was @raphaelcoeffic 's reference to PR #250. The .zip link given there does no longer work, pbly due to local branches / content having been merged and deleted in the meantime (?). Therefore cannot reproduce the working combination anymore. This is the reason why I was trying to mix OTX2.3.1 with some earlier stage of master... no luck, same bug as with Lua 1.4.0...

@RipperDrone
Copy link
Contributor

RipperDrone commented Oct 13, 2019

@mikeller @raphaelcoeffic it was this .zip file which made it work on my setup (OTX 2.3.1, Lua 1.3.0, patched with this .zip file content) yesterday (but this zip file is 0 bates = empty now...)

image

@raphaelcoeffic
Copy link
Member

I have the feeling somethings strange is going on. Let’s imagine for one second that the page is loaded twice. And as it takes so long, and you edit some field while it is doing the second loading in the background.

@raphaelcoeffic
Copy link
Member

Ok, then we might have to check what happened in between.

@RipperDrone
Copy link
Contributor

@raphaelcoeffic Jeez, believing you nailed it: When waiting for 10 secs after loading any parameters page and only then proceeding to change values, IT WORKS AS SUPPOSED - no auto-readjusting of the values changed anymore!

This seems to be in line with the general feedback that parameter page loading has slowed down a lot, it sometimes takes 6 secs to load a page now. Has been lots faster before. Plus, the annoying 'Retrying...' message has come back when trying to save (every single time!), which the dev team almost had tricked out by implementing some watchdog timing (I remember it cannot be made bullet proof because there is no bidir acknowledging of commands received...).

@RipperDrone
Copy link
Contributor

tried #259 doesn't fix it - though it maybe fixes the occasional non-react on 1st start of the lua telemetry script.

@frozenskys
Copy link
Contributor

frozenskys commented Oct 13, 2019

#259 was just meant to fix the non-reaction to events on first load of the telemetry script.

I've run both on my X7 (on OTX 2.3.1) and don't have any issues with values not changing or saving, although I have currently only tested on FrSky telemetry and I do have the telemetry mod done. Unfortunately it's going to be difficult to fix if I can't replicate it, or we can't find what's causing it through some other means.

@raphaelcoeffic
Copy link
Member

@mikeller @RipperDrone I have made a PR for testing some fixes I've just made. These changes are base directly on 1.4.0 to make it simple. @frozenskys once We have 1.4.0 fixed, let's tackle your fixes against master.

Here is the PR: #260

@RipperDrone
Copy link
Contributor

RipperDrone commented Oct 14, 2019

@raphaelcoeffic @mikeller Yep, fixes it perfectly on Taranis X9D+! Good work! :-)

PS: Reading values from FC over telemetry is still very slow, some pages take 6 secs+ to populate. Maybe it's purpose design to NOT make telemetry packets with so many sensors swamp the radio transmission pipeline...

And it obviously also has the fix for making the parameters pages re-entrant, e.g. when toggling btw telemetry display (tele page 1) and PID value edit (page to), it now always returns to the same parameters page, doesn't increment page numbers uncommandedly anymire... nice!

@mikeller
Copy link
Member Author

@RipperDrone: Re the slowness, what RX type / protocol / firmware version are you using? Some firmware versions have got issues with encoding, which could lead to errors / retransmissions. Can you try updating your RX firmware to the latest version? Also, I don't know if the built-in TX in the X9D+ had similar issues in older versions, but an update to the latest firmware version can't hurt there either.

@RipperDrone
Copy link
Contributor

@mikeller thanks for this hint. The quad I tested with for last couple of weeks has a CRSF micro TX/Nano RX combo, latest firmware installed over TBS AgentX. Wired up with TX/RX, CRSF protocol on Taranis and Nano.

@RipperDrone
Copy link
Contributor

RipperDrone commented Oct 15, 2019

maybe it's related to betaflight/betaflight#6894

Seems to be on CRSF side...

@mikeller
Copy link
Member Author

I don't have much practical experience with CRSF, but the 50 Hz mode has got a limited bandwidth, so I would assume that whenever it goes into this mode the bandwidth available for telemetry will be minimal.

@Dyrt-Nasti
Copy link

does anyone know how to get around this screen, everything is setup and ready but when i hold the 'PAGE' key this pops up

20200522_083318

@klutvott123
Copy link
Member

The telemetry script is removed from 1.5.0. It has been replaced by "Betaflight setup" which can be found in the TOOLS menu

@Dyrt-Nasti
Copy link

once i enter the Betaflight setup tab in my QX7 it just initializes and nothing else, anybody got advice on how to get past

@klutvott123
Copy link
Member

@Dyrt-Nasti Power on your quad. The script is waiting for a connection

@Dyrt-Nasti
Copy link

powered on the quad, have connection and telem. is working but still cant get past initializing

@klutvott123
Copy link
Member

@Dyrt-Nasti Strange. Could you open an issue, please? And provide information about your hardware/firmware

@Dyrt-Nasti
Copy link

posted the issue, if you got questions ask

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants