Community news, upcoming events and general discussions
Threads: 36 Posts: 88
Get technical support from the community
Threads: 1427 Posts: 7608
Threads: 18 Posts: 64
Tell us how to make XDK better!
Threads: 36 Posts: 119
Share and discuss community member projects
Threads: 81 Posts: 350
I need some guidance regarding how to access the sensor data from my web application.
as I see there are three possible ways :
1 - http post request - I have a little knowledge about this but some questions like how to add a rest web api in the workbench to access the sensor data from the web page
2 - udp - no idea about it but will be glad if anyone can explain how to configure the sensors to use it
3- MQTT broker- I tried it with bosch dashboard and IoT suite. works pretty well but I do not know how to confgure it for my own web page.
any help will be greatly appreciated.
Hello Anand, 1 - http post request: The XDK serval stack provides two different APIs to send HTTP posts. You can either use the Serval_HttpClient.h (example here) interface for HTTP or the REST interface Serval_RestClient.h. Anyway, to access the data in the first place you need a server which recieves the XDK data. Then you can fetch the data in the web page from the server. 2 - UDP Check the SendDataOverUdp example of the welcome screen in the community. It shows sending data via UDP in general. 3 - MQTT broker I heard from the developers that it is possible to recieve the XDK's data stream by subscribing to the MQTT broker. See here Sensors: In each possibility you need to read the sensor values in the XDK. We provide a very good example code here. What is the best solution for you? Each of the possibilities have its advantages and disadvantages. UDP is very fast, but not really safe. Messages could get lost. HTTP with REST is relatively slow because of much overhead in the protocol but it is safe. MQTT is a light IoT protocol and a bit faster than REST. There are several other criteria what is the best protocol. Anyway, my decision would be MQTT. I hope this could help you. Kind regards, Manuel