Re: [mh] Little problem with MQTT...

Paul Voyer <[email protected]>
Newsgroups gmane.comp.misc.misterhouse.user
Message-ID <DM6PR08MB5786EBCF1F671C1640C72969C87C0@DM6PR08MB5786.namprd08.prod.outlook.com>
Hi Guys,

More on this...

This message mean that the connection has failed:

02/17/2019 13:22:22 *** mqtt mqtt_1 Received: ConnAck/at-most-once Connection Accepted

02/17/2019 13:22:22 *** mqtt mqtt_1: read_mqtt_msg Socket closed gracefully

02/17/2019 13:22:22 *** mqtt deleting mqtt_1

Now looking at the mosquitto broker, here what I am seeing...

1550536559: New connection from 127.0.0.1 on port 1883.
1550536559: New client connected from 127.0.0.1 as NetMQTTpm29198 (c1, k120).
1550536559: Socket error on client NetMQTTpm29198, disconnecting.

It is clear that my problem is the connection to the mosquitto broker...

This is broker: mosquitto version 1.4.10 (build date Wed, 06 Feb 2019 17:03:31 +0000)

Is there any special setting that need to be done on misterhouse or on the broker?

Thanks!
________________________________
De : Paul Voyer <[email protected]>
Envoyé : 17 février 2019 13:35
À : [email protected]
Objet : [mh] Little problem with MQTT...


Hello gurus!


I use to have Raspbian Wheezy running MisterHouse on RaspberryPi for quite a long time…

I use it to control Insteon appliances and light switches and since December some MQTT switches. This has been very stable!

MisterHouse Version: 5.0

Perl version: 5.014002

Mosquitto MQTT v3.1 broker


Recently I have moved all my stuff over a fresh Raspbian Stretch on same RaspberryPi installation:

What I did is:

- Installed Stretch on brand new SD card.

- Installed mosquitto (MQTT v3.1 broker)

- Installed all Perl (v5.24.1) modules required for my MisterHouse installation.

- I copied all my MisterHouse installation (/opt/misterhouse) to the new system.

- I putted my new SD card in my RaspberryPi.



- IP address has not changed.

- I have started MisterHouse without any new error message…


Here part of the log related to MQTT initialization:

#####

02/17/2019 13:22:22 *** mqtt mqtt_connect Socket (127.0.0.1:1883,121)

02/17/2019 13:22:22 *** mqtt Socket check (121) [ ]: Connected

02/17/2019 13:22:22 *** mqtt mqtt_1 Received: ConnAck/at-most-once Connection Accepted

02/17/2019 13:22:22 *** mqtt mqtt_1: read_mqtt_msg Socket closed gracefully

02/17/2019 13:22:22 *** mqtt deleting mqtt_1

$VAR1 = \bless( {

'keep_alive_timer' => 121,

'got_ping_response' => 1,

'host' => '127.0.0.1',

'next_ping' => '1550427868.90137',

'instance' => 'mqtt_1',

'state_now' => 'off',

'command_stack' => [],

'said' => '',

'user_name' => '',

'port' => 1883,

'topic' => '#/Sonoff#',

'password' => '',

'state' => 'off',

'socket' => bless( \*Symbol::GEN3, 'IO::Socket::INET' ),

'states' => [

'off',

'on'

]

}, 'mqtt' );


02/17/2019 13:22:22 *** mqtt mqtt_1 Received: No SubAck

02/17/2019 13:22:22 *** mqtt mqtt_1 Sub 1 Received: (--No $$msg{string}--)

02/17/2019 13:22:22 *** mqtt mqtt_1 Initializing MQTT connection ...


02/17/2019 13:22:22 Oops1: Use of uninitialized value in concatenation (.) or string at /opt/misterhouse/mh/bin/../lib/mqtt.pm line 778.


02/17/2019 13:22:22 *** mqtt mqtt set mqtt_1: [(on), (mqtt=HASH(0x3c8bf78)), ]

02/17/2019 13:22:22 *** mqtt mqtt set mqtt_1: isa mqtt

#####


Now, using MisterHouse, the Insteon appliances and switches are working fine but NOT the MQTT switches! I am still getting the following error:

#####

02/17/2019 13:24:46 *** mqtt mqtt_Item nom to MH to MQTT ($Sonoff_CEsmart_1) no p_setby ::set($msg, $p_setby)

02/17/2019 13:24:46 *** mqtt mqtt_1 failed (127.0.0.1/1883/#/Sonoff#)

#####

I am trying to understand the preceding error message…


If I am using mosquitto_pub, the following commands are working fine:

mosquitto_pub -h 127.0.0.1 -t "cmnd/Sonoff_CEsmart_1/POWER" -m ON

mosquitto_pub -h 127.0.0.1 -t "cmnd/Sonoff_CEsmart_1/POWER" -m OFF


And here my ~/mh/local/code/mqtt.mht:

#####

Format = A

# MQTT stuff

# noloop=start

CODE, require mqtt;

#

CODE, $mqtt1 = new mqtt('mqtt_1', '127.0.0.1', 1883, '#/Sonoff#', "", "", 121);

CODE, $Sonoff_HT16_1 = new mqtt_Item($mqtt1, 'cmnd/Sonoff_HT16_1/POWER');

CODE, $Sonoff_S31_1 = new mqtt_Item($mqtt1, 'cmnd/Sonoff_S31_1/POWER');

CODE, $Sonoff_Basic_1 = new mqtt_Item($mqtt1, 'cmnd/Sonoff_Basic_1/POWER');

CODE, $Sonoff_CEsmart_1 = new mqtt_Item($mqtt1, 'cmnd/Sonoff_CEsmart_1/POWER');

CODE, $Sonoff_CEsmart_2 = new mqtt_Item($mqtt1, 'cmnd/Sonoff_CEsmart_2/POWER');

# noloop=stop

#####


Do I missing a package somewhere?

This was working fine previously, I mean before new OS!


Thanks in advance!


Paul

________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.