AdamWelchUK / NodeRedEPEverDashboard

A node red based dashboard for most EPEver/EPSolar solar charge controllers.
68 stars 25 forks source link

Problem with configuration modbus-client #18

Open geophys-hub opened 2 years ago

geophys-hub commented 2 years ago

Hello Adam, thank you for your hard work. I have a connection problem. I am using epever tracer 3210an, a RS485 USB cable and a RASPI 3b. I installed Node-Red yesterday following your instructions. But unfortunately I can't get in touch with EPEver. Here is the event in /var/log/daemon.log: { Mar 20 16:00:50 rpi3 Node-RED[410]: payload: { Mar 20 16:00:50 rpi3 Node-RED[410]: value: undefined, Mar 20 16:00:50 rpi3 Node-RED[410]: unitid: 1, Mar 20 16:00:50 rpi3 Node-RED[410]: fc: 4, Mar 20 16:00:50 rpi3 Node-RED[410]: address: 12544, Mar 20 16:00:50 rpi3 Node-RED[410]: quantity: 18, Mar 20 16:00:50 rpi3 Node-RED[410]: emptyMsgOnFail: true, Mar 20 16:00:50 rpi3 Node-RED[410]: keepMsgProperties: true, Mar 20 16:00:50 rpi3 Node-RED[410]: messageId: new ObjectId("623741a2fcca8f991afd26ab") Mar 20 16:00:50 rpi3 Node-RED[410]: }, Mar 20 16:00:50 rpi3 Node-RED[410]: topic: 'livestats', Mar 20 16:00:50 rpi3 Node-RED[410]: _msgid: 'e897b8b8ad8aa219', Mar 20 16:00:50 rpi3 Node-RED[410]: messageId: new ObjectId("623741a2fcca8f991afd26ab"), Mar 20 16:00:50 rpi3 Node-RED[410]: error: { Mar 20 16:00:50 rpi3 Node-RED[410]: message: 'Error: Client Not Ready To Read At State reconnecting', Mar 20 16:00:50 rpi3 Node-RED[410]: source: { Mar 20 16:00:50 rpi3 Node-RED[410]: id: '2c18fdaf.8153d2', Mar 20 16:00:50 rpi3 Node-RED[410]: type: 'modbus-flex-getter', Mar 20 16:00:50 rpi3 Node-RED[410]: name: 'Modbus Get', Mar 20 16:00:50 rpi3 Node-RED[410]: count: 1 Mar 20 16:00:50 rpi3 Node-RED[410]: }, Mar 20 16:00:50 rpi3 Node-RED[410]: stack: 'Error: Client Not Ready To Read At State reconnecting\n' + Mar 20 16:00:50 rpi3 Node-RED[410]: ' at Object. (/home/pi/.node-red/node_modules/node-red-contrib-modbus/modbus/maps/modbus-client.js:472:15)\n' + Mar 20 16:00:50 rpi3 Node-RED[410]: ' at Object.emit (events.js:314:20)\n' + Mar 20 16:00:50 rpi3 Node-RED[410]: ' at Object.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:185:20)\n' + Mar 20 16:00:50 rpi3 Node-RED[410]: ' at Object._inputCallback (/home/pi/.node-red/node_modules/node-red-contrib-modbus/modbus/maps/modbus-flex-getter.js:146:21)\n' + Mar 20 16:00:50 rpi3 Node-RED[410]: ' at /usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:207:26\n' + Mar 20 16:00:50 rpi3 Node-RED[410]: ' at Object.trigger (/usr/lib/node_modules/node-red/node_modules/@node-red/util/lib/hooks.js:149:13)\n' + Mar 20 16:00:50 rpi3 Node-RED[410]: ' at Object.Node._emitInput (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:199:11)\n' + Mar 20 16:00:50 rpi3 Node-RED[410]: ' at Object.Node.emit (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:183:25)\n' + Mar 20 16:00:50 rpi3 Node-RED[410]: ' at Object.Node.receive (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:482:10)\n' + Mar 20 16:00:50 rpi3 Node-RED[410]: ' at Immediate._onImmediate (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:814:52)' Mar 20 16:00:50 rpi3 Node-RED[410]: } Mar 20 16:00:50 rpi3 Node-RED[410]: }


I configured the modbus clients as follows:

Bildschirmfoto vom 2022-03-20 16-04-45

My cable is recognized, a driver is loaded. I checked that with lsusb and in dmesg.

Can you spot an error in the screenshot?

Many thanks in advance

Frank

kedar-1 commented 2 years ago

I have the same tracer. You must use xr_usb driver. Follow the step by step guide: https://stackoverflow.com/questions/57313343/modbus-cant-read-data-from-epever-tracer-1210a-to-raspberry

geophys-hub commented 2 years ago

I was able to install the RX driver thanks to your hint! Many thanks for this!

Here the new error-log in /var/log/daemon.log:

