LUA on ersky9x

erskyTx runs on many radios and upgrade boards
ersky9x was a port of er9x for use on the sky9x board.
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: LUA on ersky9x

Post by MikeB »

I've put a "ATSAM4S8CA-AU" on an AR9X board, that is my suggested chip to use.
Details of when I did that start here: viewtopic.php?f=7&t=40&start=3330#p126512.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: LUA on ersky9x

Post by jhsa »

The problem Mike, is that only a very limited number of users will be able to replace the chip. Look how many installed the m2561:)

João

Sent from my thor using Tapatalk

My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: LUA on ersky9x

Post by MikeB »

I believe JK is considering this chip for the next production run of AR9X/ARUNI boards.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
gizmatron
Posts: 40
Joined: Fri Jun 27, 2014 6:35 am
Country: France
Location: somewhere on the limits

Re: LUA on ersky9x

Post by gizmatron »

this is indeed the case.. not sure if anyone asked for this before me but it's just possible I might be guilty of starting this ball rolling .. lol.. PID and VTX adjustments direct on the radio just rocks.. especially on quads where i don't have an OSD.

and which chip Mike? was there supposed to be a link?
IGNORE that crossed posts there
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: RE: Re: LUA on ersky9x

Post by jhsa »

MikeB wrote:I believe JK is considering this chip for the next production run of AR9X/ARUNI boards.

Mike.
As far as I know only the ArUni at the moment :( as I believe it will go into production soon.. Not sure about the Ar9x..

João

Sent from my thor using Tapatalk

My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

andrewju
Posts: 784
Joined: Tue Aug 21, 2012 7:29 am
Country: Russian Federation
Location: Moscow

Re: LUA on ersky9x

Post by andrewju »

I'm checking with JK regarding the use of ATSAM4SD32CA-AU in the future ARUni revisions...
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: LUA on ersky9x

Post by jhsa »

But that is not the chip Mike recommended?? I believe JK should keep to Mike's recommendation to avoid incompatibilities in the future..

And also, the ArUni is no good for the thousands of people that have the 9x radio. This one is easy to upgrade with an Ar9x board.. The ArUni always needs a lot of work to install in any radio.

The Ar9x should be the main target in my opinion.. :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
andrewju
Posts: 784
Joined: Tue Aug 21, 2012 7:29 am
Country: Russian Federation
Location: Moscow

Re: LUA on ersky9x

Post by andrewju »

As I understand, both ar9x and aruni in their current configuration have a limited amount of RAM. The upgraded MCU is meant to solve this.

JK needs to decide which one to go with for the next revision of ARUni. My suggestion is to go with a more powerful version, since it will allow more flexibility in the future. We were happy even with an m64 just a few years ago, but the demands are growing... If Mike considers using M4 features, we may, at some point, benefit from the extra flash and 160kB of RAM. So why not have the hardware ready already now?! It's a change that doesn't require a complete redesign of the board, so it's worth to consider!

I sent a few ideas to JK. Which, btw, also includes a possible solution to install ARUni into a 9x in a simple way. I will certainly support the new board! Just want to make it even better! :)
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: LUA on ersky9x

Post by jhsa »

yeah, there is a good chance that the Ar9X might not go forward :( That will be the end of the 9x radio in my opinion..
I don't think the AreUni as currently is would be easy to install in a 9x.. The Ar9x is a direct replacement. With the ArUni you need to make all connections, making it difficult for normal users..
Now, if someone would develop an adapter board, that would be another story.. Hmm, idea.. :)
But they would have to be available for people to buy them or to have them made.
Hm, my RF soft power circuits could be included on this board, as well as all circuitry of the Safe Switch Board, probably allowing for using the stock switch board. It would be easy to route the GND to the switch instead of battery voltage.. Hmmm..
I might give it a try, but will need to make a exact drawing of the 9X main board, with the correct hole placement, etc. I already have an ArUni (with the old processor)..
Need also to get another destroyed 9x radio and another 7 way encoder. :(

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
andrewju
Posts: 784
Joined: Tue Aug 21, 2012 7:29 am
Country: Russian Federation
Location: Moscow

Re: LUA on ersky9x

Post by andrewju »

Tssss!
That's what I suggested to JK already! :)
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: LUA on ersky9x

Post by MikeB »

I've been looking at the compatibility of the BF script. One problem I see is it uses the specific Taranis buttons, so trying to run this on a 9X/9XR machine will require some re-writing. A second problem is it uses "small text" which ersky9x doesn't have.
I also note it writes text "off grid". On the 9X/9XR display, it is useful to have text aligned vertically on multiples of 8. Then text may make use of the formatting codes ersky9x uses (e.g. "\037" moves down a line and to the beginning of the line, \003 moves to 3 characters along a line).

Mike.

Edit: To get this to fit on a 9XR-PRO, maybe it will need to be split into 3 separate .lua files, one to handle each "page".
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: LUA on ersky9x

Post by jhsa »

andrewju wrote: Mon Jun 05, 2017 5:04 pm Tssss!
That's what I suggested to JK already! :)
Ha, funny me too :mrgreen: :mrgreen: without knowing you already did :)
But did you suggest the RF module switch and the safe power switch? as well?
I might give it a shot building one for me. Need to check if my boards are long enough ;)
Need to measure everything and get all holes and buttons right :) on ArUni too..

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: LUA on ersky9x

