New install problems with emonHP

I have just had a heat pump installed and the installer has fitted the level 3 HP Monitoring bundle. However he had left me to configure and commission it. I have got the RPi up and running measuring the flow and temperatures, but not the electrical power. What he didn’t realise is that the power sensor in the consumer unit needs to be connected to the RPi in the heat pump room 15m away. I have extended the electric meters connection using 3 cores of 4-core telephone cable I happened to have. The RS485 to USB powers LED lights up and I can see the Tx light flash but not the Rx line.

Questions:

  1. Can the RS485 link be extended in this way?
  2. I was expecting the Rx light to be flashing. Is it possible that I have cross connected the Rx and Tx links?

Many thanks in advance.

Welcome, Ian, to the OEM forum.

Was this telephone cable or alarm cable? I ask because 4-core telephone cable doesn’t usually exist in long pieces, it’s actually 2-pair cable. This means, two pairs of wires individually twisted. Do you really have Tx and Rx terminals, or are they labelled A and B or + and -   ?

You should be able to extend the bus to 15 m. As far as I’m aware, you’ll have a “half-duplex” bus which uses a balanced two-wire connection plus a reference ground. If this is the case, and you have a standard telephone cable, I’d use blue and blue/white connected to A & B legs, and the other orange pair together as the ground. If you have A & B legs swapped, this is likely to cause problems. (And if you think they are correct, it might be worth swapping one end - I think I read a long time ago about someone who had found a device which was labelled incorrectly.)

This should be worth reading:

Note particularly the bits about termination resistors. No termination or double termination will be equally bad.

Hi Robert,

Thanks for the welcome and the reply to my query.

The cable I have used is “labelled 4-core/2-pair cable for telephone extensions” and is on a 100m roll. What I haven’t done is used the same colour for the signal lines down the cable - I’ll change that when I get a chance after Christmas.

The terminals on the RS485 to USB convertor are labelled A+/B-, but I was referring to the flashing LEDs.

I powered the house down this afternoon to check the SDM120M connections in the consumer unit and found that the electrician had wired to the pulse outputs rather than the RS485 outputs! After fixing I was full of hope the connection would work - but this quickly disappeared!

I can’t find any reference in the datasheets for either the convertor or the meter about the need for termination resistors. However, it’s got to be worth a go.

I’ll report back when I have tried these additional things.

Now that you’ve got the cable connected to the correct meter port,
try swapping the leads at the RS485-to-USB device.

Hello Jack. The level 3 heat pump monitoring kit comes with additional remote configuration support from @glyn.hudson and I. We usually ensure that once the installer has done the physical installation that the meters are reporting data as expected as well as doing all of the emoncms dashboard setup for you - it’s included in the price.

I’m not able to work out what installation/order number your system relates to, can you PM me with your address or installer details and I can look into this for you.

1 Like

Using a twisted pair means the influence of an electro-magnetic field in one half-twist will hopefully be cancelled in the next half-twist.

I thought this is what you meant, but it wasn’t totally clear. I knew the meter itself was 2-wire and not 4-wire, but not knowing what was at the other end meant it was something I needed to mention.

You may not see flashing LED’s if the software configuration is not complete. That’s something I’m happy to look into. Have you connected to the emonHP locally either via the web interface or SSH?

Hi Trystan,
Thanks for the reply. Glyn also DM’ed me and is helping. I’ll come back here with the fix/outcome, or for further help.
Cheers.

1 Like

Ok, here’s the latest update as I’m still unable to connect to the energy meters.

I have
(1) Checked the SDM120 connections
(2) Tried a different cable
(3) Switched the A+/B- connections
(4) Tried various combinations of termination resistors
(5) check that the SMD120 baud rate and parity are correct (yes)
All failed to establish a link between the RS485-USB adaptor (the TX light flashes but no Rx response).

I decided to take the emonHP RPi down to the consumer unit in the garage and plug in to the meter using the short cable provided. I was expecting this to work but I get the same response!!

The Emonhub log shows the following output:


[The MBus heat meter is not connected as this is in the upstairs cupboard so errors out]

I am coming to the conclusion that the SDM120 meter is not working.

  • Is that a correct assumption?
  • Is there a way to test this?

Any help would be appreciated as I have spent way too much time on this now.

Further diagnosis…

My friend has an identical setup to the emonsHP setup I am trying to install so we decided to do some ABA testing on his system.

  1. Before changing anything we verified that his system was working correctly by checking the Inputs, feeds and EmonHub log.
  2. We swapped out his RS485-USB adaptor for mine → No connection “Could not connect to ModBus device” (same as at home).
  3. I tried different USB ports → No connection
  4. We replaced his adaptor → works OK.
  5. We swapped his EmonHP RPi for mine using his adapter → No connection “Could not connect to ModBus device” (same as at home).
  6. We replaced his Pi → works OK.
  7. We swapped his EmonHP RPi and his adapter for mine → No connection “Could not connect to ModBus device” (same as at home).
  8. We replaced his EmonHP RPi and adapter → works OK.
  9. We repeated each swap (2~7) at least twice with the same results.
  10. We verified that everything was working before I left!!

Conclusions

  1. The RS485 adapter isn’t working → Need to replace.
  2. The RPI isn’t working. I found this hard to believe (which is why we repeated the swap multiple times). I checked the USB device and it is configured correctly (the same as my friends). Before replacing I think the RPi could be tested out further. As far as I can see it’s a standard RPi4 that could take any image for testing purposes (I have a number of stock images I could try out). I’ll discuss further with my installer tomorrow when they come back on site for follow up work.
    I could also try reinstalling a “clean” emonHP RPi image. Presumably this would be the same image as available here emonSD Download — OpenEnergyMonitor 0.0.1 documentation?

I would value any thoughts on these findings, and suggestions on what to do next.

The emonHP is a current a separate image and is not available yet…

I know @TrystanLea has previously mentioned this may be getting rolled into the emonPI2 image but probably not just yet as debugging and troubleshooting is rightly taking priority.

Have you tried connecting anything else to the usb ports and are you able to see or access this from the pi via ssh (a usb stick or usb keyboard)?

If it is just the modbus adapter it could well be a driver issue/ firmware issue but unfortunately that is out of my league to assist further. Would be interested to know though.

As this bundle comes with remote support, I suggest reaching out to @glyn.hudson or @TrystanLea directly. How this bundle is setup in the shop is a bit of a mystery.

Have you connected a monitor to the Pi?

Hello @jacko

Could the issue be the name of the USB port? Noticing this error:

Is it trying to connect to a USB/serial port that does not exist?

What do you get when you run the following command on the command line?

ls -lh /dev/serial/by-id

Hi Trystan,

I get:

pi@emonhp:~ $ ls -lh /dev/serial/by-id
total 0
lrwxrwxrwx 1 root root 13 Jan 5 12:17 usb-FTDI_FT232R_USB_UART_B0019BLY-if00-port0 → …/…/ttyUSB1
lrwxrwxrwx 1 root root 13 Jan 5 12:17 usb-Prolific_Technology_Inc._USB-Serial_Controller_A@BCb11CN11-if00-port0 → …/…/ttyUSB0

and the linked device files are also there

pi@emonhp:~ $ ls -lh /dev/ttyUSB*
crw-rw---- 1 root dialout 188, 0 Jan 6 15:42 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 1 Jan 6 15:42 /dev/ttyUSB1

I checked and pi is a member of the group dialout so should be able to rw to the device.

pi@emonhp:~ $ groups pi
pi : pi adm dialout cdrom sudo audio video plugdev games users input render netdev spi i2c gpio docker

Listing the USB devices, both are registered:

