Lost getting SOC from Mitsubishi iMiev #65
Unanswered
raphael303
asked this question in
Q&A
Replies: 1 comment 2 replies
-
In case anyone ever does it: Here is the code for the function:
However, you only get data, when it is charging. I did not find out, yet, how to request that data while idle without ignition. I have connection and get data, just not that data. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
So I got MeatPi connected and I am sending requests from Node Red.
Right now my request looks like this:
{ "bus": "0", "type": "tx", "frame": [{ "id": 1889, "dlc": 8, "rtr": false, "extd": false, "data": [2, 21, 1, 170, 170, 170, 170, 170] }] };
The answer I get (like a 100 times) is:
{"bus":"0","type":"rx","ts":26171,"frame":[{"id":1060,"dlc":8,"rtr":false,"extd":false,"data":[64,0,128,0,133,221,1,255]}]}
I have derived the ID, Mode and PID from here:
https://github.com/puddnig/triplet-bmu/blob/master/triplet.py
Which is a python script which reads the SOC and more from the Mitsubishi iMiev
The ID I have derived from, the command 'atsh761' I believe it sets the header to 761, which is the ID for the BMU in hexadecimal. In decimal, this would be 1889.
Then the python script does this:
I believe The command '022101' can be broken down as follows:
02: Number of additional bytes that follow
21: Mode (Service 21 is for proprietary diagnostics)
01: PID (Parameter ID)
Hence my request:
{ "bus": "0", "type": "tx", "frame": [{ "id": 1889, "dlc": 8, "rtr": false, "extd": false, "data": [2, 21, 1, 170, 170, 170, 170, 170] }] };
and response:
{"bus":"0","type":"rx","ts":26171,"frame":[{"id":1060,"dlc":8,"rtr":false,"extd":false,"data":[64,0,128,0,133,221,1,255]}]}
From other ressources on the web I have found that the SOC is PID x374. I have thus tried (decimal):
msg.payload = { "bus": "0", "type": "tx", "frame": [{ "id": 1889, "dlc": 8, "rtr": false, "extd": false, "data": [2, 21, 884, 170, 170, 170, 170, 170] }] };
response:
{"bus":"0","type":"rx","ts":21588,"frame":[{"id":1060,"dlc":8,"rtr":false,"extd":false,"data":[64,0,128,0,133,239,1,255]}]}
I have converted the decimal strings to hex and tried to apply the logic of the above python script, but the results are nonsense.
Any help is appreciated.
Beta Was this translation helpful? Give feedback.
All reactions