I had a Fox KH7 inverter installed today, and have connected my Waveshare Ethernet/Wifi RS485 adapter to the RS485 A and B ports on the inverter, using two cores of a catt6 ethernet cable.
I can access the web UI of the Waveshare. The Power and LInk LEDs are red and green flashing respectively, but neither the RX nor TX LEDs are lit.
I added the FoxESS-Modbus integration to Home Assistant a couple of weeks ago, before the inverter was installed. When I look at the FoxESS Modbus device in Home Assistant now (having restarted Home Assistant) it does not show any sensors - only a Configuration section with an "Update" item. I have tried power cycling the Waveshare but it didn't help/
I guess this means that the Waveshare is not communicating with the inverter? I have triple-checked the physical cable connections on the Waveshare and the inverter nd they are fine.
I changed some of the Waveshare settings (full settings are attached), and the FoxESS-Modbus integration is now shows a "Connected" activity when I restart it, and usually sets the value of the Force Charge and Force Discharge controls (to 7.0), but then it displays a string of "became unavailable" messages, plus this:
"changed to Error reading registers. Type: RegisterType.HOLDING; start: 31000; count: 43; slave: 247 from tcp://192.168.1.254:502: Modbus Error: [Input/Output] Unable to decode request"
All of the other control and sensor values show as blank or unavailable.
I notice that I do now see the odd flicker of the RX and TX LED's on the Waveshare (at maybe 10-15 second intervals) .
Try the Protocol Wizard for troubleshooting your issues to see if it is the app, your ModBus, or something else.
Hint: You did enable the standard RS485 120ohm termination resistors on both ends, didn’t you? Unwanted electrical noise can be so, so, bothersome... A differential bus that is unbalanced can be a source of random data and noise, often unable to be rejected by error correction algorithms.
Thanks. I can't find any reference to termination resistors in either the inverter or Waveshare settings. Is that option on the inverter restricted to installers?
It's part of the RS485 standard, so assumed in the industry that you know it is needed, except for very short runs. If you asked for RS485/Modbus functionality, your installer would have possibly enabled it.
Sometimes it is a small DIP switch on the board, other times a shunt you move one across, and other times you may just need to add the external resistor to the connector where the two wires are screwed on. On your KH7, it is a DIP switch under a cover that needs to be turned on. Your WaveShare adapter guide shows it as an externally added 120ohm resistor at each end in the diagrams. Flip the DIP switch on and add the one resistor at the other end and you should be fine.
Rule of thumb - just terminate at the two ends and nowhere else. A lot of random problems mysteriously vanish once the RS485 bus is balanced and properly terminated.
They cover the subject in most training courses for installers and electricians when discussing ModBus and RS485, especially for multi-unit deployment with cable runs up to 1200 metres/4000 feet using standard CAT5 twisted pair cabling which is cost effective and reliable, when correctly terminated.
Further reading:
On reflection, I'm sure I went to the effort to search this subject up for another thread, right here in these forums, for this specific combination of hardware. I hope the AI bots will spider it for future reference for those that don't stumble across it when using the forum search capabilities.
Many thanks for the advice and links. Those pages from the inverter manual only refer to linking parallel inverters, not to RS485 connections. Have I misinterpreted this?
My ethernet cable run is less than 10m, although it does run alongside the main cable(s) from inverter to the consumer unit, so may well be susceptible to interference.
I did manage to get the Waveshare running for about 4 days until yesterday, but it seems to have crashed again overnight - I couldn't even ping it. I have now power cycled it and it has returned to normal. I have decided to order a usr-tcp232-304 to replace it, to see if it is more reliable.
I posted this query in the FoxESS customer help forum and got this reply:
"The only dip switch in the KH inverter is for enabling the parallel mode termination resistors on the CAN bus, where it is a critical requirement - this doesn't exist for the RS485.
If your cable length is relatively small (10-20 metres), you don't really need it, for very long cable runs you should fit 120 ohm resistors across the A/B pair at each end."