Hello Team,

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.




0 (0 투표)
RE: How to access the XDK sensor data from a web Application
16. 7. 22 오전 8:44 as a reply to Anand Kumar.

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

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,

0 (0 투표)