rttools / hodmin

CLI-Tool for Homie-devices
12 stars 5 forks source link

Can not connect to my mqtt broker #5

Closed lesjaw closed 6 years ago

lesjaw commented 7 years ago

Hello, I would like to try your homie OTA updater.. but i got this error when I try to run hodmin list

lesjaw@cloud:~$ hodmin list
/home/lesjaw/.rvm/gems/ruby-2.4.0/gems/mqtt-0.4.0/lib/mqtt/client.rb:257:in `initialize': getaddrinfo: Name or service not known (SocketError)
        from /home/lesjaw/.rvm/gems/ruby-2.4.0/gems/mqtt-0.4.0/lib/mqtt/client.rb:257:in `new'
        from /home/lesjaw/.rvm/gems/ruby-2.4.0/gems/mqtt-0.4.0/lib/mqtt/client.rb:257:in `connect'
        from /home/lesjaw/.rvm/gems/ruby-2.4.0/gems/mqtt-0.4.0/lib/mqtt/client.rb:93:in `connect'
        from /home/lesjaw/.rvm/gems/ruby-2.4.0/gems/hodmin-0.1.5/lib/hodmin/hodmin_tools.rb:86:in `mqtt_connect'
        from /home/lesjaw/.rvm/gems/ruby-2.4.0/gems/hodmin-0.1.5/lib/hodmin/hodmin_tools.rb:241:in `fetch_homie_dev_list'
        from /home/lesjaw/.rvm/gems/ruby-2.4.0/gems/hodmin-0.1.5/lib/hodmin/hodmin_list.rb:12:in `hodmin_list'
        from /home/lesjaw/.rvm/gems/ruby-2.4.0/gems/hodmin-0.1.5/bin/hodmin:144:in `<top (required)>'
        from /home/lesjaw/.rvm/gems/ruby-2.4.0/bin/hodmin:22:in `load'
        from /home/lesjaw/.rvm/gems/ruby-2.4.0/bin/hodmin:22:in `<main>'
        from /home/lesjaw/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `eval'
        from /home/lesjaw/.rvm/gems/ruby-2.4.0/bin/ruby_executable_hooks:15:in `<main>'

my .hodmin.yaml is something like this

mqtt:
  protocol: tcp://
  host: 156.xx.xx.xx
  port: 1883
  user: 'lesjaw@gmail.com'
  password: 'xxxxxxx'
  base_topic: 'devices/'
  auth: true
  timeout: '0.3'
firmware:
  dir: "/home/lesjaw/fw"
  filepattern: "*.bin"
logging:
  logdestination: nil
output:
  list: HD.mac HD.online HD.localip HD.name FW.checksumFW.fw_name FW.fw_version HD.upgradable
  nil: ''
rttools commented 7 years ago

Try protocol: mqtt:// in your config file like shown in my readme.