mattmiller
Posts: 2036
Joined: Thu Feb 05, 2015 11:25 pm

Re: Tutorial for MQTT on Raspbian Jessie?

Thu Nov 24, 2016 11:41 am

It may be ancient history but its what people are being served at the moment so I think a quick edit of your instructions would help any new comers out :)

User avatar
DougieLawson
Posts: 34775
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Tutorial for MQTT on Raspbian Jessie?

Thu Nov 24, 2016 11:51 am

mattmiller wrote:It may be ancient history but its what people are being served at the moment so I think a quick edit of your instructions would help any new comers out :)
Done. 1.4.10 is much better than the ancient history as it also includes websockets. Roll on Raspbian Stretch which should include something less ancient. DebIan (and Raspbian that follows it) with its overly conservative versioning policy isn't good for modern stuff that's built using Agile development. That's one of the reasons to switch to Ubuntu MATE or Arch.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a hippy & doctor free zone.

mattmiller
Posts: 2036
Joined: Thu Feb 05, 2015 11:25 pm

Re: Tutorial for MQTT on Raspbian Jessie?

Thu Nov 24, 2016 12:04 pm

While your on - could you add in
sudo apt-get install mosquitto-clients

for the default Pi instructions :)

User avatar
ds18s20
Posts: 80
Joined: Fri Dec 23, 2011 5:44 am
Location: San Francisco

Re: Tutorial for MQTT on Raspbian Jessie?

Wed Feb 22, 2017 3:35 am

Hi,

I'm also interested to learn how to guard against the client crashing and existing? How can one create an endless loop to make it re-connect every time something happens given that the mosquitto_sub blocks?

Code: Select all

mosquitto_sub -h m12.cloudmqtt.com -p 13937  -u i12345fh -P b8V912312Y -t switch -q 2

User avatar
DougieLawson
Posts: 34775
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Tutorial for MQTT on Raspbian Jessie?

Wed Feb 22, 2017 3:33 pm

mosquitto_sub is a sample program and a testing tool, it's not intended to be used for production tasks, you should write your own client.

Have a look at the source code for mosquitto_sub and you'll see some techniques for getting a connection. Borrow the code for your own programs.

Or take a look at https://github.com/mqtt/mqtt.github.io/ ... d=software where there's a bunch of pointers to code samples for a wide variety of programming languages.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a hippy & doctor free zone.

jsaldivias
Posts: 13
Joined: Mon Mar 06, 2017 8:49 pm

Re: Tutorial for MQTT on Raspbian Jessie?

Fri Mar 09, 2018 4:09 pm

Where can I find a tutorial for MQTT on Raspbian. I have reviewed this topic, but found nowhere to go for a Tutorial.
Anyone can help on this?

jbudd
Posts: 782
Joined: Mon Dec 16, 2013 10:23 am

Re: Tutorial for MQTT on Raspbian Jessie?

Fri Mar 09, 2018 4:11 pm

For installing or using mqtt?

asandford
Posts: 1996
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Tutorial for MQTT on Raspbian Jessie?

Sat Mar 10, 2018 11:21 pm

jsaldivias wrote:
Fri Mar 09, 2018 4:09 pm
Where can I find a tutorial for MQTT on Raspbian. I have reviewed this topic, but found nowhere to go for a Tutorial.
Anyone can help on this?
Install with

Code: Select all

sudo apt update; sudo apt dist-upgrade -y; sudo apt install -y mosquitto mosquitto-clients
After that's done, any MQTT tutorial (and there are loads on the web) should apply to Raspbian.

flagtrax
Posts: 38
Joined: Thu Mar 02, 2017 12:31 am

Re: Tutorial for MQTT on Raspbian Jessie?

Wed Apr 04, 2018 4:13 am

Yo Dougie,
so I've been running mosquitto on a Rpi 2b brokering for a couple esp8266's. At the same time I was doing tutorials on Python. The system was getting a bit trashy, so I decided to reload Raspbian from the latest noobs and clean it all out. I did so, then did a

Code: Select all

sudo apt-get install mosquitto
(I think LOL) and my little esp's were happily talking to each other. Then I got brave; I have this Rpi zero w hanging around and I thought "ah a great dedicated broker!". So I loaded a fresh version of Raspian (from noobs again) did the updates/upgrades, (which took considerable time due to the slowness of the Rpi 0, and typed the same command to install mosquitto. This time I got an error "E: unable to locate package mosquitto". So then I went to the "Instructionals" website via google, and tried the method there with out success. In their instructional the first command was:
"wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key". This resulted in an error 404 from the website.
Meanwhile the Rpi2b is still brokering BUT I realized that I hadn't installed the client . When I tried to do that the same circumstances occured. Any thoughts?
UPDATE:
OK let me back up a bit. After much fooling around I realized when I reloaded the Rpi2b I reloaded a fresh copy of Jessie. When I loaded the Rpi 0 It was Stretch. When I attempted an update or upgrade, they failed with the error "E: Failed to fetch http://mirrordirector.raspbian.org/rasp ... -2_all.deb Temporary failure resolving mirrordirector.raspbian.org"
OK time for some zzzzzzzzzzzzz's my head hurts.

User avatar
DougieLawson
Posts: 34775
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Tutorial for MQTT on Raspbian Jessie?

Wed Apr 04, 2018 7:44 am

Last time I tested it the code from http://mosquitto.org/2013/01/mosquitto- ... epository/ WILL NOT work on RPi1B, B+, Z, ZW, ZWH or CM1. It gets a segfault.

You have to install the version from the regular Stretch repo, or you have to build from source.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a hippy & doctor free zone.

froussel
Posts: 34
Joined: Thu Oct 04, 2012 3:53 pm

Re: Tutorial for MQTT on Raspbian Jessie?

Mon Apr 16, 2018 3:05 pm

Install with
Code: Select all

sudo apt update; sudo apt dist-upgrade -y; sudo apt install -y mosquitto mosquitto-clients
After that's done, any MQTT tutorial (and there are loads on the web) should apply to Raspbian.
Answer :

Les paquets suivants contiennent des dépendances non satisfaites :
mosquitto : Dépend: libssl1.0.0 (>= 1.0.1) mais il n'est pas installable
Dépend: libwebsockets3 (>= 1.2) mais il n'est pas installable
mosquitto-clients : Dépend: libmosquitto1 (= 1.4.15-0mosquitto3~jessie1) mais 1.4.10-3+deb9u1 devra être installé
N: « mosquitto-jessie.list.1 » dans le répertoire « /etc/apt/sources.list.d/ » a été ignoré car il utilise une extension non valable
E: Impossible de corriger les problèmes, des paquets défectueux sont en mode « garder en l'état ».

Help !

User avatar
marine_hm
Posts: 79
Joined: Tue Mar 07, 2017 4:27 pm

Re: Tutorial for MQTT on Raspbian Jessie?

Mon Aug 13, 2018 7:31 pm

Hello guys. I need help once again. My Pi Zero W fried the other day due to a lightning storm. I got it all back up and running on another Pi Zero. All but the MQTT address. I need to assign the IP address of the MQTT server. Now loaded via Raspbian stretch.

My Ardiuno Sketch from 2017 shows it logs into the Pi Zero Access point with SSID, PASSWORD, then MQTT IP address.

// CONNECT TO RASPBERRY PI
const char* ssid = "MYSSID";
const char* password = "MYPASSWORD";
const char* mqtt_server = "169.254.78.169";

Rather than pull apart all my sensors and reprogram them. I thought I would just assign the MQTT IP on the new Pi0W.

Dougie. or Matt; Are you still out there?

User avatar
DougieLawson
Posts: 34775
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Tutorial for MQTT on Raspbian Jessie?

Tue Aug 14, 2018 8:25 am

You can assign your 169.254.78.169 IP with

sudo ifconfig eth0 169.254.78.169/16
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a hippy & doctor free zone.

B.Goode
Posts: 7063
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Tutorial for MQTT on Raspbian Jessie?

Tue Aug 14, 2018 10:09 am

DougieLawson wrote:
Tue Aug 14, 2018 8:25 am
You can assign your 169.254.78.169 IP with

sudo ifconfig eth0 169.254.78.169/16

Maybe not...

This is an RPi Zero, hence no Ethernet port, and it has been set up as a standalone WiFi access point.

(You have also advised the same user in this parallel thread: viewtopic.php?f=63&t=220234&p=1352692#p1352509)

User avatar
marine_hm
Posts: 79
Joined: Tue Mar 07, 2017 4:27 pm

Re: Tutorial for MQTT on Raspbian Jessie?

Tue Aug 14, 2018 11:56 am

Being that I have another thread going on a particular problem with MQTT and this topic is for Raspbian Jessie. I'm not going to add to my own confusion. by continuing my problem on this thread. Thanks for pointing it out.

User avatar
DougieLawson
Posts: 34775
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Tutorial for MQTT on Raspbian Jessie?

Tue Aug 14, 2018 12:22 pm

B.Goode wrote:
Tue Aug 14, 2018 10:09 am
DougieLawson wrote:
Tue Aug 14, 2018 8:25 am
You can assign your 169.254.78.169 IP with

sudo ifconfig eth0 169.254.78.169/16

Maybe not...

This is an RPi Zero, hence no Ethernet port, and it has been set up as a standalone WiFi access point.

(You have also advised the same user in this parallel thread: viewtopic.php?f=63&t=220234&p=1352692#p1352509)
You can do that in /etc/rc.local
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a hippy & doctor free zone.

User avatar
marine_hm
Posts: 79
Joined: Tue Mar 07, 2017 4:27 pm

Re: Tutorial for MQTT on Raspbian Jessie?

Tue Aug 14, 2018 12:36 pm

Dougie;
Thanks for all your assistance. I've moved my issue/thread over here:

viewtopic.php?f=63&t=220234&p=1352785#p1352785

I still have minor questions on that thread.

Thanks

Return to “Troubleshooting”