Open lluiscab opened 3 years ago
I think your serial connection might not be 100% reliable. For the same TX command, you receive 3 different responses:
RX: 02 00 60 f0 0010 0000 .... .0000 0110 0000 ... 1111 0000
RX: 02 00 03 00 f0 0010 0000 0000 0000 0011 0000 0000 1111 0000
RX: 02 00 60 f0 0010 0000 .... .0000 0110 0000 ... 1111 0000
The second one looks mostly correct, but the other two don't.
For clarity I've put the binary encoding next to each packet, and you can see roughly 8 bits have been dropped (NOTE: I haven't shown the 9th bit in each byte)
Do you have a logic analyzer or oscilloscope handy?
If you loop back RX & TX, can you send and receive the same data? (Disconnect the MATE from the opto-isolator, connect RX & TX together, provide 24V, and open the serial port in a terminal program and try typing - do you see any dropped chars?)
Also just realised I'd never merged in the fix for issue 22, but should be there now. I don't believe that's the cause of what you're seeing however...
I unfortunately do not have any logic analyzer or oscilloscope to use, I'm not quite there yet.
I'll try to test the circuit looping back RX & TX and I'll get back to you once that test is complete.
Hi,
Finally got time to try this out
If you loop back RX & TX, can you send and receive the same data? (Disconnect the MATE from the opto-isolator, connect RX & TX together, provide 24V, and open the serial port in a terminal program and try typing - do you see any dropped chars?)
I have looped the corresponding RX & TX cables on the ethernet cable that I'm using and provided 24V. By running the test script in debug mode I can see that any data that's send is correctly received back.
Send [Port0, Type=0x02, Addr=0x0000, Param=0x0000] TX: [1] 00 TX: [0] 02 00 00 00 00 00 02 RX: 00 02 00 00 00 00 00 02
I have also used the linux screen
utility to further try with all sorts of characters and everything seems to be working correctly (I event sent a paragraph of lorem ipsum and got it back perfectly)
I think this removes the adapter not properly working as a possible cause, but I'm not 100% sure as I'm testing on my "lab" and not on the install location, there might be something there that's causing interferences that I'm not aware of.
If that's not the case, then the only other option I can think of is that my MATE unit has a different protocol or something along this line.
Hi,
I'm trying to use this library with a FlexMax 60 charge controller.
Unfortunately I seem to be stuck on an infinite "Invalid checksum" error cycle which I assume might be related to #22
This is the code that I'm currently running
And this is the output I'm getting
As you can see in the second attempt, I get the response
02 00 03 00 f0
which to me looks to be what I'd expect (from reading the protocol spec),02
indicating a read command response,00 03
indicating an MX unit and00 f0
as the checksum, even tho it seems to be invalid as I'd expect it to be00 05
from what I can see from the docs, but neither the checksum from the unit nor the expected checksum seem to be valid.I would appreciate any help on this.
Thanks