Closed danieltorkian closed 3 months ago
Hi Daniel, ok, thanks for that. I've not been able to test the RS485 binding for the JK so its good if your willing to help me test it and get it up and running. I will update the code to fix that exception and then we can go from that. Could you also please set the log level to debug please to get more information?
sure thing
this my config: bms.pollInterval=1
bms.1.type=JK_RS485 bms.1.id=1 bms.1.portLocator=/dev/ttyAMA0 bms.1.delayAfterNoBytes=2000
###################################################################
###################################################################
inverter.type=SOLARK_CAN
inverter.portLocator=can0
inverter.sendInterval=1
I use SEENGREAT RS485-Dual-CAN-I and also tested two RS485-USB Dongles with same results....
Hi Daniel,
I fixed the exception above.
Could you set the log level to debug and do a Clean install from the Configurator app please and test again?
I also adjusted the Configurator
app to produce a log file configuration that doesn't log all the useless information at startup, so you might want to get the new Configurator too.
Hi Thank you! I tried again but still getting an error. See logs. BMS-to-Inverter.log
can you please give me the permissions to push a branch and request a PR????
Hi Daniel, I've added iterating through all commands and error handling in case no data was received. The program will delay (Delay after no bytes received setting) a short time and try to read again. If no bytes are received for over 10x then it will try the next command.
Could you please Clean install with the Configurator and lets see if we get any responses.
Hey Torsten, CRC calculation of spec is wrong.... See according branch. Next step would be to convert the values from response to Battery_Object according to the spec.
Hi Daniel, thanks for your contribution. I merged your code with some minor changes. I skipped the lombok framework (I know its nice) but I'd like to keep the footprint as small as possible. I was thinking about requesting all values at once, but kept it consistent with the other bindings. But it will be more performant this way so I kept it :)
I did however change some of your code to read the frames. Maybe you like to have a look and see if I didn't miss anything critical.
Can you get any readings from the JK now?
@danieltorkian could you try a Clean install from the Configurator application and test the JK binding?
I will close this issue, since the JK RS485 binding is working now
2024-03-14 18:46:34.633 | INFO | Thread-2 | verter.BmsToInverter:164 | Reading BMS #1 JK_RS485 on /dev/ttyAMA0... 2024-03-14 18:46:34.645 | INFO | Thread-2 | stoinverter.core.BMS:120 | ---------------------------------> Thread 44 2024-03-14 18:46:34.647 | ERROR | Thread-2 | stoinverter.core.BMS:139 | Error requesting data! java.lang.UnsupportedOperationException: null at java.nio.ByteBuffer.array(ByteBuffer.java:1471) ~[?:?] at com.airepublic.bmstoinverter.protocol.rs485.JSerialCommPort.sendFrame(JSerialCommPort.java:115) ~[protocol-rs485-0.0.1-SNAPSHOT.jar:?] at com.airepublic.bmstoinverter.bms.jk.rs485.JKBmsRS485Processor.collectData(JKBmsRS485Processor.java:27) ~[bms-jk-rs485-0.0.1-SNAPSHOT.jar:?] at com.airepublic.bmstoinverter.core.BMS.process(BMS.java:127) ~[core-api-0.0.1-SNAPSHOT.jar:?] at com.airepublic.bmstoinverter.BmsToInverter.lambda$start$2(BmsToInverter.java:165) ~[bms-to-inverter-main-0.0.1-SNAPSHOT.jar:?] at java.lang.Thread.run(Thread.java:840) [?:?]