eclipse / paho.mqtt.ruby

Eclipse Public License 1.0
34 stars 8 forks source link

How to debug paho mqtt? #15

Open BKDruby opened 3 years ago

BKDruby commented 3 years ago

I have the next code:

    client = PahoMqtt::Client.new
    client.ssl = true
    client.persistent = true
    certificate = 'mqqt-certificate.pem.crt'
    key = 'mqqt-private.pem.key'
    root_ca = 'cacert.pem'
    client.config_ssl_context(certificate, key, root_ca)
    client.connect("someserveramazonaws.com", 8883) #, 60, true, true)

    client.add_topic_callback("selfmon/vmod.01a/vrio/outputs/#") { |packet| puts "Specific callback for #{packet.topic}" }
    client.publish("selfmon/vmod.01a/vportal/vrio/outputs", "999999,unset", false, 1)

client.connected? return true

publish command return 0 and I don't receive any in the topic callback and don't see any changes through mqtt explorer on this server.

Where I can find some logs of it? because I don't receive any error and not sure that 0 result unexpectable or not.

Please help me with it. Thank you.

BKDruby commented 3 years ago

BTW Do I have the possibility to get a list of available topics?