-
Notifications
You must be signed in to change notification settings - Fork 19
Simplified 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 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.
-
Install this specific version of termux (v118): https://drive.google.com/file/d/1MPx2W95jsQqMRfqRnbKovzOR-PtOP_uC/view?usp=sharing
-
Open up termux and upgrade and install some packages:
pkg update
pkg upgrade
pkg install tsu
pkg install tmux
pkg install p7zip
-
Download the compressed tarball of my prebuilt fork Flow Pilot 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.
-
You need to enable the allow-external-apps property for termux. Edit the /data/data/com.termux/files/home/.termux/termux.properties file and uncomment out the "allow-external-apps = true" line. I found this easiest to do with "nano" either via an "adb shell" or within termux.
-
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:
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 can likely guess your camera intrinsics pretty nicely too. Try:
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. 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).
-
For customizing code for your car... well, I only know how to get it working for my Hyundai WITHOUT "Smart Cruise Control". You will likely want to fork your own repository and overwrite my Hyundai code (if you have a Hyundai). 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 don't need to send anything more than a single character, 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.
-
Profit!