Logic Machine Forum
qr code generator - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: qr code generator (/showthread.php?tid=2401)



qr code generator - Auzzii - 27.12.2019

Hello,

Can someone help me integrate QR generator in SCADA


I receive ASCII string code from RS485 to address 5/1/1

I need to display QRcode image in SCADA

http://davidshimjs.github.io/qrcodejs/


Tnx.


RE: qr code generator - Joep - 28.12.2019

It's easier to use an API. I just tested with the script below and it works. Check the website for the API options. Source: http://goqr.me/api/

Add the script below to your controller and fill the data with your ASCII string.
Next step is to add an image object to your visualization with the remote url: /scada/resources/img/qr-code.png and a refresh interval of 10 seconds for example.
Now each time you run the script an png image with the qr code will be added to the folder /scada/resources/img and dueto the refresh it will be visible within 10 seconds.


SCRIPT:
--Source: http://goqr.me/api/

require('ssl.https')

data = 'https://knxgroothandel.nl' --QR code data
qr = ssl.https.request('https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=' .. data)

io.writefile("/www/scada/resources/img/qr-code.png", qr)


RE: qr code generator - admin - 28.12.2019

Constantly writing data to SD card is bad for it's longevity. Pure client side solution is better but more complicated to implement.


RE: qr code generator - Erwin van der Zwart - 28.12.2019

Hi,

Extract this to user folder inside the "apps" ftp location:
.zip   qr.zip (Size: 10.14 KB / Downloads: 17)


Add a frame to your visu with this URL: /user/qr/qr.lp

When the object 5/1/1 has no value a QR to the host location is generated.

BR,

Erwin


RE: qr code generator - Auzzii - 30.12.2019

Hi,
Everything works except Right-click to save

Tnx


RE: qr code generator - Erwin van der Zwart - 30.12.2019

Hi,

That must have something to do with your client as it works perfect in my controller..

   

BR,

Erwin


RE: qr code generator - Auzzii - 30.12.2019

In /scada-vis on iphone/android i can't Sad


RE: qr code generator - Erwin van der Zwart - 30.12.2019

Hi,

It also works on iOS, i don't have Android to test..
   
Add to Photo's -> in Dutch "Voeg toe aan Foto's"

BR,

Erwin