Sainsmart 16 Channel USB relay

That’s the “3A” at the beginning of outString. Python allows you to mix ascii characters (“:FE05”) with hex-escaped and special characters (\r\n).

That said, though, you should be able to send the original strings without encoding to hex.

This should work

I think too, but OP said this did not work. the decodehex approach is essentially the same.

I think more of a bad firmware in the microcontroller on the board. these are entry level relays, but they do the job mostly.
why in the first place do you have to send such a complicated string to power some relays ?
at what frequancy does this bad behavior happen ? relay are not meant to be switched too fast.

Sorry for the delay, but I have spent some time fiddling with the code and testing it.
the outputs the code generates are consistant and correct, but the relay board indeed seems to have bad firmware.
So the hunt begins for a high quality 16 channel relay.
Thanks anyway for your support all :slight_smile:

Btw. for people creating hobby projects this relay will probably be usefull and in this tread there is now the code to get it running so have fun guys :smiley:

Can you attempt to create the strings to send, and paste them into say, putty connected to the serial instead, to see if there is some other serial software issue with Xojo happening?