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

Error: Not enough memory on 2.2.1N439 opentx nightly #97

Closed
brycedjohnson opened this issue Nov 21, 2017 · 157 comments
Closed

Error: Not enough memory on 2.2.1N439 opentx nightly #97

brycedjohnson opened this issue Nov 21, 2017 · 157 comments
Labels

Comments

@brycedjohnson
Copy link

Was testing out the latest opentx nightly for a different reason and I saw I was getting a memory error. Seems to happen after paging through a few lua screens.

Script Syntax Error
BF/ui.lua:335
not enough memory

@codecae
Copy link
Member

codecae commented Nov 21, 2017

@brycedjohnson did you download the source or use the release zip file?

@brycedjohnson
Copy link
Author

@codecae Release zip file. Should I try the source?

@codecae
Copy link
Member

codecae commented Nov 21, 2017

no the release is the smallest in terms of memory. Which page is loading when you hit the limit?

@brycedjohnson
Copy link
Author

On the 4th or 5th page in. Weirdly one time it just worked and I didn't have any issues until I rebooted the taranis.

@codecae
Copy link
Member

codecae commented Nov 21, 2017

@brycedjohnson
Copy link
Author

That seemed to fix it! Tried it like 3 times and it worked everytime. Thanks!

@brycedjohnson
Copy link
Author

Want me to close this issue or want to close it when you reference whatever fix you did? Thanks for the quick help!

@codecae
Copy link
Member

codecae commented Nov 21, 2017

I'd like to leave it open for tracking purposes.

Glad it helped you :)

@mikeller Looks like the Jenkins build didn't have the -s switch for luac. Should we do an increment release with the current master and include a better build, or should I just update the release zip to contain a build using -s?

@mikeller
Copy link
Member

@codecae: No problem, we are still in the process of getting this set up. I would say there have been a couple of pretty significant bug fixes since 1.0, so a release 1.0.1 would be in order. (Also, we should totally move to SemVer (https://semver.org/).)

One of the things in SemVer that is sometimes overlooked, but in my opinion is a crucial part of it is

Once a versioned package has been released, the contents of that version MUST NOT be modified. Any modifications MUST be released as a new version.

Breaking this rule will create a lot of confusion and frustration amongst users ('I tried v1.0, it did not work, why would I try it again') for no benefit at all (there is an unlimited supply of version numbers, and they are free ;-) ).

@David-VG
Copy link
Contributor

David-VG commented Nov 21, 2017

I am not sure if it's the same bug or not, but I am using OpenTX 2.2.0 on a Taranis X9D:

Script syntax error
TELEMETRY/bf.lua:10
not enough memory

I get this with the release 1.1 and the file http://null.eastus.cloudapp.azure.com/job/Betaflight%20Lua%20-%20X7,%20X9,%20X9D,%20X9D+,%20X10,%20X12/24/artifact/obj/*zip*/obj.zip

But... i am using FPort :P

@David-VG
Copy link
Contributor

David-VG commented Nov 21, 2017

Also disconected but switching between pages I get at the VTX page:

Script syntax error
BF/ui.lua 335
not enought memory

@David-VG
Copy link
Contributor

As a little tip: I am using 2 telemetry scripts, one is the betaflight tx lua scripts and the other one: https://github.com/tozes/taranis_telemetry

I am not sure, but maybe betaflight tx lua scripts needs ALL of the available memory.

@raphaelcoeffic
Copy link
Member

@David-VG yes, definitely! but you could use the one-time script (in /BF/bf.lua) for configuring, and the other as a telemetry script for flying.

@raphaelcoeffic
Copy link
Member

raphaelcoeffic commented Nov 21, 2017

Or just buy yourself a brand new shinny X10: no issue with memory there ;-)

@David-VG
Copy link
Contributor

I dont get Memory errors that way, (running BF.lua manually). But just wanting to warn about the memory issues. Thanks @raphaelcoeffic

@mikeller
Copy link
Member

@raphaelcoeffic: Except that the X10 can not (yet) run telemetry scripts at all (as far as I know), and the https://github.com/tozes/taranis_telemetry does not yet support the X10. ;-P

