Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSA Key... #3

Open
att100101 opened this issue Mar 7, 2019 · 11 comments
Open

PSA Key... #3

att100101 opened this issue Mar 7, 2019 · 11 comments

Comments

@att100101
Copy link

I am glad with your job. The project about the emulator for PSA key connect is wonderfull...but, must I wait for a long time to watch on screen the phrase "Hello World"? Please help!

@Mwyann Mwyann transferred this issue from Mwyann/win3mu Mar 8, 2019
@Mwyann
Copy link
Owner

Mwyann commented Mar 8, 2019

What is the model of your car? What type of Rpi are you using? When you plug your Rpi on the car, what do you get on the screen of your car after at least 30 seconds?

@att100101
Copy link
Author

Thanks to answer me...the car model is Grand Picassso Citröen Model 2016 and i have the SMEG+(5.43.A.R2). The Ppi is Zero W with the same specifications that the project need. The screen shows the prhase: "Turning on...do not disconnect the key. This operation can take a few minutes".
I wait for ten minutes, but nothing happens, please, can you help me?

@Mwyann
Copy link
Owner

Mwyann commented Mar 8, 2019

Ok then, there is a problem somewhere. Here are some steps you can try to debug the process;

  • If you have access to a Linux machine, plug your Rpi into it like it's your car. After a few seconds, you should see a "usb0" connection showing on your computer. Set your computer's IP to 192.168.10.4, and try to visit this URL: http://192.168.10.3:8080. It should display some page, not the "Hello world" but it should react. If it doesn't, try to ssh into your Rpi using the IP 192.168.10.3 and see the apache logs or anything else until it works.
  • If you have a smartphone which can act as a wifi hotspot, try to set it up on the Rpi (fill the details into /etc/wpa_supplicant/wpa_supplicant.conf), and when you're in your car, you can then connect to the Rpi wirelessly while it's plugged into the car, so you can debug what's going wrong in place. Don't hesitate to use tcpdump on the usb0 interface to see the traffic between the Rpi and the car.

If you need more instructions about debugging what's going wrong, I can assist you, although it's not that easy on github's ticket system ;) Last time I checked, the install script did all the work for you, maybe something changed somewhere but I can't figure out what (and my Rpi is broken right now, I need to buy another one).

@att100101
Copy link
Author

Thank´s for you help! I will try all you told me step by step and i will report to you with the feedback

@att100101
Copy link
Author

Hi again! I bought other microsd Kingston 32Gb and i repeated all again. I saw that an update is before that the wifi configurations, so some lines did not downloading.
But, with a Ubuntu Desktop and the Pi plug in usb like at the car, i did not saw nothing...i am sorry because i don´t know enough in linux machines...
New Microsd, all the steps carefully and watching on screen without errors...finally, the program end and say: Reboot and put it on the car with USB plug and push bottom of "internet conection"
and first is conecting and after say:"do not unplug the key...you might wait a while..." and nothing happens.
I think it is connected to internet by SSH ( i can see some Kb/s in the screen of the smartphone)
But the code or psakey do not charged to allow to use the key.
Sorry for my English

@quadrat2
Copy link

quadrat2 commented May 16, 2020

Hello! I have a similar problem.
Car: Citroen C4 Grand Picasso
SMEG+ version: 5.43.A.R2

At first: "Connecting...", few minutes later:
IMG_20200516_154517
.. and nothing!

@Mwyann
Copy link
Owner

Mwyann commented May 23, 2020

@quadrat2 Weird, I have the same SMEG+ version but the visuals are not the same at all. I guess there's something different in the way the car connects to the key, but I cannot debug it without access to some car with a similar system. I can only redirect you to the previous post which indicates some debugging tests, to see if the key is properly configured, and to check if the car and the key are communicating correctly.

There's something you could try eventually to help me debug this problem: you could try step number 2, which is connecting the rpi to your phone's wifi hotspot, then connect to your rpi via ssh from your phone, while plugged into the car, run the 'remount' comman dto remount the rpi's system read/write, and try to make a tcpdump like this:

tcpdump -i usb0 -w psakey.pcap

Wait a few seconds to capture some data, then send me the resulting psakey.pcap file so I can see what the car is trying to communicate to the key. It's not guaranteed but it's a start :)

@quadrat2
Copy link

quadrat2 commented May 24, 2020

@quadrat2 Weird, I have the same SMEG+ version but the visuals are not the same at all. I guess there's something different in the way the car connects to the key, but I cannot debug it without access to some car with a similar system. I can only redirect you to the previous post which indicates some debugging tests, to see if the key is properly configured, and to check if the car and the key are communicating correctly.

There's something you could try eventually to help me debug this problem: you could try step number 2, which is connecting the rpi to your phone's wifi hotspot, then connect to your rpi via ssh from your phone, while plugged into the car, run the 'remount' comman dto remount the rpi's system read/write, and try to make a tcpdump like this:

tcpdump -i usb0 -w psakey.pcap

Wait a few seconds to capture some data, then send me the resulting psakey.pcap file so I can see what the car is trying to communicate to the key. It's not guaranteed but it's a start :)

psakey.zip

@Mwyann
Copy link
Owner

Mwyann commented May 24, 2020

@quadrat2 Thanks for the dump :) I've looked at it and... yeah there's something that caught my eye:

GET http://pms-onboard.mpsa.com/2/widgetengine/ru/[YOUR_VIN] HTTP/1.1
HTTP/1.1 404 Not Found

I didn't think about different languages, so the 'ru' language code wasn't expected. You should try this (and maybe @att100101 may try it too if you're still interested):

Edit the file /etc/apache2/sites-available/psakey.conf and change these lines:

	RewriteRule "^/2/widgetengine/fr/.*$" "/resources.json" [R=307]
	RewriteRule "^/2/widgetengine/en/.*$" "/resources.json" [R=307]

into this line:

	RewriteRule "^/2/widgetengine/[a-z]+/.*$" "/resources.json" [R=307]

Should work better I guess.

@quadrat2
Copy link

Yep!!! It works!
The problem was probably that the language of the system was set to "Russian".
Many thanks!!! Great job!!!

@Mwyann
Copy link
Owner

Mwyann commented May 24, 2020

Thank you for pointing out the bug and providing your help to find it out. The problem wasn't what language you've selected, the problem was an oversight on my part :-) I've pushed the change to commit f6c8d04

Can I ask what you're gonna do with it? :) Maybe following this discussion on this issue #4 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@Mwyann @quadrat2 @att100101 and others