Hello Fellow Yuneec Pilot!
Join our free Yuneec community and remove this annoying banner!
Sign up

Modding or Creating New FlightMode.apk for ST16

Joined
Jun 20, 2024
Messages
11
Reaction score
12
Age
41
Check this out guys,
To start I just simply decom the APK for the app. That contains the full java source in the original format. So all the protocol data is below. With this, there is no need even to scope it with a probe and figure it out. Because most Android apps are just Java and not truly compiled they are not in binary format. Now being able to see the guts of how the entire app works either making a custom version of the client or adding features should be a breeze.

If you want to decomp yourself simply download their latest firmware. Then head over to this site below. Run the decomp, download the output as a zip. Use 7Zip on windows to properly open as the structure wont work with the built in client. But this opens up a lot of anyone interested in the inter workings of the client controller side. Now on to interfacing and customization looking. I dont have a ton of time tonight but will keep looking and once I write some more code start sharing with you guys on the GutHub that was setup.

APK decompiler
 
Last edited:
  • Like
Reactions: 1midniterider
Sorry don't understand the joke. Probably too tired by now. I modified my message and removed the snippit of code from the decompile. Figured if people want to they can themselves. Don't want to make the company mad though posting their code (even though its open for anyone to see). But trying to do the right thing. Anyhow, with being able to see the data structures as well as CRC messages. That alone saves a huge amount of time. Also, could be used as a basis to write a complete custom client that would be both open as well as have the ability to accurately control the Yuncee drones. Maybe in the future I will buy one as they actually look really nice.
 
Sorry don't understand the joke. Probably too tired by now. I modified my message and removed the snippit of code from the decompile. Figured if people want to they can themselves. Don't want to make the company mad though posting their code (even though its open for anyone to see). But trying to do the right thing. Anyhow, with being able to see the data structures as well as CRC messages. That alone saves a huge amount of time. Also, could be used as a basis to write a complete custom client that would be both open as well as have the ability to accurately control the Yuncee drones. Maybe in the future I will buy one as they actually look really nice.


It seems like there are two different topics going here. One is custom FW which replaces the FW on the Yuneec flight controller. The other is modifying the flight mode app on the ST16 to add or modify features.

For number two, I'm interested in any progress you make on that. I am at best a novice programmer and know essentially nothing about programming for android, but I did try to modify the flight mode app some awhile ago. My specific goal was to add the ability to connect to different types of yuneec cameras that seemed to be commented out in the flight mode code. While I was able to modify the app, when I tried to run it, it had problems with accessing/permissions for communicating with other parts of the software on the ST16.

Some other messages on this topic:
 
  • Like
Reactions: 1midniterider
The other is modifying the flight mode app on the ST16 to add or modify features.
No reason to do that. Focus on ST's APK to ST's FC communication. All the rest can be written in a much better manner.
 
No reason to do that. Focus on ST's APK to ST's FC communication. All the rest can be written in a much better manner.


Well, like I said I don't know anything about android programming and also I just wanted to enable a feature that seemed like it might already be in the code just disabled. I'm all for somebody rewriting the whole thing better, but it is beyond my capabilities and available time.

I think you are right that the key is to figure out the flightmode APK communication to the serial driver used to communicate with the ST24 transmitter. I think (possibly incorrectly) that the problems with my modified flightmode APK was that it didn't have the correct permissions to access the serial driver/port.

There were some messages where somebody said that, unlike the ST10, the ST16 had some sort of custom low level serial driver that was harder to interface with. I think it was that same person who had said he managed to make the ST10 and ST16 control a cheap android drone (@SilentR9), but he has since disappeared. Advice for using/hacking ST16 for Fathom ROV
 
figure out the flight mode APK communication to the serial driver used to communicate with the ST24 transmitter.
It doesn't communicate directly! Between them is an FC! Somewhere, probably in the WTF... documents is a very good diagram of how the mixer works...
 
Check this out guys,
To start I just simply decom the APK for the app. That contains the full java source in the original format. So all the protocol data is below. With this, there is no need even to scope it with a probe and figure it out. Because most Android apps are just Java and not truly compiled they are not in binary format. Now being able to see the guts of how the entire app works either making a custom version of the client or adding features should be a breeze.

If you want to decomp yourself simply download their latest firmware. Then head over to this site below. Run the decomp, download the output as a zip. Use 7Zip on windows to properly open as the structure wont work with the built in client. But this opens up a lot of anyone interested in the inter workings of the client controller side. Now on to interfacing and customization looking. I dont have a ton of time tonight but will keep looking and once I write some more code start sharing with you guys on the GutHub that was setup.

APK decompiler
Question... If you are able to modify the app. Will you be able to overcome the app signing issue noted in another thread?
 
New feature that I would like to have except both above:
* Add a new instance for MAVlink that shall be routed to a serial connection, best would be the RealSense UART. HW: RealSense is connected to PA0 and PA1 on STM32.
Currently we have only one instance routed to ttyAMA0 (USB).
instance #0:
GCS heartbeat: 835008 us ago
mavlink chan: #0
type: USB CDC
flow control: OFF
rates:
tx: 14.106 kB/s
txerr: 0.000 kB/s
tx rate mult: 1.000
tx rate max: 800000 B/s
rx: 0.038 kB/s
FTP enabled: YES, TX enabled: YES
mode: Config
MAVLink version: 1
transport protocol: serial (/dev/ttyACM0 @2000000)

