Is there a library to use MQTT with a bluetooth module (HC-06) instead of WiFi? If not is there a similar ready for use implementation of a publisher subscriber pattern available?
1 Answer
MQTT is TCP/IP native. If you want to access it via Bluetooth, you need a gateway; a device that translate protocols. You need one for the specific protocols involved: MQTT, TCP/IP and Bluetooth.
Google "MQTT Bluetooth gateway" to find alternatives like this one:
The iGS01 gateway listens for beacons, gets their advertising data and forwards it on to your server or an IoT server via TCP, HTTP(S) or MQTT. It can be used to feed back-end systems that report on the presence or absence of iBeacon or Eddystone beacons or act on beacon sensor (e.g. accelerometer, temperature, light, humidity) data.
The gateway connects to your local 2.4GHz frequency band WiFi access point and is managed via a web browser interface. It can be connected via WPS (press button on both the gateway and the WiFi access point). It can also be managed via Telnet commands from other hardware (or a human).
For MQTT/MQTTS, the host, port, username, password and a root CA cert can be provided.
There are also software only solutions available, but I didn't found a generic one, only specific for certain vendors.