Sim808 bluetooth pairing and sending

hello i read the datasheet and i read ur example at
so from what i see i turn on the bluetooth then i scan
then i pair with the index of the scan results
then connect and send
but I dont wanna do this , I want to pair and connect to a certain device with a mac address that I know
because I’m using it to connect to a printer via bluetooth and I want to make sure it will connect to it not other devices so I don’t really need the scanning
also in your example you did pairing by choosing the device only but you didn’t enter the pairing key like : “AT+BTPAIR=2,0000” before AT+BTCONNECT=1,2
any suggestions?

I think the pairing happens only based on the ID and index. I didnt find anything related to MAC address in the manual.

Hi Mr. Ravi
thanks for your quick reply
yea I have seen the same but this is weird , I mean how can I set it to connect auto if I’m not looking to the device
like this I have to be looking at scan results everytime and choose which 1 to connect to
anyway I’ll try to find something out like comparing mac addresses to the 1 I need then choose the corresponding ID
now another question : I found 3 pairing write command modes

and I noticed in your video and article you didn’t enter pairing number
well here’s what I do :
1- AT+BTPOWER=1 (to power on the bluetooth)
2- AT+BTSCAN=1,10 then i put a delay (to scan surrounding bluetooth devices)
3- AT+BTPAIR=0,1 (active write command where “1” is the 1st device id considering my bluetooth printer is number 1 )
4- AT+BTPAIR=2,0000 (passive write command with passkey request assuming it’s “0000” )
5- AT+BTCONNECT=1,4 (to connect to device 1 after pairing with the profile 4 -> SSP )
am I doing something wrong ?

1 Like


Its been a long time since i made that video or worked on BT AT commands. I dont remember much. But the command sequence seems correct. What problem are you facing with above sequence?

oh I had to fix some delays and it’s successful until the sending step
the thing here I’m not dealing with an active terminal
the sim808 is connected to artm cortex-m7 same70
so it’s a bit different to send data to the bluetooth sewoo printer

maybe there’s something wrong with the sending command

const char cmd_BTPWR_ON[] = “AT+BTPOWER=1\r\n”;
const char cmd_BTPWR_OFF[] = “AT+BTPOWER=0\r\n”;
const char cmd_BTSCAN[] = “AT+BTSCAN=1,10\r\n”;
const char cmd_BTPAIR[] = “AT+BTPAIR=0,1\r\n”;
const char cmd_BTPAIRKEY[] = “AT+BTPAIR=2,0000\r\n”;
const char cmd_BTGETPROF[] = “AT+BTGETPROF=1\r\n”;
const char cmd_BTCONNECT[] = “AT+BTCONNECT=1,4\r\n”;
const char cmd_BTSEND[] = “AT+BTSPPSEND=1,10,“Hello123#”\r\n”;
const char cmd_VRTC_WRITE[] = “AT+CCLK=“10/05/06,00:01:52+08”\r\n”;
const char cmd_VRTC_READ[] = “AT+CCLK?\r\n”;

I’m trying to do the sending step on 2 steps now like this and gonna test

const char cmd_BTSEND[]= “AT+BTSPPSEND=10\r\n”;

const char cmd_BTSENDDATA[]= ““HelloTest”\r\n”;

awesome ! I had a success after making it into 2 steps and it printed at the sewoo printer :grinning:

1 Like

Mostafa i read you discussions, now i also want to connect particular bluetooth device with mac address instead of every time scan and pair with ID & Index,
Do you find any solution ? kindly share

Hello ,
I think you need to receive the response of scanning in a buffer
then analyze this buffer and match the mac address with desired one , then connect to corresponding ID/Index

1 Like

Without the scanning process i want to connect using mac address. ( with pre stored mac address)
is that possible ?