Undocumented Bluetooth relay board

Thread Starter

quique123

Joined May 15, 2015
405
Undocumented Bluetooth relay board

how would I go about deciphering which Bluetooth commands activate the four different relay channels on this board? I bought this off the Internet and the seller does not provide any support for this product anymore.

BB8B2471-CCC9-43FB-9C61-EC89316B9B43.jpeg
 

Thread Starter

quique123

Joined May 15, 2015
405
I just tried connecting to it from a mobile app and sending 1 as utf8 text but it didnt do anything. no relay got activated.
 

djsfantasi

Joined Apr 11, 2010
9,156
I just tried connecting to it from a mobile app and sending 1 as utf8 text but it didnt do anything. no relay got activated.
You actually sent a decimal 31; the code does nothing in that case.

You need to send an ASCII Ctrl-A thru an ASCII Ctrl-D for the code you listed to do anything.

A text “1” is represented by a decimal 31; a text “2” is decimal 32, etc... until a text “4” is decimal 34.

The code is looking for decimal 1-4. You sent decimal 31. Do you understand why nothing happened?
 

djsfantasi

Joined Apr 11, 2010
9,156
oh ok, how do i send ctrl+A from my phone?
Wrong question. How do you send a decimal 1 from your phone. ASCII Text is just a name for a coded scheme, to represent the alphabet with numbers. A byte containing an “A” and another containing a decimal 65 have the identical contents. A Ctrl-1 is a decimal 1.
 

djsfantasi

Joined Apr 11, 2010
9,156
  • Initialize your Bluetooth connection to the relay board
  • Create variables with the decimal value of 1 through 4
  • Check for an input required to turn on/off a relay
  • Send the appropriate variable over Bluetooth to the board
  • Done!
You need to realize that ASCII is a code to represent characters in a computer.

As such, you really don’t need the variables. Just send the value directly. But I admit, it might be easier to use and understand with variables.

I made a mistake earlier. The character “0” is decimal 48, hexadecimal 0x30 or binary 001100b. (My mistake was in confusing the decimal and hex values).

Your earlier example was sending a text character “1”. You want to send a decimal 1. Or binary 1b, or hex 0x01.

I’m emphasizing DONT CONFUSE a character with its value. A search for ASCII Table will give you many links to a chart that explains this. Like this one
 

Thread Starter

quique123

Joined May 15, 2015
405
So in python c.write(1) where c = .getCharacteristics()[0]

And yes, i did get confused with the ascii thing. Ive used ascii characters tables before and i do programming as well, but im not so clear on the relationship. So ASCII is a way to have the letter A (when typed on a keyboard), sent as a data type.
 

Thread Starter

quique123

Joined May 15, 2015
405
One last thing. the number 1 activates relay 1, but to a certain position, how do i get it to the other position? send 1 again?
 
Top