I don’t manage to get the relay status of a VMB4RY via code, I can get the name of the relay ok, but not the status.
Code:
packet.Address = 0x00; // change this address to reflect your setup
packet.Priority = PacketPriority.Low; // low priority command
packet.DataSize = 2; // 2 data bytes
packet.Command = 0xFA; // Command "Get Status"
packet[1] = 0x01; // We want to get status on Relay 1
And this is the sent package:
Packet sent to address 0 - command:fa - data: 0f fb 00 02 fa 01 01 04 00
But there is no answer…
What am I doing wrong?
Thanks!
Edit: In the velbuslink software (latest release) the relay status is always “Off” in the watchlist, no mather the real status.
Is this a known problem, do I have a defective relay, can I reflash the damn thing?
I’m writing my own domotics solution so the status of the relays is quite important…
You code looks perfect, except for the address Maybe you already did this, but you need to give your modules a valid address. Modules with address 0 will not respond to most commands.
packet.Address = 0x01; // don't forget to change the address on the module itself (rotator switches)
At the moment I’m working on a function to call the name of the module.
The request is no problem, but parsing the answer from the flood of bus messages isn’t…
Do you by any chance have a code snipped how you guys did this in VelBuslink?
I thought of buffering the last 50 received messages or so and than go find the messages with the right name in the buffer, past them together for the name and return the name. But I can’t believe this is a reliable solution.
An other way would be to let the program pick up all the messages and wait till all 3 responses are received, discarding any other messages but not shure yet how to implement this.