Are there file size limits for file access using JS API, like
http:.../JS/Run/loadObject("filename")
and
http:.../JS/Run/saveObject("filename")
?
What are the limits and what do we get back when limit is exceeded?
JS API: file size limits for file access?
JS API: file size limits for file access?
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Re: JS API: file size limits for file access?
Limit is the memory limit of your Pi. You get an exception if it is exceeded. Otherwise there are no limits.
But JSON is a bad format for big files
But JSON is a bad format for big files
Re: JS API: file size limits for file access?
I tested loadObject with the standard ZWay files. 4 of them return null:
http://IP:8083/JS/Run/loadObject('dedevices.json')
http://IP:8083/JS/Run/loadObject('endevices.json')
http://IP:8083/JS/Run/loadObject('zwayo ... ckets.json')
http://IP:8083/JS/Run/loadObject('zwayp ... ckets.json')
These 4 are the largest files of all:
-rwxr-xr-x 1 4142694 Apr 19 13:49 dedevicesjson-b02fc6609e0022e8f55ff6bb5b853d35.json
-rwxr-xr-x 1 4103417 Apr 19 13:49 endevicesjson-7904daacdb872d656b01c6c9eddd3a48.json
-rwxr-xr-x 1 621220 Aug 11 08:31 zwayoriginPacketsjson-2ad2998bc2cb543d29ac586cec215398.json
-rwxr-xr-x 1 817011 Aug 11 08:31 zwayparsedPacketsjson-f1aed46af7fae1368e78db7768e4d9e5.json
For saveObject there seems to be a buffer size limit of about 6000 bytes. Larger buffers cause an error {"readyState":0,"status":0,"statusText":"error"}.
http://IP:8083/JS/Run/loadObject('dedevices.json')
http://IP:8083/JS/Run/loadObject('endevices.json')
http://IP:8083/JS/Run/loadObject('zwayo ... ckets.json')
http://IP:8083/JS/Run/loadObject('zwayp ... ckets.json')
These 4 are the largest files of all:
-rwxr-xr-x 1 4142694 Apr 19 13:49 dedevicesjson-b02fc6609e0022e8f55ff6bb5b853d35.json
-rwxr-xr-x 1 4103417 Apr 19 13:49 endevicesjson-7904daacdb872d656b01c6c9eddd3a48.json
-rwxr-xr-x 1 621220 Aug 11 08:31 zwayoriginPacketsjson-2ad2998bc2cb543d29ac586cec215398.json
-rwxr-xr-x 1 817011 Aug 11 08:31 zwayparsedPacketsjson-f1aed46af7fae1368e78db7768e4d9e5.json
For saveObject there seems to be a buffer size limit of about 6000 bytes. Larger buffers cause an error {"readyState":0,"status":0,"statusText":"error"}.
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Re: JS API: file size limits for file access?
This should be HTTP limit and not API
Re: JS API: file size limits for file access?
Is it a limit of ZWay webserver? Where is it configured?
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Re: JS API: file size limits for file access?
It's not the filesize but the filename. After storing those file with a different valid filename it works.
It's obviously the ZWay embedded webserver. I tested it with netcat.
Apache server also has such a limit: LimitRequestLine 8190
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Re: JS API: file size limits for file access?
We should use mongoose default values
Re: JS API: file size limits for file access?
Of course, but I found it nowhere documented.
Now looked into mongoose code: #define MG_MAX_HTTP_REQUEST_SIZE 8192
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me(327) ZW0700 7.21.00 07.42/1766938484 1025/257
Z-Way version v4.1.2 from 2023-10-18 03:34:26 +0300