Jeoffreybauvin / tesla-http-api-over-ble

Use my custom HTTP API as a proxy for making BLE request to your Tesla
Apache License 2.0
3 stars 0 forks source link

Build Steps for Noobs - Raspberry Pi Zero W? #4

Open ChutneyMary opened 1 month ago

ChutneyMary commented 1 month ago

I'm not making much progress in the installation. I'm SSH'ing into a Raspberry Pi Zero W that's installed within the Tesla Wall Charger.

The Raspberry Pi Zero W is an ideal candidate as it can be powered off an internal voltage supply within the charger (and is of course within a few metres of the vehicle).

Step 1: Build and launch the API image -

docker build -t tesla-http-api-over-ble:latest .

Results in this error -

Preparing metadata (pyproject.toml): finished with status 'error' 386.0 error: subprocess-exited-with-error 386.0 386.0 × Preparing metadata (pyproject.toml) did not run successfully. 386.0 │ exit code: 1 386.0 ╰─> [6 lines of output] 386.0 386.0 Cargo, the Rust package manager, is not installed or is not on PATH. 386.0 This package requires Rust and Cargo to compile extensions. Install it through 386.0 the system's package manager or via https://rustup.rs/ 386.0 386.0 Checking for Rust toolchain.... 386.0 [end of output] 386.0 386.0 note: This error originates from a subprocess, and is likely not a problem with pip. 386.2 error: metadata-generation-failed 386.2 386.2 × Encountered error while generating package metadata. 386.2 ╰─> See above for output. 386.2 386.2 note: This is an issue with the package mentioned above, not pip. 386.2 hint: See above for details.

Dockerfile:4

2 | WORKDIR /code 3 | COPY ./requirements.txt /code/requirements.txt 4 | >>> RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt 5 | COPY *.py /code 6 | EXPOSE 8000

ERROR: failed to solve: process "/bin/sh -c pip install --no-cache-dir --upgrade -r /code/requirements.txt" did not complete successfully: exit code: 1

I've run the error description through ChatGPT, and gone through about 10 iterations of new Dockerfile build suggestions. ChatGPT can't solve it.

The variations in ChatGPT suggestions has concentrated on the Rust installation. It won't install.

Any suggestions?

Is there any potential to build this specifically for the Raspberry Pi Zero W?

Jeoffreybauvin commented 1 month ago

Hi @ChutneyMary ,

I built this project using a classic amd64 architecture. You're using a Raspberry, with an ARM architecture. Not sure all of this works on ARM :(. I don't have any ARM device to test it, sorry.

ChutneyMary commented 1 month ago

Thanks. If you ever consider building this for the Raspberry Pi Zero W, I'd be very happy to donate a device for the cause. Thanks for sharing the development.

Jeoffreybauvin commented 1 month ago

Let me check, maybe I have an old Raspberry somewhere ;). I' reopening the issue, I'll let you know.

Jeoffreybauvin commented 1 month ago

Hi @ChutneyMary

I did find a Raspberry Pi Zero, but not W, so no bluetooth or wifi. But, some good news : I made a multi arch build for both images.

https://github.com/Jeoffreybauvin/tesla-http-api-over-ble/pull/5

I built the 2 images :

Or build the 2 images yourself with the 2 Makefiles in the repo :).

Looking forward to your feedback.

ChutneyMary commented 1 month ago

Thank you! Will report back on how it goes.

ChutneyMary commented 1 month ago

I've had success with the Docker image for the Tesla vehicle-command. From the command-line, I can start and stop charging and all the other commands within the Tesla Bluetooth API.

I can't install the tesla-http-api-over-bluetooth. I run the command -

docker build -t tesla-http-api-over-ble:latest .

It continues to throw the error described above. I've tried variations of -

docker build -t tesla-http-api-over-ble:beta-0.0.3 .

I'm probably doing something very nooby...

Also, if I do get it installed correctly, I'm a bit lost in how to employ the homemade API? Is it run from the address bar of a browser?

Jeoffreybauvin commented 1 month ago

have you tried the "provided" image on the Docker hub ?

docker pull jeoffrey54/tesla-http-api-over-ble:beta-0.0.3

if it's working, you can try to build from scratch. Be sure ton take the multi-arch branch on this Git repo.

Jeoffreybauvin commented 1 week ago

Any news @ChutneyMary ?

ChutneyMary commented 1 week ago

I’m looking forward to getting stuck into it when I return from overseas travel.