Mix IO repeater with wireless serial

Hello all,

Please could someone help me with this program I want to do?

I want to send by an Wixel conected to my PC USB port an serial message than another Wixel wireless receive this message and if this message is equal to what is expected then the remote Wixel turns on a LED.

Example.
Wixel on my PC send “abcd” using the wireless serial program.

Many remote wixels will be at the same chanell listening to the same "abcd"message sent by the Wixel on my USB port, BUT only the wixel with the correct code will turn on the led.

let’s supose I have 2 remote wixels, one is expecting “efgh” and the other is expecting “abcd” only the one with “abcd” will tunrn on the led, if I send a “abcd” message by the Wixel plugged in my PC.

Is possible to do that? I don’t know how to do.

Cant someone give me the tips or a code that do this?

Thank you

Hello.

Unforunately, the apps we currently have for the Wixel do not support the application you have in mind. The Wireless Serial App can only be used to connect a pair of Wixels; there is no easy way to talk to connect three or more Wixels. The I/O repeater app supports multiple transmitters and receivers but it does not listen for serial commands on its COM port; you would have to drive an I/O line high or low on the transmitter side (e.g. with a pushbutton) in order to control LEDs on the receiver side.

If you are comfortable with C programming you should be able to write your own app to make this possible. On the receiver Wixels that control the LEDs, you should just run the standard I/O Repeater App. For the transmitter Wixel that connects to the computer, you could write an app that accepts commands from its virtual COM port and transmits the appropriate radio packets to update the receiver Wixels using the protocol of the I/O repeater app. It should transmit the packets repeatedly, just like the I/O repeater app does, because some packets will be lost occasionally.

To make the new app, I recommend that you use the existing I/O repeater app as a starting point. To get an idea about how to receive commands from the Wixel’s virtual COM port, you could look at the source code of the test_random app and the documentation of the Wixel libraries.

–David

Hello David,

Thank you for your repply, but if I just use the wireless serial APP in all wixels at the same channel just listening what is receiveid from the USB wixel, then all of them will receive the same thing right? Well if I just adapt the code in each onde of the remote wixels and verify the received message then if is the one expected then set one of the IO pins to high. I don’t know how to do that in C, im used to Visual Basic programming. What is the variable that stores what is being received by the wixel wireless?
Can I do something like this?

if received_message = “abcd” then
led_port=enabled
else
led_port=disabled
end if

No, you cannot use the wireless serial app with more than two Wixels on the same channel because the protocol is not designed to handle that case.

There is no specific variable you can read to see what was received by the radio, but the Wixel’s radio libraries are documented here. However, I still think that the right approach would be what I described above, in which case you would not try to process commands received wirelessly but you are trying to parse commands received from a USB virtual COM port. Processing a multi-byte command like “abcd” will be a lot more difficult than processing single-byte commands so I recommend you just start with single-byte commands for now.

–David