Parameters with LUA Script
- ThomasMiric
- Offline Autor
- Junior Mitglied
- Beiträge: 34
- Dank erhalten: 26
Hello Jeti Team!
I would like to have a chance to send or receive data with LUA Script.
Specifically, it is about the possibility for Betaflight / Cleanflight / INav to change the parameters for the PIDs or the transmission frequency of the VTX.
Here's an example of what it might look like:
Request a parameter:
LUA: getDeviceParamter(<serialNumber>, <parameterID>)
Parameters
Return value
Packet example - Master
0x3D 0x01 0x0B 0xAA 0x3C 0x03 0xBF 0xCF 0x00 0x45 0x54
0x3D 0x01 - Packet header with a permission to answer
0x0B - Message length (11)
0xAA - Packet ID
0x3C - Data identifier - request for LUA parameter
0x03 - Length of the Data
0xBF 0xCF - Serialnumber
0x00 - Parameter ID
0x5445 - CRC16-CCITT
Send a parameter:
LUA: setDeviceParameter(<serialNumber>, <parameterID>, <value>)
Parameters
Packet example - Slave
0x3B 0x01 0x0F 0x55 0x3C 0x03 0xBF 0xCF 0x00 0x12 0x34 0x45 0x67 0x10 0xCB
0x3B 0x01 - Packet header
0x0F - Message length (15)
0x55 - Packet ID
0x3C - Data identifier - LUA parameter
0x07 - Length of the Data
0xBF 0xCF - Serialnumber
0x00 - Parameter ID
0x11 - integer 32
0x23
0x45
0x67
0xCB10 - CRC16-CCITT
I would be happy if a solution could be found.
Thank you in advance,
Thomas
I would like to have a chance to send or receive data with LUA Script.
Specifically, it is about the possibility for Betaflight / Cleanflight / INav to change the parameters for the PIDs or the transmission frequency of the VTX.
Here's an example of what it might look like:
Request a parameter:
LUA: getDeviceParamter(<serialNumber>, <parameterID>)
Parameters
- serialNumber - to select the device
- parameterID - to select the parameter
Return value
- (interger) - value of the parameter
Packet example - Master
0x3D 0x01 0x0B 0xAA 0x3C 0x03 0xBF 0xCF 0x00 0x45 0x54
0x3D 0x01 - Packet header with a permission to answer
0x0B - Message length (11)
0xAA - Packet ID
0x3C - Data identifier - request for LUA parameter
0x03 - Length of the Data
0xBF 0xCF - Serialnumber
0x00 - Parameter ID
0x5445 - CRC16-CCITT
Send a parameter:
LUA: setDeviceParameter(<serialNumber>, <parameterID>, <value>)
Parameters
- serialNumber - to select the device
- parameterID - to select the parameter
- value - value of the parameter (integer)
Packet example - Slave
0x3B 0x01 0x0F 0x55 0x3C 0x03 0xBF 0xCF 0x00 0x12 0x34 0x45 0x67 0x10 0xCB
0x3B 0x01 - Packet header
0x0F - Message length (15)
0x55 - Packet ID
0x3C - Data identifier - LUA parameter
0x07 - Length of the Data
0xBF 0xCF - Serialnumber
0x00 - Parameter ID
0x11 - integer 32
0x23
0x45
0x67
0xCB10 - CRC16-CCITT
I would be happy if a solution could be found.
Thank you in advance,
Thomas
von ThomasMiric
Folgende Benutzer bedankten sich: Crottorfer, andreobi
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
- davidmcq137
- Offline
- Senior Mitglied
- Beiträge: 75
- Dank erhalten: 82
Hi Thomas,
If I understand your request, I agree it is reasonable.
If you want to do something today, you can .. Jeti enabled serial i/o from the motherboard via lua api in V5 of the TX firmware .. so if you can find a nice solution to get the wire out of the TX case (!) .. you can use the lua api to send and receive serial data to flightcontrollers. I have done this to send data out to a bluetooth UART mounted on the back of the TX case.
Dave
If I understand your request, I agree it is reasonable.
If you want to do something today, you can .. Jeti enabled serial i/o from the motherboard via lua api in V5 of the TX firmware .. so if you can find a nice solution to get the wire out of the TX case (!) .. you can use the lua api to send and receive serial data to flightcontrollers. I have done this to send data out to a bluetooth UART mounted on the back of the TX case.
Dave
von davidmcq137
Folgende Benutzer bedankten sich: skyfreak
Bitte Anmelden oder Registrieren um der Konversation beizutreten.
Ladezeit der Seite: 0.944 Sekunden