Need Webserver to send plain text

herbie
Posts: 15
Joined: Sun Jul 01, 2018 9:54 am

Need Webserver to send plain text

Postby herbie » Sun Jul 01, 2018 10:08 am

Hello,

I´ve built myself an Arduino BME_280 weatherstation (humidity,airpressure,temparature) and my Arduino webserver sends the tree values in html. That´s not a problem with a webbrowser - but for a short time I have a NodeMCU lua Amica module configured as a receiver and when I get the values the whole html-code is shown on the display :cry: :cry: :cry:
What can I do about it - I tried to find a way to reconfigure the webserver to send plain text but failed. I´d need the webserver to show html /for the browser) and plain text (for the nodemcu). Has anybody an idea how to do that??

thanks in advance!!!

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Need Webserver to send plain text

Postby kolban » Sun Jul 01, 2018 4:05 pm

I get the sense that your NodeMCU component is asking the remote server for data and what the remote server is sending back is an HTML page. What I think you desire is that the NodeMCU component requests data and just the data come back to it without HTML formatting instructions. This could be achieved by making a REST call from NodeMCU to the server and getting back a JSON encoded payload of just the data. Your Web Server app hosted on the server could expose two paths. One which returns HTML and one which returns JSON.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

herbie
Posts: 15
Joined: Sun Jul 01, 2018 9:54 am

Re: Need Webserver to send plain text

Postby herbie » Sun Jul 01, 2018 5:42 pm

Thanks a lot Mr. Kolban - that helped!!!!!!!

Who is online

Users browsing this forum: No registered users and 127 guests