pi@emonhp:~ $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 067b:23a3 Prolific Technology, Inc. USB-Serial Controller
Bus 001 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Why wouldn’t the Emons SW be able to open the device if the driver was present?
Should I try recreating the device drivers?

I’ve also borrowed a known good adapter but I am loath to plug in until further understanding has been achieved.

Hi Trystan,

I just realised that the error message above relates to the MBus that connects to the heat meter not the power meter. Even though the connection failed and invalid MBus data is received, the data retrieval does seem to work

2024-01-06 16:11:21,127 DEBUG MBUS Invalid MBUS data received 204 bytes 1033.9 ms
2024-01-06 16:11:21,130 DEBUG MBUS Decoded MBUS data: {“Energy”: [428, “kWh”], “Volume”: [425.75, “m3”], “FlowT”: [30.84, “C”], “ReturnT”: [28.62, “C”], “DeltaT”: [2.22, “C”], “Power”: [3200, “W”], “FlowRate”: [1.216, “m3/h”], “heat_calc”: [3111.946666666665, “W”]}
2024-01-06 16:11:21,130 DEBUG MBUS 126 NEW FRAME :
2024-01-06 16:11:21,131 DEBUG MBUS 126 Timestamp : 1704557480.093435
2024-01-06 16:11:21,131 DEBUG MBUS 126 From Node : heatpump
2024-01-06 16:11:21,131 DEBUG MBUS 126 Values : [428, 425.75, 30.84, 28.62, 2.22, 3200, 1.216, 3111.946666666665]
2024-01-06 16:11:21,132 DEBUG MBUS 126 Sent to channel(start)’ : ToEmonCMS
2024-01-06 16:11:21,132 DEBUG MBUS 126 Sent to channel(end)’ : ToEmonCMS

I further noticed that on this power cycle the ModBus adaptor did open OK.

2024-01-06 16:00:42,010 INFO MainThread Connecting to Modbus device=/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_B0019BLY-if00-port0 baud=9600 parity=none datatype=float
2024-01-06 16:00:42,023 INFO MainThread Setting SDM120 read_interval: 10
2024-01-06 16:00:42,024 INFO MainThread Setting SDM120 nodename: heatpump
2024-01-06 16:00:42,024 INFO MainThread Setting SDM120 prefix:
2024-01-06 16:00:42,024 INFO MainThread Setting SDM120 meters electric address 1
2024-01-06 16:00:42,025 INFO MainThread Setting SDM120 meters electric registers [12, 72]
2024-01-06 16:00:42,025 INFO MainThread Setting SDM120 meters electric names [“Power”, “Energy”]
2024-01-06 16:00:42,025 INFO MainThread Setting SDM120 meters electric precision [1, 3]
2024-01-06 16:00:42,025 DEBUG MainThread Setting SDM120 pubchannels: [‘ToEmonCMS’]

But the SDM120 power meters are currently disconnected so it can’t pull any data

2024-01-06 16:00:52,347 INFO SDM120 Connecting to Modbus device=/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_B0019BLY-if00-port0 baud=9600 parity=none datatype=float

2024-01-06 16:01:01,164 ERROR SDM120 Could not read register @ 12: No communication with the instrument (no answer)

2024-01-06 16:01:02,268 ERROR SDM120 Could not read register @ 72: No communication with the instrument (no answer)
2024-01-06 16:01:02,369 ERROR SDM120 Could not read all registers

Given these general USB problems/inconsistencies could something gone wrong with the USB subsystem?

I have just connected the borrowed RS485-USB adapter and lo’ and behold I am now getting power meter data :slight_smile:

I wonder if connecting the adapter to the pulse outputs of the power meter somehow damaged it? (this had been original done by the installer)

I am now a happy bunny and ready to get on with optimising my new heat pump. The only positive side of this is that I have learned a lot more about RS485 and Emons. I am sure that will come in handy.

Thanks to those that have helped my journey so far.

2 Likes

Good to hear that you have resolved this!