Open guest715 opened 5 years ago
Make sure you have the right device id encoded in the message and the checksum matches the payload. I connect to the inverter from a raspi via a cheap usb RS 485 device. Works.
Hi @danho-san, thanks for responding to my issue submission. When you refer to the device id, are you referring to the Bluetooth id that is configurable on the inverter between 1 and 99 and not the MAC address of the inverter? If so, my inverter is configured with the default value of 1. Should this work without any changes to solar_poller.pl and/or config.ini? If it’s the MAC address, I’m specifying the correct MAC address in the rfcomm connect command, where I’m also specifying the correct device id of 1, and in the pincodes file in /var/lib/bluetooth/\<MAC address of Bluetooth adapter in my Ubuntu machine>.
MAC should not be relevant here. It's the device ID. The device ID is the 2nd byte in the message and the checksum at the end of the message needs to be correct. All the examples in the ginlong interface document have ID 02 in the messages. Like here: 7E 02 A1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 A3 So, that could have been a source of error.
Hi @danho-san, thanks again for your reply. My inverter is configured with a device id of 1 and, looking at config.ini, by default solar_poller.pl sends a message with the correct device id (Slave address) and corresponding checksum (Check bit) so it would seem the content of the message solar_poller.pl is sending to my inverter might not be the cause of my problem:
7E 01 A1 ... A2
I’ve been having difficulty getting this to work with my Eko (rebranded Ginlong) inverter. In short, it connects, sends the magic sequence but never receives the expected response. If I enable debug in config.ini, the debug output indicates it never receives anything back from the inverter. I know the inverter works via Bluetooth because the Ginlong Power Monitor application (https://web.archive.org/web/20160605130524/http://www.ginlong.com/Download/down/id/13.html or https://web.archive.org/web/20170606105859/http://www.ginlong.com/Download/down/id/227.html) works in Windows (I’m running solar_poller.pl within Ubuntu). I’m wondering if the magic sequence is never reaching the inverter because what is written by the writeToPort function is buffered and not flushed? If this is the case, perhaps it’s necessary to call the $serial->write_done(0) and/or $serial->write_drain functions after the $serial->write($writeStr) call within the writeToPort function?
Here’s some notes on what I’ve done so far in case it helps anyone else: