Code Monkey home page Code Monkey logo

Comments (28)

runestone74 avatar runestone74 commented on September 17, 2024 2

Hi, I have a 2018 PHEV and is very frustrated by the fact that the fab remote cooling/heating are not available over 3G/4G, just a very short range WiFi. I have a working solution with TeamViewer Host on a cellphone connected to a USB-port for charging in the car right now, but I would love to make a proper Home Assistant solution ( https://www.home-assistant.io/hassio/ ) I found your project just by googling the IP adress and port that the PHEV uses :) I did not find anything other than the Pentest security test otherwise... I have set up WireShark equvivalent Packet Capture which works fine to get both PCAP and line by line info on the communication, so tell me if can help you out in some way. Thanks for your great efforts so far papawattu.

from phevcore.

guiguid avatar guiguid commented on September 17, 2024 2

Hi all,
I'm also very interested by Home Assistant integration.
I've a MY19 PHEV, I'll try to help.
If you plan to use ESP32 or 8266, I suggest you to look at ESPHome https://esphome.io/ as it's already include as an Home Assistant Addon.
So you can use intergated developpement include in ESPHome ( GUI, OTA ...)

from phevcore.

papawattu avatar papawattu commented on September 17, 2024 1

Yes in fact I have two of them, they work fine I am just tweaking a few things at the moment.

from phevcore.

petitjfl avatar petitjfl commented on September 17, 2024 1

from phevcore.

buxtronix avatar buxtronix commented on September 17, 2024 1

Also keen here. Got a 2018 one too, which judging by my tests and packet captures has a different binary format not compatible with this current codebase.
Seems the MY18 changes in phevcore are very early for now, and registration doesnt even work yet. Happy to help out.

from phevcore.

petitjfl avatar petitjfl commented on September 17, 2024 1

Hello :)

It's been a while but I'm back at it... I'm trying to take your code and have it run on ESP32. My plan is to get a "bridge" device. One that is connected to the PHEV permanently and sending data back to my own WiFi network. I'm not sure if I'm doing this right or if I make it over complicated but... I loaded your cJSON & msg-core & phevcore into VSCode and I'm using PlatformIO to build and deploy to ESP32 DevKit v1 board.

I fixed a few include issues then I got compile errors on some lines like uint8_t * phev_core_xorDataWithValue(const uint8_t * data,uint8_t xor); because of the xor at the end that was recognized as the operator... I renamed them all. Now it all compile.

Where I need help is... what to do next. ;) Then ESP32 has 2 section : setup and loop. I'm not sure how should I be using your code and what function to call...

from phevcore.

papawattu avatar papawattu commented on September 17, 2024

Hi Leon

The requests are not http unfortunately, they are a binary message format which I've mostly got a handle on now. I've rewritten some code to send an encoded message and decode the messages take a look at the tests

https://github.com/papawattu/phev-core/blob/master/test/test_phev_service.c

If you want to help contribute I'd love your help as progress is slow at my end at the moment.

Jamie.

from phevcore.

papawattu avatar papawattu commented on September 17, 2024

Hi
I share your frustration, it was the reason for me starting development. The objective of this is to create a gateway connected to a 3G/4G network. I have this library working on a ESP32 which is paired to a 2G card is using MQTT,

I will take a look at the hassio project and see how easy it will integrate with what's there already.

Keep an eye on this repo for more coming soon.

Jamie.

from phevcore.

runestone74 avatar runestone74 commented on September 17, 2024

from phevcore.

skoef avatar skoef commented on September 17, 2024

Hi guys, I'm in a similar situation. My idea was to hook up a raspberry pi right outside of where I park my car, with the raspberry connected to my home LAN and constantly trying to see if it could connect to the car. Then, when it can connect, gather some data periodically and show some grafana graphs perhaps about some statistics in a web-interface. This web-interface would then also offer buttons like headlight/parking lights etc, just like the app would, but then accessible over your regular WiFi.

Anyway, initially I wanted to reverse engineer the binary protocol to a Go library, my go-to language (pun intended) and just like @runestone74 stumbled upon this project while searching for more information about the WiFi interface of the car. So instead of re-inventing the wheel, I figured let's give this a try. But up until now, without any luck. I've tried registering the raspberry pi 30 times and created tcpdumps of whatever was happening (there wás in fact stuff happening) but it didn't work. Or I wasn't patient enough, but after 10 minutes per try I gave up. I also tried giving my Pi the MAC-address of the iPhone that I did register with the car. Also didn't work.

So I would like to help out in whatever way with this project, although I'm a complete n00b in C-coding, or still going to create that Go-library afterall. But it would really help if I at least could register my device. So far I found out that besides the commands listed there were command types 0xe4/0x4e and 0xf3/0x3f being passed back and forth when I created a tcpdump while using my iOS app.

