MaffooClock / SerialRenogy

A NodeJS utility to retrieve data from a Renogy solar controllers via RS-232 and serve it as a Prometheus metrics endpoint for display in Grafana.
MIT License
2 stars 0 forks source link

TransactionTimedOutError/32165 #2

Closed oBorks closed 4 months ago

oBorks commented 5 months ago

I found your project through your review on Amazon for the cable I bought to connect our Wanderer to a Raspberry Pi Zero 2 W.

image

On both your project and the one it's based on I receive this error. I had a similar issue on renogymodbus when the slave channel was set to the default. However after searching for the channel, I found my Wanderer's channel is 16 and was able to read the data on that channel. I'm wondering if the issue is the channel, and if so is there any way I can specify the correct one?

MaffooClock commented 4 months ago

I'm wondering if the issue is the channel, and if so is there any way I can specify the correct one?

Sounds like you identified the issue exactly.

Looks like the way to do this with the modbus-serial library is with setID(), which defaults to 1 if it isn't explicitly set.

I can easily add in an option to allow the device ID to be specified...

oBorks commented 4 months ago

Much appreciated.

MaffooClock commented 4 months ago

I added a comment a few hours ago (just moments before yours), and I see my comment is gone 😳. Not sure if something happened, or if I'm losing my mind...

So, here's what I thought I said earlier:

I've added an argument that will let you specify a device ID if the default "1" doesn't work. I tested it on my live system, first without specifying the argument, which worked. Then I tested a second time, but I added -d 99 to specify a bogus device ID, and it failed with TransactionTimedOutError as expected. So, it seems this is working.

So, if you'll test with serial-renogy -s /dev/ttyUSB0 -d 16 and confirm, I'll close this issue.

oBorks commented 4 months ago

That worked perfectly. Had to bash my head around getting Prometheus and Grafana set up since I was originally only going to use MQTT to pull the data into Home Assistant with the NodeRenogy project, but with your change I was able to successfully get the data into the Grafana addon for Home assistant.

image

This will probably be a nicer solution for us than cluttering the main Home Assistant dashboard with more data anyway.

MaffooClock commented 4 months ago

Awesome!