ble between two esp32
Posted: Tue Jan 30, 2018 7:12 pm
hello, anyone have succes connecting two esp32 via ble?
here first one white role server:
[TX] AT+BLEINIT=2<CR><LF>
[RX] AT+BLEINIT=2<CR><LF>
<CR><LF>
OK<CR><LF>
[TX] AT+BLEINIT?<CR><LF>
[RX] AT+BLEINIT?<CR><LF>
+BLEINIT:2<CR><LF>
<CR><LF>
OK<CR><LF>
[TX] AT+BLEADVDATA="1122334455"<CR><LF>
[RX] AT+BLEADVDATA="1122334455"<CR><LF>
<CR><LF>
OK<CR><LF>
[TX] AT+BLEADVSTART<CR><LF>
[RX] AT+BLEADVSTART<CR><LF>
<CR><LF>
OK<CR><LF>
On second esp32 white client role: (can see adv data from server)
[TX] AT+BLEINIT=1<CR><LF>
[RX] AT+BLEINIT=1<CR><LF>
<CR><LF>
OK<CR><LF>
[TX] AT+BLEINIT?<CR><LF>
[RX] AT+BLEINIT?<CR><LF>
+BLEINIT:1<CR><LF>
<CR><LF>
OK<CR><LF>
[TX] AT+BLESCAN=1<CR><LF>
[RX] AT+BLESCAN=1<CR><LF>
<CR><LF>
OK<CR><LF>
+BLESCAN:30:ae:a4:12:07:76,-42,1122334455d6d563fd3fa8c5fd3f3cfdfe3f,<CR><LF>
[TX] AT+BLESCAN=0<CR><LF>
[RX] AT+BLESCAN=0<CR><LF>
<CR><LF>
OK<CR><LF>
now connect :
[TX] AT+BLECONN=0,"30:ae:a4:12:07:76"<CR><LF>
[RX] AT+BLECONN=0,"30:ae:a4:12:07:76"<CR><LF>
<CR><LF>
OK<CR><LF>
verifying:
[TX] AT+BLECONN?<CR><LF>
[RX] AT+BLECONN?<CR><LF>
+BLECONN:<CR><LF> <--- something messing!!
<CR><LF>
OK<CR><LF>
[TX] AT+BLEDISCONN=0<CR><LF>
[RX] AT+BLEDISCONN=0<CR><LF>
<CR><LF>
ERROR<CR><LF>
trying to disconnect give error because is not connected, any sugestions?
here first one white role server:
[TX] AT+BLEINIT=2<CR><LF>
[RX] AT+BLEINIT=2<CR><LF>
<CR><LF>
OK<CR><LF>
[TX] AT+BLEINIT?<CR><LF>
[RX] AT+BLEINIT?<CR><LF>
+BLEINIT:2<CR><LF>
<CR><LF>
OK<CR><LF>
[TX] AT+BLEADVDATA="1122334455"<CR><LF>
[RX] AT+BLEADVDATA="1122334455"<CR><LF>
<CR><LF>
OK<CR><LF>
[TX] AT+BLEADVSTART<CR><LF>
[RX] AT+BLEADVSTART<CR><LF>
<CR><LF>
OK<CR><LF>
On second esp32 white client role: (can see adv data from server)
[TX] AT+BLEINIT=1<CR><LF>
[RX] AT+BLEINIT=1<CR><LF>
<CR><LF>
OK<CR><LF>
[TX] AT+BLEINIT?<CR><LF>
[RX] AT+BLEINIT?<CR><LF>
+BLEINIT:1<CR><LF>
<CR><LF>
OK<CR><LF>
[TX] AT+BLESCAN=1<CR><LF>
[RX] AT+BLESCAN=1<CR><LF>
<CR><LF>
OK<CR><LF>
+BLESCAN:30:ae:a4:12:07:76,-42,1122334455d6d563fd3fa8c5fd3f3cfdfe3f,<CR><LF>
[TX] AT+BLESCAN=0<CR><LF>
[RX] AT+BLESCAN=0<CR><LF>
<CR><LF>
OK<CR><LF>
now connect :
[TX] AT+BLECONN=0,"30:ae:a4:12:07:76"<CR><LF>
[RX] AT+BLECONN=0,"30:ae:a4:12:07:76"<CR><LF>
<CR><LF>
OK<CR><LF>
verifying:
[TX] AT+BLECONN?<CR><LF>
[RX] AT+BLECONN?<CR><LF>
+BLECONN:<CR><LF> <--- something messing!!
<CR><LF>
OK<CR><LF>
[TX] AT+BLEDISCONN=0<CR><LF>
[RX] AT+BLEDISCONN=0<CR><LF>
<CR><LF>
ERROR<CR><LF>
trying to disconnect give error because is not connected, any sugestions?