@raphaelcoeffic
Copy link
Member

@mikeller yeah, it's called "widgets", and these scripts will need to be modified. And it still lacks the capability of having widgets that can handle keys. But we're working on it, you can bet on that ;-)

@mikeller
Copy link
Member

@raphaelcoeffic: Just hassling you. :-P You are involved in OpenTx? Also, out of interest, what are the MCU / RAM hardware specs of the X10?

@raphaelcoeffic
Copy link
Member

@mikeller I did only a couple of small things. Trying to get more involved these days, so I can make my new X10 with opentx the best TX in the world :-D

@mikeller
Copy link
Member

That's a good goal. Having nice new hardware but firmware that isn't as good as the one on the old stuff is always a big disappointment.

I've seen flashy marketing videos of FrSky's own firmware on the X10. Is it any good, or is it just a non-recent version of OpenTx with some flashy bitmaps slapped on?

@raphaelcoeffic
Copy link
Member

Totally different. It's quite good for people in need of a UI that basically works like on of the main brands (futaba was named a few times in that context). But it's not my cup of tea when it comes to planes. I would not mind for Quads. probably enough (no LUA though).

@codecae
Copy link
Member

codecae commented Nov 22, 2017

This issue should now be addressed in release v1.0.1.

Please download and verify!

@David-VG
Copy link
Contributor

