22.09.2025, 15:56
(22.09.2025, 14:25)admin Wrote: Value must be a valid JSON. Strings must be enclosed in double quotes.
Good afternoon,
That is not the issue. I’ve changed the script to analyze what the Logic Machine returns, and for some reason, it only receives the first variable within the string. If I put addr first, it receives addr, and if I put value first, it receive value (without "").
With this write.lp:
Code:
<?
require('apps')
addr = getvar('addr') or ''
value = getvar('value') or ''
print("Addr: ", addr)
print("Value: ", value)
print("Type: ", type(value))
if value then
print("Value: ", value)
grp.write(addr, value)
end
If I send "http://192.168.2.205/public/write.lp?value=test&addr=35/1/12"
Response:
Code:
HTTP/1.1 200 OK
cache-control: no-store
connection: keep-alive
content-type: text/html; charset=utf-8
date: Mon, 22 Sep 2025 15:48:28 GMT
permissions-policy: autoplay=self,fullscreen=self
referrer-policy: same-origin
transfer-encoding: chunked
x-content-type-options: nosniff
Addr:
Value: test
Type: string
Value: test
If I send "http://192.168.2.205/public/write.lp?addr=35/1/12&value=test""
Response:
Code:
HTTP/1.1 200 OK
cache-control: no-store
connection: keep-alive
content-type: text/html; charset=utf-8
date: Mon, 22 Sep 2025 15:49:12 GMT
permissions-policy: autoplay=self,fullscreen=self
referrer-policy: same-origin
transfer-encoding: chunked
x-content-type-options: nosniff
Addr: 35/1/12
Value:
Type: string
Value:
If i send "http://192.168.2.205/public/write.lp?value=1"
Response:
Code:
HTTP/1.1 200 OK
cache-control: no-store
connection: keep-alive
content-type: text/html; charset=utf-8
date: Mon, 22 Sep 2025 15:51:48 GMT
permissions-policy: autoplay=self,fullscreen=self
referrer-policy: same-origin
transfer-encoding: chunked
x-content-type-options: nosniff
Addr:
Value: 1
Type: string
Value: 1
If i send "http://192.168.2.205/public/write.lp?addr=35/1/12&valor="Test" (or 'Test')
Response:
Code:
HTTP/1.1 200 OK
cache-control: no-store
connection: keep-alive
content-type: text/html; charset=utf-8
date: Mon, 22 Sep 2025 15:55:35 GMT
permissions-policy: autoplay=self,fullscreen=self
referrer-policy: same-origin
transfer-encoding: chunked
x-content-type-options: nosniff
Addr: 35/1/12
Value:
Type: string
Value: