Scripts for ersky9x

ersky9x is a port of er9x for use on the sky9x board.
User avatar
MikeB
9x Developer
Posts: 15617
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Scripts for ersky9x

Post by MikeB » Fri Dec 01, 2017 10:48 am

This is a place to put working scripts for ersky9x.
The files are of type ".bas", but need to be in a .zip file in order to be posted.
Scripts are also now being placed on http://www.er9x.com/
S6Rscript.zip
05-Jan-2018 13:09
Fix operation on X7/X9E
Fix editing for "offset" values
(2.59 KiB) Downloaded 34 times
S6Rscript.zip
02-Dec-2017 23:43
Configuration for FrSky S6R and S8R.
Fix unable to chage output directions from Inverse to Normal
(2.54 KiB) Downloaded 38 times
S6Rscript.zip
01-Dec-2017 10:50
Configuration for FrSky S6R and S8R.
(2.49 KiB) Downloaded 35 times
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
midelic
Posts: 77
Joined: Mon Dec 23, 2013 9:57 pm
Country: -

Re: Scripts for ersky9x

Post by midelic » Sun Dec 03, 2017 12:51 am

Mike,
Script for changing PID/Rates in betaflight. Working just fine.Tested with 9Xpro and multimodule.
https://github.com/midelic/Ersky9x-Tx-bas-scripts
Sorry no zip file.

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

Re: Scripts for ersky9x

Post by MikeB » Sat Jan 06, 2018 7:17 pm

I've just put two scripts on http://www.er9x.com/, to make them more accessible.

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

zipray
Posts: 23
Joined: Sun Sep 04, 2016 9:05 am
Country: -

Re: Scripts for ersky9x

Post by zipray » Sat Jan 13, 2018 2:59 pm

Mike,
Can you transplant the Script in ersky9x?https://github.com/iNavFlight/LuaTelemetry

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

Re: Scripts for ersky9x

Post by MikeB » Thu Feb 01, 2018 4:41 pm

It can very likely be converted, but I don't have the means to test it if I tried to convert it. It really needs someone with the hardware to do the comversion.

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


zipray
Posts: 23
Joined: Sun Sep 04, 2016 9:05 am
Country: -

Re: Scripts for ersky9x

Post by zipray » Thu Feb 01, 2018 7:50 pm

Thanks Mike, I'm using this script on qx7.I can even use this script to make instrument flights.I hope to continue using 9xr pro for long flights under openlrs.I can test it.

mrozilla
Posts: 58
Joined: Sat Nov 14, 2015 9:59 pm
Country: -

Re: Scripts for ersky9x

Post by mrozilla » Thu Jul 05, 2018 2:45 pm

Could someone have already created a telemetry script for 9XR Pro?
Something similar to this:
https://github.com/iNavFlight/LuaTelemetry
Of course, working on Ersky9x. The scripts (.bas) that are currently on the forum have a different action, and none of them applies to telemetry.

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

Re: Scripts for ersky9x

Post by jhsa » Thu Jul 05, 2018 3:01 pm

Scripts can be a bit specific.. and it should be something that would display or use the telemetry differently from the radio? otherwise, why bother if the radio can already do it, right?? :)

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
Kilrah
Posts: 9515
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Scripts for ersky9x

Post by Kilrah » Thu Jul 05, 2018 4:24 pm

Did you not look at his link?

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

Re: Scripts for ersky9x

Post by jhsa » Thu Jul 05, 2018 4:29 pm

As I said, it is a special thing :)

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

mrozilla
Posts: 58
Joined: Sat Nov 14, 2015 9:59 pm
Country: -

Re: Scripts for ersky9x

Post by mrozilla » Thu Jul 05, 2018 7:44 pm

That's why I asked for the script, because it is unique, nicely and legibly presented all the important parameters on one screen. That's right, the same can be displayed on the Custom Telemetry screen only here is more information on one window and some information is graphic.
I do not mean something necessarily identical, it would be good to have a script similar to this one.

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

Re: Scripts for ersky9x

Post by jhsa » Thu Jul 05, 2018 11:23 pm

yeah I understand.. The graphics are nice and might only be done with a script.. :)

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

mrozilla
Posts: 58
Joined: Sat Nov 14, 2015 9:59 pm
Country: -

Re: Scripts for ersky9x

Post by mrozilla » Sat Jul 07, 2018 2:38 pm

That's why I'm writing in this topic, maybe someone has a similar script and would like to share it. It would be easier to process it a little, than to write from scratch, because it seems to me that it is not so easy, and the graphical appearance and all important parameters on one screen seem to me a very good solution for telemetry.

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

Re: Scripts for ersky9x

Post by MikeB » Sat Jul 07, 2018 9:41 pm

Here is a bit of a start. Since I don't have a naza, I cannot test it properly.
I have an update pending for ersky9x so that "drawrectangle" takes an optional 5th parameter, "percent". If present, then that percentage of the rectangle will be filled from the left. This will remove the need to have the subroutine "hbar".

Mike
Inav.zip
(834 Bytes) Downloaded 8 times
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

mrozilla
Posts: 58
Joined: Sat Nov 14, 2015 9:59 pm
Country: -

Re: Scripts for ersky9x

Post by mrozilla » Sat Jul 14, 2018 8:05 am

@Mike, I checked the script and yes and I have some information.
I would like to remove Curr because I do not have a current sensor.
Fuel shows both percent and indicator correctly.
Batt is on 0.0V all the time (LiPo is measured with A2 through me and A2 is showing correctly so here too it would have to be changed.
Correctly shows the time of use of the gas rod.
In the upper right corner is 0.0V and nothing shows here, you also need to correct it.
Unfortunately, despite catching FIX 3D and several satellites, the satellite icon in the upper right corner shows nothing, it is the same icon but without any information.

Can you improve this script? It starts to look very nice :)

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

Re: Scripts for ersky9x

Post by jhsa » Sat Jul 14, 2018 8:56 am

Can you please..... :)

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

mrozilla
Posts: 58
Joined: Sat Nov 14, 2015 9:59 pm
Country: -

Re: Scripts for ersky9x

Post by mrozilla » Sat Jul 14, 2018 9:04 am

Of course, please, unfortunately my language is not English, that's why there may be errors :)

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

Re: Scripts for ersky9x

Post by jhsa » Sat Jul 14, 2018 9:31 am

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

Re: Scripts for ersky9x

Post by MikeB » Sat Jul 14, 2018 10:10 am

Someone else who does have a current sensor may like the current displayed.
Please try changing the script yourself.
For the battery voltage change "FasV" to "A2=" and see if that then shows the battery voltage correctly.

To remove the current display, "comment out" the code. To make a line into a comment, add "rem " (no quotes) at the start of the line, so change:
let value = getvalue( "Amps" )
to:
rem let value = getvalue( "Amps" )
and do the same down to changing:
drawnumber( 41, 32, value )
to:
rem drawnumber( 41, 32, value )

Try adding:
gps_fix = getvalue("T2")
gps_sat = gps_fix / 10
gps_fix -= gps_sat * 10
drawnumber( 127, 8, gps_sat )

After the code that draws the satellite image (indicated by the line "rem satellite image") to get the number of satellites showing.

The upper right corner is showing the receiver voltage, as obtained from the "RxV" telemetry item. Do you have the receiver voltage?

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

mrozilla
Posts: 58
Joined: Sat Nov 14, 2015 9:59 pm
Country: -

Re: Scripts for ersky9x

Post by mrozilla » Sat Jul 14, 2018 10:42 am

I changed as you wrote:
- 0 appeared next to the satellite icon, but it does not change. Although it has caught FIX 3D and 4 satellites, it is still 0.
It would be great if it showed both FIX (2D, 3D etc.) and the number of satellites.
- The Li-Po voltage in the model has been repaired. It shows the voltage but there is a slight bounce between Batt and Fuel, it is about 1 pixel, maybe because there is tension in one place and in the other the percentages?
- 0 disappeared in Curr and only A.
- In the upper right corner, it is still 0. The voltage D8R-II Plus shows me on the A1 port (5V), and the Li-Po voltage of my equipment in the regular telemetry window also shows me correctly (currently around 11.2V), and in the script I still have 0.
- It would also be good to add two stripes at the bottom of RX and TX as it is in a regular telemetry window so that all the important information is on one window.

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

Re: Scripts for ersky9x

Post by MikeB » Sat Jul 14, 2018 12:58 pm

PLease try the following, change the line:
gps_fix = getvalue("T2")
to the two lines:
gps_fix = getvalue("T2=")
drawnumber( 30, 16, gps_fix )

This will put a value on the display on the third line, I need to know what this value is, together with the number of satellites and the type of fix.

Also change:
let value = getvalue( "RxV" )
to:
let value = getvalue( "A1=" )

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

mrozilla
Posts: 58
Joined: Sat Nov 14, 2015 9:59 pm
Country: -

Re: Scripts for ersky9x

Post by mrozilla » Sat Jul 14, 2018 1:17 pm

I have already changed RxV to A1 (beige =) for test purposes and of course it works, it shows 5V :)

Regarding:
gps_fix = getvalue ("T2=")
drawnumber (30, 16, gps_fix)

It popped 0 in the top left of the screen and after catching FIX shows 2D or 3D, meaning it works fine. It would probably be good to add the letter D, especially for 3D, because it's probably FIX that saves so well?
GPS Fix: 0 = No Fix, 2= 2D, 3 = 3D, 4 = DGPS
Such descriptions should probably appear depending on what FIX is, i.e. No Fix, 2D, 3D, DGPS.

As for the 0 at the satellite icon, unfortunately nothing has changed, it still does not show the number of satellites.

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

Re: Scripts for ersky9x

Post by MikeB » Sat Jul 14, 2018 4:09 pm

You say you get a number 0 in the top left of the screen. It should be on the third line . My understanding is this number should be something like
100 * the number of satellites + the type of fix.

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

mrozilla
Posts: 58
Joined: Sat Nov 14, 2015 9:59 pm
Country: -

Re: Scripts for ersky9x

Post by mrozilla » Sat Jul 14, 2018 5:04 pm

At about this moment, it looks just like the sketch I made. Of course, the logo of the satellite is correct, I made that sign because it was easier and here is where "3" is shown by Fix GPS. There is always "0" at the satellite logo.
Of course, 5V and the time is in the color of the negative.
I only described the number "3" with red.
Attachments
Inav.jpg
Inav.jpg (9.7 KiB) Viewed 140 times

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

Re: Scripts for ersky9x

Post by MikeB » Sat Jul 14, 2018 6:08 pm

OK, I've had a look round and it seems you are sending the number of satellites in T1, so try the following:
gps_fix = getvalue("T2=")
drawnumber( 30, 16, gps_fix )

gps_sat = getvalue("T1=")
drawnumber( 127, 8, gps_sat )

To show the current RSSI value try adding:

let percent = getvalue( "RSSI" )
drawtext(0, 56, "RSSI db")
drawnumber( 47, 56, percent )
rx = 56
ry = 57
rh = 7
rw = 72
gosub hbar


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

mrozilla
Posts: 58
Joined: Sat Nov 14, 2015 9:59 pm
Country: -

Re: Scripts for ersky9x

Post by mrozilla » Sat Jul 14, 2018 7:57 pm

Now correctly shows the satellites :)
- Only the FIX is still in this place as in the sketch, should it be here?
- Is it possible to do, just like the post, display No Fix, 2D, 3D, DGPS, instead of 1,2,3,4?
- RSSI is working properly, but if the value has 2 digits, for example, dl88, and if it has 3 digits it displays, for example (101
Maybe it's better to do two stripes next to each other, on one side TX, on the other RX already without db, to more or less on the bars you could evaluate the range, or possibly if you want to become an RSSI then you probably need to remove "db" from the name, because you does not fit, although the RSSI and TSSI values are similar in DJT, so I do not know if it makes sense to make two stripes, unless RSSI is enough.
- Can you add the rest of the values such as coordinates, compass, the transmitter's voltage with the battery as on the screen, etc.?
At this moment the progress is going very fast and the script is more and more useful with every moment, thank you for your help :)

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

Re: Scripts for ersky9x

Post by MikeB » Sat Jul 14, 2018 8:51 pm

For RSSI, change to :
drawtext(0, 56, "RSSI db")
drawnumber( 41, 56, percent )
NOTE: there should be 3 space characters between RSSI and db

For the heading/angle display add the following (after the goto main/end)

Code: Select all

 goto main
end

normalize:
if angle > 360 then angle -= 360
if angle <   0 then angle += 360
return


