mvines / sainsmart-relay16

SainSmart 16-channel USB-HID programmable relay controller
MIT License
15 stars 7 forks source link

General Inquiry #11

Open DirkRussellG opened 6 years ago

DirkRussellG commented 6 years ago

Hi. I'm on MacOS and I installed your program and it works perfectly. I purchased this module only then to realize there is no useful documentation and I think it's amazing that you were able to reverse engineer it. I see where two others have taken your work and implemented to java and python. I am looking to implement in xojo. It's kind of a little beyond me but I'm trying to decipher your code to see what I can apply to my programming. My basic question is (as a starting point to see if I can get this working) can you just open a connection to the device and send a write command to activate a relay? Not reading anything first or checking device state, just send a write? I think I am successfully sending data to the device but it isn't doing anything, I think I have no idea what the packet structure should look like. Thanking you in advance for your consideration. Thanks, Dirk

DirkRussellG commented 6 years ago

actually I sniffed your output and figured it out, your work is amazing, how you figured out the checksum is pretty amazing too, I'm only looking at the decimal output so I haven't worked that out yet but thank you, this relay would be worthless without your work...thanks

mvines commented 6 years ago

Cool, I'm glad you find this project helpful. I unfortunately don't know much about xojo so all the best with that.

DirkRussellG commented 6 years ago

Thank you for your work. I just finished implementing your code into xojo. Everything works perfect. There no possible way anyone could have ever figured this out with the available documentation. I never heard of Bitwise operators before, I'm a noob, so that absolutely blew me away, so cool. One thing yours does (mine too) is when you send an "off" when it's already off it turns on. I want my button to toggle anyways so it works for me but I'm digging in to see whats going on there. Thanks again so much for sharing your code, thank you.