RF Coexistence (BLE + WiFi) in Uno R4 WiFi

I've been working on software for an espresso gear pump controller for about a year now and it works very well with my bluetooth scale. For the next phase of the project, I'd like to work in a wireless screen to get rid of my messy and very small SPI touchscreen.

I've tried running both over BLE, but its not going well. I was thinking I'd switch the screen to try to use wifi, since the scale requires bluetooth.

Ive found the RF coexistence pages on the ESP32 website, but not sure if this is possible with the Uno R4. Id like to stick with it if possible so i dont have to rewrite my current 1500 lines of code, but not sure its possible.

Does anyone know how i can wirelessly connect to two objects at once? I dont think the method is as important as the end result, except for the fact that the scale requires bluetooth.

Thanks in advance!

Since you already have the devices and experience with BLE, why not just get this to work, rather than jumping to unknowns?

Well... I was thinking that since I couldn't get it to work before that maybe it just wasn't possible. There could be a way to do it but I couldn't seem to figure it out. Do you know if two peripherals is possible with an Uno R4? If so, is there any example code that you know of that I could work into mine?
I have seen some solutions for two ESP32s to work directly with each other using both WiFi and BLE and have thought about getting an Arduino Nano ESP32 to see if I had better luck with it. If there's a way to get the Uno to do it I'd love that, but I gave up after spending a couple months trying to make it work.

According to the UNO R4 WiFi Cheat Sheet the Wi-Fi® section states...

The ESP32 module has a built in trace-antenna, meaning that you do not need an external one to use the connectivity features of the board. However, this trace antenna is shared with the Bluetooth® module, which means that you cannot use Bluetooth® and Wi-Fi® at the same time.

A Nextion might be a good solution. The Serial interface is quite manageable.
You might need a level shifter between the ESP32 and the Nextion Tx , since the Nextion is a 5v device.

Thanks cattledog. I decided on an Elecrow 7" ESP32 screen which is working well so far - UI uploaded to it, and it's creating a BLE server that the Uno connects to, but haven't gotten the Uno R4 as a central to work with both it and the BLE scale I need it to work with. Logic for the scale alone is working well, but getting them to both work at the same time (or rather... bounce back and forth between the two?) has been a challenge.

I know that the trace antenna can't be used for BLE and WiFi at the same time, but from what I've found there are ways to have them [coexist] (RF Coexistence - ESP32 - — ESP-IDF Programming Guide v5.2.1 documentation).

I may end up having to switch to their ESP-IDF framework (but I think I can use ESP-IDF code directly in the Arduino IDE...) to get it to work in the way I'd like, but I'm starting to think something like WiFI + BLE is only possible on the Nano ESP32 and not the Uno R4 WiFi. Programming the ESP32 directly in ESP-IDF makes communication with the Uno's main processor hard or impossible.

I will give it a try and report back.

The ESP32 is indeed using a normal serial interface.

The concern I have is related to the modem.cpp on the UNOR4 WiFi, which handles sending and receiving between the ESP32 and the UNOR4 WiFi. It is part of the WIFIS3 library.

The modem code is NOT a single instance running on the UNOR4 WiFi, which is then shared between Wifi and Bluetooth to communicate with the ESP32. It is defined as a "Modemclass" and thus there would be 2 modem-instances running in parallel trying to communicate on the same Serial-line.

Does not look like a scenario for a stable solution for running Wifi and Bluetooth in parallel on the UNOR4Wifi.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.