Page 1 of 1

Maximum Template Size **solved**

Posted: Tue Apr 02, 2019 8:34 pm
by SANdood
I don't see it documented anywhere, but there does indeed seem to be a maximum send and/or receive size for a template. Worse, once you cross this limit, the MeteoBridge apparently silently drops the request and doesn't respond. My guess is that the max is somewhere around 2560 characters (maybe a little less).

It would be great to know:
  1. The maximum string length of a template (say, from from the end of "`/cgi-bin/template.cgi?template=`"). I would expect that this would be a maximum AFTER all the special characters are converted/escaped.
  2. The maximum string length of a template response (if any)
  3. That an error has occurred. Instead of not responding at all, could you please send back an error response of some sort - perhaps an HTTP error?
Thanks!

Re: Maximum Template Size

Posted: Wed Apr 03, 2019 2:41 am
by Ag2000CO
Not sure which hardware you have. My experience is with the Meteogridge PRO (Hope it is relevant).

Using the FTP Dashboard example https://www.meteobridge.com/wiki/index. ... h_Services
With modifications, my Meteogridge PRO processes a ~4Kb template "gen-dashboard.html" and pushes out a ~3Kb file to my domain.

The Saratoga Template Example, gen-MBtags.php is an 11Kb with an output file MBtags.php around 38Kb.

Can you upload/use any of the included Dashboard example?

It is not clear from you post if the issue is with the template upload or with the output/download process.
When uploading/refreshing the template there should be a message success or failure at the top of the "Services" screen. Is there any message in the system log?

When "testing" your event what is the result/message? Is there any output file result?

I would suggest checking you input file (template) for:
  • valid MB template syntax. Are all tags that are opened then closed () [] etc.
  • Are any special characters used in the input file that may be causing issues during the input read process
Any messages, log entries, screen shots would help.

Re: Maximum Template Size

Posted: Wed Apr 03, 2019 2:48 pm
by SANdood
My hardware is TP-MR3020V3.

I'm not using FTP because it is already being used for my Saratoga site, and you can't have multiple FTP sites defined. I use HTTP GET requests to request updates every 60 seconds.

My template is expanded by the `hubAction` method on my SmartThings and Hubitat hubs into this structure:

Code: Select all

/cgi-bin/template.cgi?template=%7B%22timeGet%22%3A1554289213107%2C%22version%22%3A%5Bmbsystem-swversion%3A1.0%5D%2C%22lat%22%3A%5Bmbsystem-latitude%3A%22%22%5D%2C%22lon%22%3A%5Bmbsystem-longitude%3A%22%22%5D%2C%22tz%22%3A%22%5Bmbsystem-timezone%3A%5D%22%2C%22current%22%3A%5B%22%5BM%5D%2F%5BD%5D%2F%5BYY%5D%22%2C%22%5BH%5D%3A%5Bmm%5D%3A%5Bss%5D+%5Bapm%5D%22%2C%5Bth*hum-act%3D.2%3A%22%22%5D%2C%5Bthb*hum-act%3D.2%3A%22%22%5D%2C%5Bth*temp-act%3DF.2%3A%22%22%5D%2C%5Bth*dew-act%3DF.2%3A%22%22%5D%2C%5Bth*heatindex-act%3DF.2%3A%22%22%5D%2C%5Bwind*chill-act%3DF.2%3A%22%22%5D%2C%5Bthb*temp-act%3DF.2%3A%22%22%5D%2C%5Bthb*dew-act%3DF.2%3A%22%22%5D%2C%5Bth*temp-dmax%3DF.2%3A%22%22%5D%2C%5Bth*temp-dmin%3DF.2%3A%22%22%5D%2C%5Brain*total-daysum%3Din.3%3A%22%22%5D%2C%5Brain*total-sum1h%3Din.3%3A%22%22%5D%2C%5Bsol*evo-act%3Din.3%3A%22%22%5D%2C%5Brain*rate-act%3Din.3%3A%22%22%5D%2C%5Bthb*seapress-act%3DinHg.2%3A%22%22%5D%2C%22%5Bthb*seapress-delta10%3Denbarotrend%3A%5D%22%2C%22%5Bwind*dir-act%3Dendir%3AN%2FA%5D%22%2C%5Bwind*wind-max10%3Dmph.2%3A%22%22%5D%2C%5Bwind*dir-act%3A%22%22%5D%2C%5Bwind*wind-act%3Dmph.2%3A%22%22%5D%2C%5Bwind*wind-act%3Dbft.0%3A%22%22%5D%2C%22%5Bmbsystem-daylength%3A%5D%22%2C%5Bth*hum-dmax%3D.2%3A%22%22%5D%2C%5Bth*hum-dmin%3D.2%3A%22%22%5D%2C%22%5Bmbsystem-sunrise%3A%5D%22%2C%22%5Bmbsystem-sunset%3A%5D%22%2C%5Bmbsystem-daylength%3Dmins.0%3A%22%22%5D%2C%5Buv*index-act%3A%22%22%5D%2C%5Bsol*rad-act%3A%22%22%5D%2C%5Bmbsystem-lunarage%3A%22%22%5D%2C%5Bmbsystem-lunarpercent%3A%22%22%5D%2C%5Bmbsystem-lunarsegment%3A%22%22%5D%2C%22%5Bmbsystem-moonrise%3A%5D%22%2C%22%5Bmbsystem-moonset%3A%5D%22%2C%5Bmbsystem-isday%3D.0%3A%22%22%5D%5D%7D&contenttype=text%2Fjson HTTP/1.1 Accept: */* User-Agent: Linux UPnP/1.0 Hubitat HOST: ###.###.###.###:80 Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=
The entire string has been trimmed down to work and is ~1820 characters long. Before trimming, if the total size of the expanded hubAction request exceeded ~2400 characters the Meteobridge seems never to reply. And yes, I have verified that both the above and the original are valid templates (by plugging them into a browser).

Yes - I can use the dashboard examples - I actually have 3 different weather templates being fed from my Meteobridge already.

And no - the Live Data page doesn't report on the status of an HTTP GET template.cgi request. In fact, it doesn't report status of the individual HTTP Service requests either - it only shows a single "HTTP Upload" status, even though I have 6 HTTP services configured.

What I am asking for is a HTTP status response from the Meteobridge when I make an HTTP GET template.cgi request - I get a status of 200 on good request responses; I'm looking for a 400-range status for bad ones...any of 400 Bad Request, 401 Unauthorized, 403 Forbidden, 406 Not Acceptable, 408 Request Timeout, 409 Conflict, 413 Request Entity Too Large, etc. would be helpful.

All that said, the issue I am experiencing could possibly be caused by the platform software and not the Meteobridge at all. I'll see if I can do more testing to narrow down the possibilities.

FWIW, my question is simply: Is there a character limit for HTTP GET requests to template.cgi?

Re: Maximum Template Size

Posted: Sun Apr 07, 2019 1:18 pm
by admin
Limit to feed port 5551 (which template.cgi uses) is 9.500 bytes.

Re: Maximum Template Size

Posted: Mon Apr 08, 2019 12:50 pm
by SANdood
Thanks!