Webserver Meteobridge pro question

This section covers the Meteobridge PRO, PRO2, NANO SD, Raspberry Pi and VM platforms exclusively

Moderator: Mattk

Post Reply
FraSti
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: Sat Feb 01, 2020 9:43 am

Webserver Meteobridge pro question

Post by FraSti »

Hi,

I like to receive an html view of live data from meteobridge nano pro SD. I succeed to periodically write an html file with the services. It also works to proceed a text template with cgi-bin on request.

I am now wondering how to get an html page on request by use of cgi-bin? All trials returned the completed html template as plain text with all the html commands visible.

What’s missing to tell the browser that it shall be show as webpage? Can also graph templates be integrated?

Tips are highly welcome
Thanks
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

Re: Webserver Meteobridge pro question

Post by admin »

You have to add the corresponding HTTP header (separated by an empty line form the HTML content), like

Code: Select all

Content-type: text/html

FraSti
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: Sat Feb 01, 2020 9:43 am

Re: Webserver Meteobridge pro question

Post by FraSti »

It was set, for sure.

Seems that I've to continue writing every 10 min the to the SD. Let's cross the fingers that it will not be worn-out too early.
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

Re: Webserver Meteobridge pro question

Post by admin »

I would not recommend to do that. Can't the data be requested by a call to ../cgi-bin/template.cgi?template=mytemplatefile
FraSti
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: Sat Feb 01, 2020 9:43 am

Re: Webserver Meteobridge pro question

Post by FraSti »

That’s what I‘m talking about. Text works well, but html not. Anyhow, I‘ve now booked a web space and got disappointed that ftp services can fill and upload templates, but no charts. Meaning, the metachart is also created on the SD temporary. Let’s see if a workaround will be found...
User avatar
admin
Platinum Boarder
Platinum Boarder
Posts: 7854
Joined: Mon Oct 01, 2007 10:51 pm

Re: Webserver Meteobridge pro question

Post by admin »

Why is html not working? Can you please elaborate on this?
FraSti
Fresh Boarder
Fresh Boarder
Posts: 9
Joined: Sat Feb 01, 2020 9:43 am

Re: Webserver Meteobridge pro question

Post by FraSti »

When opening http://meteobridge/cgi-bin/template.cgi ... board.http the browser is showing me the answer as a text file. When renaming the file to .html, it is shown as a table. Same when using the .html in before command. The placeholders, like [th0...] are all replaced with values.

The html, respectively http, file starts with:

<!DOCTYPE text/html>

<html>
<style type="text/css">
#table-2 {
border: 1px solid #e3e3e3;
background-color: #f2f2f2;
width: 500px;

I have tries all I could image of. Also different content types in cgi-bin command.

As said, I solved it by using a web-space.

Cheers
Post Reply