VM8090 with Linux (Raspian)

Hello I have a Question.
I bought the Velleman VM 8090 and I like to use it with my Raspberry Pi under Wheezy Raspian.
I saw the post viewtopic.php?f=3&t=6186
and I can Switch the relay but only in the Toggle mode. So this is useless to me because I don’t now if the relay is on or off. shure I can look on the LED but this isn’t the point.
so I can switch the relay with following commands.

printf ‘\x04\x14\x01\x00\x00\xe7\x0f’ >>/dev/ttyACM0
printf ‘\x04\x14\x02\x00\x00\xe6\x0f’ >>/dev/ttyACM0
printf ‘\x04\x14\x04\x00\x00\xe4\x0f’ >>/dev/ttyACM0
printf ‘\x04\x14\x08\x00\x00\xe0\x0f’ >>/dev/ttyACM0
printf ‘\x04\x14\x10\x00\x00\xd8\x0f’ >>/dev/ttyACM0
printf ‘\x04\x14\x20\x00\x00\xc8\x0f’ >>/dev/ttyACM0
printf ‘\x04\x14\x40\x00\x00\xa8\x0f’ >>/dev/ttyACM0
printf ‘\x04\x14\x80\x00\x00\x68\x0f’ >>/dev/ttyACM0

In the Protocol Manual is written down that there is x11 and X12 to switch the relay and x18 to read the value.

My first guess was printf ‘\x04\x11\x01\x00\x00\xe7\x0f’ >>/dev/ttyACM0
but that didn’t realy worked out.

Has anyone a solution on this?

Thank you.

The device /dev/ttyACM0 is meant to be used as a terminal, what you want to do is send raw datastty -F /dev/ttyACM0 19200 raw -echo printf '\x04\x11\x01\x00\x00\xea\x0f' >>/dev/ttyACM0 printf '\x04\x12\x01\x00\x00\xe9\x0f' >>/dev/ttyACM0Must be executed as root

Thx That worket it was the checksum I dont change.

an other question with x18 you can look up the statusbut to me it doesnt work with

printf ‘\x04\x18\x01\x00\x00\xa9\x0f’ >>/dev/ttyACM0

Any idea of this?

If you want to receive data, then you’ll have to start using some kind of programming language (C, perl, python, Java, …) that can actually read from the port and parse what comes in.

Sure but how if I execute this command nothing come back.
Can you give me a short tutorial?

The function printf is just a string formatting routine, it prints text on the screen. But in your case, you send this piece of text to a serial port instead of the screen.

That said, you can not expect a text function to communicate properly with the K8090, that’s just not how things work :slight_smile:

I suggest you look for tutorials on the internet about how to communicate with the serial port under linux. Find a tutorial that you can understand or get to understand gradually.