rhysmorgan134 / react-carplay

MIT License
507 stars 71 forks source link

Cant get any further than ./setup-pi.sh #33

Closed iLightFPS closed 1 year ago

iLightFPS commented 1 year ago

I followed the latest video you have on youtube but i cant get any further than ./setup-pi.sh It says

failed to create the file /home/pi/Desktop/Carplay.AppImage

Curl: (23) failure writing output to destination

chmod: cannot access ./home/pi/Desktop/Carplay.AppImage: no such file....

I have a fresh copy of raspbian on the sd card.

jstri114 commented 1 year ago

Is your user set to "pi"? If you chose a different user the paths will be different and it will fail to create the file like you mentioned.

iLightFPS commented 1 year ago

@jstri114 I got it to pass ./setup-pi.sh. However when i do ./Carplay.AppImage it now says "no such file or directory" even thought i can see the file in desktop and it shows up when doing the ls command in the terminal.

jstri114 commented 1 year ago

Are you running 32bit or 64bit raspbian? I was running 64bit initially and it seems to only work on 32bit.

iLightFPS commented 1 year ago

@jstri114 its 64bit. Should i try 32?

jstri114 commented 1 year ago

yes, give it a shot. It fixed that issue for me and I've got it working on my Pi 4 8GB now.

kostasfe commented 1 year ago

Are you running 32bit or 64bit raspbian? I was running 64bit initially and it seems to only work on 32bit.

I would back jstri114 on this one. I had the same issue when trying to run on 64 bit too.

rhysmorgan134 commented 1 year ago

Next time I do a build I’ll build for 64 as well as 32

iLightFPS commented 1 year ago

It's working now. Don't have a Carplay dongle yet so can't test the Carplay. But i guess i can make my own interface now.

Before i close this question. Where do you guys take power from to the Pi? I have a Volvo V70 2010 with a 2012 dashboard that has a place for a 7" screen. Is it safe to take power from the cd player? OH and what screen do you use @rhysmorgan134

kostasfe commented 1 year ago

