WIFI/BLE Simultaneously
Re: WIFI/BLE Simultaneously
Hi, it is said above that using BT and WiFi at the same time as long as they are not used simultaneously may work.
I cannot make it work even when only one is used at any one time.
I have a ESP32-CAM that sends emails with photos but needs WiFi connection.
Wifi credentials are stored on SD card.
Asking users to remove the SD card to configure WiFi credentials is quite a pain, most cannot do it.
So I decided that I could use Bluetooth to setup a config.txt file with the necessary credentials and the problem would be solved.
The problem is that I cannot make ESP32 WiFi and Bluetooth (serial) work activated (even not transmuting) at the same time.
I would like to keep Bluetooth on for about 2 minutes when the the system is powered up then switch off Bluetooth and let WiFi take over.
I can indeed switch off Bluetooth using the command btStop(); but, although Bluetooth disconnects and WiFi can connect back to the router connection with the mail server always fail.
Removiing the following line from Setup() solves the problem.
// inti Bluetooth
SerialBT.begin("myBT"); //Bluetooth device name
Assistance welcome.
Thanks
Paulo
I cannot make it work even when only one is used at any one time.
I have a ESP32-CAM that sends emails with photos but needs WiFi connection.
Wifi credentials are stored on SD card.
Asking users to remove the SD card to configure WiFi credentials is quite a pain, most cannot do it.
So I decided that I could use Bluetooth to setup a config.txt file with the necessary credentials and the problem would be solved.
The problem is that I cannot make ESP32 WiFi and Bluetooth (serial) work activated (even not transmuting) at the same time.
I would like to keep Bluetooth on for about 2 minutes when the the system is powered up then switch off Bluetooth and let WiFi take over.
I can indeed switch off Bluetooth using the command btStop(); but, although Bluetooth disconnects and WiFi can connect back to the router connection with the mail server always fail.
Removiing the following line from Setup() solves the problem.
// inti Bluetooth
SerialBT.begin("myBT"); //Bluetooth device name
Assistance welcome.
Thanks
Paulo
Re: WIFI/BLE Simultaneously
Hello Tipo,tipo1000 wrote: ↑Tue Mar 12, 2019 6:10 amESP32 needs to collect heart rate data at the same time it is sending previously collected data over wifi.
Heart rate sensor sends heart rate data to ESP32 once every second.
Forming wifi connection to router and sending previously collected data to database takes about 4 seconds.
Would this work?
Thanks,
Tipo
Sorry for late reply. Yes. It is possible as per your requirements.
Let me know if you have any concern or query for same.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: WIFI/BLE Simultaneously
Along the same lines, I'm planning an ESP32 project that will stream data through wifi to a web client using web sockets, but also I want to monitor BLE to detect that a remote button has been pressed. If I understand the problem correctly, the issue is that the ESP32 uses the same radio and antenna for both wifi and BLE. So do I have to switch the radio back and forth or will the ESP32 handle that? It's important that I don't miss a button press. I would appreciate comments, thank you.
Re: WIFI/BLE Simultaneously
Did you cope with your task, because I also have such a task and do not know where to even look for answers?jimhelios wrote: ↑Mon Feb 10, 2020 7:17 amAlong the same lines, I'm planning an ESP32 project that will stream data through wifi to a web client using web sockets, but also I want to monitor BLE to detect that a remote button has been pressed. If I understand the problem correctly, the issue is that the ESP32 uses the same radio and antenna for both wifi and BLE. So do I have to switch the radio back and forth or will the ESP32 handle that? It's important that I don't miss a button press. I would appreciate comments, thank you.
-
- Posts: 1
- Joined: Sun Aug 02, 2020 7:54 pm
Re: WIFI/BLE Simultaneously
I am stuck on this WIFI/BLE Coexistence challenge. There are good comments and ideas here, but I can't find any working coexistence examples, so I can try and implement some of the suggestions made here. Can anyone post a link to a working WIFI/BLE Coexistence working example? Thanks in advance.
-
- Posts: 2
- Joined: Tue Sep 22, 2020 5:50 am
Re: WIFI/BLE Simultaneously
I notice Espressif has an example in the esp-idf. Found at esp-idf/examples/bluetooth/esp_ble_mesh/ble_mesh_wifi_coexist/dherrington wrote: ↑Sun Aug 02, 2020 7:59 pmI am stuck on this WIFI/BLE Coexistence challenge. There are good comments and ideas here, but I can't find any working coexistence examples, so I can try and implement some of the suggestions made here. Can anyone post a link to a working WIFI/BLE Coexistence working example? Thanks in advance.
Has anyone successfully got this example working? I can get it to compile and load into my ESP-WROVER-Kit V1.4. From the terminal I can connect to my wi-fi successfully and get a IP and that's about all I can get working.
I can run 'iperf -s -i 3 -t 1000' on the ESP32, but every time I try to connect to it from a PC (tried Linux/Win10 and Yes, iperf 2.X) I get connection refused. I can run iperf between two different PC's without issues, so it's not firewall networking issues. The problem seems to be the ESP32 side. I have tried different settings, making the ESP32 the server and client without any luck.
I can run the example /wifi/iperf without any issues, proving the issue is with the ble_mesh_wifi_coexist example.
Also on the BLE_Mesh side (ble_mesh_wifi_coexist example), I can see the ESP32 broadcasting a beacon "ESP-BLE_MESH" which I can connect to via Nordic's nRF connect, but Espressif's "ESP-Mesh" app on Android will never find it. Why? My Android device only supports BLE 4, however as nRF connect on the same Android device works, I don't think this is the issue.
Many Thanks
Wayne Peacock
-
- Posts: 2
- Joined: Tue Sep 22, 2020 5:50 am
Re: WIFI/BLE Simultaneously
IDF V4.1 (stable)wayne_peacock wrote: ↑Tue Sep 22, 2020 7:37 amI can run 'iperf -s -i 3 -t 1000' on the ESP32, but every time I try to connect to it from a PC (tried Linux/Win10 and Yes, iperf 2.X) I get connection refused. I can run iperf between two different PC's without issues, so it's not firewall networking issues. The problem seems to be the ESP32 side. I have tried different settings, making the ESP32 the server and client without any luck.
There is a few bugs in cmd_wifi.c that prevents this from working. After a little bit of stuffing around I now have it working. I will put in a bug fix request.
Basically iperf is always given an uninitialised server address. Also the server address for iperf is always fixed with your ESP32 ip address from the looks of it, so only run iperf server on it, don't try to run the client.
cmd_wifi.c line 348: cfg.sip = wifi_get_local_ip(); <SIP will always be your local address!
The bigger program is wifi_get_local_ip() will always pass a uninitialised value.
initialise_wi-fi(void)
Line 132: esp_netif_t *sta_netif = esp_netif_create_default_wifi_sta(); <-- This can't be private as wifi_get_local_ip() needs it.
Still struggling to get the BLE_Mesh to provision, but that's a separate section.
Regards
Wayne Peacock
Re: WIFI/BLE Simultaneously
Is there any update to this post ?
Seems like this is possible in current ESP-IDF SDK according the documentation https://www.espressif.com/sites/default ... Qs__EN.pdf section 5.3.2.How do ESP32 Bluetooth and Wi-Fi coexist?
I have enabled both options Software controls BLE/Wi-Fi coexisting and Coexisting Bluetooth Side Option, but nothing helps ...
According documentation I have to set intervals scan 160 ms, but I cannot find option in menuconfig how to do this ...
I use NimBle framework in ESP32
I tried to use `ESP_ERROR_CHECK( esp_wifi_set_ps(WIFI_PS_MIN_MODEM) ); //must call this` power mode for wifi, but this did not help
Any help would be appreciated ??
Seems like this is possible in current ESP-IDF SDK according the documentation https://www.espressif.com/sites/default ... Qs__EN.pdf section 5.3.2.How do ESP32 Bluetooth and Wi-Fi coexist?
I have enabled both options Software controls BLE/Wi-Fi coexisting and Coexisting Bluetooth Side Option, but nothing helps ...
According documentation I have to set intervals scan 160 ms, but I cannot find option in menuconfig how to do this ...
I use NimBle framework in ESP32
I tried to use `ESP_ERROR_CHECK( esp_wifi_set_ps(WIFI_PS_MIN_MODEM) ); //must call this` power mode for wifi, but this did not help
Any help would be appreciated ??
Re: WIFI/BLE Simultaneously
Could you explain what you have fixed for this solution to work ?
What dirty magic did you use ?
Re: WIFI/BLE Simultaneously
I also have got the error:
```
LE connection complete. handle=0 role=1 paddrtype=1 addr=6d.77.b5.d5.54.40 local_rpa=0.0.0.0.0.0 peer_rpa=0.0.0.0.0.0 itvl=39 latency=0 spvn_tmo=500 mca=1
0x40 0x54 0xd5 0xb5 0x77 0x6d
connection established; status=0 handle=0 our_ota_addr_type=0 our_ota_addr=30:ae:a4:dd:9b:ee our_id_addr_type=0 our_id_addr=30:ae:a4:dd:9b:ee peer_ota_addr_type=1 peer_ota_addr=6d:77:b5:d5:54:40 peer_id_addr_type=1 peer_id_addr=6d:77:b5:d5:54:40 conn_itvl=39 conn_latency=0 supervision_timeout=500 encrypted=0 authenticated=0 bonded=0
ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0007 len=0
0x07 0x20 0x00
Command complete: cmd_pkts=5 ogf=0x8 ocf=0x7 status=0
ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0008 len=32
0x08 0x20 0x20 0x17 0x02 0x01 0x06 0x03 0x03 0x11 0x18 0x0c 0x09 0x73 0x74 0x75 0x66 0x66 0x2d 0x65 0x73 0x70 0x33 0x32 0x02 0x0a 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Command complete: cmd_pkts=5 ogf=0x8 ocf=0x8 status=0
GAP procedure initiated: advertise; disc_mode=2 adv_channel_map=0 own_addr_type=0 adv_filter_policy=0 adv_itvl_min=0 adv_itvl_max=0
ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0006 len=15
0x06 0x20 0x0f 0x30 0x00 0x60 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x07 0x00
Command complete: cmd_pkts=5 ogf=0x8 ocf=0x6 status=0
ble_hs_hci_cmd_send: ogf=0x08 ocf=0x000a len=1
0x0a 0x20 0x01 0x01
Command complete: cmd_pkts=5 ogf=0x8 ocf=0xa status=0
ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0016 len=2
0x16 0x20 0x02 0x00 0x00
Command Status: status=0 cmd_pkts=5 ocf=0x16 ogf=0x8
LE Remote Used Features. handle=0 feat=ff 00 00 00 00 00 00 00
LE Remote Connection Parameter Request. handle=0 min_itvl=6 max_itvl=6 latency=0 timeout=500
ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0020 len=14
0x20 0x20 0x0e 0x00 0x00 0x06 0x00 0x06 0x00 0x00 0x00 0xf4 0x01 0x00 0x00 0x00 0x00
Command complete: cmd_pkts=5 ogf=0x8 ocf=0x20 status=0
ble_hs_hci_evt_acl_process(): conn_handle=0 pb=2 len=11 data=0x07 0x00 0x04 0x00 0x10 0x01 0x00 0xff 0xff 0x00 0x28
rxed att command: read group type req; conn=0 start_handle=0x0001 end_handle=0xffff
txed att command: read group type rsp; conn=0 length=6
host tx hci data; handle=0 length=24
ble_hs_hci_acl_tx(): 0x00 0x00 0x18 0x00 0x14 0x00 0x04 0x00 0x11 0x06 0x01 0x00 0x05 0x00 0x00 0x18 0x06 0x00 0x09 0x00 0x01 0x18 0x0a 0x00 0x0e 0x00 0x00 0x18
D (10445) CurrentSensor: count >= 1000: _voltage = 78mV
D (10449) NimBleGattChar: Connection handle: 0, Value handle: 24
GATT procedure initiated: notify; att_handle=24
txed att command: notify req; conn=0 handle=0x0018
host tx hci data; handle=0 length=15
ble_hs_hci_acl_tx(): 0x00 0x00 0x0f 0x00 0x0b 0x00 0x04 0x00 0x1b 0x18 0x00 0x4e 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Number of Completed Packets: num_handles=1
handle:0 pkts:1
ble_hs_hci_evt_acl_process(): conn_handle=0 pb=2 len=11 data=0x07 0x00 0x04 0x00 0x10 0x0f 0x00 0xff 0xff 0x00 0x28
rxed att command: read group type req; conn=0 start_handle=0x000f end_handle=0xffff
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x4018fb33 PS : 0x00060530 A0 : 0x800e8b6b A1 : 0x3ffe2e80
A2 : 0x00000000 A3 : 0x00000000 A4 : 0x00000000 A5 : 0x3ffdbb90
A6 : 0x00000000 A7 : 0x00000000 A8 : 0x800ebe80 A9 : 0x3ffe2e80
A10 : 0x3ffdbb90 A11 : 0x00000000 A12 : 0x3ffdbba8 A13 : 0x00000000
A14 : 0x00000000 A15 : 0x00000000 SAR : 0x00000008 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x4000c349 LEND : 0x4000c36b LCOUNT : 0xffffffff
Backtrace:0x4018fb30:0x3ffe2e80 0x400e8b68:0x3ffe2ea0 0x400ed82e:0x3ffe2ec0 0x400edc01:0x3ffe2f00 0x400ede12:0x3ffe2f30 0x400edefe:0x3ffe2f80 0x400eec33:0x3ffe2ff0 0x400e2645:0x3ffe3040 0x400e1b7e:0x3ffe3070 0x400e107d:0x3ffe30a0 0x400e108f:0x3ffe30c0 0x400ebc82:0x3ffe30e0 0x400d9712:0x3ffe3100 0x4008e741:0x3ffe3120
```
when I start Bluetooth and WiFI simultaneously for esp-idf release/v4.2, but the same error was at release/v4.1
```
LE connection complete. handle=0 role=1 paddrtype=1 addr=6d.77.b5.d5.54.40 local_rpa=0.0.0.0.0.0 peer_rpa=0.0.0.0.0.0 itvl=39 latency=0 spvn_tmo=500 mca=1
0x40 0x54 0xd5 0xb5 0x77 0x6d
connection established; status=0 handle=0 our_ota_addr_type=0 our_ota_addr=30:ae:a4:dd:9b:ee our_id_addr_type=0 our_id_addr=30:ae:a4:dd:9b:ee peer_ota_addr_type=1 peer_ota_addr=6d:77:b5:d5:54:40 peer_id_addr_type=1 peer_id_addr=6d:77:b5:d5:54:40 conn_itvl=39 conn_latency=0 supervision_timeout=500 encrypted=0 authenticated=0 bonded=0
ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0007 len=0
0x07 0x20 0x00
Command complete: cmd_pkts=5 ogf=0x8 ocf=0x7 status=0
ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0008 len=32
0x08 0x20 0x20 0x17 0x02 0x01 0x06 0x03 0x03 0x11 0x18 0x0c 0x09 0x73 0x74 0x75 0x66 0x66 0x2d 0x65 0x73 0x70 0x33 0x32 0x02 0x0a 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Command complete: cmd_pkts=5 ogf=0x8 ocf=0x8 status=0
GAP procedure initiated: advertise; disc_mode=2 adv_channel_map=0 own_addr_type=0 adv_filter_policy=0 adv_itvl_min=0 adv_itvl_max=0
ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0006 len=15
0x06 0x20 0x0f 0x30 0x00 0x60 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x07 0x00
Command complete: cmd_pkts=5 ogf=0x8 ocf=0x6 status=0
ble_hs_hci_cmd_send: ogf=0x08 ocf=0x000a len=1
0x0a 0x20 0x01 0x01
Command complete: cmd_pkts=5 ogf=0x8 ocf=0xa status=0
ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0016 len=2
0x16 0x20 0x02 0x00 0x00
Command Status: status=0 cmd_pkts=5 ocf=0x16 ogf=0x8
LE Remote Used Features. handle=0 feat=ff 00 00 00 00 00 00 00
LE Remote Connection Parameter Request. handle=0 min_itvl=6 max_itvl=6 latency=0 timeout=500
ble_hs_hci_cmd_send: ogf=0x08 ocf=0x0020 len=14
0x20 0x20 0x0e 0x00 0x00 0x06 0x00 0x06 0x00 0x00 0x00 0xf4 0x01 0x00 0x00 0x00 0x00
Command complete: cmd_pkts=5 ogf=0x8 ocf=0x20 status=0
ble_hs_hci_evt_acl_process(): conn_handle=0 pb=2 len=11 data=0x07 0x00 0x04 0x00 0x10 0x01 0x00 0xff 0xff 0x00 0x28
rxed att command: read group type req; conn=0 start_handle=0x0001 end_handle=0xffff
txed att command: read group type rsp; conn=0 length=6
host tx hci data; handle=0 length=24
ble_hs_hci_acl_tx(): 0x00 0x00 0x18 0x00 0x14 0x00 0x04 0x00 0x11 0x06 0x01 0x00 0x05 0x00 0x00 0x18 0x06 0x00 0x09 0x00 0x01 0x18 0x0a 0x00 0x0e 0x00 0x00 0x18
D (10445) CurrentSensor: count >= 1000: _voltage = 78mV
D (10449) NimBleGattChar: Connection handle: 0, Value handle: 24
GATT procedure initiated: notify; att_handle=24
txed att command: notify req; conn=0 handle=0x0018
host tx hci data; handle=0 length=15
ble_hs_hci_acl_tx(): 0x00 0x00 0x0f 0x00 0x0b 0x00 0x04 0x00 0x1b 0x18 0x00 0x4e 0x00 0x00 0x00 0x00 0x00 0x00 0x00
Number of Completed Packets: num_handles=1
handle:0 pkts:1
ble_hs_hci_evt_acl_process(): conn_handle=0 pb=2 len=11 data=0x07 0x00 0x04 0x00 0x10 0x0f 0x00 0xff 0xff 0x00 0x28
rxed att command: read group type req; conn=0 start_handle=0x000f end_handle=0xffff
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x4018fb33 PS : 0x00060530 A0 : 0x800e8b6b A1 : 0x3ffe2e80
A2 : 0x00000000 A3 : 0x00000000 A4 : 0x00000000 A5 : 0x3ffdbb90
A6 : 0x00000000 A7 : 0x00000000 A8 : 0x800ebe80 A9 : 0x3ffe2e80
A10 : 0x3ffdbb90 A11 : 0x00000000 A12 : 0x3ffdbba8 A13 : 0x00000000
A14 : 0x00000000 A15 : 0x00000000 SAR : 0x00000008 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x4000c349 LEND : 0x4000c36b LCOUNT : 0xffffffff
Backtrace:0x4018fb30:0x3ffe2e80 0x400e8b68:0x3ffe2ea0 0x400ed82e:0x3ffe2ec0 0x400edc01:0x3ffe2f00 0x400ede12:0x3ffe2f30 0x400edefe:0x3ffe2f80 0x400eec33:0x3ffe2ff0 0x400e2645:0x3ffe3040 0x400e1b7e:0x3ffe3070 0x400e107d:0x3ffe30a0 0x400e108f:0x3ffe30c0 0x400ebc82:0x3ffe30e0 0x400d9712:0x3ffe3100 0x4008e741:0x3ffe3120
```
when I start Bluetooth and WiFI simultaneously for esp-idf release/v4.2, but the same error was at release/v4.1
Who is online
Users browsing this forum: No registered users and 409 guests