BLE/BT connection to mobile ohone for internet access

I want to connect to a mobile phone from an ESP32 module using BT/BLE so that the ESP can access the internet from the mobile phone connection whether wifi or cellular.

I think this is traditionally called tethering or perhaps BT PAN. I have found a few fragments relating to this around BTStack and others but nothing that actually provides this ability.

Has anyone got any experience of this type of connection or some links that might lead to a solution?

Data volumes from the connections are small and relatively infrequent. The data can all be in the form of BASE64 encoded ascii.

Ideally the solution will allw for the ESP to fail over from its own wifi to the BT connection as required.

if you have local WiFi with internet access probably simpler to use that

Tethering is usually called distributing the Internet via WiFi. I'm not even sure that the ESP32 is capable of connecting to the Internet via BT

I believe it's somehow doable on ESP IDF, but why don't you tether over wifi aka hotspot ?

Search the forum, somebody else had the same situation in the last couple of weeks. There may have even been sample code associated with one of the Bluetooth modules.

OK for clarification the BT connection is mandated by the client. Standard wifi will be used when available but in the event of failure the devices need to connect to individuals co located mobile.

I found this which seems to suggest it will do what I need but I cant get this to work:

I tried but really cant see anything - if you can find it please let me know

Tethering, also known as a mobile hotspot or phone-as-modem, allows a mobile device to share its internet connection with other devices like laptops, tablets, or even other phones. It effectively turns the phone into a wireless router or modem, enabling connected devices to access the internet through the phone's cellular data network.

Bluetooth tethering allows you to share your phone's internet connection with another device, like a computer, wirelessly using Bluetooth. It's similar to a Wi-Fi hotspot but uses Bluetooth instead.

This is what I am trying to achieve.

Obviously client can ask whatever he wants, but the whole case has no sense according to information provided here. There is mobile with internet, why should it tether it over bluetooth instead of wifi? Frequency is same... Range is lower..

Sorry for the apparent confusion. The ESP device is part of a system that requires internet to operate.
Normally the ESP connects via wifi however, when wifi is not available then the ESP needs to connect to the users cellphone via BT to allow continued operation. The client does not want to have his users setup hotspots on their devices simply to a pairing with the ESP BT and then connect as required.

Sorry, that still doesn't make sense.

It is no problem to pair a BT device with a cell phone, but what is supposed to happen then?

Sorry again - as I said before the system running on the ESP needs internet access. If wifi isnt available to the ESP then it needs to get access to the internet through BT on a paired mobile phone.

You have a mobile phone problem, not an Arduino problem.

Im sorry but that is not correct.

The issue is simply how to :
connect to the internet
FROM an ESP application / device
USING BT transport pairing it to a mobile phone
WHERE the mobile phone is using a cellular connection to the internet..

As already mentioned, it is no problem to pair a BT device with a cell phone, and transmit data between them. You can find many posts on this forum describing how to do that.

Unfortunately you seem unable to provide a single useful detail about the rest of your project, so Arduino forum members will probably not be able to help with that.

Good luck with your project!

1 Like

OK if all you can do is resort to being rude for your lack of understanding of a simple communications architecture, then I suggest you just stop responding with useless responses

Now that I see your diagram, why doesn't your esp32 simply connect to the phone, no need for Blue Tooth. I see in post #10 that you don't want to set up a hotspot (no setup, one tap does it) which is at least as easy as setting up BT if not easier.
I see you mentioned a client. Does that mean you are being paid to deliver a system to a paying client?

I forgot to mention that since this appears to be a commercial project of some sort, you can use the flag button (below right) to ask a moderator to move the thread to the Jobs and Paid Consultancy forum section.

People are happy to develop code and applications for pay.