ble between two esp32

fritch
Posts: 14
Joined: Tue Dec 05, 2017 2:02 pm

ble between two esp32

Postby fritch » 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?

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

Re: ble between two esp32

Postby chegewara » Tue Jan 30, 2018 8:15 pm

Im connecting 2 esp32's all the time with ble, but never tried with AT commands. But according to AT instruction it should have work with your commands. Maybe try to connect to server with android or iPhone device to test it is connectable?
+BLECONN:<conn_index>,<remote_address>
OK
If the connection has not been established,
there will NOT be <conn_index> and
<remote_address>
OK

If the connection established successfully, it will
prompt message
+BLECONN:<conn_index>,<remote_address>
It will prompt the message below, if NOT:
+BLECONN:<conn_index>,fail

fritch
Posts: 14
Joined: Tue Dec 05, 2017 2:02 pm

Re: ble between two esp32

Postby fritch » Wed Jan 31, 2018 3:41 pm

whit an android phone yes is connectable:

+BLECONN:0,"41:d1:5d:7a:b4:2a"<CR><LF>

but not whit an esp32 client role (example above).

chegewara
Posts: 2378
Joined: Wed Jun 14, 2017 9:00 pm

Re: ble between two esp32

Postby chegewara » Wed Jan 31, 2018 5:33 pm

fritch wrote:whit an android phone yes is connectable:

+BLECONN:0,"41:d1:5d:7a:b4:2a"<CR><LF>

but not whit an esp32 client role (example above).
Then its time to make another test. With android 6.0+ you can create server in nRF connect and then try to connect to it with esp32 client using AT command.

fritch
Posts: 14
Joined: Tue Dec 05, 2017 2:02 pm

Re: ble between two esp32

Postby fritch » Thu Feb 01, 2018 1:47 pm

testing to connect esp32 role client to a server in android 7 whit nrf connect , yes the esp32 client connect succesful.

Who is online

Users browsing this forum: axellin, Google [Bot] and 106 guests