User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: MQTT PUB AND SUB

Thu Aug 24, 2017 12:20 pm

You are not describing you problem in enough detail.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

pieuser
Posts: 38
Joined: Sat Jun 03, 2017 7:56 am

Re: MQTT PUB AND SUB

Thu Aug 24, 2017 12:58 pm

my problem is my ip and my etho ip what i have saved in /etc/network/interface not same . what ever i saved or changed in that file no effect on pi ip address. its not saved . i think that may be a problem ,is this ?

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: MQTT PUB AND SUB

Thu Aug 24, 2017 1:42 pm

Restore everything in /etc/network/interfaces to exactly how it was when you installed Raspbian.

Do all the stuff for IP addresses in /etc/dhcpcd.conf
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

pieuser
Posts: 38
Joined: Sat Jun 03, 2017 7:56 am

Re: MQTT PUB AND SUB

Fri Aug 25, 2017 6:43 am

i do the same in two files but no network connection in pi. even eth-0 shows connect but no internet connection and saved ip also different.

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: MQTT PUB AND SUB

Sat Aug 26, 2017 2:07 am

Try starting from scratch with a fresh download of Raspbian.

At each step when you change something a) make a note of what you've changed, b) save backups of every file in /etc that you change, c) reboot and test after every change.

If anything fails take a step back and see if you can understand/fix what went wrong or try a different configuration change.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

pieuser
Posts: 38
Joined: Sat Jun 03, 2017 7:56 am

Re: MQTT PUB AND SUB

Mon Aug 28, 2017 11:59 am

hey dougie,
i have one question is mosquitto installed at 192.168.3.14.

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: MQTT PUB AND SUB

Mon Aug 28, 2017 12:54 pm

Your machine, you have to look.

192.168.any.any addresses are always private. I'll always use 192.168.3.14 as an example address for a Raspberry Pi (π ~= 3.14) as that address block is unlikely to be used by anyone.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

pieuser
Posts: 38
Joined: Sat Jun 03, 2017 7:56 am

Re: MQTT PUB AND SUB

Mon Aug 28, 2017 1:10 pm

is it needed to install mqtt at both sides.

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: MQTT PUB AND SUB

Mon Aug 28, 2017 1:12 pm

pieuser wrote:
Mon Aug 28, 2017 1:10 pm
is it needed to install mqtt at both sides.
No. You only need one broker unless you're planning to run a bridges between brokers.
If the broker is listening on the INADDR_ANY (or in6addr_any) interface then any other machine on your LAN can connect to it.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

pieuser
Posts: 38
Joined: Sat Jun 03, 2017 7:56 am

Re: MQTT PUB AND SUB

Mon Aug 28, 2017 1:17 pm

no i want to send data from my pi to other network. i have installed mosquitto in pi. if i want to send data from my pi to other network should i need to install mosquitto to that network also.

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: MQTT PUB AND SUB

Mon Aug 28, 2017 5:50 pm

NO!
Open port 1883 on this machine/router so that your other machine can connect to it.

Or run the broker on the other machine with port 1883 open on the machine/router over there so your local machine can connect to it.

You can even run port 1883 over an ssh tunnel.
http://diabolicalws.blogspot.co.uk/2012 ... r-ssh.html
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

pieuser
Posts: 38
Joined: Sat Jun 03, 2017 7:56 am

Re: MQTT PUB AND SUB

Wed Aug 30, 2017 6:12 am

i open the port 1883 , start the mosquitto . do u have any mosquitto broker installed at ur side now so i can connect to it.

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: MQTT PUB AND SUB

Wed Aug 30, 2017 8:43 pm

http://test.mosquitto.org/ hosts a Mosquitto server at: test.mosquitto.org:1883

To drink from the firehose from there run mosquitto_sub -h test.mosquitto.org -t "#" -v
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Beginners”