Post by jhsa »

MikeB wrote: Mon Jun 05, 2017 5:55 pm A second problem is it uses "small text" which ersky9x doesn't have.
Mike, what do you mean by small text?? Not smaller characters I suppose? Let me know if you need help :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
andrewju
Posts: 784
Joined: Tue Aug 21, 2012 7:29 am
Country: Russian Federation
Location: Moscow

Re: LUA on ersky9x

Post by andrewju »

MikeB wrote: Mon Jun 05, 2017 5:55 pm I've been looking at the compatibility of the BF script. One problem I see is it uses the specific Taranis buttons, so trying to run this on a 9X/9XR machine will require some re-writing. A second problem is it uses "small text" which ersky9x doesn't have.
I also note it writes text "off grid".
I started to write that it's probably worth adding a 'mid-layer' mapping Taranis buttons to what we have on our 9x radios. But then I realized there are too many deviations, and 'emulating' a Taranis will probably take too much efforts (and likely RAM as well).

So it is probably better to write another LUA script to meet ersky9x specifics. Ideally, it shall be just another version - similar to Taranis / X7 / Horus as posted on the BF LUA page. I may look into this some time later, but definitely not within the next few weeks (too busy at my new work at present).
User avatar
Kilrah
Posts: 11108
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: LUA on ersky9x

Post by Kilrah »

jhsa wrote: Mon Jun 05, 2017 7:20 pm Mike, what do you mean by small text?? Not smaller characters I suppose?
Yes that's what it is, OpenTX has 5 text sizes to choose from
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: LUA on ersky9x

Post by jhsa »

No problem, thanks, we can always scrap a couple pixels here and there :)
Mike, if you need help for that, please let me know..;)

João

Sent from my thor using Tapatalk


My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
tsenecal
Posts: 45
Joined: Wed Mar 22, 2017 8:32 pm
Country: United States

Re: LUA on ersky9x

Post by tsenecal »

jeez,

leave the forum for a few months to actually go and play with my radio, and what do i miss? apparently all you need to do to spark an enormous amount of work from mike is to hand him a new cpu to play with :D

i have a telemetry LUA script that i wrote for my taranis x9e that displays different data like depth and compass heading and speed of my submarines... i will look into what it will take to make this look good on my ARuni radio... odds are it won't run, given that i have not updated the CPU on my board and am still limited to 64k, but it would be worth the effort just to see what changes need to be made for the smaller screen...
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: LUA on ersky9x

Post by MikeB »

Feel free to post your existing LUA code, then I can have a look to see what I might need to add to get it to work, or how much might need to be cut out to get it to fit.

Having looked in to how much RAM LUA actually uses, it seems to be a great deal, even for what might be simple things. I've seen something that indicates a LUA table uses 40 bytes when empty, then at least 16 bytes for each subscript, and that doesnt include the actual data stored in the table, and numbers are stored a "doubles" that take 8 bytes for the value, and, I believe, another 8 bytes for control information.
So, if you want a table that really contains 8 bytes of data, LUA uses 40 for the table, 8*16 for the indices, and 8*16 for the data, so 296 bytes (minimum) for an 8 byte table. Seems a bit over the top.

I'm looking into whether something other than LUA could be used that is much more RAM efficient. Hopefully, anything I come up with will, at least, look fairly similar.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: LUA on ersky9x

Post by jhsa »

MikeB wrote: Tue Jun 13, 2017 4:25 pm I'm looking into whether something other than LUA could be used that is much more RAM efficient. Hopefully, anything I come up with will, at least, look fairly similar.

Mike.
I did remember thinking a while ago that you might come up with something better and lighter than LUA :)
Now you got me interested in this "script" thing. :mrgreen:
I still don't know what so special can be done with scripts that it can't be done with the radio?
I see people using (and asking for) scripts to do basic stuff that can easily be done with the radio alone :o

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
ReSt
Posts: 1581
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: LUA on ersky9x

Post by ReSt »

For the 8051 type of processors there were BASIC interpreters available that ran in small rom (probably less than 10 K).
That would be something that I believe, I could be able to use. But LUA is far away from my capabilities.

Reinhard
frediix
Posts: 16
Joined: Sun Mar 10, 2013 9:34 am
Country: -

Re: LUA on ersky9x

Post by frediix »

BBC BASIC ?

