Posts: 7773
Threads: 42
Joined: Jun 2015
Reputation:
447
This means that connection is working fine.
Next add some logging to group event callback:
Code: function publishvalue(event)
-- message from us or client is not connected
if event.sender == 'mq' or not mclientfd then
return
end
local addr = event.dst
local dpt = datatypes[ addr ]
local topic = object_to_mqtt[ addr ]
-- unknown object
if not dpt or not topic then
return
end
local value = busdatatype.decode(event.datahex, dpt)
if value ~= nil then
if type(value) == 'boolean' then
value = value and 1 or 0
end
log('publish', mclient:publish(topic, tostring(value)) )
else
log('failed to decode data', event.datahex, dpt)
end
end
Posts: 237
Threads: 31
Joined: May 2018
Reputation:
2
25.11.2019, 09:05
(This post was last modified: 25.11.2019, 09:12 by DGrandes.)
(25.11.2019, 07:35)admin Wrote: This means that connection is working fine.
Next add some logging to group event callback:
Code: function publishvalue(event)
-- message from us or client is not connected
if event.sender == 'mq' or not mclientfd then
return
end
local addr = event.dst
local dpt = datatypes[ addr ]
local topic = object_to_mqtt[ addr ]
-- unknown object
if not dpt or not topic then
return
end
local value = busdatatype.decode(event.datahex, dpt)
if value ~= nil then
if type(value) == 'boolean' then
value = value and 1 or 0
end
log('publish', mclient:publish(topic, tostring(value)) )
else
log('failed to decode data', event.datahex, dpt)
end
end
Hi,
Don´t log anything when I change value of 37/3/1 and in the script i have:
Code: object_to_mqtt = {
['37/3/1'] = 'SEND1',
['37/3/2'] = 'SEND2', --SEND 1 and SEND 2 are object to mqtt commands
}
Posts: 7773
Threads: 42
Joined: Jun 2015
Reputation:
447
Check if you get event data at all:
Code: function publishvalue(event)
log(event, datatypes[ event.dst ], object_to_mqtt[ event.dst ])
Posts: 237
Threads: 31
Joined: May 2018
Reputation:
2
25.11.2019, 10:01
(This post was last modified: 25.11.2019, 10:03 by DGrandes.)
(25.11.2019, 09:05)DGrandes Wrote: (25.11.2019, 07:35)admin Wrote: This means that connection is working fine.
Next add some logging to group event callback:
Code: function publishvalue(event)
-- message from us or client is not connected
if event.sender == 'mq' or not mclientfd then
return
end
local addr = event.dst
local dpt = datatypes[ addr ]
local topic = object_to_mqtt[ addr ]
-- unknown object
if not dpt or not topic then
return
end
local value = busdatatype.decode(event.datahex, dpt)
if value ~= nil then
if type(value) == 'boolean' then
value = value and 1 or 0
end
log('publish', mclient:publish(topic, tostring(value)) )
else
log('failed to decode data', event.datahex, dpt)
end
end
Hi,
Don´t log anything when I change value of 37/3/1 and in the script i have:
Code: object_to_mqtt = {
['37/3/1'] = 'SEND1',
['37/3/2'] = 'SEND2', --SEND 1 and SEND 2 are object to mqtt commands
}
I don´t get event data from " object_to_mqtt" objects but I get from other objects in my LM.
I have another question:
I´ve installed 2 MQTT packages from last Logic Machine Firmware but I don´t see new packages from this firmware, aren´t necessary?
Posts: 7773
Threads: 42
Joined: Jun 2015
Reputation:
447
MQTT packages are included by default, no need to install anything manually. Do you get anything in the error log? Can you send backup from your device via PM so we can check locally?
Posts: 237
Threads: 31
Joined: May 2018
Reputation:
2
25.11.2019, 10:17
(This post was last modified: 25.11.2019, 10:19 by DGrandes.)
(25.11.2019, 10:01)DGrandes Wrote: (25.11.2019, 09:05)DGrandes Wrote: (25.11.2019, 07:35)admin Wrote: This means that connection is working fine.
Next add some logging to group event callback:
Code: function publishvalue(event)
-- message from us or client is not connected
if event.sender == 'mq' or not mclientfd then
return
end
local addr = event.dst
local dpt = datatypes[ addr ]
local topic = object_to_mqtt[ addr ]
-- unknown object
if not dpt or not topic then
return
end
local value = busdatatype.decode(event.datahex, dpt)
if value ~= nil then
if type(value) == 'boolean' then
value = value and 1 or 0
end
log('publish', mclient:publish(topic, tostring(value)) )
else
log('failed to decode data', event.datahex, dpt)
end
end
Hi,
Don´t log anything when I change value of 37/3/1 and in the script i have:
Code: object_to_mqtt = {
['37/3/1'] = 'SEND1',
['37/3/2'] = 'SEND2', --SEND 1 and SEND 2 are object to mqtt commands
}
I don´t get event data from "object_to_mqtt" objects but I get from other objects in my LM.
I have another question:
I´ve installed 2 MQTT packages from last Logic Machine Firmware but I don´t see new packages from this firmware, aren´t necessary? But mqtt server is internal on my network.
Nothing in error log
Anydesk maybe to show my LM?
Posts: 7773
Threads: 42
Joined: Jun 2015
Reputation:
447
This is probably not connected with MQTT server. You can also provide access via TeamViewer or port forward ports 22 and 80 to your LM.
Posts: 237
Threads: 31
Joined: May 2018
Reputation:
2
(25.11.2019, 10:21)admin Wrote: This is probably not connected with MQTT server. You can also provide access via TeamViewer or port forward ports 22 and 80 to your LM.
I send you Teamviewer acces by mp
Posts: 7773
Threads: 42
Joined: Jun 2015
Reputation:
447
Thanks, the issue was with resident script having 1 second sleep time (it should be 0). This causes the handler to get only 1 bus message per second.
Posts: 237
Threads: 31
Joined: May 2018
Reputation:
2
25.11.2019, 10:57
(This post was last modified: 25.11.2019, 10:57 by DGrandes.)
(25.11.2019, 10:56)admin Wrote: Thanks, the issue was with resident script having 1 second sleep time (it should be 0). This causes the handler to get only 1 bus message per second.
Thanks!
Posts: 449
Threads: 94
Joined: Jun 2015
Reputation:
6
I have a LM5P2-KC (right side of the device sticker).
But when i choose system - upgrade firmware is said: LM5 Lite + ext (i.MX6) ???
What firmware do i need to upgrade my device?
Posts: 4659
Threads: 24
Joined: Aug 2017
Reputation:
212
LM5 Power with extensions
------------------------------
Ctrl+F5
Posts: 20
Threads: 4
Joined: Mar 2019
Reputation:
2
Hi,
Does Mosaic3 work in the cloud with the release RC1?
Thx!
Posts: 4659
Threads: 24
Joined: Aug 2017
Reputation:
212
yes it works
------------------------------
Ctrl+F5
Posts: 110
Threads: 10
Joined: Mar 2019
Reputation:
3
Is there any ETA for the final release?
Posts: 7773
Threads: 42
Joined: Jun 2015
Reputation:
447
Not yet, RC2 is planned for early next year
Posts: 92
Threads: 9
Joined: Sep 2015
Reputation:
1
(16.12.2019, 09:39)admin Wrote: Not yet, RC2 is planned for early next year
For the sake of releasing approved quality SW upgrades, I would strongly recommend to OpenRB to test the packages on all your HW products.
For example, I own a LM4 and I have used the image file from this link and the result was that my LM4 has stayed on the same version. Below is a capture after the upgrade:
Also, don't forget to change the copyright year, as we will soon be in 2020!
Posts: 7773
Threads: 42
Joined: Jun 2015
Reputation:
447
Are you sure your SD card is not in read-only state? This would explain why upgrade did not work.
Posts: 92
Threads: 9
Joined: Sep 2015
Reputation:
1
30.12.2019, 11:14
(This post was last modified: 30.12.2019, 11:15 by andeug.)
I am using the same upgrade method as below, via the System config / System / Upgrade firmware.
I am not sure about which SD card you are mentioning - how can I check its state on a LM4 module?
Posts: 4659
Threads: 24
Joined: Aug 2017
Reputation:
212
Open system logs and paste what is there. Use separate thread for this discussion.
------------------------------
Ctrl+F5
|