MQTT lib references? enable TLS for use with AWS - 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: MQTT lib references? enable TLS for use with AWS (/showthread.php?tid=1740) Pages:
1
2
|
MQTT lib references? enable TLS for use with AWS - juanpalf - 21.11.2018 Hi there! Im new to the forum, maybe this is a redundant thread but I cant find it anywere in the forums... or the internet I need to configure the MQTT library to be used with AWS so far i can connect to a broker without authentication or just with user and password... the libs i downloaded from the admin post are here: Libs Files And used this code to connect to my broker: Code: broker = 'broker ip' now i need to setup the LM to connect to AWS but i need to provide TLS security with all the files needed to it root, Private etc etc... So... is this possible?? any help is very appreciated Thanks in advance -Juan RE: MQTT lib references? enable TLS for use with AWS - admin - 22.11.2018 Please update LM to 2018 RC1 firmware, it has MQTT libraries built in and it uses latest version that has some SSL issues fixed. This library is used in LM: https://github.com/flukso/lua-mosquitto Before connection is established you need to provide paths to certificate files. You can upload certificates via ftp. Keyfiles cannot have a passphrase. Only server certificate is used: Code: cafile = '/home/ftp/server.crt' Both client and server certificates are used: Code: cafile = '/home/ftp/server.crt' RE: MQTT lib references? enable TLS for use with AWS - juanpalf - 22.11.2018 Hi again Thanks for the help. now i Have this issue with the script it get me te following error code: Conexion MQTT AWS 22.11.2018 15:18:54 Resident script:31: Invalid function arguments provided. stack traceback: [C]: in function 'tls_set' RE: MQTT lib references? enable TLS for use with AWS - admin - 23.11.2018 Have you uploaded all certificate files to FTP correctly? RE: MQTT lib references? enable TLS for use with AWS - juanpalf - 23.11.2018 (23.11.2018, 15:27)admin Wrote: Have you uploaded all certificate files to FTP correctly? Yes done several times maybe something is wrong with my procedure? I connect to my FTP server with open "IP" then use cd /home/ftp/ [I had to create this folders] then use send "file.crt" etc etc for the other files is there a way to see if the files are actually stored in LM? also im starting tests for Google Clooud and there is also a difficultys.... RE: MQTT lib references? enable TLS for use with AWS - Erwin van der Zwart - 23.11.2018 Hi, /home/ftp is the root location of the build in ftp server, you should not create folders.. BR, Erwin RE: MQTT lib references? enable TLS for use with AWS - juanpalf - 23.11.2018 (23.11.2018, 18:58)Erwin van der Zwart Wrote: Hi, I mean connecto to the FTP I use a windows laptop to upload the files maybe im actually doing something wrong? i tried both the apps user and the ftp user to login..... again is there a way to see if the files are there? RE: MQTT lib references? enable TLS for use with AWS - Erwin van der Zwart - 23.11.2018 Hi, Use your windows explorer (not browser!) by entering ftp:// ftp:ftp@192.168.0.10 in the path bar, or use filezilla, total commander or another ftp client to login to the ftp server with username ‘ftp’ and default password ‘ftp’, also make sure the ftp server is enabled. There you see the files or copy them there. BR, Erwin RE: MQTT lib references? enable TLS for use with AWS - juanpalf - 23.11.2018 (23.11.2018, 19:09)Erwin van der Zwart Wrote: Hi, Just did and the files are there.... what could possibly be the problem? thanks in advance RE: MQTT lib references? enable TLS for use with AWS - Erwin van der Zwart - 23.11.2018 Hi, In folders or direct on root? BR, Erwin RE: MQTT lib references? enable TLS for use with AWS - juanpalf - 23.11.2018 (23.11.2018, 19:18)Erwin van der Zwart Wrote: Hi, folders exactly as i mention.. I had to create these folders path is /home/ftp/ i just tested again and its the same also i have to change directorys with cd in the FTP terminal.... the code looks like this.... Code: broker = 'awsarn' RE: MQTT lib references? enable TLS for use with AWS - Erwin van der Zwart - 23.11.2018 Hi, That is not correct, the files needs to be direct in the root of the ftp without folders. In script we use /home/ftp but that is just the internal path to the internal ftp server at root level. If you have the folders like now your path would be /home/ftp/home/ftp/xxxxx.crt BR, Erwin RE: MQTT lib references? enable TLS for use with AWS - juanpalf - 23.11.2018 (23.11.2018, 19:57)Erwin van der Zwart Wrote: Hi, Thats correct weird enough the files dont show in the root folder even when i send them to the root anyway THANK YOU! The error message is gone now but the AWS is not receiving anything.... tested with node-red and its working any ideas? RE: MQTT lib references? enable TLS for use with AWS - admin - 26.11.2018 Post whole code that you're using. RE: MQTT lib references? enable TLS for use with AWS - juanpalf - 26.11.2018 (26.11.2018, 10:29)admin Wrote: Post whole code that you're using. Code: mqtt = require("mosquitto") This is the code is now working ok with a Mosquitto install in a different server but with no security..... Should be done differently? Thanks for all the help so far. RE: MQTT lib references? enable TLS for use with AWS - admin - 26.11.2018 Have you updated firmware to 2018 RC1? RE: MQTT lib references? enable TLS for use with AWS - juanpalf - 26.11.2018 (26.11.2018, 14:50)admin Wrote: Have you updated firmware to 2018 RC1? yes.... Testing with both AWS and Google and seems like its broken.. No error logs or warning even added some logs each time it try to send a payload and seems ok but nothing is arriving at the other side... i find something interesting in the google documentation... it uses JWT to connect with the server in the password fied.... is there any CreateJWT() kind of function available? RE: MQTT lib references? enable TLS for use with AWS - juanpalf - 28.11.2018 I got it working with a node_MCU and its needed the JWT is there any way to have this working? RE: MQTT lib references? enable TLS for use with AWS - admin - 29.11.2018 You have disconnect on first publish, remove this code. Code: client.ON_PUBLISH = function() Also, try replacing the loop part to log the result: Code: while true do RE: MQTT lib references? enable TLS for use with AWS - juanpalf - 30.11.2018 (29.11.2018, 08:53)admin Wrote: You have disconnect on first publish, remove this code. Log sends MQTT error now maybe its something wrong with the certificate files?? |