Luup code exceeding 50k in one file will error out with haserl CGI error

Once a luup code file exceeds ~50k, Vera will no longer upload it.

In this situation, the file upload operation reports:

(Stop) haserl CGI Error

Attempted to send content larger than allowed limits

My Alarm panel interface (with comments) now exceeds the limits. I’m slowly working out how to prune it back.

Wow. How many lines is that?

1070, not that many. It’s commented so that others can work it out, and I’m currently stripping some of the code redundancy to “make it fit”

Honestly, how much free space does Vera even have for such Luup code overall? I know she can accommodate larger files in general, but now wonder if MCV hard-coded a per-file filesize limitation just to ward off overfilling and leave some operational headroom.

These get LZ’d into the filesystem, so event @ ~50k, they’re only ~13k on disk after compression. Given the space in these boxes, I think we have more than enough room.

The compression is fairly good, and the only real reason it’s 50k is that it’s got LOTS of comments, along with a number of “tables” containing the Text-strings (Labels) for every type of Alarm trigger/change/status event.

I could strip these tables, and save most of the space, but you’d get very cryptic decodes in the log files. I put them in so folks didn’t need to re-read the reference manual for the API, and so I could add more features “down the road” in terms of Status Messages.

eg. “Mary unlocked the XXXX via Keypad YYYY” type stuff.

To give you an idea of what I mean, I have tables declared like:

-- -- The field on the end is for a future codebase. -- EVENT_GROUP = {["000"] = {"Zone is OK", ZONE_LABEL, false}, ["001"] = {"Zone is Open", ZONE_LABEL, true}, ["002"] = {"Zone is Tampered", ZONE_LABEL, true}, ["003"] = {"Zone is in Fire Loop Trouble", ZONE_LABEL, true}, ["004"] = {"Non-reportable Event", NON_REPORTABLE_EVENT_LABEL}, ["005"] = {"User Code entered on Keypad", USER_LABEL}, ["006"] = {"User/Card Access on door", nil}, ["007"] = {"Bypass Programming Access", USER_LABEL}, ["008"] = {"TX Delay Zone Alarm", ZONE_LABEL, true},

and then stuff like this:

[code] if (tmp == ZONE_LABEL) then
eventLabel = processZoneEvent(deviceId, eventNumber, EVENT_GROUP[eventGroup][3])
areaLabel = AREA_LABEL[areaNumber]
elseif (tmp == USER_LABEL) then
eventLabel = tmp[eventNumber]
areaLabel = AREA_LABEL[areaNumber]

                -- TODO: Move this logic into the last parameter of my Table
                --       and eliminate all this logic by making it table-driven.
                if (eventNumber == "004" or eventNumber == "031") then
                    processAlarmStay(deviceId, areaNumber, true)
                    processAlarmArmed(deviceId, areaNumber, true)
                elseif (eventNumber == "013" or eventNumber == "014" or eventNumber == "016" or eventNumber == "017") then
                    processAlarmStay(deviceId, areaNumber, false)
                    processAlarmArmed(deviceId, areaNumber, false)
                elseif (eventNumber == "019" or eventNumber == "020") then


The constants in the former, make it somewhat easier to “Decode” the latter without declaring a ton more constants (the latter with be changed to eliminate the if-then-else-end code blocks, and moved to Table-driven state-changes, after I’ve gotten the kinks out of the basic operation.

For those interested, the upload limit for UPnP files is definitely specified by MCV and team. The limit is outlined in the first line of [tt]/www/cgi-bin/cmh/[/tt]

#!/usr/bin/haserl --upload-limit=50

I increased the maximum allowed size, so you can upload larger files.

What is the new Max size, and what’s the Release # it’s available in?