Could it use Web Bluetooth connection and Wi-Fi connection at the same time?

Issue #454 resolved
Tom Ming created an issue

Hi @John Maloney , I would like to use MQTT block when use esp32-ble_ide VM on BLE_test IDE. But it seems that it could not connect to Wi-Fi. Could it use Web Bluetooth connection and Wi-Fi connection at the same time?

Comments (12)

  1. John Maloney repo owner

    Thank you for reporting this. I had not yet tested WiFI in combination with BLE so this is useful information. I've verified that I cannot connect to a WiFi network using a vm that connects to the IDE vis BLE.

    That VM is an experiment and we are still trying to understand how it interacts with other parts of MicroBlocks. It may take a while to get it working well. We definitely want to to coexist with WiFi. I will investigate...

  2. Tom Ming reporter

    Hi @John Maloney , Is it possible to program using Bluetooth transparent transmission as below?

  3. John Maloney repo owner

    Yes, that's possible, and it's an excellent "fallback" solution.

    However, it would be even better if users could use the same firmware for both WiFi and BLE. That way, they would not need to install different firmware for BLE and WiFi applications.

    The ideal solution would be to be able to use WiFi and BLE at the same time. So far, I haven't figured out how to do that, even though the documentation suggests it is possible. (The two systems, WiFi and BLE, must take turns using the radio, using a process called "WiFi - Bluetooth coexistence".) It may be that NimBLE does not yet support that mode of operation.

    However, I hope it will be possible to switch between WiFI and BLE modes at run time. That is, MicroBlocks would disable BLE when using WiFi and vice versa. Of course, it shouldn't disable BLE if the user is using BLE to program the board, but we can check for and prevent that. As shown in your diagram, the user could only live-code WiFi when connected to the IDE over serial. Explicitly switching between WiFi and BLE is actually a good thing for performance; time-sharing the radio between the two systems is bound to hurt performance of both.

    A related issue is that it would be great if the same firmware could connect to the IDE via either serial or BLE. I've been working on that...

  4. Tom Ming reporter

    Glad to hear that the WiFi - Bluetooth coexistence question was solved!👏 Thanks to Jose, Wenjie and your team!🌹

  5. Tom Ming reporter

    @John Maloney Wish you Merry Christmas in advance ,Happy New year! Have nice holidays!

  6. John Maloney repo owner

    Thank you for the holiday wishes!

    I've made some progress (see below).

    If you want to try the latest, you can download and install this .hex file on a micro:bit v2:

    https://microblocks.fun/mbtest/tmp3/vm_microbitV2_BLE.hex
    

    Or one this for an ESP32:

    https://microblocks.fun/mbtest/tmp3/vm_esp32_BLE.bin
    

    I realize it may be difficult or slow to access our server from China. Wenjie is traveling right now but I guess he will update the Chinese BLE test page when he gets a chance.

    (Note: This doesn't include José's fix for WiFi + BLE. That will be in the next version.)

  7. Log in to comment