https://en.wikipedia.org/wiki/BBC_BASIC#Other_platforms
A GPL clone of BBC BASIC named Brandy written in portable C is also available.
tsenecal
Posts: 45
Joined: Wed Mar 22, 2017 8:32 pm
Country: United States

Re: LUA on ersky9x

Post by tsenecal »

didn't clive have a basic that ran on the zx-80 with 2k of ram?
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: LUA on ersky9x

Post by MikeB »

Been there! My first computer, which I had to build since you couldn't buy one then, had 4K of RAM (32 off 1K by 1 bit chips) and a Z80. I ran a copy of Palo Alto Tiny Basic (2K of code) on that (hand assembled from the source code).
I did manage to build a 16K byte, dynamic RAM board (32 off 4K by 1 bit chips), so moved on to having 20K of RAM so then moved on to a 5K code Basic interpreter. I later created a version of that interpreter that supported 6 users concurrently connected over "dumb" terminals (I was paid for that!).
I never bothered with Spectrums or the BBC computer as, by then, my own computer was more powerful. It has 256K of RAM now, on a Z80, paged using CPM 3 (I say has as it still exists (in the loft)), with 2 8-inch floppy disk drives and an 8-inch hard disk drive. I don't need to use it though as I have written a Z80 emulator that runs on the PC. I have CPM 3 running on that.
I've also got a 'C' compiler I wrote to create code for PIC processors. So I have some building blocks available. I'm experimenting on a PC at present, with code that should transfer over to ersky9x very easily. Don't expect anything too soon though, it will take some time to sort out so it is useful.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: LUA on ersky9x

Post by jhsa »

Wow Mike, it looks like you were a pioneer on this computer thing.. I had (and still have) a "Sinclair 2048". Tried to learn some basic on it, but really enjoyed the cool games :) I was never a gamer by the way ;) and it was a pain having to tune the cassette player heads every time I wanted to play a new game :mrgreen: I might see if it still works though ;)
The model I have was only sold in Portugal and Poland I think, so it might be quite rare :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: LUA on ersky9x

Post by MikeB »

When I got my Z80, I believe there were only 6 other hobbyists with one in the UK!
I designed my own cassette interface, with a phase locked loop, so this was very reliable and ran at 2400 baud.You could even pick the player up and move it around, hearing a lot of wow and flutter, and it still worked fine.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: LUA on ersky9x

Post by jhsa »

Cool times :) I remember a friend of mine creating a game for the ZX Spektrum, and winning the first prize of a contest with it. He was good also.. He also had all the hardware available for it.. :)

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW
tsenecal
Posts: 45
Joined: Wed Mar 22, 2017 8:32 pm
Country: United States

Re: LUA on ersky9x

Post by tsenecal »

i brought it up because my very first computer was the american version... the timex/sinclair ts1000.. apparently i was a much luckier person than most here... i didn't have to assemble it, and there was a small garage company not far from where i lived that sold upgrade hardware for it (can't remember the name.. something like magnetek), so by the time it got retired, it had a 9" green monochrome monitor, a full size keyboard, 64k of ram, a wordstar knock-off wordprocessor in rom, and a centronics parallel port that was plugged into an epson rx-80 dot-matrix printer... the only optional equipment i knew of that i didn't have was 5.25" floppy drive that someone in texas sold for it. that was bought in 1983, and retired in 1984. I still have it sitting in a box in the basement.

my second computer was the original macintosh.

re-reading mike's post... i have both a macII and a ts-1000 emulator running on my android phone... as well as an apple newton emulator (but we wont talk about that)
User avatar
gizmatron
Posts: 40
Joined: Fri Jun 27, 2014 6:35 am
Country: France
Location: somewhere on the limits

Re: LUA on ersky9x

Post by gizmatron »

lol.. sadly my zx81 and spektrum disappeared in a clear out some years ago.. i believe the BBC model B is still in the loft with its insanely noisy daisywheel printer.. you guys rock.. I have every confidence that at some point our resident geniuses will come up with a way to add the same functionality as the BF and RF LUA scripts , even if it means building a new language to do so.. it seems the challenge has been launched.. I shan't be much use with technical coding but I have a 9xr-pro, and all posible mixes of BF.. RF.. unify.. tramp so I can test any configuration or test versions.. just got out of hospital after spinal surgery and i'm about 10 times more mobile than i expected.. cant spend hours sat at the keyboard but I'm functional so if you need anything testing let me know
User avatar
MikeB
9x Developer
Posts: 17990
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: LUA on ersky9x

Post by MikeB »

I'm looking to come up with a very simple language to start with, but probably extend it as we progress. Initially, probably have all variables as integers only.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
jhsa
Posts: 19480
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: LUA on ersky9x

Post by jhsa »

How easy would be for the average user to use it?

Thanks

João

Sent from my thor using Tapatalk

My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

Post Reply

Return to “erskyTx (was ersky9x)”