-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USB to RS485 adapter issues? #10
Comments
I had simular output here. Check your connections and make sure you are using the correct device in linux. I believe USB to serial converters should generally be /dev/ttyUSBx in most distros. Maybe unplug the device and reconnect it and compare the |
Thanks for the reply. The dev entry is definitely ^ is from Home Assistant. Using a vanilla RasberryPI OS image adding/removing tht USB cable makes So it's definitely the "correct" logical device, but I'm not sure the USB device is completely correct for this purpose. The fact it's AMA (from a bit of Googling) suggests it might not be a serial console like I'm thinking it is (it was a punt based on availability on ebay) - https://arduino.stackexchange.com/questions/19648/difference-between-dev-ttyacm0-and-dev-ttys0-arduino-ide-ports-under-linux
Which probably means I should stop wasting time on it :). Especially as what should be the right device should be here tomorrow. At what it cost, it's probably not even worth bothering to return with the cost of the return postage... Will follow up again tomorrow when the delivery person has been! |
I guess at this point, my only feedback might this part of the code might benefit from a bit better error handling. Trap it and show a better error message, before showing the stack trace anyway |
Will improve that error if it fails on reading the serial number! |
Yay, so with https://smile.amazon.co.uk/dp/B06Y1JTGZX and me making up a new (longer) cable.. it works! Just need to try and work out the dashboards/sensors now (I'm new to HA too)... |
Seem to be having similar issues to #13 even only with 1 or 2 sensors
And then the logs...
|
Same on
|
And after dea9864
Think I need to turn up the debug settings |
With
Ok... So with DEBUG enabled, things work? This is obviously good, but a bit strange... Some race type conditions, and debug mode helps there? Any ideas @kellerza? :) |
Logs get truncated quite quickly..
But...
And more...
|
What happens with only battery_voltage as a start. Frist try without debug and then enable it later |
As per #10 (comment)
These without debug mode didn't work. See #10 (comment) and then with I'll try just |
Just
etc etc. Adding back
|
Ok, try to update in 5 min when the CI/CD job is finished and then at least debugging should work better |
Looks like it was fairly consistenly getting values overnight. Just updated to Without debug enabled, it's still regularly timing out it seems
Lets turn debug back on now... |
I still don't like your Timeouts, it seems to occur way too often! I probably get <5 a day... Can you try do this through the mbusd bridge addon? Things to check on your cable:
Another thing might be to try another RS485 converter, like this with pin 3 to ground |
I can try to get the mbusd addon up and running.
Nope. Experience has told me not to bother doing stuff like that until you know it's all working. The cable currently goes out the front of the inverter (the removeable panel is off), into the USB adapter plugged into the RPI sat on top of a grounded metal cabinet, so nowhere near any DC or AC cables. Cable is definitely twisted pair (see photos in #14 same for cable out of inverter setup) Crimp seems to be fine, has continuity. I'm not sure if it is good quality cable. It's CAT5e, and the tail end of the box I've been using on and off for a while. I do have some (much newer) external grade CAT5e I can try making a cable up from instead. Electricians used cable from the same reel to do the inverter <-> battery communication cable. The plugs I know are of decent quality. Haven't got any shielded cable (currently). Happy to try another converter if I can find somewhere to source one... That one ordered from ZA isn't that bad price wise, just shy of 245 ZAR shipped to the UK (though, I'm not sure it's actually delivery to the UK - That or finding a similar FTDI one (ie "known good brand") somewhere.... |
That seems to be better! It just uses a C implementation to do the RS485 comms, the external pymodbus might be 100% python |
Logs are generally quieter too..
|
Modbus is still identical
|
Maybe this converter? Can you try measure if there is voltage difference between the inverter ground (pin 3 on the rj-45 likely orange-white?) and the USB ground (maybe you can try measure to the metal shield) The only other option I can think of is to increase the retry timer on mbusd (but its not configurable today) |
Thanks for digging it up. Ordered, should be here in a month... |
@reedy you should also try the (dev) version of the addon for improved read&reconnects |
Issue related to
[ ] New Sensors / Sensors not working (existing definitions available here)
[x] Sunsynk Home Assistant Add-On
[ ] mbusd Home Assistant Add-On
[ ] Python sunsynk library
Describe the issue/bug
Not so much a bug (necessarily), but I guess a support request.
Recently had a Sunsynk 3.6 kWh inverter installed.
I bought one of https://www.ebay.co.uk/itm/393575748700 "RS485-150U" hoping it would work (being premade), but when starting the addon it seems to timeout.
I don't know if it's due to the wrong pinout on the RJ45 end, but I did try
/dev/ttyACM0
,/dev/ttyAMA0
and/dev/serial1
; all of which failed similarly.I have plugged it into the BMS485 (top left) port; it seems for a lot of things the 5.5 and 3.6 are similar.
Got a different adapter coming tomorrow from Amazon - https://smile.amazon.co.uk/dp/B06Y1JTGZX which will make it easier to make sure the pinout is right, so this request might be invalid at that point...
Trying to avoid having to shell out for one of https://solar-assistant.io/shop/products/sunsynk_rs485
Happy to try a few other things (and/or doing this outside Home Assistant.. On a vanilla Ubunutu/Raspberry Pi OS/Debian rpi install), such as the library as a standalone if it helps.
Thanks!
Expected behavior
Not crash on startup? :)
Home Assistant version (if applicable)
2022.2.0
Additional context
Add any other context about the problem here.
Logs
The text was updated successfully, but these errors were encountered: