Script Language

ersky9x is a port of er9x for use on the sky9x board.
vodkabears
Posts: 20
Joined: Thu Aug 23, 2018 5:37 am
Country: Russian Federation
Contact:

Re: Script Language

Post by vodkabears » Wed Oct 10, 2018 10:20 am

Hello Mike. Is there any way to debug scripts? Mine just stops working right after start, it will be hard to find a problem.

User avatar
MikeB
9x Developer
Posts: 15811
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Script Language

Post by MikeB » Wed Oct 10, 2018 4:10 pm

What Tx are you using?
Is your script very large?
I'm (currently) allocating 12k bytes of RAM for scripts (except for the SKY board that only has 8k). I'm wondering if your script is too large to fit.

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

vodkabears
Posts: 20
Joined: Thu Aug 23, 2018 5:37 am
Country: Russian Federation
Contact:

Re: Script Language

Post by vodkabears » Thu Oct 11, 2018 1:17 pm

9XR-PRO. Yes, about 1k lines. 12 kB might be too few for it.

User avatar
MikeB
9x Developer
Posts: 15811
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Script Language

Post by MikeB » Thu Oct 11, 2018 3:53 pm

I will increase the space available on the 'PRO, although if the script is too large, you should get an error 10 reported.

I did originally have a test setup I used on my computer, running the script language within QTCreator. If you have QTCreator I could see about making this available.

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

rcfish
Posts: 53
Joined: Tue Jan 10, 2017 8:11 pm
Country: Germany

Re: Script Language

Post by rcfish » Thu Oct 11, 2018 5:24 pm

MikeB wrote:
Thu Oct 11, 2018 3:53 pm
I did originally have a test setup I used on my computer, running the script language within QTCreator.
Does that mean you can run the scripts without having to upload them to the TX? This yould be great I think.


User avatar
MikeB
9x Developer
Posts: 15811
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Script Language

Post by MikeB » Thu Oct 11, 2018 11:34 pm

That test setup was really for me to test the code that handles the script, so doesn't have a script display output.
It may take a bit of time but I should be able to get a display output, I have some hooks in for it that seem to work. I've just got "drawtext" displaying something.
I'll probably need to add some buttons (Menu, Exit etc,) to the display.
How much of any script can be simulated, I'm not sure, things like getting telemetry values won't work.

What I also do have working is the same syntax check as the radio uses, so this should, at least, check the syntax. It does use the same source code file as the radio.

Give me a few days to see if I can knock this into shape.

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

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

Re: Script Language

Post by jhsa » Thu Oct 11, 2018 11:42 pm

what about if the scripts could be simulated in Eepskye?

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: 15811
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Script Language

Post by MikeB » Fri Oct 12, 2018 8:56 am

Later maybe, but much easier to develop the feature using a specific application.

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

User avatar
MikeB
9x Developer
Posts: 15811
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Script Language

Post by MikeB » Sat Oct 13, 2018 11:18 pm

I'm making good progress on a PC program to test scripts. I have it running with 6 buttons working and a simulated display (128x64).
I have text, numbers and graphics displaying, complete with the popup working.
I need to add a file select dialog, it is currently using a hard coded path to a script to run.

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

User avatar
MikeB
9x Developer
Posts: 15811
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Script Language

Post by MikeB » Sun Oct 14, 2018 3:42 pm

I've posted, on the first post of this thread, a first version of a PC (windows only so far) program that runs scripts.
Copy "interpreter.exe" into the directory in which you have installed eepe/eepskye (it needs the QT dll files), then run it.
Click on the "File" button to select your script file, then click on the "Run" button to run it. The Menu, Exit, Left, Right, Up and Down buttons should operate as though you are using them on the radio. The "Abort" button stops a running script.
Remember that this cannot simulate all the functions, although it should check the runtime operation without performing those functions.

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

rcfish
Posts: 53
Joined: Tue Jan 10, 2017 8:11 pm
Country: Germany

Re: Script Language

Post by rcfish » Sun Oct 14, 2018 4:37 pm

That‘s really cool . Thank you

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

Re: Script Language

Post by jhsa » Sun Oct 14, 2018 5:14 pm

Thanks Mike..

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: 15811
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: Script Language

Post by MikeB » Mon Oct 22, 2018 11:37 pm

Just adding a new BT function "Script", and two new functions to scripts "btsend" and "btreceive". This should allow scripts to send and receive data over bluetooth.
I have just tested a script that sends a single character 'A' once per second, and received that over bluetooth in a terminal emulator on my PC, so that much seems to work.

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

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

Re: Script Language

Post by jhsa » Tue Oct 23, 2018 12:12 am

Would it be for example possible to mimic the radio screen over bluetooth on an android device?

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

Post Reply

Return to “ersky9x”