marcraft2 / tesla-carplay

Carplay Raspberry Pi Wi-Fi Hotspot Web Server for Tesla.
Other
111 stars 19 forks source link

Carlinkit not working #4

Closed psmith3 closed 2 years ago

psmith3 commented 2 years ago

Marc, I have gotten pretty far and am close to making this whole thing work. I did have issues getting the hostapd working, but finally got it working and can connect to the Pi through it via Wi-Fi. For testing, I am not in the car, but am trying to connect to the CarPlay.lan address with a Mac and only getting a black screen on my browser. I have previously testing that there bluetooth audio worked in the Tesla. I have tried using a Carlinkit 3.0 plugged into one of the raspberry PI USB ports and the phone plugged in to the other side of the Carlinkit. Have also tried connecting the phone directly to the USB on the PI with no luck. I don't think my Carlinkit is working and has a red light on it. Is there a driver for it that I was supposed to enable? This is what I have and I don't think it is the exact model that yours is. CPC200-U2W Plus. https://www.amazon.com/gp/product/B08P1GWQDB/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

psmith3 commented 2 years ago

I expect this might have something to do with the reason it is not working. Any idea?

`root@carplay:~/tesla-carplay# pm2 logs [TAILING] Tailing last 15 lines for [all] processes (change the value with --lines option) /root/.pm2/pm2.log last 15 lines: PM2 | 2022-02-24T15:06:46: PM2 log: App [index:0] online PM2 | 2022-02-24T15:06:47: PM2 log: App [index:0] exited with code [1] via signal [SIGINT] PM2 | 2022-02-24T15:06:47: PM2 log: App [index:0] starting in -fork mode- PM2 | 2022-02-24T15:06:47: PM2 log: App [index:0] online PM2 | 2022-02-24T15:06:47: PM2 log: App [index:0] exited with code [1] via signal [SIGINT] PM2 | 2022-02-24T15:06:47: PM2 log: App [index:0] starting in -fork mode- PM2 | 2022-02-24T15:06:47: PM2 log: App [index:0] online PM2 | 2022-02-24T15:06:48: PM2 log: App [index:0] exited with code [1] via signal [SIGINT] PM2 | 2022-02-24T15:06:48: PM2 log: App [index:0] starting in -fork mode- PM2 | 2022-02-24T15:06:48: PM2 log: App [index:0] online PM2 | 2022-02-24T15:06:48: PM2 log: App [index:0] exited with code [1] via signal [SIGINT] PM2 | 2022-02-24T15:06:48: PM2 log: App [index:0] starting in -fork mode- PM2 | 2022-02-24T15:06:48: PM2 log: App [index:0] online PM2 | 2022-02-24T15:06:49: PM2 log: App [index:0] exited with code [1] via signal [SIGINT] PM2 | 2022-02-24T15:06:49: PM2 log: Script /root/tesla-carplay/index.js had too many unstable restarts (16). Stopped. "errored"

/root/.pm2/logs/index-out.log last 15 lines: /root/.pm2/logs/index-error.log last 15 lines: 0|index | at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:61:29) 0|index | at require (node:internal/modules/cjs/helpers:102:18) 0|index | at Object. (/root/tesla-carplay/modules/Carplay.js:1:13) 0|index | at Module._compile (node:internal/modules/cjs/loader:1097:14) 0|index | at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10) 0|index | at Module.load (node:internal/modules/cjs/loader:975:32) 0|index | at Function.Module._load (node:internal/modules/cjs/loader:822:12) 0|index | at Module.require (node:internal/modules/cjs/loader:999:19) 0|index | at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:80:39) { 0|index | code: 'MODULE_NOT_FOUND', 0|index | requireStack: [ 0|index | '/root/tesla-carplay/modules/Carplay.js', 0|index | '/root/tesla-carplay/index.js' 0|index | ] 0|index | }

`

psmith3 commented 2 years ago

Making progress. Had to install usb. npm install usb. Is there more to do other than just this? Do I need pycarplay? Now getting this error...

