No response from modbus slave 2, register 0

Hi

I have an Eastron SDM230 and SDM120 connected to my Pi via USB. SDM230 is slave 1, SDM120 is slave 2.

Readings are reported by Hassio regularly. The history graphs look acceptable.

Slave 2 is giving the error in the topic title for all the registers that I am polling all the time.

Configuration entry is:

# Modbus sensors in sensors.yaml
modbus:
  type: serial
  method: rtu
  port: /dev/ttyUSB0
  baudrate: 9600
  stopbits: 1
  bytesize: 8
  parity: N
  delay_between_queries: 50

Sensors in Sensors.yaml are:

#Modbus SDM120 ##########
- platform: modbus
  scan_interval: 30
  registers:
  - name: 'Solar Voltage'
    unit_of_measurement: Volts
    slave: 2
    register: 0
    register_type: input
    count: 2
    data_type: float
  - name: 'Solar Current'                                                    
    unit_of_measurement: Amps
    slave: 2                                                                
    register: 6
    register_type: input                                                        
    count: 2                                                                 
    data_type: float 
  - name: 'Solar Power'                                                    
    unit_of_measurement: Watts
    slave: 2                                                                
    register: 12
    register_type: input                                                        
    count: 2                                                                 
    data_type: float 
  - name: 'Solar Import Energy Raw'
    unit_of_measurement: kWh
    slave: 2                                                                
    register: 72
    register_type: input                                                        
    count: 2                                                                 
    data_type: float 
    precision: 2                                                             
    offset: 21326.51    

Does anyone have any idea why this is happening?

Thank you.

Hi, did you manage to get this resolved? I am experiencing exactly the same issue, I have four SDM120 Modbus sensors and they all seem to work fine, I am getting values in Hassio and the history graph looks ok. About 4 times per second I get the same warning as you got:

018-08-25 09:00:58 ERROR (SyncWorker_2) [custom_components.sensor.modbus1] No response from modbus slave 3, register 12

This happens for all of the sensors. I have been trying to change the “delay_between_queries” parameter in the modbus configuration but that does not seem to have any effect.

Thanks

I’m afraid that I have not resolved this issue yet.

I have a SDM230 as slave 1 and a SDM120 as slave 2.

The SDM230 works pperfectly and does not produce any errors.

It is only the SDM120 that produces errors.

Hi, ok… That is sad… Are you sure that it is related to the SDM120 and not to the fact that it is slave number 2? Because I have six SDM120s and I only get the error if I add more than one slave… If I am only reading from slave number 1 there are no errors… Maybe you can try to comment out reading from the SDM230 and see if you still get errors? I guess you have configured the baud rate, parity and stop bits to match on both the units?

I’ll try to remove the sdm230 and see what happens.

Mind you I do get readings from the sdm 120 just not all the time.

How did you configure 4 sdm120s then if not as slave 1, 2, 3, 4?

I have configured them as slave 1,2,3 and 4. And then I have added a section for each one of them in sensors.yaml. If I do it like that I get that same warning. For each of the sdm120s. But, if I comment out the section for slave 2, 3 and 4 I don’t get any warnings…

Tried the suggestions in this thread:

But it’s not working for me. I’m using a Modbus to USB dongle.

Perhaps it will work for you.

I am using a few SDM120s and I get errors from them as soon as I have more than one slave. Currently I am not sure if it is the SDM120s that are causing this or if it is home assistant…

There is a youtube video that describes how to setup these: https://www.youtube.com/watch?v=yBtqKSWDn1Q&t=1173s

But you probably know this already since you have changed to 9600 bps… If not, perhaps you can have a look at this video. He uses modbus poll and another tool that I don’t remember the name of.
I think both of these tools should be able to poll data from multiple modbus slaves. I would like to set it up like that and see if I can read all the registers from all the slaves with that tool. That way I might be able to figure out if this issue is caused by home assistant or by the slaves.

My other plan is to use a modbus gateway module, such as ADM-5850G, that converts from modbus serial interface to modbus TCP. I have bought one but not had time to test it out yet.

You might be having the same issue as I am, with the “No response from modbus slave” errors.

I created an issues report for it, but it doesn’t seem to have gotten much attention yet.

1 Like

Yes, that does indeed look very similar to the issue described by myself and PierreScerri.
Do you happen to know if this error is likely to go away if I use a serial to tcp modbus converter like the ADM-5850G or will I just be wasting my time trying that approach? Also, is there anything I can do to help out with getting this issue resolved?
Thanks

I’m not 100% sure. I would expect yes, it would, because the converter will be dealing with the RS485 interface and HA will only need to talk to a single Modbus TCP/IP device, which I haven’t seen any specific bug reports about. I just ordered one myself (this one) a few days ago to test that theory.

I would expect that any device designed to talk proper RS485 MB RTU would have no problems, because the protocol is pretty darn simple, comparatively. I also didn’t have any issue reading my modbus devices with industry standard tools, only the HA component seems to be the one failing here.

One caveat though, is that you will ONLY be able to read from that one device; at least that’s what I gather from this feature request. So you would not be able to have any more modbus TCP/IP devices that you want to read, and all other RS485 devices will have to all be connected to your one converter

Maybe comment in the github issue that you are also having this problem? Unless you’re a programmer yourself, we just need to get someone who is to look at it, as far as I can tell.

