squ1rrel
Posts: 3
Joined: Mon Aug 05, 2019 9:17 am

Webpage over Bluetooth?

Wed Jul 28, 2021 5:42 pm

How can I connect from an Android phone over Bluetooth to get to a web page served by a pico?

Longer version:

I have a pico with a couple of temperature sensors. It has a HM-10 Bluetooth 4 module and I can connect using an Android Bluetooth terminal app to the pico and get back the sensor values.

This Random Nerds ESP32 post does something similar and serves up the results via a simple webpage. But that connects to a WiFi network and in my situation there is no WiFi. So how can I connect from an Android phone over Bluetooth to get a webpage like that in the post?

fanoush
Posts: 811
Joined: Mon Feb 27, 2012 2:37 pm

Re: Webpage over Bluetooth?

Wed Jul 28, 2021 6:17 pm

While there is no easy networking over BLE and you have the hm10 module (that can do only bluetooth serial anyway?) there is easy solution - web bluetooth. most phone browsers like Chrome or Samsung Internet can do it. Check this https://www.espruino.com/UART.js or concept of this http://www.espruino.com/Web+Bluetooth
Since you have no espruino BLE device you cannot run javascript remotely but still you can read/write data from hm-10/pico in same way and present it on your page as you wish.

Not sure what uart service guids hm-10 uses for serial communication, if it doesn't use Nordic UART (or you can't change it to use those via some AT commands) then you need to fix guids here https://github.com/espruino/EspruinoWeb ... rt.js#L117 to use ones for hm-10

squ1rrel
Posts: 3
Joined: Mon Aug 05, 2019 9:17 am

Re: Webpage over Bluetooth?

Fri Jul 30, 2021 10:39 pm

Many thanks - I'll investigate Web Bluetooth.

Return to “MicroPython”