• 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
  apt.pilight.org/dists/stable/main/binary 301 Moved Permanently Rschnauzer 6 236 11-23-2020, 01:49 PM
Last Post: Rschnauzer
  problem publish to pilight MQTT server Emiks5 4 691 08-31-2020, 07:45 PM
Last Post: Emiks5
  pilight for Raspbian Buster (raspberry pi 4) ? starob 32 10,757 08-10-2020, 09:12 AM
Last Post: simanuel
  pilight switch node in node-red framp 0 650 06-24-2020, 10:01 PM
Last Post: framp
  pilight-control TML 13 1,911 05-27-2020, 07:51 AM
Last Post: curlymo
  API Requests by HTTP from other devices fore use in pilight scootermacro 2 908 05-10-2020, 08:19 AM
Last Post: scootermacro
  pilight-send seems successful but doesn't actually send RF signal ayeyebrazov 37 4,959 03-31-2020, 01:02 PM
Last Post: curlymo
  pilight 8.1.5 not working on Raspberry pi after reboot beejayf 4 1,447 03-08-2020, 12:14 AM
Last Post: beejayf
  pilight cpu usage possibly associated with noticeable sluggishness? hepcat72 4 1,548 01-28-2020, 08:02 PM
Last Post: hepcat72
  apt.pilight.org stable Release' is not signed. thomasol 2 1,546 01-23-2020, 11:34 PM
Last Post: thomasol

Forum Jump:


Browsing: 1 Guest(s)