If you wire it directly to the radio it will get its power cut as opposed to a graceful shutdown and that can damage the Pi eventually. You might want to look into Carpihat, which is made specifically for that purpose (https://thepihut.com/products/carpihat-car-interface-hat-for-raspberry-pi). This is what I used, though admittedly it is a bit pricy given the whole value of such project.

iLightFPS commented 1 year ago

@kostasfe Welp. I thought i could get away with only rpi4, carplay dongle and a screen. Guess i got some reading todo.

kostasfe commented 1 year ago

Well, an option would be to turn off the pi each time properly before you turn off the ignition, but this will probably start to get annoying in no time..

rhysmorgan134 commented 1 year ago

@iLightFPS I use the official screen, can run smooth 30fps even on a pi3, added benefit of nice backlight control if you interface to the canbus.

I am working on some MOST bus hardware, so will use that to do power, however I have been running this in two cars for 3 years with no graceful shut down. I havent had a single SD card fail, so kinda low on the priority list atm.

LRYMND commented 1 year ago

You can check out my volvo-rtvi repo. In there you find a schematic for a cheap raspberry PSU that handles the ignition logic.

kostasfe commented 1 year ago

Ineresting. I got the carpihat to reduce the risk, but goot to hear its so robust. I can recommend also waveshare 7 inch screen, specifically revision 4.1. It connects through HDMI and has backlight control/power/touch through microusb. ~£60 on Amazon.

iLightFPS commented 1 year ago

@rhysmorgan134 MOST? Like the fiber cable?? What are you running now to controll the shutdown for the Pi when switching off the car?

@LRYMND I looked at it. Seems to be well writen. However i believe the V70 is way different than V50 as urs is P1 and mine P3. Right now i'm only going to use the Carplay function and adding some dark theme to the interface. So i can get rid of the black placeholder screen.

@kostasfe Waveshare seems the way to go but i havn't found a screen that has support to mount the Pi on the back from them yet. But it also have to fit the original Volvo screen frame so it mounts the original way

rhysmorgan134 commented 1 year ago

IMG_3775

@iLightFPS yeah correct, created a piHat for it, just soldering it up right now, super early days though!

kostasfe commented 1 year ago

@iLightFPS btw I used a £4 lux sensor over I2C with a small python script for automatic backlight control on the waveshare screen. Let me know if you ever need the code, happy to share.

LRYMND commented 1 year ago

@LRYMND I looked at it. Seems to be well writen. However i believe the V70 is way different than V50 as urs is P1 and mine P3. Right now i'm only going to use the Carplay function and adding some dark theme to the interface. So i can get rid of the black placeholder screen.

@iLightFPS I mentioned it because of the power source since you were concerned of shutting down the Raspi. The schematic in my repo takes care of that. It's a little additional PCB with a soft latch circuit that hooks to IGN, 12V and GND and turns on/off the Raspi based on the ignition. Power consumption in the off state is almost 0. Its also quiet cheap.

iLightFPS commented 1 year ago

@rhysmorgan134 Whats the white box on the board for?

@kostasfe Can it be done using the original light sensor on the car to controll darkmode and stuff?

@LRYMND Cool. I got alot of reading to do before i can install it in my car.

kostasfe commented 1 year ago

@iLightFPS It might be, but you would need to decode the signal of the original light sensor I suppose, people have done that.. The sensor I mentioned is already I2C, which is nearly plug and play for the Pi.

iLightFPS commented 1 year ago

@kostasfe I'll have to look more into this. I really want it to be as original as possible.

Back to the CarPiHat. I've read that i need ground, permanent 12v and ignition switched 12v. I guess i can get the ground and permanent 12v from the cd unit but where do i get ignition. Do i have to find the correct wire from the start button?

Do you have any pictures from your project that you can share?.

Edit: Should i order the CarPiHat with the fan?

kostasfe commented 1 year ago

You should be able to find permanent 12v and ignition (also called a switch sometimes), which is also 12v from the radio too. The switch gives the signal to the radio tu turn on when you turn the ignition on. It might be complicated in new cars, but that was the case on my Lexus IS300 2001. Unfortunately, I did not take photos, was not planning to document the project. But while testing, I simply was connecting the permanent and switch wires to the positive terminal of a battery.

Not sure about the fan. I took the one with the fan - figured it'll be safer.

Btw the lux sensor is quite small, you might be able to hide it well.

iLightFPS commented 1 year ago

@kostasfe I just checked Volvo Vida and i can't see any pins for the ignition to the cd unit. Thinking about it. Do i really need ignition to the Pi? Can't i just have 12v and ground taken from the cd unit?

kostasfe commented 1 year ago

Not sure. If it's constant 12v, then the Pi will not turn on/off with you turning the car on/off but will stay on constantly until you turn it off manually. That's why you want ignition, so that the computer turns on together with the car.

iLightFPS commented 1 year ago

My bad of opening this ticket again. But i don't know where to get help with CarPiHat.

@kostasfe Just got around to install the head unit. I ran 2 wires to the CD player connector to the MAIN LOOM of the CarPiHat. Positive wire goes to 12V SWITCH and the negative wire goes to grnd. I get power to the CarPiHat since the IGN led lights up but the RPi doesn't turn on. Do you have any idea of what i've done wrong?

kostasfe commented 1 year ago

Can't remember of the top of my head now exactly, but I think there are a few settings to change in the RPi to get powered through the GPIO. See if those are done. Make sure both 12v are connected, the constant and the switch one.

iLightFPS commented 1 year ago

@kostasfe I got it to work now.

12V constant to fusebox. GND to GND and 12V SWITCH to a wire that gets power when ignition is on.

Sadly it didnt turn off when i removed the 12V SWITCH wire. But i probleby f up when doing the scripts for safe shutdown.

kostasfe commented 1 year ago

Glad it worked. I believe there was some code provided in the documentation of the CarPiHat. I used that and it worked nicely. The only inconsistency was that if I now use the RasPi from a wall connector, it won't shut down completely, the OS itself shuts down, but something keeps running as the fans stay on.

iLightFPS commented 1 year ago

@kostasfe I noticed that aswell. However a quick search on google i found from the creator of CarPiHat to replace

"dtoverlay=gpio-poweroff,gpiopin=22,active_low"

with

"gpio=22=op,dh"

It's worth a try.

If that doesn't work i definetly f uped the safe shutdown script.

Update: It didn't work. It somehow fails at the last step when creating the service for the script. Running the last commands it says service failed.

Update 2: Tried to remake the service and script with Root but still doesn't turn of the Pi when IGN is low.