I’m not 100% sure. I would expect yes, it would, because the converter will be dealing with the RS485 interface and HA will only need to talk to a single Modbus TCP/IP device, which I haven’t seen any specific bug reports about. I just ordered one myself (this one ) a few days ago to test that theory.

Ok, I have now installed the RTU to TCP converter and there are no more errors.I do get a bunch of warnings instead:

2018-11-13 09:38:35 WARNING (MainThread) [homeassistant.components.sensor] Updating modbus1 sensor took longer than the scheduled update interval 0:00:01
2018-11-13 09:38:39 WARNING (MainThread) [homeassistant.components.sensor] Updating modbus1 sensor took longer than the scheduled update interval 0:00:01
2018-11-13 09:38:40 WARNING (MainThread) [homeassistant.components.sensor] Updating modbus1 sensor took longer than the scheduled update interval 0:00:01
2018-11-13 09:38:42 WARNING (MainThread) [homeassistant.components.sensor] Updating modbus1 sensor took longer than the scheduled update interval 0:00:01
2018-11-13 09:38:43 WARNING (MainThread) [homeassistant.components.sensor] Updating modbus1 sensor took longer than the scheduled update interval 0:00:01
2018-11-13 09:38:45 WARNING (MainThread) [homeassistant.components.sensor] Updating modbus1 sensor took longer than the scheduled update interval 0:00:01

But I have not managed to find anything wrong with the readings. I cranked up the scan_interval to 1 time per second and so far everything is ok.

One caveat though, is that you will ONLY be able to read from that one device; at least that’s what I gather from this feature request . So you would not be able to have any more modbus TCP/IP devices that you want to read, and all other RS485 devices will have to all be connected to your one converter

I am not so sure about that, I followed the instructions in the same feature request. and I now have two modbus TCP slaves talking to home assistant, I already have a PLC from earlier and now my new modbus converter which is using the custom modbus1.py, so far it seems to be working fine.

Maybe comment in the github issue that you are also having this problem? Unless you’re a programmer yourself, we just need to get someone who is to look at it, as far as I can tell.

Yeah, I will make an account in GitHub and comment.

so any progress with this matter?

Which matter are you referring to?

Modbus rtu performance…

ok…No, not for me… I have given up on this. I first converted to modbus TCP and that did solve a lot of the issues but I still had a bunch of warnings and it was not fast enough so I am now trying another approach:
I installed the hassio “node red” add on with “node-red-contrib-modbus” package. I can then poll modbus from node red and send to home assistant as MQTT sensor.
I just got it to work now, it’s not that hard to setup, but I haven’t transferred all the sensors over to node red. So far it seems to work fine, I can setup my modbus push buttons to be polled every 200 ms from node red and then just publish to a MQTT topic when state changes.

Can you please share settings??
So you mean mqtt server is talking to the modbus and answer home assistance?
And you defined mqtt switch?

Hi, yeah something like that. I don’t really know much about MQTT so I am trying to learn it now. I haven’t gotten to switches yet, so far I have received a reading from a temperature sensor using modbus flex getter in node red. I have then published that to my mosquitto MQTT broker (or server, I don’t know the terminology here). I have then created a MQTT sensor in home assistant which is receiving data from node red. This is working. I am going to try to create a switch next and see how that works. I don’t have anything useful to share at the moment, I suggest you have a look at this video first… they are using modbus read instead of flex getter, I am not sure what the difference is… I read somewhere that modbus flex getter is more stable but it is no problem to change later if you have issues.
Are you running hassio? If so, you can just go to the add on shop and add node red from the community add ons. And in the config you have to add the modbus package (“node-red-contrib-modbus”), like this:

“npm_packages”: [
“node-red-contrib-modbus”
],

If you can get your modbus sensors to update in node red that is about 50 % of the battle. The next step is to publish to home assistant, I might be able to help out with that once I have figured it out myself. And also, I have no guarantee that this will work, I just really hope that it will.

Anyone manage to resolve modbus response i am getting lots of errors…
About


Home Assistant
0.84.6

Path to configuration.yaml: /home/homeassistant/.homeassistant
81 Loaded Components

Developed by a bunch of awesome people.

Published under the Apache 2.0 license
Source: server — frontend-ui

Built using Python 3, Polymer, Icons by Google and MaterialDesignIcons.com.

Frontend JavaScript version: latest

Try out the new Lovelace UI

>> Set lovelace as default page on this device <<

No response from modbus slave 1, register 1

1:07 PM components/sensor/modbus.py (ERROR)

Updating modbus sensor took longer than the scheduled update interval 0:00:01

1:06 PM helpers/entity_platform.py (WARNING)

Updating modbus sensor took longer than the scheduled update interval 0:00:01

1:06 PM helpers/entity_platform.py (WARNING)

No response from modbus slave 10 coil 4

1:06 PM components/switch/modbus.py (ERROR)

Updating modbus switch took longer than the scheduled update interval 0:00:30

1:06 PM helpers/entity_platform.py (WARNING)

Updating modbus sensor took longer than the scheduled update interval 0:00:01

1:06 PM helpers/entity_platform.py (WARNING)

Updating modbus sensor took longer than the scheduled update interval 0:00:01

1:06 PM helpers/entity_platform.py (WARNING)

No response from modbus slave 1, register 10

1:06 PM components/sensor/modbus.py (ERROR)

Someone must know about this matter no??..