`/root/.pm2/pm2.log last 15 lines: PM2 | 2022-02-24T16:16:44: PM2 log: App [index:0] online PM2 | 2022-02-24T16:16:45: PM2 log: App [index:0] exited with code [1] via signal [SIGINT] PM2 | 2022-02-24T16:16:45: PM2 log: App [index:0] starting in -fork mode- PM2 | 2022-02-24T16:16:45: PM2 log: App [index:0] online PM2 | 2022-02-24T16:16:46: PM2 log: App [index:0] exited with code [1] via signal [SIGINT] PM2 | 2022-02-24T16:16:46: PM2 log: App [index:0] starting in -fork mode- PM2 | 2022-02-24T16:16:46: PM2 log: App [index:0] online PM2 | 2022-02-24T16:16:46: PM2 log: App [index:0] exited with code [1] via signal [SIGINT] PM2 | 2022-02-24T16:16:46: PM2 log: App [index:0] starting in -fork mode- PM2 | 2022-02-24T16:16:46: PM2 log: App [index:0] online PM2 | 2022-02-24T16:20:37: PM2 log: Stopping app:index id:0 PM2 | 2022-02-24T16:20:37: PM2 log: App [index:0] exited with code [0] via signal [SIGINT] PM2 | 2022-02-24T16:20:37: PM2 log: pid=1220 msg=process killed PM2 | 2022-02-24T16:21:37: PM2 log: App [index:0] starting in -fork mode- PM2 | 2022-02-24T16:21:37: PM2 log: App [index:0] online

/root/.pm2/logs/index-error.log last 15 lines: 0|index | at Function.Module._load (node:internal/modules/cjs/loader:822:12) { 0|index | status: 7, 0|index | signal: null, 0|index | output: [ 0|index | null, 0|index | , 0|index | <Buffer 63 75 72 6c 3a 20 28 37 29 20 43 6f 75 6c 64 6e 27 74 20 63 6f 6e 6e 65 63 74 20 74 6f 20 73 65 72 76 65 72 0a> 0|index | ], 0|index | pid: 1218, 0|index | stdout: , 0|index | stderr: <Buffer 63 75 72 6c 3a 20 28 37 29 20 43 6f 75 6c 64 6e 27 74 20 63 6f 6e 6e 65 63 74 20 74 6f 20 73 65 72 76 65 72 0a> 0|index | } 0|index | % Total % Received % Xferd Average Speed Time Time Time Current 0|index | Dload Upload Total Spent Left Speed 100 7633k 100 7633k 0 0 297k 0 0:00:25 0:00:25 --:--:-- 292k

/root/.pm2/logs/index-out.log last 15 lines: 0|index | dpi: 15, 0|index | nightMode: 0, 0|index | hand: 0, 0|index | boxName: 'nodePlay', 0|index | width: 960, 0|index | height: 600, 0|index | fps: 30 0|index | } 0|index | directory found 0|index | device not connected 0|index | New WebSocket VIDEO Connection: (1 total) 0|index | Disconnected WebSocket VIDEO (0 total) 0|index | NEW CONTROL CONNECTION 0|index | New WebSocket CONTROL Connection: (1 total) 0|index | New WebSocket VIDEO Connection: (1 total)

`

psmith3 commented 2 years ago

I am thinking that maybe the issue is the adapter I have is incompatible. I have ordered the CPC200-Autokit and will try again later.

marcraft2 commented 2 years ago

If your iphone is well connected by USB to the carlinkit and you have authorized this carplay, I think your carlinkit box is not compatible. Make sure you have a cable that can transfer data and not just charge the phone.

Your browser seems to have successfully connected to your server anyway.

Maybe you could share more log I could maybe tell you more.

Note: If you open carplay in a browser on a computer, you must simulate a touch screen, otherwise you cannot control carplay.

psmith3 commented 2 years ago

I did get it all working, and added a second USB Wi-Fi radio and swapped eth0 for the second Wi-Fi for internet access and am tethering my iphone to this new interface. Biggest challenge right now is how slow the web interface is, either from the Tesla browser or my ipad browser connected to the same network. Is your interface slow too? Also noticed the touch interface is not lined up with the bottom left icon to go to the home screen. Might need to tinker with the resolution. E1CACBAF-7F58-4B82-B3A7-4666BA79E642