By the way, I couldn't compile phevctl without changing PHEV_START to PHEV_STARTED on https://github.com/phev-remote/phevctl/blob/master/main.c#L280.

from phevcore.

papawattu avatar papawattu commented on September 17, 2024

I'd not pushed a change to the core library, sorry about that. Should be fixed now.

The best way to see the flows is looking at the tests for registration have a look at the test_phev_register_outHandlerOutE2E. link

Also there needs to be a constant ping from the client to the car so that the car doesn't close the connection.

If you'd like some help creating a golang client then I'm happy to get involved.

from phevcore.

skoef avatar skoef commented on September 17, 2024

@papawattu I'd like that very much (you getting involved). Is there any way we can get in contact, other than this form of slowchat? You can reach me on reinier [at] skoef.nl if you want.

Also, indeed I looked at the test-framework, but like I said, C is just not my thing and I'm not savvy enough to debug/mess around with it.

from phevcore.

runestone74 avatar runestone74 commented on September 17, 2024

from phevcore.

papawattu avatar papawattu commented on September 17, 2024

It is possible, unfortunately building Android apps and fancy UI's is not my strong point.

from phevcore.

runestone74 avatar runestone74 commented on September 17, 2024

from phevcore.

papawattu avatar papawattu commented on September 17, 2024

Hi,

I have a working beta version with the TTGO device. New project is here https://github.com/phev-remote/phev-ttgo

Please let me know if you can get this working.

It's great to be able to control the car from outside its WiFi range.

Jamie.

from phevcore.

runestone74 avatar runestone74 commented on September 17, 2024

from phevcore.

papawattu avatar papawattu commented on September 17, 2024

Great ! I am working on building a web based UI as well so you don't need to use raw MQTT commands. It was great for a frosty morning I was able to set off the heater from bed :)

from phevcore.

runestone74 avatar runestone74 commented on September 17, 2024

from phevcore.

papawattu avatar papawattu commented on September 17, 2024

Very early days, my car is getting the update on Monday so I will be able to see what changes are needed.

If you know any C that would be great :)

from phevcore.

buxtronix avatar buxtronix commented on September 17, 2024

My C coding is fine yes, though my reverse-engineering (especially of binary wire formats) is a bit rusty.

I've managed to sniff the session from the official app and car into pcap.

from phevcore.

petitjfl avatar petitjfl commented on September 17, 2024

Hi all,
I'm also very interested by Home Assistant integration.
I've a MY19 PHEV, I'll try to help.
If you plan to use ESP32 or 8266, I suggest you to look at ESPHome https://esphome.io/ as it's already include as an Home Assistant Addon.
So you can use intergated developpement include in ESPHome ( GUI, OTA ...)

I successfully build a few sensors now with ESPHome… it make it so easy!!! Now I'm really motivated to get this nice PHEV code working on it!!! :)

from phevcore.

papawattu avatar papawattu commented on September 17, 2024

There is a version already running on ESP32 which runs on a TTGO device which has built in mobile connection. You can take a look here http://www.runesdata.se/butik/bilelektronik/mitsing-link/

The core library will work on an ESP as its the same code that is used on that device.
If you want to do build your own version take a look at the phevctl code that uses this library https://github.com/phev-remote/phevctl/blob/master/main.c

from phevcore.

petitjfl avatar petitjfl commented on September 17, 2024

from phevcore.

frodegr avatar frodegr commented on September 17, 2024

Hello.
Has the phev-ttgo project moved somewhere else?

I am trying to compile pvev-core for ESP32 in PlatformIO. I got some error ie regarding malloc(). I have kind of sorted this out, but still not able to successfully compile it.

Any tips on how to integrate phev-remote in an ESP32 project?

best regards,
Frode

I have a working beta version with the TTGO device. New project is here https://github.com/phev-remote/phev-ttgo

from phevcore.

petitjfl avatar petitjfl commented on September 17, 2024

from phevcore.

frodegr avatar frodegr commented on September 17, 2024

Hello!!!! I was trying to do the same but had to put that aside since there was too many error for my level and skills. I though I was simply doing something wrong and did not had enough time to better learn all that. I was trying to compile the code and have it deployed on ESP32. I’m also using PlatormIO. Maybe we should get in touch to see if we could help each other? In my case it was dependencies missing and compile errors…

I made some progress (I think) by using the esp-idf framework instead of arduino. The phev* libraries compile with some warnings, but without errors.

The next step is to try to use code from phve-ctl

from phevcore.

scooper1 avatar scooper1 commented on September 17, 2024

keep on with the good work
I am interested in this for home assistant and Phev

from phevcore.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.