I know its been done before, but I figured Id play around myself programming communication to my Elk M1 through the M1EXP.
Ive been able to successfully open the port and send a command, that all works fine. Where Im stuck is writing a function to determine the checksum portion of the message string.
Im following Elks protocol doc, and cutting the C code over to Java (it should be the same/similar) but for the life of me the check digits arent coming out correct. On top of that, I took a look at the Elk::M1 Perl module, and they seem to be computing the check digit differently than the Elk protocol doc. Either version I cannot get to work for some reason. Im basically adding up the ASCII codes of the message (tried it with and without the first two characters denoting the length of the string), bitwise AND-ing it and adding 1 (per the Elk doc). I think the disconnect is in the "NibToAsc" portion, which incidentally doesnt seem to be anywhere in the Elk::M1 Perl module......which makes me wonder what I might be doing wrong.
Anyone out there gone through this and had similar issues? Or maybe example code that DOES work?
Thanks in advance.
-Chris
Ive been able to successfully open the port and send a command, that all works fine. Where Im stuck is writing a function to determine the checksum portion of the message string.
Im following Elks protocol doc, and cutting the C code over to Java (it should be the same/similar) but for the life of me the check digits arent coming out correct. On top of that, I took a look at the Elk::M1 Perl module, and they seem to be computing the check digit differently than the Elk protocol doc. Either version I cannot get to work for some reason. Im basically adding up the ASCII codes of the message (tried it with and without the first two characters denoting the length of the string), bitwise AND-ing it and adding 1 (per the Elk doc). I think the disconnect is in the "NibToAsc" portion, which incidentally doesnt seem to be anywhere in the Elk::M1 Perl module......which makes me wonder what I might be doing wrong.
Anyone out there gone through this and had similar issues? Or maybe example code that DOES work?
Thanks in advance.
-Chris