pyHPSU icon indicating copy to clipboard operation
pyHPSU copied to clipboard

ELM not working

Open m-reuter opened this issue 3 years ago • 27 comments

Hi, can anyone help me get started?

I bought the ELM that is linked in the readme, "bbfly Forscan Elm327 ELMconfig USB VINT-TT55502 mit MS-CAN für Ford OBD2 Diagnose" but cannot get it to work (actually I tried with two of these, to make sure it is not broken - bought from different vendors, but otherwise the same ). Both show the same problems. Also, my heat pump is Rotex HPSU compact ultra. I know the folks at FHEM use the same adapter and it works for them. My goal is to run pyHPSU in a docker and push info (both ways) via MQTT to homeassistant.

I usually get (but not always) when I run for the first time after connecting: pyHPSU.py -d ELM327 -p /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 -v 2 -c flow_rate error - Error sending AT PP 2F ON (rc:AT PP 2F ONOK)

and when I run it a second time: pyHPSU.py -d ELM327 -p /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0 -v 2 -c flow_rate warning - sending cmd 31 00 FA 01 DA 00 00 (rc:NO DATA) warning - retry 1 command flow_rate (also when trying other commands)

I have a Raspberry Pi 4 B. Is the ELM working for anyone in this constellation? What ELM are you using? Or do I need to get a PICAN hat? If so, does the PICAN 2 work on the Raspi 4?

Thanks for any help.

P.S. I connected to Rotex first from the female OBD 16 pin connector with 2m wire. Then, because I was unsure if wires are twisted pairs in that cable, I now use an ethernet cable with a twisted pair. Either way same result. Also, I run pyHPSU in a docker, but given that the ELM reacts I think that works fine. In the meantime, I will re-build that docker to be double sure that I am running the latest version but I built it just a couple of weeks ago.

m-reuter avatar Mar 12 '21 22:03 m-reuter

