-
Notifications
You must be signed in to change notification settings - Fork 19
Simplified "Tarball" Flow Pilot Install Process
This method uses a prebuilt tarball package, which you uncompress into your termux environment carefully. It shall provide everything you need to get Flow Pilot's backend up and running. You will still need to install the latest APK (linked in this guide) and configure your car and phone specifics.
-
Make sure you have a decent phone (855+ SnapDragon with a wide camera) that is ROOTED and running Lineage 20 (Android 13). Android 11 and 12 might work, but have not been tested with this method. LG G8, Poco F3 and the OnePlus 7T are recommended devices.
-
Install this specific version of termux (v118): https://drive.google.com/file/d/1MPx2W95jsQqMRfqRnbKovzOR-PtOP_uC/view?usp=sharing
-
Download this script to run in termux in your home directory: https://drive.google.com/file/d/1Mzju1AqBPOPWoxdsTgMqlBTQ5wxUbSYM/view?usp=sharing
chmod +x flowpilot-setup-env
./flowpilot-setup-env
-
Download the compressed tarball of my prebuilt Flow Pilot fork here: https://drive.google.com/file/d/1zXFlrE9Vf7twrzQUfllN81G8CqpmLqgH/view?usp=sharing
-
Make a /data/data/com.termux/files/temp/ folder in termux and move that compressed tarball there.
mkdir /data/data/com.termux/files/temp
mv termux-flowpilot-files.tar.7z /data/data/com.termux/files/temp/
cd /data/data/com.termux/files/temp
-
Unzip and uncompress the tarball into this temp folder NOT as root in termux. This should create a /data/data/com.termux/files/temp/home and /data/data/com.termux/files/temp/usr pair of folders owned by your termux user. You might get some errors, but that is fine.
7z x termux-flowpilot-files.tar.7z
tar xf termux-flowpilot-files.tar
-
Now we will copy the contents of these temp folders to your termux base folders WITHOUT REPLACING FILES. The commands should look like this while in the /data/data/com.termux/files/temp/ folder in termux:
cp -n -r home/* ../home/
cp -n -r usr/* ../usr/
-
Go back to the home directory (simply entering in "cd" should do it). Try then logging into the Flow Pilot environment by running the ./l login script.
cd
./l
-
Try actually starting the Flow Pilot backend with the ./g script. This will probably give you some errors, which is expected.
./g
-
You will probably see an error about dubious git ownership and it will give you a command to run to allow Flow Pilot to work. Copy and paste that git config line and run it. This should let you run git commands on the flowpilot directory. It will probably look like this:
git config --global --add safe.directory /root/flowpilot
-
You will also probably see errors about /tmp/tmux-0 or /tmp permission errors. Just delete the /tmp/tmux-0 temporary folder:
rm -rf /tmp/tmux-0
-
Try running the Flow Pilot backend again in the home directory via the ./g script. It should hopefully work this time after performing a git update and build:
./g
-
Use CTRL+C to exit when you see green text repeating on the screen, which means things are working (hopefully). Press and hold on the screen to kill and exit termux.
-
Grab and install the latest APK from my releases here: https://github.com/phr00t/flowpilot/releases/ This will serve as the front-end, while the script in the background is the backend.
-
If you've got an LG G8 with a 2019 Kona EV, you are probably all set! Chances are, this is not your phone or car, so you will need to do some tinkering for your phone and car. Starting the Flow Pilot app will likely crash right now because it is looking for LG G8 camera properties. You can specify your camera information that the Flow Pilot app will load on start: https://github.com/phr00t/flowpilot/blob/master/android/src/main/java/ai.flow.android/AndroidLauncher.java#L55
-
The files should be placed in your /sdcard/flowpilot/ folder and the "camerainfo.big.txt" is the only one you really need to do (as the big model works better than the medium one). The file should have 5 lines, as described in the linked file above. You may need to grab your camera's intrinsics from another Android app, perhaps this one: https://github.com/vyi/android-camera-calibration (you want intrinsics for 1080p resolution).
-
The format of the camerainfo.big.txt file is as follows:
<Focal Length X>
<Focal Length Y>
<Focal Center X>
<Focal Center Y>
<Camera ID#>
-
You can likely guess your camera intrinsics pretty nicely too. Try this for your camerainfo.big.txt (which you will likely need to make) contents:
1500
1500
960
540
1
-
That last number might need to change depending on what wide camera ID your phone is. My LG G8 is 2. 0 is probably the default back camera, which is likely not the wide camera. If you can't seem to get a wide camera ID working, you may need to enable wide camera access using step 6 from this guide: https://github.com/phr00t/flowpilot/wiki/How-to-make-an-LG-G8-Flow-Pilot-Device (then reboot).
-
If you are still having trouble opening the Android app (like hanging), try running the Flow Pilot backend manually by opening up termux, running the ./l login script, then the ./g backend starting script. That should allow the Flow Pilot app to fire up. The Android app should be doing this automatically, but this is a good troubleshooting step.
-
For customizing code for your car... well, I only know how to get it working for my Hyundai WITHOUT "Smart Cruise Control". You can start by picking your phone from the "Vehicles" pulldown in the Android app and rebooting. You will likely want to fork your own repository and overwrite my Hyundai code (if you have a Hyundai) -- probably from a different Open Pilot fork. Also note that you will need to send debug data from your carcontroller.py like this: https://github.com/phr00t/flowpilot/blob/master/selfdrive/car/hyundai/carcontroller.py#L368 (look for the sLogger.Send call). You just need to send a string that starts with "0", and it can be as simple as "0All set!" (which gets drawn on the screen), but this at least lets the Android app know carcontroller.py is running (otherwise you will get a System Unresponsive error on the Android app). This is how I quickly detect crashes or other problems while driving. Also make sure "from common.logger import sLogger" is at the top.
-
This sets up software, but you will need to actually hook it up to your car and have all the proper hardware. You can look at my LG G8 guide which talks about that.