* UART support for gimbal control (tilt, rotate). This will need a lot of research/high effort.


Question, is the difficulty adding UART support for the gimbal tilt and rotate because of trying to add another serial connection (like you show above) or with the data that needs to be sent gimbal?

Controlling the tilt and rotate of the gimbal via a direct serial connection as been figured out. It is in my arduino code. The entire message that is sent to the CGO3 isn't understood (by me), but which bytes control the movement are known. Basically you just have to send the initialization bytes during start up, then modify the movement bytes of a the message, re-calculate the crc and send it out.
 
Question, is the difficulty adding UART support for the gimbal tilt and rotate because of trying to add another serial connection (like you show above) or with the data that needs to be sent gimbal?
The camera UART is already activated and is used to tilt the camera via PWM signal. Other messages will be ignored as I understand.
I want to open an additional UART to connect a MAVlink bridge with a second instance of MAVlink. Instance#0 is connected to USB. You can calibrate only with USB cable connected. Especially the compass calibration is a mess with cable. A MAVlink bridge would allow to access the drone via WiFi. This makes it easier to calibrate it, upload missions and read/write parameter. And it would open a way to control the drone with QGroundControl for special features.
A MAVbridge would increase the usability and may allow tu use other cameras like cams from H520/H Plus including infrared cams with full gimbal support (not tested but who knows).
 
I have been working out logic diagams and some other docs to release in the near future specifically for the controller modding. Would it make sense to start a new thread separate for the controller subject to separate from the autopilot firmware side? I will start a github repo as well for modding the controller soon as I get some more work time on it.
 
That would be a good idea so we can keep the two things separate and avoid confusion.

I will try to place all recent controller related posts from this thread in a new one this weekend.
Thank you, I will try and upload my diagrams from DrawIO or in PDF this weekend. As far as the controller I was just going to write a new app and release the code for Android. I have the reference needed via the other decompile to not spends hours on signal analysis. Then if someone wants to replace the internal Zigbee with a opentx, FlySky, Spectrum, etc all that will be needed is a small microcontroller to translate between the modules. I probably will write the microcontroller bridge code too. It could go directly in place of the Zigbee transceiver in the ST24 because its simply connected via UART with a JST connector. With a custom android app the output protocol can be done as well without even a translator microcontroller. Or the translator could be dropped in line to take the existing app and translate to use with a generic transceiver module. They honestly make it really easy to mod the controller. Wish I would have found the st24 before I bought a new radiomaster st16. But Ill end up using both no biggie. Having all the features and nice controllers attached in one unit to an android tablet though with all the electronics on separate boards makes modding super easy. Dont take a whole lot of customization and the case is large enough to fit a lot of new items in the controller when the Zigbee mod is removed. Ill post pictures later showing what each circuit board does. The wifi could also be replaced with a LoraWan module later or different higher speed non wifi link for long range video rx with a little more work. Non wifi video would be some work. But making the st24 an open platform would be awesome there less then $100 on ebay and tons available to help the community afford a cheaper radio that is mod’s able.
 
  • Like
Reactions: 1midniterider
I'm confused now... Are both PWM and UART required to control the camera gimbal tilt and rotate or can UART alone be used without PWM?
PWM is a fallback procedure if UART connection could not established in time. It was implemented in the flight controller FW for backward compatibility to CGO3.
 
  • Like
Reactions: 1midniterider
Thanks for moving the thread. I been busy all weekend. But will try and start getting some items uploaded and looking over modding a mini app to start dev with. Once I start working on this anyone interested to assist or test is welcome to, I will try and write instructions anyone can use as well. Initially the focus will be customizing the controller firmware with a new open one, then move on to supporting more advanced things (possibly tying into the OpenPilot and other actual custom Yuncee drones). Below is a new repo I started on GitHub to start storing files so everyone can access. Initial plan is to get the docs together for what and how the mod will be then start writing the code. I am going to install an external tail to access the transmitter UART for trialing different mods (will document as well). Hoping there is another UART for the Android sub board I can tap as well for reading console messages if possible.

GitHub - filelan/STX-Open-Controller: This is the initial container for the open source firmware replacement for the Yuncee Drone control station with larger screen. Intended to be a complete and open source replacement allowing great use of the easy to modify control station running Android. This will allow people to buy a great fully loaded controller easily and cheaply available.
 
  • Like
Reactions: 1midniterider
Haven't forgot about everyone here and the project. Just been extremely busy. I will try and post some of the hardware info tonight or tomorrow to the repo though so keep an eye out. Once I have a custom GUI boot up screen on the controller as well I will share some screen shots and pictures.
 
  • Like
Reactions: 1midniterider

New Posts

Members online

No members online now.

Forum statistics

Threads
21,032
Messages
242,640
Members
27,638
Latest member
wkeithcallahan