Still out of memory here :(

But thanks.

@codecae
Copy link
Member

codecae commented Nov 22, 2017

I'm wondering now if the other script you're using is eating up resources. These scripts have been dialed back and optimized in just about every way possible to reduce the memory footprint. I'm not sure if the other script you're using has undergone the same level of scrutiny.

@codecae
Copy link
Member

codecae commented Nov 22, 2017

Have you tried temporarily disabling the other script and seeing if it still happens? If you attempt this, please power cycle your transmitter to ensure the resources from the previous script are freed.

@David-VG
Copy link
Contributor

It works while using just of both scripts (even if I dont power cycle).

Also works if y manually launch BF/bf.lua while the other script is assigned as the only telemetry script.

But the other script only runs while being displayed (does not background function, just "run").

https://github.com/tozes/taranis_telemetry/blob/master/X9D/TELEMETRY/telem1.lua

As you can see is just a run, divided in 9 functions that just draw the screen. I will try other script just to know if the problem is having 2 telementry scripts or just that "telem1.lua".

@raphaelcoeffic
Copy link
Member

But the other script only runs while being displayed (does not background function, just "run").

That does not matter at all: it is still kept in memory, as long as you model is loaded and no one-time script is executed.

@David-VG
Copy link
Contributor

Yeah, but it doesent use global variables, just the run loop that just draws.

@raphaelcoeffic
Copy link
Member

The code is stored in memory as well

@David-VG
Copy link
Contributor

Yeah, but only 238 lines. I tought the bitmaps could be the issue but without bitmaps had the same problem.

Tried a hello world without issues and also the snake.lua. Will keep trying.

@Seewatz
Copy link

Seewatz commented Apr 6, 2018

I use latest 2.2.1. With only lua I had no problem.

@dengorman
Copy link

I just now followed exactly what JB's youtube video instructed, and it seems to be working.

@mikeller
Copy link
Member

Reopening this to stop users from creating duplicate issues.

@frizzle101101
Copy link

frizzle101101 commented Apr 22, 2018

so i noticed after ive already used and exited from the vtx, and pwm menu i can no longer open the script untill rebot because the not enough memory error. This does not happen when using and exiting from the pid, rates 1&2, filters, and rx menu, the next time i open the script it opens to the last menu no out of memory error.

@stale
Copy link

stale bot commented May 22, 2018

This issue / pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within a week.

@stale stale bot added the Inactive label May 22, 2018
@stale
Copy link

stale bot commented May 29, 2018

Automatically closing as inactive.

@stale stale bot closed this as completed May 29, 2018
@callagga
Copy link

callagga commented Jul 9, 2018

I just downloaded betaflight-tx-lua-scripts v1.0.2 but got the following issue as I was going through (pressing "menu") and when I was on the "Betaflight-RX" page, then pressed "Menu" got this error:

Script syntax error
BF/ui.lua:335
not enough memory

Should I raise a new issue for this?

Note that I have:

  • Taranis X9D+
  • Opentx version: 2.2.1
  • I initially copied/merged the SCRIPTS folder across, then when getting this error went back and copied the root BF folder across also to the tararnis root directory, but same issue

@hchalouati
Copy link

I want to confirm that I have the same issue with same versions above.

I did a fresh install of the script.

@turbosi92
Copy link

I wanted to bring this back up simply to ask if the latest opentx fixes the out of memory issue. I haven't loaded it yet but figured i't ask. I don't see it mentioned in the release notes but wanted to ask before I take the time to upgrade.

@floriangaller
Copy link

I tested it with opentx-x9d+-noheli-lua-en-2.2.2 and BF scripts: bf-tx-lua-1.0.2.zip and i have the also the out of memory issue

@OZamirO
Copy link

OZamirO commented Aug 7, 2018

I also tested it with opentx-x9d+-noheli-lua-en-2.2.2 and BF scripts: bf-tx-lua-1.0.2.zip and have this issue.
Thing is, if I go directly to the lua script page after powering the tx ON, it works great. But, if go to that lua page after I, for example, edited settings on my model, it shows this error on page 1.
(I edited "x9pre.lua" so VTX is 1st page)

@Saschabrix
Copy link

Good morning,

I have the same issue as the user Florian Galler.
Opentx-x9d+-noheli-lua-en-2.2.2 and BF scripts: bf-tx-lua-1.0.2.zip.

Same Issue,
Script Syntax Error
BF/ui.lua:335
not enough memory

@OZamirO
Copy link

OZamirO commented Aug 13, 2018

I got this working.
I have re-flashed Opentx-x9d+-noheli-lua-luac-en-2.2.2 and BF scripts: bf-tx-lua-1.0.2.zip

the change from my previous try is not modifying any files of the scripts.
As to JB's youtube video, he says there are two options to modify the order of the pages. The second one, modifying x9pre.lua, and moving vtx to the top, seem to be making the issue for me.

@LIAUTFAM
Copy link

Yep worked for me too... great to see not just me!
Try this, per Lazy8onez and my post above, if you have this problem, and report if successful.

@mikeller
Copy link
Member

@Lazy8onez: Did you recompile the scripts after modifying them? If not, uploading changed source code will force recompilation on the TX, which would explain why this does not work properly.

@floriangaller
Copy link

I got it also working... my mistake seemed that i used the opentx version without luac...

@OZamirO
Copy link

OZamirO commented Aug 16, 2018

@mikeller, no I did not

@mikeller
Copy link
Member

@Lazy8onez: My suspicion is that the on-board compilation is less optimised than off-board, so compiling it before installing will have a better chance of working.

@Snake675
Copy link

Snake675 commented Sep 9, 2018

@Lazy8onez: Did you call the luac script by menu (as done by jb on his youtube video) or from the telemetry screen?

@OZamirO
Copy link

OZamirO commented Sep 10, 2018

@Snake675
Telemetry screen.

@Pigost
Copy link

Pigost commented Sep 11, 2018

I've also got "script syntax error FB/ui.lua: 335 not enough memory"

@Snake675
Copy link

I hope this issue will be fixed soon for shure. Some of us seem to have no errors but others do. So what is going on?

@mikeller
Copy link
Member

@Snake675: Part of the seemingly inconsistent behaviour that gives some users errors for things that work for others could stem from the 'pick and choose' build on the fly system that OpenTX uses to build their firmware - there are over 1000 possible permutations of the every 'release' of OpenTX that users can install, all of which probably have a different RAM consumption...

@frizzle101101
Copy link

frizzle101101 commented Sep 16, 2018 via email

@Snake675
Copy link

@frizzle101101 & mikeller
Yes. But I wonder if a own fw without luac helps if you want to open the BF scripts by telemetry screen. If not, I would rather still stick to the previous version of OTX...

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

No branches or pull requests