AnonymousInactiveJuly 11, 2007 at 9:50 pmPost count: 20
Does the Get Sensor Value command 0x4A only pertain to the analog and 1 wire sensors?AnonymousInactiveJuly 12, 2007 at 10:08 pmPost count: 256
Actually, only to the 1-wire (8-bit value returned)AnonymousInactiveAugust 31, 2007 at 7:48 pmPost count: 20
So what command do I use to get the analog sensor values? I guess I could use the peek. Is that the only mechanism?AnonymousInactiveSeptember 1, 2007 at 5:13 amPost count: 256
You must use peek/poke into locations starting at 0x4C (see command set document). Each analog input is 2 bytes. On the other hand, commad 0x4A returnd the value of a sensor in the 1-wire bus as 1 byte.AnonymousInactiveSeptember 1, 2007 at 8:11 pmPost count: 35
I’ve had success sending 0x49,0x00 to the 2×4. The reply’s CMD2 is a bitmask with the states of the inputs. I haven’t worked with I3 and I4 yet, either analog or digital, so I don’t know if they’re included in the bitmask.
Here’s what my software does at startup to find out the current state of I1 and I2:
Send an Insteon DIRECT message, Cmd1 = 0x49, Cmd2 = 0x00.
Receive an Insteon DIRECT reply, Cmd1 = 0x49, Cmd2 = bitmask.
Examine the bitmask — bit 1 represents I1, bit 2 represents I2 (and, I assume, but haven’t tested, that bits 3 and 4 represent I3 and I4).
Another undocumented oddity of the 2×4: broadcasts and DIRECT responses with all ones in the high nibble (i.e., 0xF0 through 0xF2) represent the states of the relays.
So, when I get a message, I check to see if Cmd2 is greater than 0x7f (just to be safe and generic), and if so, mask off the top and use the bottom nibble as a bitmask to obtain the states of the two relays. If none of the high nibble bits are set, I assume it’s a bitmask for the inputs.
So far, this has worked quite reliably. Later today, I plan to use a pull-up resistor and get I3 and I4 working (in digital mode) with dry contacts. If those also report their statsus correctly, I’m done.AnonymousInactiveSeptember 4, 2007 at 7:30 pmPost count: 20
You must use peek/poke into locations starting at 0x4C (see command set document). Each analog input is 2 bytes. On the other hand, commad 0x4A returnd the value of a sensor in the 1-wire bus as 1 byte.
Which location contains which value (i.e. which one is the LSB)?
- You must be logged in to reply to this topic.