sin100:
neg = 0
	gosub normalize
	if angle > 180
		neg = 1
		angle -= 180
	end
	if angle > 90 then angle = 180 - angle
	scresult = 3283 - angle * angle / 20
	scresult = 3283 - scresult * angle * angle / 19697
	scresult = scresult * angle / 1880
	if neg then scresult = -scresult
return

cos100:
	angle += 90
	gosub normalize
	gosub sin100
return


drawDirection
angle = ddheading
gosub sin100
ddx1 = scresult * ddradius / 100 + ddx

angle = ddheading
gosub cos100
ddy1 = ddy - scresult * ddradius / 100

angle = ddheading + ddwidth
gosub sin100
ddx2 = ddx - scresult * ddradius / 100

angle = ddheading + ddwidth
gosub cos100
ddy2 = ddy + scresult * ddradius / 100

angle = ddheading - ddwidth
gosub sin100
ddx3 = ddx - scresult * ddradius / 100

angle = ddheading - ddwidth
gosub cos100
ddy3 = ddy + scresult * ddradius / 100


drawline( ddx1, ddy1, ddx2, ddy2)
drawline( ddx1, ddy1, ddx3, ddy3)

return
then after the RSSI code add:
ddheading = getvalue( "SC5" )
ddwidth = 25
ddradius = 10
ddx = 70
ddy = 20
gosub drawDirection

but replace the "SC5" with the heading value name you need, this may be "Hdg".

I'm not sure about the FIX type, I can't see it on the image I have. I can see "3D HOLD", but I understand this to be flight mode name.

The transmitter voltage may be added as a number. To display the image of a battery needs to know the max and min voltages.

The GPS coordinates are a problem at present as there isn't a way of getting them in a script at present! I need to look into that.

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

mrozilla
Posts: 58
Joined: Sat Nov 14, 2015 9:59 pm
Country: -

Re: Scripts for ersky9x

Post by mrozilla » Sat Jul 14, 2018 9:10 pm

- With FIX, I mean that instead of number 1 it displays No Fix, instead of number 2 it displays 2D, instead of number 3 it displays 3D and instead of number 4 it displays DGPS.
- As for the battery of the apparatus, it is 3S, i.e. the appropriate range would be from 9.7V to 12.6V
- In fact, 3 spaces probably help.
- I noticed that when I have the script turned on, after pressing the EXIT button on the apparatus appears the "SCRIPT ERROR" communiqué, then I have to switch off and turn on the apparatus, it can be somehow fixed?

As for the operation of the compass, I will check it out tomorrow and write how it looks, then you can try to add the rest of the parameters.

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

Re: Scripts for ersky9x

Post by MikeB » Sat Jul 14, 2018 11:14 pm

I understand about the FIX, but where on the display should this appear? It doesn't appear on the image I have (with lots of red labels on it).
I'll see what might be done for a battery display.
Does it just say "SCRIPT ERROR", or does it inlcude an error code and a line number? Mine exits with no error.

I've got some changes to ersky9x that let me get the GPS info, and also make drawing the "Bars" easier and the arrow for the compass better.
I'll see about posting a new test version of ersky9x tomorrow.

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

mrozilla
Posts: 58
Joined: Sat Nov 14, 2015 9:59 pm
Country: -

Re: Scripts for ersky9x

Post by mrozilla » Sun Jul 15, 2018 7:31 am

I'm happy to check the new version :)
- As far as the FIX place is concerned, at this point the sketch that I placed is a black number 3 and in this place is FIX. In red I wrote FIX 3D just to let you know that this black number means it. It seems to me that it would be possible to make a constant "Fix:" under the satellites, and after the colon, "No", "2D", "3D", "DGPS" would appear. I think this place would be the best.
- I checked the arrow and I have data not Hdg, and with Cog and during the flight actually indicates the flight's only occasionally in some positions the arrow is a bit shapeless, and in some it seems to be missing a dot (one pixel) but generally works.
- The error appears when EXIT is pressed. No additional code appears, only "SCRIPT ERROR" and I have to turn off and turn on the apparatus to make everything work again. I have a R222b3 firmware version. I have the script added in the telemetry settings on the Custom screen, and the Inav.bas file is in the scripts / telemetry folder on the memory card.

Post Reply

Return to “ersky9x”