This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Azure IoT Hub - MQTT
#21
(10.01.2019, 09:55)admin Wrote: Thanks!

First, you need to update MQTT library packages:

New CPU:
https://dl.openrb.com/pkg/libmosquitto_1...1_imx6.ipk
https://dl.openrb.com/pkg/luamosquitto_0.3-2_imx6.ipk

Old CPU:
https://dl.openrb.com/pkg/libmosquitto_1.4.15-1_mxs.ipk
https://dl.openrb.com/pkg/luamosquitto_0.3-2_mxs.ipk

Here's a minimal example that you can use, don't forget to change device_id, broker, username and password parameters. You also need to upload azure.crt via FTP (using ftp username, upload to root directory). Certificate file contents: https://gist.github.com/jsopenrb/5873b20...d6b950151f
Code:
device_id = 'DEV_TEST'
broker = 'DEV.azure-devices.net'
port = 8883
username = 'DEV.azure-devices.net/DEV_TEST'
password = 'SharedAccessSignature ...'

mqtt = require('mosquitto')
client = mqtt.new(device_id)

client.ON_CONNECT = function(...)
 log('ON_CONNECT', ...)
 client:publish('devices/' .. device_id .. '/messages/events/', '{id=456}')
end

client.ON_PUBLISH = function(...)
 log('ON_PUBLISH', ...)
end

client.ON_LOG = function(...)
 log('ON_LOG', ...)
end

client.ON_DISCONNECT = function(...)
 log('ON_DISCONNECT', ...)
end

client:version_set(mqtt.PROTOCOL_V311)
client:tls_set('/home/ftp/azure.crt')
client:login_set(username, password)
client:connect(broker, port)

while true do
 res, err, code = client:loop()
 if not res then
   log('loop error', res, err, code)
   os.sleep(1)
 end
end

Is there a typo in the filename or is the package removed from your downloads? 

libmosquitto_1.4.15-1_imx6.ipk
Reply
#22
Updated package: https://dl.openrb.com/pkg/libmosquitto_1.6.2-1_imx6.ipk
Reply
#23
(10.01.2019, 09:55)admin Wrote: Thanks!

First, you need to update MQTT library packages:

New CPU:
https://dl.openrb.com/pkg/libmosquitto_1...1_imx6.ipk
https://dl.openrb.com/pkg/luamosquitto_0.3-2_imx6.ipk

Old CPU:
https://dl.openrb.com/pkg/libmosquitto_1.4.15-1_mxs.ipk
https://dl.openrb.com/pkg/luamosquitto_0.3-2_mxs.ipk

Here's a minimal example that you can use, don't forget to change device_id, broker, username and password parameters. You also need to upload azure.crt via FTP (using ftp username, upload to root directory). Certificate file contents: https://gist.github.com/jsopenrb/5873b20...d6b950151f
Code:
device_id = 'DEV_TEST'
broker = 'DEV.azure-devices.net'
port = 8883
username = 'DEV.azure-devices.net/DEV_TEST'
password = 'SharedAccessSignature ...'

mqtt = require('mosquitto')
client = mqtt.new(device_id)

client.ON_CONNECT = function(...)
 log('ON_CONNECT', ...)
 client:publish('devices/' .. device_id .. '/messages/events/', '{id=456}')
end

client.ON_PUBLISH = function(...)
 log('ON_PUBLISH', ...)
end

client.ON_LOG = function(...)
 log('ON_LOG', ...)
end

client.ON_DISCONNECT = function(...)
 log('ON_DISCONNECT', ...)
end

client:version_set(mqtt.PROTOCOL_V311)
client:tls_set('/home/ftp/azure.crt')
client:login_set(username, password)
client:connect(broker, port)

while true do
 res, err, code = client:loop()
 if not res then
   log('loop error', res, err, code)
   os.sleep(1)
 end
end

HELLO!

You seem to have removed one of the mosquitto lib files from your server!! Thats a bit of an issue as we have software that downloads and installs those libs automatically. Can you please upload them again?
Reply
#24
New CPU:
https://dl.openrb.com/pkg/libmosquitto_1.6.3-1_imx6.ipk
https://dl.openrb.com/pkg/luamosquitto_0.3-2_imx6.ipk

Old CPU:
https://dl.openrb.com/pkg/luamosquitto_0.3-2_mxs.ipk
https://dl.openrb.com/pkg/libmosquitto_1.6.3-1_mxs.ipk
Reply
#25
(03.07.2019, 12:33)admin Wrote: New CPU:
https://dl.openrb.com/pkg/libmosquitto_1.6.3-1_imx6.ipk
https://dl.openrb.com/pkg/luamosquitto_0.3-2_imx6.ipk

Old CPU:
https://dl.openrb.com/pkg/luamosquitto_0.3-2_mxs.ipk
https://dl.openrb.com/pkg/libmosquitto_1.6.3-1_mxs.ipk

Hi, 

These don't work with our software. You probably did some changes, I'm getting loads of error messages.

Could you send me the old ones linked to in this thread earlier? Then I can just deploy new software with these versions built in instead.

Edgars has my email.

EDIT:

It’s only the lib file for the new cpu I’m missing. 1.4 something.
Reply
#26
What errors are you getting exactly and what CPU are you using?

We constantly update packages on our server and you should never rely on certain files being there.

You can find older versions here but I suspect that they won't work:
https://dl.openrb.com/lm-17/pkg/
https://dl.openrb.com/lm-17-imx6/pkg/

Can you also send connection details via PM so we can test locally?
Reply
#27
(03.07.2019, 13:18)admin Wrote: What errors are you getting exactly and what CPU are you using?

We constantly update packages on our server and you should never rely on certain files being there.

You can find older versions here but I suspect that they won't work:
https://dl.openrb.com/lm-17/pkg/
https://dl.openrb.com/lm-17-imx6/pkg/

Can you also send connection details via PM so we can test locally?

Thank you for the files. I've packaged a version with local libs instead of downloading from the internet. I had to focus on making this work as opposed to troubleshooting as we have customers downloading our software from our portal. When I get back down to earth I'm sure we can look at what the issues might be. What changes were made? 

The hardware here is a HW3 SpaceLYnk, Armv7. We require they use 2.3.0 firmware for our software to function, that's why these "older" mosquitto libs will work fine.
Reply
#28
There should not be any changes on the protocol level, only some bug fixes. Can you send connection details via PM so we can test it?
Reply
#29
Hi,

FW 2.3.0 has MQTT default in the FW so you don't need to install any package to use it..

BR,

Erwin
Reply
#30
There might be some features missing like an ability to set protocol version.
Reply


Forum Jump: