xAPPO 9 Share Posted July 19, 2020 (edited) Did you get the mqtt library installed OK ? Or you mean you are using IF's to not execute any mqtt statements offline ? Our posts overlapped sorry - what OS are you running ZeroBrane on ? Edited July 19, 2020 by xAPPO Quote Link to post Share on other sites
10der 656 Share Posted July 19, 2020 17 minutes ago, xAPPO said: Did you get the mqtt library installed OK ? Or you mean you are using IF's to not execute any mqtt statements offline ? Our posts overlapped sorry - what OS are you running ZeroBrane on ? no. I am chuck norris Quote Link to post Share on other sites
jgab 903 Author Share Posted July 19, 2020 20 minutes ago, 10der said: @jgab Jan another issue I can't see any ":" in the code - this piece of code has compiled for months - must be some evil char that have sneaked into your source. Quote Link to post Share on other sites
jgab 903 Author Share Posted July 19, 2020 42 minutes ago, 10der said: You need to change the way you include the emulator if require and not hc3_emulator then require("fibaro") end ...otherwise you get an infinite loop. Quote Link to post Share on other sites
10der 656 Share Posted July 19, 2020 Jan. thank you. fixed. so. luamqtt doesn't work in VSCode. attached lib works. but I re-wrote (cuz uncompatibile) your code mqtt_lua-master.zip Quote Link to post Share on other sites
jgab 903 Author Share Posted July 19, 2020 12 minutes ago, 10der said: Jan. thank you. fixed. so. luamqtt doesn't work in VSCode. attached lib works. but I re-wrote (cuz uncompatibile) your code mqtt_lua-master.zip 123.74 kB · 0 downloads Why doesn't it work? Is it some lib? like luasocket? Quote Link to post Share on other sites
10der 656 Share Posted July 19, 2020 ok. trying to debug. btw: simple lib what i attached worls like a charm Quote Link to post Share on other sites
jgab 903 Author Share Posted July 19, 2020 18 minutes ago, 10der said: ok. trying to debug. btw: simple lib what i attached worls like a charm Ok, I will have look at the library and see if I can use it instead. Quote Link to post Share on other sites
10der 656 Share Posted July 19, 2020 @jgab fixed luamqtt installation fro VSCode now i have this blad. [19.07.2020] [23:13:14] |ERROR|: MQTT error:failed to open network connection: socket.connect failed: host or service not provided, or not known Quote Link to post Share on other sites
10der 656 Share Posted July 19, 2020 (edited) UPD mqtt://192.168.1.10:1883 self.client = mqtt.Client.connect("192.168.1.10", {clientId = "HC3"}) [19.07.2020] [23:20:07] |[34;1mSDBG |: MQTT connect:{"rc":0,"type":2,"sp":false} [19.07.2020] [23:20:12] [DEBUG]: connected: {"returnCode":0,"sessionPresent":false} [19.07.2020] [23:20:17] |[34;1mSDBG |: MQTT close:{"close_reason":"connection closed by broker","connack":{"type":2,"rc":0,"sp":false},"coro":thread: Edited July 19, 2020 by 10der Quote Link to post Share on other sites
10der 656 Share Posted July 19, 2020 UPD2: all OK! just clientID already was busy by own app. Quote Link to post Share on other sites
10der 656 Share Posted July 19, 2020 so, RTFM for windows VSCode users 1) download luamqtt-master.zip 2) unpack to mqtt folder from zip mqtt folder (sorry for tautology) 3) create mqtt.lua file with context return require("mqtt.init") happy debugging! Quote Link to post Share on other sites
rangee 11 Share Posted July 23, 2020 After F/W upgrade to 5.040.37.. mainFunction now invisible. Yes. Can't edit via api.post() Quote Link to post Share on other sites
tinman 621 Share Posted July 23, 2020 click in the main file left .. this version supports multifile QAs. Once clicked you should see content and be able to save, so the selection stays in saved QA. 1 Quote Link to post Share on other sites
jgab 903 Author Share Posted July 23, 2020 (edited) 1 hour ago, rangee said: After F/W upgrade to 5.040.37.. mainFunction now invisible. Yes. Can't edit via api.post() Yes, the quickApp's code management have become more sophisticated. I need to update the way I deal with it in the emulator. The good news is that I believe what we got is much better.... Edited July 23, 2020 by jgab Quote Link to post Share on other sites
rangee 11 Share Posted July 23, 2020 2 minutes ago, jgab said: Yes, the quickApp's code management have become more sophisticated. I need to update the way I deal with it in the emulator. The good news is that I believe what we got is much better.... I think this is preparation of QA encryption. To encrypt the code, it need to be invisible via any way. QA editor consists of main file and additional files(eg. test1) QA loads test1, test2 and finally main file. main file loaded at last. test1, test2, main these 3 files are cooperative but works independently. I mean... test1's local var, fun cannot call at test2, main. test1's function Quickapp:method is callable at main. Quote Link to post Share on other sites
jgab 903 Author Share Posted July 23, 2020 (edited) 1 hour ago, rangee said: QA editor consists of main file and additional files(eg. test1) QA loads test1, test2 and finally main file. main file loaded at last. test1, test2, main these 3 files are cooperative but works independently. I mean... test1's local var, fun cannot call at test2, main. test1's function Quickapp:method is callable at main. So they share the global environment and not locals, and that is expected. Yes it seems like 'main' (that can't be removed) is run last. The rest of the files seems to be loaded in order, top to bottom. If I have 3 files: File 'main': print("A1") function QuickApp:onInit() self:debug("A1") end File 'test1': print("B1") File 'test2': print("C1") I get the log: [23.07.2020] [22:23:32] [DEBUG] [QUICKAPP1333]: B1 [23.07.2020] [22:23:32] [DEBUG] [QUICKAPP1333]: C1 [23.07.2020] [22:23:32] [DEBUG] [QUICKAPP1333]: A1 [23.07.2020] [22:23:32] [DEBUG] [QUICKAPP1333]: B1 [23.07.2020] [22:23:32] [DEBUG] [QUICKAPP1333]: C1 [23.07.2020] [22:23:32] [DEBUG] [QUICKAPP1333]: A1 Which looks like they load all the files twice(!) - be aware to not have commands that execute directly in your files - like the prints in my example... However, it's only when we save the QA - if it restarts due to a crash it only loads the files once. Edited July 23, 2020 by jgab Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.