We are pairing WT901BLE device with the ESP32.When WT901BLE is paired with smart phone application NRFConnect then service UUID is shown. I have read on some forums that some devices don't advertise service UUID and ESP32 only analyzes advertised data so that's why ESP32 can't see the service UUID of WT901BLE.Someone proposed on git to a similar issue that library code need to be updated for ESP32 to read scan response for data other than advertised data also then it will work. Can someone tell whether this is the only solution or there is some better way to do it. Secondly, which library need to be updated to get the desired result?
Related
I have a BLE temperature sensor, which should send measurements to an ESP32 via a BLE connection and my plan was that the ESP32 could send the measurements via WiFi to my database (Firebase Realtime Database). However, I have seen from a few tutorials that a mqtt server would be neccesary (see the screenshot below - link to the video: https://www.youtube.com/watch?v=PBYCG-ypvRY). Could someone please explain to me why the mqtt component is neccesary? Currently I am measuring temperatures using my ESP32 (without the BLE temperautre sensors) and sending them directly to the database, so I am confused as to why with BLE I would need a mqtt server.
Thanks for your help in advance!
You don't need MQTT. It's just one of the IoT-friendly protocol alternatives (like HTTPS, AMQP, CoAP, homebrew, etc) available to you for device-to-server communication. There are pros and cons to each one. It's up to you to choose whatever solution is relevant to your system.
If you've already implemented the Firebase HTTPS interface and it does the job, you're done.
If you are having problems, note that the Google IoT Core also prescribes MQTT (or, alternatively HTTPS) as an underlying messaging protocol - used together with the Device SDK for Embedded C. But this is for people who want to have a large-scale authentication and management solution for their devices. By all means, stick to your existing solution if it works.
I'm interested in the answer to this question above because I'm trying to setup my Lab so I can send data from an ESP32 device over wifi to Influx DB hosted on my local network with a raspberry pi.
I've tried doing this with udp but the arduino libraries are very poorly documented (and didn't work)
and I couldn't find anything from Influx about what and how the data sending format should be...
Also is there a way to quickly find the network method used to transmit communicate with Python and influxDB?
According to the documentation here they support several methods.
Looking in particular to the upd listener seems that you need to enable the listener on the influx db server first.
I want to know how to send out an advertisement with some specific user number and data such that a connection can be established using the the sdk 15.3.0.
could anyone suggest me what changes i need to make in the ble app beacon code given in the sdk examples.
Thanks
One idea would be to start with the ble_peripheral example of the Nordic SDK.
You can find the following two guides on their forum : https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-services-a-beginners-tutorial and https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial
This explains how to build a custom service with a custom characteristic to handle read / write and notification of values from the embedded device to a BLE central device (e.g: smartphone).
I bought one of these:
https://www.aliexpress.com/item/Smart-finder-Key-finder-Wireless-Bluetooth-Tracker-Anti-lost-alarm-Smart-Tag-Child-Bag-Pet-GPS/32806261079.html
As far as I can tell it is a BLE (Bluetooth Low Energy) location tag.
I downloaded the app for it onto my iphone, and the app instantly recognised it and connected to it. The iPhone app seems to know how far away the tag is - it has a little map of the local area and says how many feet away. I was able to set the device name via the app, but I'm not sure if that set it locally or on the tag itself. The iPhone app also has a "find" button - when you press it, the tag beeps.
So I want to know how I can program this thing myself. I want to be able to identify it when it is nearby, connect to it and make it beep. I've searched for quite a while but not come up with much.
I'm assuming (wrongly/rightly?) that there is some general standard or approach for talking to these BLE location devices and carrying out the basic functions with them - but what is that standard - where is the documentation?
Does anyone have any idea how to program these BLE location tag devices?
BLE devices typically communicate using GATT, either using standard GATT services, or custom ones. The command to make it beep is probably implemented using a custom GATT service.
For finding out the distance to the beacon, typically the RSSI is used. This is a measure of the received power. It needs to be compared to the output power at the emitter. Usually beacons will put their output power in advertisement data, so it can be used without connecting to them. Here since the app is also able to send commands to the beacon, chances are it keeps a connection to it and has a custom GATT protocol to retrieve the output power.
Here is what I would suggest:
Read up on BLE, especially advertising and GATT. For instance read this for advertising and this for GATT. The full BLE spec is available here but should be used for reference and not introduction
Sniff the communication between your device and your phone. You can see this other answer of mine to get started
Replicate the communication protocol in you own app. For that you'll need to use your target platform's BLE libraries. For instance for iOS it is CoreBluetooth
I am fairly new to Arduino, and for a project I want to use an UNO to push/publish notifications to an MQTT broker, then have the broker push a notification to a subscribing Android app I am developing.
I have an ESP8266 for my Arduino incoming. I've done a fair bit of research but am having some trouble piecing things together. I've read articles with the Arduino as the subscriber, or as the server, or the Android as the publisher, but none for this specific implementation. What I (think) I know so far is:
1: Since this is just a fun DIY, test.mosquitto.org would suffice as a decent free broker. So for a #define mqtt_server field, it'd be test.mosquitto.org.
2: Programmatically, I can push notifications from my Arduino to this broker via an mqtt library such as PubSubClient.
3. In Android Studio, I can use an mqtt client (Paho?) to subscribe to the topics being pushed to the broker.
My questions at this point are:
Is there anything else I would need to install on the Arduino besides PubSubClient and the library for my ESP?
I saw that on some code examples, there were 'mqtt_password' and 'mqtt_user' fields. Do all brokers generate these fields, and if so, where can I access them from test.mosquitto.org.
Are there better brokers for a job like this (that are also free) or would mosquitto be enough? I'll only be sending short messages of < 100 characters, but do some brokers limit the amount of data they receive/send?
I just need a jump start in understanding the overall architecture. As usual, any help is appreciated.
Is there anything else I would need to install on the Arduino besides
PubSubClient and the library for my ESP?
You are on the right way... if your Arduino libs are working then you can pub topics and see if the broker can deal with it (I suggest to use mqttFx as a client and subs to those topics too)
I saw that on some code examples, there were 'mqtt_password' and
'mqtt_user' fields. Do all brokers generate these fields, and if so,
where can I access them from test.mosquitto.org.
every broker can deal with anonymous clients, M2m.eclipse.org is one of those...
Are there better brokers for a job like this (that are also free) or
would mosquitto be enough? I'll only be sending short messages of <
100 characters, but do some brokers limit the amount of data they
receive/send?
yes, you can search in the web for those, I have been playing with:
HiveQM: broker.mqttdashboard.com
and
Eclipse: iot.eclipse.org
and they allow you more or lesss the same features you need for the test...
For the andoir part, Paho is a pretty good way to go...
but fisrt step fisrt, pub things with arduino and check that the broker is understanding you + that another client(mqttfx) can get the info and send you something too :)