I tried the same ELM327 adapter and got the same bad result. :-( The command „AT Z“ is answered with „ELM327 v1.5“. Zanac wrote that Version 1.5 is a China clone where the PP command is not implemented correctly. Can anybody with a working adapter confirm that? What version should a working adapter have? Pics of my board showing the microprozessor PIC18F25K80 that emulates the ELM327:

56599AB9-4849-48EC-849C-2D7967A256CD 8F6BBEF2-84B9-4B9C-9B76-66484468622E

regards Karl

KalaNagHTD avatar Mar 13 '21 06:03 KalaNagHTD

Or do I need to get a PICAN hat? If so, does the PICAN 2 work on the Raspi 4?

I'm using a Raspi 4 with the PICAN 2 duo. Works without any problems.

Regards Martin

martinbischofff avatar Mar 13 '21 16:03 martinbischofff

Today I tried the RS485 CAN Hat also without any success, although I am not sure if it can be seen, because either way (conntected to rotex or not) I get this: pyHPSU.py -c t_hs error - Not aquired bus warning - msg not sync, retry: 1 ...

I do see the can0 in ifconfig (outside the docker) but I don't have ifconfig in the docker image, to check there.

Another thing:

When I connect the Rotex this happens (also occured with the ELM before): Rotex goes into "Absenk" (sorry, don't know the english) mode and I cannot see any room temp (only "-") I have to restart the Rotex again after that. This behavior is a little scary. It happens without sending a command, only attaching the two (hi, lo) CAN cables.

m-reuter avatar Mar 13 '21 17:03 m-reuter

With ifconfig my Pican2 shows up as follows:

can0: flags=193<UP,RUNNING,NOARP> mtu 16 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC) RX packets 2682935 bytes 18780545 (17.9 MiB) RX errors 1 dropped 1279 overruns 0 frame 1 TX packets 166256 bytes 1163792 (1.1 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

with dmesg I see the following:

[ 8.342024] CAN device driver interface [ 8.359017] mcp251x spi0.0 can0: MCP2515 successfully initialized.

Does your Waveshare RS485 CAN Hat show similar lines?

Did you modify the config.txt according to the RS485-CAN-HAT-user-manual? (https://www.waveshare.com/w/upload/2/29/RS485-CAN-HAT-user-manuakl-en.pdf)

dtparam=spi=on dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=25,spimaxfrequency=200000

KalaNagHTD avatar Mar 13 '21 20:03 KalaNagHTD

I forgot to mention: The error message „error - Not aquired bus“ shows up, when the CAN board is not initialiced correctly in the config.txt

KalaNagHTD avatar Mar 14 '21 05:03 KalaNagHTD

Thanks Karl,

I had the config.txt adjusted already:

# RS485 CAN Hat
# https://www.waveshare.com/w/upload/2/29/RS485-CAN-HAT-user-manuakl-en.pdf
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=25,spimaxfrequency=1000000

Ifconfig shows only zeros (which could be ok after a reboot without sending anything).

can0: flags=193<UP,RUNNING,NOARP>  mtu 16
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

And I had this (same as in README) in /etc/network/interfaces also:

auto can0
iface can0 inet manual
     pre-up /sbin/ip link set $IFACE type can bitrate 20000 triple-sampling on
     up /sbin/ifconfig $IFACE up
     down /sbin/ifconfig $IFACE down

I'll probably have to try outside of docker, if I start inside docker I get the errors and also the TX RX packages do not change. This is my docker command docker run --name pyhpsu -v /home/pi/projects/pyHPSU-docker-cmds:/etc/pyHPSU --network host -it --rm --entrypoint /bin/bash pyhpsu

and I pass -network host to have can0 available inside docker (maybe that part is not working properly). Maybe I can test this with picocom but not sure how I connect it to the can0 device, it only worked with /dev devices so far. thanks.

m-reuter avatar Mar 14 '21 10:03 m-reuter

I tried the same ELM327 adapter and got the same bad result. :-( The command „AT Z“ is answered with „ELM327 v1.5“. Zanac wrote that Version 1.5 is a China clone where the PP command is not implemented correctly. Can anybody with a working adapter confirm that? What version should a working adapter have? Pics of my board showing the microprozessor PIC18F25K80 that emulates the ELM327:

8F6BBEF2-84B9-4B9C-9B76-66484468622E

regards Karl

With regard to the findings in the project „fhemHPSU“ my Adapter ELM v.1.5 with the PIC18F25K80 should do the job!

URL: wiki.fhem.de/wiki/Rotex_HPSU_Compact#ELM327_OBD2_Adapter

KalaNagHTD avatar Mar 14 '21 13:03 KalaNagHTD

So what do people get when they run pyHPSU without anything attached to the CAN interface? Is it the same as

exception - Error sending msg
error - Not aquired bus
warning - msg not sync, retry: 1
error - Not aquired bus
...

and is there any way to check if my can0 interface works without connecting it? Then I'd know if I need to debug on the raspi side or if it could be the cable connection (at least for the can hat version). For ELM I think the problems is likely on the software/driver/raspi side given that:

  • I can contact it (e.g. via picocom ) and interact
  • pyHPSU works for KarlaNag when he uses the can0 interface but same cable connection attached to ELM does not work
  • and it should work theoretically according to the readme and according to the people at fhemHPSU

Also I modified pyHPSU.py to work from a local directory without having to install it, so I can test without docker. Only had to change the hard-coded paths everywhere.

Any help would be apprechiated. Thanks.

m-reuter avatar Mar 16 '21 20:03 m-reuter

In order to clarify that I removed the CAN-connection from my Pican2 and got the same message („Error - Not aquired bus“) After reconnecting the CAN the message remained the same and I had to power reset the Pi to get the unit working again.

KalaNagHTD avatar Mar 17 '21 09:03 KalaNagHTD

Thanks @KalaNagHTD for testing! In the meantime I obtained a Pican2 hat (my 4th CAN device after two ELMs and the RS485 CAN Hat) and with the Pican2 on Raspi 4b it finally works (both inside and outside docker).

Given that there was little response here with respect to those other two devices I would advise to remove those buying recommendations from the README until we know what is causing these problems: Could be changes in the code, could be incompatibility with some more recent RasPi (I have 4b) or incompatibility with the compact ultra model of Rotex. We don't know.

Also it would be great if anyone who has a running setup with either the ELM or the RS485 CAN Hat can post details of his Hardware (exact CAN device, computer, and heatpump model) and Software setup here.

Happy to try a couple things, will probably keep one of the ELMs around and will return the RS.. hat and 2nd ELM.

m-reuter avatar Mar 17 '21 15:03 m-reuter

Just wanted to say that the RS485 CAN Hat works fine with my old Pi2 which I'm using. Added the config to /boot/config.txt and the rest was straight forward. # CAN dtparam=spi=on dtoverlay=mcp2515-can0,oscillator=12000000,interrupt=25,spimaxfrequency=1000000

evildad avatar Dec 22 '21 14:12 evildad

Good news for budget sensitive projects! Thank you!

KalaNagHTD avatar Dec 22 '21 16:12 KalaNagHTD

Just wanted to say that the RS485 CAN Hat works fine with my old Pi2 which I'm using. Added the config to /boot/config.txt and the rest was straight forward. # CAN dtparam=spi=on dtoverlay=mcp2515-can0,oscillator=12000000,interrupt=25,spimaxfrequency=1000000

Hi! I want to connect to my HPSU too and I have the RS485 Can Hat. Can you tell me which connections did you use? I mean, I can see that we have the CAN-H and CAN-L on the RS485 Hat but not the GND. I guess I can use any GND from the Pi? Or GND is not needed? Thanks!

acalatrava avatar Jul 28 '22 07:07 acalatrava

Hi @acalatrava , sorry for my late answer, CAN-H and CAN-L with twisted pair cable is working for me, GND is not needed.

evildad avatar Aug 03 '22 18:08 evildad