electric-monk / pycarplay

Python Carplay library for the "Autobox" dongles
MIT License
268 stars 36 forks source link

Requirements to run this project? #4

Open Glenf opened 3 years ago

Glenf commented 3 years ago

Hi

What are the requirements to run this project?

I know I need libusb. To get something to happen I had to run things as sudo. Do I need some other libraries installed?

I have a wireless version of this box but it identifies the same as in the script. The box doesn't seem to start up correctly, blue light doesn't stay on. When I've used this on Android host (with the Autokit apk) the blue light lights up correctly.

Any info on how to go forward would be nice. Like where and how to debug the box start up.

electric-monk commented 3 years ago

libusb should be the main one, with ffmpeg to decode the frames. Did you grab and extract the APK by running the little script? If it fails you might need to find the APK elsewhere, it was the address printed on the packaging for my dongle but I suspect it's just some random person's home server somewhere in China. From what I recall one of those files is a binary blob that seems to be a driver for the wifi component in the dongle that needs to be uploaded to enable that feature. I suspect the dongle runs Linux itself, and there's probably ways to hack into it by uploading files, but I haven't really investigated that aspect of experimenting with it yet. I believe the driver was the file '8848' and you have to upload it in response to a request from the dongle, but I never implemented that specific part (note the 'SupportWifiNeedKo' response you can get from one of the other parameters).

Sadly the one I bought doesn't have wifi (as I didn't realise it was an option until I'd already received mine and started decoding the protocol) so I didn't really have any way to actually work on those parts.

Otherwise, the stuff it sends at startup is contained in the list 'startup_info' in protocol.py, and includes simple configuration (the _send_int function, which writes a little file containing a single value) as well as the driver and other files (these items are generated from the '_copy_assets' call) and finally the actual command that starts the protocol (the "Open" object). After the device replies to that message, the stuff in the 'opened_info' list is sent, but it's mostly just more configuration values. Actual messages are handled in the teslabox.py _Connection class, though it doesn't need to do much for the basic support.