Multiple Sonsors (integrated and BT) via MQTT - Printable Version +- phyphox Forums (https://phyphox.org/forums) +-- Forum: Discussion (https://phyphox.org/forums/forumdisplay.php?fid=1) +--- Forum: General (https://phyphox.org/forums/forumdisplay.php?fid=3) +--- Thread: Multiple Sonsors (integrated and BT) via MQTT (/showthread.php?tid=1218) |
Multiple Sonsors (integrated and BT) via MQTT - nbk83 - 12-11-2020 Hey Folks, i really like your App, since i have several old smartphones lying around here that can be used as sensors. For different applications/projects my demand is the following: - Collecting various data with an ESP32 or Arduino and sending it to phyphox-app via BT - Collecting various data from smartphone sensors - Sending BT and smartphone sensor data via MQTT/Wi-Fi to an external server - no data logging/saving in smartphone wanted since the logging and visualisation will be done on server Now i'm facing following issues that i'd really appreciate your assistance: - How can i can send more than one value from ESP32? i tried it with following sketch: Code: #include <phyphoxBle.h> but i only see the value 'randomNumber' in the app, not 'sense' - from starting a new experiment in the app, i can only choose "Bluetooth experiment" or "simple experiment", how can i create an experiment with both BT-data and integrated sensor data? - how can i use the MQTT-functionality? unfortunately i haven't found anything about that topic yet. (i'm using app version 1.1.7) - how can i read the sensor data, without logging them? Best regards from way up north in Germany Jan RE: Multiple Sonsors (integrated and BT) via MQTT - Dominik Dorsel - 12-11-2020 Hey Jan, let me start with the bluetooth topic: With the "new bluetooth experiment" option in phyphox you will get the phyphox-configuration (xml file) which is store on your esp32/arduino. By default its a simple experiment which expects just a single float value. If you would like to customize this experiment to display more data (or change units and so on) you have different options: A) Create your custom epxeriment directy within the Arduino IDE. Therefore you might want to check the phyphoxBLE example "createExperiment". But keep in mind that this library feature does not support all features you might now from other phyphox experiments. This leads me to another option B) Use the p web editor: https://phyphox.org/editor/ With the web editor you can create "easily" your own experiment-configuration (at least using the smartphone sensors ). For bluetooth communication things get a litte bit more complicated, because you need some bluetooth low energy specific information. I think a good way for beginners to start is to use the experiment which is created in "createExperiment". You can get your customized "createExperiment" the following way:
I have to say here aswell: The online editor has much more features than the arduino library but it is also limited. To use all available features you have to create the xml/phyphox file by your own. To get an idea how the the actually .phyphox file looks like press on the "xml" tab in the online editor. Feel free to mix these 3 techniques to create your own experiment! Also you might want to check out the phyphox wiki to get more information about bluetooth, analysis modules and so on. https://phyphox.org/wiki/index.php/Analysis_modules https://phyphox.org/wiki/index.php/Bluetooth_Low_Energy The MQTT support is quite new, so there are not many examples available right now. Also the web editor does not support this feature right now. But you can get some information in the wiki. There is also an example to send acceleration data via MQTT https://phyphox.org/wiki/index.php/Network_Connections I know Sebastian is using an ESP32 with a CO2 sensor and send these values via MQTT (ESP32 has wifi on board!), maybe he can share his sketch to get an idea how it works. Hope this solves your questions! Otherwise feel free to ask for a more detailed explanation =) Cheers Dominik RE: Multiple Sonsors (integrated and BT) via MQTT - nbk83 - 12-13-2020 Hey Dominik, thx a lot for your extensive answer! I will play around with it and come back with (hopefully) positive results, as soon as i find some time to do so. I know that the ESP32 has WiFi onboard and i have a few projects with ESP32 and ESP8266 working with mqtt, sending data to IOBroker. I really like the easy way to build visualisation UI`s and log data with IOBroker, thats why i was waiting for MQTT functionality in Phyphox and was glad to see that it's integrated now. Cheers Jan |