VM201 - Program for switching relais


#1

Hi,

I want to write a program to switch the output realais on/off via a plain socket connection or a html web-service.
I can’t use any windows-dll or android-app, because neither is supported on the platform I’m working on.

In the manual “protocol_vm201” there’s only a status request, but no info about how to set the states.
A description of how to calculate the checksum is missing, too, though mentioned in the manual.

Could somebody please supply the information needed to control the state of the outgoing relais?

Cheers
Erik


#2

description of how to calculate the checksum :

The length is the length of the entire packet, every byte
<6><CMD_TOGGLE>

1
2 <6>
3 <CMD_TOGGLE>
4
5
6

The checksum is calculated by adding every byte up to the checksum byte
checksum = + <6> + <CMD_TOGGLE> +
Inverting the bits
checksum = not checksum
And adding one
checksum = checksum + 1

Example :

02 06 4F 01 ? 03

  1. Sum: 02 + 06 + 4F + 01 = 58
  2. Invert the result: 58 (01011000) -> A7 (10100111)
  3. Add one: A8

Changing states of the relais :

------- *** TOGGLE *** ***** ON ******** ***** OFF *******
Relay1 02065401A303 02064F01A803 02064601B103
Relay2 02065402A203 02064F02A703 02064602B003
Relay3 02065404A003 02064F04A503 02064604AE03
Relay4 020654089C03 02064F08A103 02064608AA03
Relay5 020654109403 02064F109903 02064610A203
Relay6 020654208403 02064F208903 020646209203
Relay7 020654406403 02064F406903 020646407203
Relay8 020654802403 02064F802903 020646803203

I am using “commandfusion” program “iviewer” , a free user interface ( 2 pages ) to control the card on iphone , ipad or android .
Have fun !
Regards , Luc


#3

Hi,
I want to write a program in python to control the vm201 module.
I saw your crc calculation example.
Have you also an example of a compleet data string which is sent to
the vm201 app from the card.

Thanks in advance.

Eric