Hi,
I have http server running on esp32 that sends html website to the pc.
I am wondering what is the best way to pass actual data from sensors to the website.
At the moment I use simple http rest (Each 5 seconds, using ajax, my javascript code, requests json file from esp32 and fill all website fields with actual values).
Honestly saying I know nothing about mqtt in details. Would it be somehow better? Suggest me some good, full of code example.
Best way to pass data to the html website [sockets/mqtt/http rest]
-
- Posts: 54
- Joined: Mon Dec 05, 2016 12:34 am
-
- Posts: 9730
- Joined: Thu Nov 26, 2015 4:08 am
Re: Best way to pass data to the html website [sockets/mqtt/http rest]
It depends, what's your use case? How's the setup going to be used in practice, what is it for?
Re: Best way to pass data to the html website [sockets/mqtt/http rest]
How do you want to do encryption, checksum and authentication?
If you can do authentication on transport layer (SSL/TLS/SSH) the final choice is kinda trivial.
HTTP/WS is not efficient for purposes of logging and etc, and has no native format on UDP.
So, I bet, mqtt + tls with auth + lightweight binary serialisation format will work for you.
You seem to be coming from a web dev background?
If you can do authentication on transport layer (SSL/TLS/SSH) the final choice is kinda trivial.
HTTP/WS is not efficient for purposes of logging and etc, and has no native format on UDP.
So, I bet, mqtt + tls with auth + lightweight binary serialisation format will work for you.
You seem to be coming from a web dev background?
-
- Posts: 54
- Joined: Mon Dec 05, 2016 12:34 am
Re: Best way to pass data to the html website [sockets/mqtt/http rest]
I have no web dev background, but have a project to finish so I do learn new technologies
Esp monitors voltage, sends its value to browser. In borwser graph is showed.
What do you mean by encryption? There is no encryption, esp works as AP and provide HTTP server. No ssl or post-alike login.
Esp monitors voltage, sends its value to browser. In borwser graph is showed.
What do you mean by encryption? There is no encryption, esp works as AP and provide HTTP server. No ssl or post-alike login.
Who is online
Users browsing this forum: Bing [Bot], ESP_adokitkat and 137 guests