• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
bridging pilight and mosquitto
#1
I tried to use pilight and mosquitto by simply bridging pilight to mosquitto and thus avoiding to change pilight. Bridging meaning selected topics to be replicated from one mqqt broker to the other. Unfortunately this resulted in a Socket error. Does anyone have a clue?

pilight running on port 1884, mosquitto on port 1883

Mosquitto.conf addition:

Code:
connection pilight
address 127.0.0.1:1884
topic pilight/device/DT/day out
topic pilight/device/DT/day in

Result
Code:
netstat output:
tcp        0      0 0.0.0.0:1883            0.0.0.0:*               LISTEN      20084/mosquitto

tcp        0      0 0.0.0.0:1884            0.0.0.0:*               LISTEN      20016/pilight-daemo

mosquitto log

Code:
1601659036: Connecting bridge (step 1) pilight (127.0.0.1:1884)
1601659036: Connecting bridge (step 2) pilight (127.0.0.1:1884)
1601659036: Socket error on client local.harijnwebnew.pilight, disconnecting.
 
Reply
#2
If you disable mqtt in the settings and use a external broker, pilight will just connect to that. The internal broker will be disabled.
 
Reply
#3
(10-02-2020, 07:22 PM)curlymo Wrote: If you disable mqtt in the settings and use a external broker, pilight will just connect to that. The internal broker will be disabled.

Thanks, I did try that immediately. I used a fresh install of today's nightly, pilight (8.1.5-110-g1af4c284) to check, with raspbian stretch on a rpi 2B. But I did not succeed. What am I missing?

If I use:

Code:
    "mqtt-port": 1884,
       "mqtt-enable": 1,
I get the date-time messages in the broker directly, (mosquitto_sub -t "#" -p 1884)

If I use:

Code:
    "mqtt-port": 1883,
       "mqtt-enable": 0,

I see nothing in the broker, (mosquitto_sub -t "#" -p 1883). Same thing happens when I remove the port number.
Code:
       "mqtt-enable": 0,

Or when I remove both lines.
 
Reply
#4
This was the error message:

[Oct 09 18:52:40:819837] ERROR: cannot bind to socket port, address already in use?

This was when mosquitto was running when I started pilight. When I stopped mosquitto and started pilight the error message did not appear. 

In the config I added only mqtt-port = 1883, the default mosquitto is using. In a second try I omitted the port and the same error occurred.

I would certainly like pilight to use the mosquitto queue, if I can be of any help in testing please tell me how,
 
Reply
#5
(10-09-2020, 08:12 PM)hansrijn2 Wrote: This was the error message:

[Oct 09 18:52:40:819837] ERROR: cannot bind to socket port, address already in use?

This was when mosquitto was running when I started pilight. When I stopped mosquitto and started pilight the error message did not appear. 

In the config I added only mqtt-port = 1883, the default mosquitto is using. In a second try I omitted the port and the same error occurred.

I would certainly like pilight to use the mosquitto queue, if I can be of any help in testing please tell me how,
 
Reply
#6
(10-26-2020, 06:26 PM)hansrijn2 Wrote:
(10-09-2020, 08:12 PM)hansrijn2 Wrote: This was the error message:

[Oct 09 18:52:40:819837] ERROR: cannot bind to socket port, address already in use?

This was when mosquitto was running when I started pilight. When I stopped mosquitto and started pilight the error message did not appear. 

In the config I added only mqtt-port = 1883, the default mosquitto is using. In a second try I omitted the port and the same error occurred.

I would certainly like pilight to use the mosquitto queue, if I can be of any help in testing please tell me how,
The current nightny [Oct 26 17:22:34:477806] INFO: version v8.1.5-nightly-ee723126 still shows the error message but it does connect to the mosquitto mqtt port 1883. Fine!

The blacklist unfortunately does not work when I chose this port. If pilight uses its own mqtt port it does work.

When I use 1884 as the pilight port it also connects to 1883, the mosquitto port. Blacklist working on 1884 only.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  update pilight Traeumer 0 26 07-29-2021, 09:41 PM
Last Post: Traeumer
  problem publish to pilight MQTT server Emiks5 8 1,561 07-24-2021, 06:46 PM
Last Post: Emiks5
  Hardware Switch and pilight-send/-control iTommix 3 546 02-14-2021, 09:25 PM
Last Post: iTommix
  pilight error after update to 8.1.5 on Odroid C2 WitchDoctor 4 1,720 02-07-2021, 09:50 PM
Last Post: pilightalpine
  pilight in Docker not accepting connections due to possible SYN flooding akloeckner 3 471 02-07-2021, 04:22 PM
Last Post: akloeckner
  pilight-debug format Rschnauzer 2 454 12-17-2020, 07:09 PM
Last Post: Rschnauzer
  pilight-flash not working danny 14 3,383 12-12-2020, 10:00 AM
Last Post: tox
  pilight does not start, Deamon is not found. Dekkertje 6 772 12-08-2020, 06:55 PM
Last Post: Dekkertje
  Failed pilight-send that say they succeeded hepcat72 2 493 12-05-2020, 05:30 PM
Last Post: hepcat72
  apt.pilight.org/dists/stable/main/binary 301 Moved Permanently Rschnauzer 6 851 11-23-2020, 01:49 PM
Last Post: Rschnauzer

Forum Jump:


Browsing: 1 Guest(s)