Mar 21 13:17:12 rpi3 Node-RED[409]: 21 Mar 13:17:12 - [error] [modbus-flex-getter:Modbus Get] Error: Client Not Ready To Read At State reconnecting Mar 21 13:17:13 rpi3 Node-RED[409]: 21 Mar 13:17:13 - [error] [modbus-flex-getter:Modbus Get] Error: Client Not Ready To Read At State init Mar 21 13:17:14 rpi3 Node-RED[409]: 21 Mar 13:17:14 - [error] [modbus-flex-getter:Modbus Get] Error: Client Not Ready To Read At State init Mar 21 13:17:15 rpi3 Node-RED[409]: 21 Mar 13:17:15 - [error] [modbus-flex-getter:Modbus Get] Error: Client Not Ready To Read At State reconnecting Mar 21 13:17:17 rpi3 Node-RED[409]: 21 Mar 13:17:17 - [error] [modbus-flex-getter:Modbus Get] Error: Client Not Ready To Read At State init Mar 21 13:17:17 rpi3 Node-RED[409]: 21 Mar 13:17:17 - [warn] [modbus-flex-getter:Modbus Get] Modbus Failure On State sending Get More About It By Logging Mar 21 13:17:17 rpi3 Node-RED[409]: 21 Mar 13:17:17 - [warn] [modbus-flex-getter:Modbus Get] Modbus Failure On State sending Get More About It By Logging Mar 21 13:17:17 rpi3 Node-RED[409]: 21 Mar 13:17:17 - [error] [modbus-flex-getter:Modbus Get] Error: Timed out

There are the settings: Bildschirmfoto vom 2022-03-21 13-22-25

Device ttyXRUSB0 is ready!

root@rpi3:~# ls /dev/tty* /dev/tty /dev/tty12 /dev/tty17 /dev/tty21 /dev/tty26 /dev/tty30 /dev/tty35 /dev/tty4 /dev/tty44 /dev/tty49 /dev/tty53 /dev/tty58 /dev/tty62 /dev/ttyAMA0 /dev/tty0 /dev/tty13 /dev/tty18 /dev/tty22 /dev/tty27 /dev/tty31 /dev/tty36 /dev/tty40 /dev/tty45 /dev/tty5 /dev/tty54 /dev/tty59 /dev/tty63 /dev/ttyprintk /dev/tty1 /dev/tty14 /dev/tty19 /dev/tty23 /dev/tty28 /dev/tty32 /dev/tty37 /dev/tty41 /dev/tty46 /dev/tty50 /dev/tty55 /dev/tty6 /dev/tty7 /dev/ttyXRUSB0 /dev/tty10 /dev/tty15 /dev/tty2 /dev/tty24 /dev/tty29 /dev/tty33 /dev/tty38 /dev/tty42 /dev/tty47 /dev/tty51 /dev/tty56 /dev/tty60 /dev/tty8 /dev/tty11 /dev/tty16 /dev/tty20 /dev/tty25 /dev/tty3 /dev/tty34 /dev/tty39 /dev/tty43 /dev/tty48 /dev/tty52 /dev/tty57 /dev/tty61 /dev/tty9 root@rpi3:~#

The XR driver is loaded: dmesg | grep usb ... [ 9.374491] xr_usb_serial_common: Exar USB UART (serial port) driver ...

Thank you for your quick help.

geophys-hub commented 2 years ago

That also makes me think...

Bildschirmfoto vom 2022-03-21 14-02-10

geophys-hub commented 2 years ago

Bildschirmfoto vom 2022-03-21 14-04-31 Do I have the correct cable to read out?

geophys-hub commented 2 years ago

The Python Test Script PROBLEM is SOLVED!

The problem sat 30 cm in front of the screen! I had defined the device /dev/ttyRXUSB0. That was incorrect! /dev/ttyXRUSB0 is correct ;)

Bildschirmfoto vom 2022-03-21 14-51-14

Now, the testscript works fine

Laurieralma commented 2 years ago

Screenshot_20220321-095044_Amazon Wich std rj45 pin 4 blue on -, pin 6 green on + Screenshot_20220320-122555_Firefox

geophys-hub commented 2 years ago

Thanks! But i have the cable from the manual ... CC...150 The python Test Script work fine. The cable is ok. The problem should be my node-red configuration ...

Bildschirmfoto vom 2022-03-21 15-14-41

geophys-hub commented 2 years ago

Question: I rename all 3 Modbus-Flex-Getter --> Servername "Tracer_3210_AN" I have the same USB-configuration. The name for this is for all USB0. Now, all three Modbus-Flex-Getter are active, but now is the error message in daemon.log

"message: "TypeError: Cannot read property 'lastUpdatedAt' of null",

I probably did it completely wrong ...

geophys-hub commented 2 years ago

If I don't find it I'll reinstall the raspi image and node-red too.

The real problem was actually the missing XR driver as Adam wrote.

kedar-1 commented 2 years ago

Change the type of Modbus server to "Serial" from "Serial Expert". My setup is working without modbus read issues over six months.

mmsfla commented 2 years ago

The problem could be changes in the register addresses and function code of the newly purchased EPEver Tracer 3210AN.

I found references to this while researching.

If someone has the same problem, they can have a look here:

https://github.com/rosswarren/epevermodbus

After installing you find in folder ./epevermodbus driver.py. Compares the parameters used there.

mitchross commented 2 years ago

@mmsfla if you are still stuck I wrote up a step by step foolproof guide. https://medium.com/@mitchross09/solar-energy-monitoring-with-raspberry-pi-and-node-red-ed59e287cdd4

TalShaf93 commented 1 year ago

for some reason after I remove the CDC-ACM driver and installing the driver I can't find the /dev/ttyXRUSB0. I tried it many times in different orders but same result.

anyone can help?

thanks in advance

terminal image with no /dev/ttyXRUSB0