Mwyann / psakey

Peugeot Connect Apps / Citroën Multicity Connect your way
59 stars 14 forks source link

Is there any possibility that a dumb USB key could contain html pages? #6

Open JassMan23 opened 4 years ago

JassMan23 commented 4 years ago

I know it is extremely unlikely, but since the SMEG can recognise photos and music files on a USB key, and since your work on the PI zero emulates a key (with a webserver?), is there any possibility that a USB key with the correct folder structure might be recognised as a website? eg. //xxx.peugeot.fr/psakey/
I just wonder since with a bit of HTML coding, I think it should be possible to replicate some of the existing SMEG screens but have all the theme info in a CSS to allow for a more aesthetic displays. If it were possible, I would like to try to create screens with information more usefully combined.

Also I note in you demo file that you have top.GetCarTrip1 and top.GetCarTrip2 but not the info for the instantaneous consumption and distance remaining. Does that info exist?

Mwyann commented 4 years ago

First of all, if you car has only one USB outlet (like mine), you unfortunately cannot use both a standard music/photo USB stick AND the "webserver" key at the same time, even using a USB hub.

The browser is only triggered when the "webserver" key is inserted, it cannot display a static HTML file out of a standard Mass Storage media. My setup creates all the structure and config files for it to work out of the box. So you can setup a Rpi zero and create your own HTML/CSS/JS files like you want. Please note though that you'll have to write all of it "from scratch" and the HTML won't affect any of the rest of the car's display (you cannot change the full SMEG theme or display anything in front of the other apps).

And for the car's API, you can find a useful doc here: https://github.com/xorcdbit/psakey/blob/patch-1/Doc_KeyWord.txt with all the API calls available. You have top.GetCar.Autonomy(); but you cannot get the instantaneous consumption using the API. If you'd really want it, I'd suggest hooking an OBD2 interface on your car (like a bluetooth one) and using it with the Rpi. That's what I'm planning to do: having a dashboard on the SMEG with all the car's internals data out of it. Unfortunately, OBD2 is kind of messy, not very well documented and full of manufacturer's crap.

JassMan23 commented 4 years ago

Thanks for the detailed explanation. I did suspect this would be the case but I was intrigued by the fact that there are some html files in SYSTEM eg. /SYSTEM/internet_default/config/OOM.html and /SYSTEM/internet_default/portal/index.html .
I had assumed that the second one might be the one that appears when you select the "Internet" option from the main menu even when you don't have a PSAkey plugged in.

Oh well, back to concentrating on UBPorts ubuntu phone apps instead.