Mosquitto



  • Not really related to mysensors but many are using MQTT so the question goes like this.
    Currently moving from UBUNTU 14 server to the latest RASPBIAN on raspberry. The gateway is the MQTT client ESP12
    Installed mosquitto, mosquitto-clients and mosquitto python (both)

    Running tcommand on ubuntu

    $ mosquitto_sub -v -t 'mygateway1-out/#'
    

    gives me output from mysensors

    running

    $ mosquitto_sub -v -t 'mygateway1-out/#'
    

    on raspbian gives me silence

    Mosquitto is up and running and i can see it on the sockets

    And yes i have a loopback in interfaces.

    auto lo
    iface lo inet loopback
    

    Any help will be appreciated



  • In the logs i notice

    1465234765: New connection from ::1 on port 1883.
    1465234765: New client connected from ::1 as mosqsub/1701-homepi (c1, k60).
    1465234774: Socket error on client mosqsub/1701-homepi, disconnecting.
    1465234789: mosquitto version 1.3.4 terminating
    1465234789: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.


  • Mod

    @moskovskiy82 Maybe different Mosquitto versions?
    Caused me headaches in the past...



  • Touche... Will try to install a new one. Wonder if it is worth going MQTT path after this...

    Ubuntu

    libmosquitto0:amd64/trusty 0.15-2ubuntu1 uptodate
    libmosquitto1:amd64/trusty 1.4.9-0mosquitto1 uptodate
    mosquitto:amd64/trusty 1.4.9-0mosquitto1 uptodate
    mosquitto-clients:amd64/trusty 1.4.9-0mosquitto1 uptodate
    

    Raspbian

    libmosquitto1:armhf/jessie 1.3.4-2 uptodate
    mosquitto:armhf/jessie 1.3.4-2 uptodate
    mosquitto-clients:armhf/jessie 1.3.4-2 uptodate
    python-mosquitto:all/jessie 1.3.4-2 uptodate
    python3-mosquitto:all/jessie 1.3.4-2 uptodate


  • Well now i have a hedache as well..
    Updated to 1.4.8 freom http://repo.mosquitto.org/debian/mosquitto-jessie.list (as it seems the latest avail)

    Upgraded mosquitto and mosquitto clients

     $ apt-show-versions | grep mosquitto
    libmosquitto1:armhf/jessie 1.4.8-0mosquitto2 uptodate
    mosquitto:armhf/jessie 1.4.8-0mosquitto2 uptodate
    mosquitto-clients:armhf/jessie 1.4.8-0mosquitto2 uptodate
    

    And still i get

     1465238048: Config loaded from /etc/mosquitto/mosquitto.conf.
     1465238048: Opening ipv4 listen socket on port 1883.
     1465238048: Opening ipv6 listen socket on port 1883.
     1465238066: New connection from 127.0.0.1 on port 1883.
     1465238066: New client connected from 127.0.0.1 as mosqsub/1282-homepi (c1, k60).
     1465238078: Socket error on client mosqsub/1282-homepi, disconnecting.

  • Mod

    @moskovskiy82 Did you try google'ing for the error?
    When I do, I get e.g. http://jpmens.net/2014/07/03/the-mosquitto-mqtt-broker-gets-websockets-support/#comment-1907704831
    Maybe that helps?



  • I tried. But i don't have any username/password
    Strange thing is that this is a fresh raspbian install (downloaded yesterday)

    pid_file /var/run/mosquitto.pid
    persistence true
    persistence_location /var/lib/mosquitto/
    log_dest file /var/log/mosquitto/mosquitto.log
    include_dir /etc/mosquitto/conf.d


  • I had some issues as well and read somewhere that there was an issue with the mosquitto packages for raspberri, so I installed from git.

    wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
    sudo apt-key add mosquitto-repo.gpg.key
    cd /etc/apt/sources.list.d/
    

    for wheezy: sudo wget http://repo.mosquitto.org/debian/mosquitto-wheezy.list
    for jessie: sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list

    apt-get update
    apt-get install mosquitto
    sudo /etc/init.d/mosquitto start
    

    All working flawless for months now.



  • This i what i did above to solve the old version problem
    Installed from http://repo.mosquitto.org/debian/mosquitto-jessie.list

    With no luck.
    Turning debug i see the following only

    1465240376: mosquitto version 1.4.8 terminating
    1465240386: New connection from 127.0.0.1 on port 1883.
    1465240386: New client connected from 127.0.0.1 as mosqsub/1948-homepi (c1, k60).
    1465240386: Sending CONNACK to mosqsub/1948-homepi (0, 0)
    1465240386: Received SUBSCRIBE from mosqsub/1948-homepi
    1465240386:     mygateway1-out/# (QoS 0)
    1465240386: Sending SUBACK to mosqsub/1948-homepi
    1465240419: Socket error on client mosqsub/1948-homepi, disconnecting.
    

    Not that much of a help...



  • What is also strange i tried to start mosquitto with
    sudo mosquitto -c /etc/mosquitto/mosquitto.conf -v

    Than on the second console i tried
    mosquitto_sub -v -t 'mygateway1-out/#'
    and also
    mosquitto -c /etc/mosquitto/mosquitto.conf -v

    Strange thing is that id didn't see any messages in cosole. In the log file

    1465242491: mosquitto version 1.4.8 (build date Tue, 17 May 2016 11:26:59 +0100) starting
    1465242491: Config loaded from /etc/mosquitto/mosquitto.conf.
    1465242491: Opening ipv4 listen socket on port 1883.
    1465242491: Opening ipv6 listen socket on port 1883.
    1465242495: New connection from ::1 on port 1883.
    1465242495: New client connected from ::1 as mosqsub/1848-homepi (c1, k60).
    1465242495: Sending CONNACK to mosqsub/1848-homepi (0, 0)
    1465242495: Received SUBSCRIBE from mosqsub/1848-homepi
    1465242495:     mygateway1-out/# (QoS 0)
    1465242495: mosqsub/1848-homepi 0 mygateway1-out/#
    1465242495: Sending SUBACK to mosqsub/1848-homepi
    1465242527: Socket error on client mosqsub/1848-homepi, disconnecting.
    1465242530: New connection from ::1 on port 1883.
    1465242530: New client connected from ::1 as mosqpub/1850-homepi (c1, k60).
    1465242530: Sending CONNACK to mosqpub/1850-homepi (0, 0)
    1465242530: Received PUBLISH from mosqpub/1850-homepi (d0, q0, r0, m0,     'mygateway1-in/99/0/1/0/40', ... (6 bytes))
    1465242530: Received DISCONNECT from mosqpub/1850-homepi
    1465242530: Client mosqpub/1850-homepi disconnected.
    1465242536: mosquitto version 1.4.8 terminating

  • Mod

    @moskovskiy82 can you subscribe and publish something on the pc? Then do the same on the rpi. At least that should work...


Log in to reply
 

Suggested Topics

  • 4
  • 274
  • 14
  • 2
  • 933
  • 5

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts