hello is there any way I can connect 2+ vm 8090 boards on a Raspberry pi and have the 1.board defined as bord xxx and 2.board defined as board 123. So I have no problems with the commands?
thanks
sudoraspian
hello is there any way I can connect 2+ vm 8090 boards on a Raspberry pi and have the 1.board defined as bord xxx and 2.board defined as board 123. So I have no problems with the commands?
thanks
sudoraspian
You can have two boards, but which board gets which device path is up to the operating system.
The board itself has no unique identification.
hi thanks fou your answer
there are 2 boards connected with the raspi.
and I can switch the relays with
board 1 = printf ‘\x04\x11\x01\x00\x00\xea\x0f’ >>/dev/ttyACM0
board 2 = printf ‘\x04\x11\x01\x00\x00\xea\x0f’ >>/dev/ttyACM1
But, probably, board 1 may become /dev/ttyACM1 and board 2 may become /dev/ttyACM0, after a reboot. You’ll have to test this experimentally
I know i this is my problem can I define a board as the /dev/ttyACM1 and the other /dev/ttyACM0?
As VEL448 said, the board is not addressable.
A possible workaround: write a different value in a timer for each board. By reading the timer value, you can determine which board is which.
So if I have 10 boards connected to a computer there is no way I can switch relay 40 and relay 40 stay relay 40?
I’m afraid that this is not possible with USB unless it’s a card with 40 relays.
TCP/IP has this possibility, but not USB. The VM201 is a network card; you could assign a fixed unique IP to a hundred VM201 cards based on their MAC address. For example:
ff:00:05:34:23 192.168.0.4 (card1)
01:ae:32:33:99 192.168.0.5 (card2)
e6:b3:45:b7:75 192.168.0.6 (card3)
78:42:14:7e:54 192.168.0.7 (card4)
...
Then card1 will always be card1, card2 will always be card2, etc.
USB does not have something like that
ok I baugt the vm201 now how can I send commands from my raspberry to the board? on off and read value?
[quote=“sudoraspian”]ok I bought the vm201 now how can I send commands from my raspberry to the board? on off and read value?[/quote]What have you tried so far?
nothing I dont know where to start
I suppose you’re using Raspbian from raspberrypi.org/downloads/?
Do you know how to use the shell? Have you ever used any programming language before?
yes I know how to use the shell and I am programming in python.
yes raspian
[quote=“sudoraspian”]yes I know how to use the shell and I am programming in python.
yes raspian[/quote]If you’re using python, then the first thing you can Google is a socket client example. You will need to “understand” sockets to be able to connect to port 9760 of the VM201.
google.be/#q=python+socket+client+tutorial
Then find out how to send an array of bytes over that socket so you can communicate with the VM201 and send commands.
Your total script will probably be only less than a dozen lines, it just needs a little bit of research