-
- Posts: 25
- Joined: Thu Sep 07, 2017 5:21 pm
Re: STRECH and MQTT
Dear all
I have the identical problem as the first posting here. This is on a clean install of Raspbian Stretch. The only software loaded beforehand was NodeRed. I used: sudo wget http://repo.mosquitto.org/debian/mosquitto-stretch.list.
I looked at Aptitude but was not sure if either of the references from a search on Mosquito were correct.
The issue on the mosquitto GitHub does not have any assignees so not sure how quickly a solution will be found.
Response to apt-cache policy mosquitto is:
mosquitto:
Installed: (none)
Candidate: 1.4.12-0mosquitto1
Version table:
1.4.12-0mosquitto1 500
500 http://repo.mosquitto.org/debian stretch/main armhf Packages
1.4.10-3 500
500 http://mirrordirector.raspbian.org/raspbian stretch/main armhf Packages
So would appreciate thoughts on the best approach to get Mosquitto running. Would be great if I don't have to start from scratch (again).
Mike
I have the identical problem as the first posting here. This is on a clean install of Raspbian Stretch. The only software loaded beforehand was NodeRed. I used: sudo wget http://repo.mosquitto.org/debian/mosquitto-stretch.list.
I looked at Aptitude but was not sure if either of the references from a search on Mosquito were correct.
The issue on the mosquitto GitHub does not have any assignees so not sure how quickly a solution will be found.
Response to apt-cache policy mosquitto is:
mosquitto:
Installed: (none)
Candidate: 1.4.12-0mosquitto1
Version table:
1.4.12-0mosquitto1 500
500 http://repo.mosquitto.org/debian stretch/main armhf Packages
1.4.10-3 500
500 http://mirrordirector.raspbian.org/raspbian stretch/main armhf Packages
So would appreciate thoughts on the best approach to get Mosquitto running. Would be great if I don't have to start from scratch (again).
Mike
Re: STRECH and MQTT
It would be beneficial if you post *your* exact error messages.
The main problem is that the package I find on the repo you refer to, depends on the "libssl1.0.0" package, but both current versions of Debian and Raspbian call the package "libssl1.0.2". It doesnt matter what version number is inside the package if the name is wrong.
If you are the adventurous type you can actually fix this yourself.
There are probably the same error in the other packages that are available from that repo, but at least the server itself does not seem to depend on them.
EDIT:
I just realized that "nows" stands for "no websockets". And looking here ( http://repo.mosquitto.org/debian/pool/main/m/mosquitto/ ) I find no v1.4.14 version for Stretch with websockets. That might be because the version of libwebsockets in Stretch is "libwebsockets8" and the one in Jessie was "libwebsockets3".. idk..
The main problem is that the package I find on the repo you refer to, depends on the "libssl1.0.0" package, but both current versions of Debian and Raspbian call the package "libssl1.0.2". It doesnt matter what version number is inside the package if the name is wrong.
If you are the adventurous type you can actually fix this yourself.
Code: Select all
# get the deb-file with wget or copy it from "/var/cache/apt/archives"
wget http://repo.mosquitto.org/debian/pool/main/m/mosquitto/mosquitto_1.4.14-0mosquitto1~nows1_armhf.deb
#extract package
mkdir tmpdeb
dpkg-deb -R mosquitto/mosquitto_1.4.14-0mosquitto1~nows1_armhf.deb tmpdeb
#Fix wrong dependency
nano tmpdeb/DEBIAN/CONTROL
# Now change "libssl1.0.0" to "libssl1.0.2" on the line that starts with "Depends:"
# Save and exit.
# Rebuild
dpkg-deb -b tmpdeb mosquitto_fixed.deb
# Install
sudo dpkg -i mosquitto_fixed.deb
EDIT:
I just realized that "nows" stands for "no websockets". And looking here ( http://repo.mosquitto.org/debian/pool/main/m/mosquitto/ ) I find no v1.4.14 version for Stretch with websockets. That might be because the version of libwebsockets in Stretch is "libwebsockets8" and the one in Jessie was "libwebsockets3".. idk..
-
- Posts: 25
- Joined: Thu Sep 07, 2017 5:21 pm
Re: STRECH and MQTT
Thank you for your quick reply. I will give this a go, and also change the libwebsockets dependency from 3 to 8. For reference my error messages were:
pi@home:/etc/apt/sources.list.d $ sudo apt-get install mosquitto
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mosquitto : Depends: libssl1.0.0 (>= 1.0.1) but it is not installable
Depends: libwebsockets3 (>= 1.2) but it is not installable
E: Unable to correct problems, you have held broken packages.
Thank you.
Mike
pi@home:/etc/apt/sources.list.d $ sudo apt-get install mosquitto
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mosquitto : Depends: libssl1.0.0 (>= 1.0.1) but it is not installable
Depends: libwebsockets3 (>= 1.2) but it is not installable
E: Unable to correct problems, you have held broken packages.
Thank you.
Mike
-
- Posts: 25
- Joined: Thu Sep 07, 2017 5:21 pm
Re: STRECH and MQTT
Success - but a bit of a bumpy ride! I hope the trail below will useful to others to also get mosquito working on Stretch. However a couple of points:
I wget the version 1.14.12 as this is what was showing as Candidate earlier.
The .deb file was downloaded to root so I did not need the mosquitto/mosquitto/ in the dpkg-deb -R instruction
I ended up editing the control file in leafpad.
The first install failed as I did not have libwebsockets8 installed. So do a:
first and install if required.
see my install of libwebsockets8 below that also failed but was fixed with
Now to my trail. See at the end checks for both mosquito installed and mosquitto stop/start.
Thank you for your help. Very nice to have this sorted and without starting from scratch! I find the Pi a big trial and am most grateful for the advice. Assembly code on PICs is a piece of cake compared to this.
I can now get on with gaining some C experience getting MQTT working with some ESP8266s.
Mike
I wget the version 1.14.12 as this is what was showing as Candidate earlier.
The .deb file was downloaded to root so I did not need the mosquitto/mosquitto/ in the dpkg-deb -R instruction
I ended up editing the control file in leafpad.
The first install failed as I did not have libwebsockets8 installed. So do a:
Code: Select all
apt-cache policy libwebsockets8
see my install of libwebsockets8 below that also failed but was fixed with
Code: Select all
sudo apt --fix-broken install
Code: Select all
pi@home:~ $ mkdir tmpdeb
pi@home:~ $ wget http://repo.mosquitto.org/debian/pool/main/m/mosquitto/mosquitto_1.4.12-0mosquitto1_armhf.deb
--2017-09-08 14:45:06-- http://repo.mosquitto.org/debian/pool/main/m/mosquitto/mosquitto_1.4.12-0mosquitto1_armhf.deb
Resolving repo.mosquitto.org (repo.mosquitto.org)... 85.119.83.194, 2001:ba8:1f1:f271::2
Connecting to repo.mosquitto.org (repo.mosquitto.org)|85.119.83.194|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 121368 (119K) [application/octet-stream]
Saving to: ‘mosquitto_1.4.12-0mosquitto1_armhf.deb’
mosquitto_1.4.12-0mosquitto1_ar 100%[====================================================>] 118.52K --.-KB/s in 0.05s
2017-09-08 14:45:06 (2.15 MB/s) - ‘mosquitto_1.4.12-0mosquitto1_armhf.deb’ saved [121368/121368]
pi@home:~ $ dpkg-deb -R mosquitto_1.4.12-0mosquitto1_armhf.deb tmpdeb
# Now change "libssl1.0.0" to "libssl1.0.2" and "libwebsockets3" to "libwebsockets8" on the line that starts with "Depends:"
pi@home:~ $ dpkg-deb -b tmpdeb mosquitto_fixed.deb
dpkg-deb: building package 'mosquitto' in 'mosquitto_fixed.deb'.
pi@home:~ $ sudo dpkg -i mosquitto_fixed.deb
Selecting previously unselected package mosquitto.
(Reading database ... 124155 files and directories currently installed.)
Preparing to unpack mosquitto_fixed.deb ...
Unpacking mosquitto (1.4.12-0mosquitto1) ...
dpkg: dependency problems prevent configuration of mosquitto:
mosquitto depends on libwebsockets8 (>= 1.2); however:
Package libwebsockets8 is not installed.
dpkg: error processing package mosquitto (--install):
dependency problems - leaving unconfigured
Processing triggers for systemd (232-25+deb9u1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Errors were encountered while processing:
mosquitto
pi@home:~ $ apt-cache policy libwebsockets8
libwebsockets8:
Installed: (none)
Candidate: 2.0.3-2
Version table:
2.0.3-2 500
500 http://mirrordirector.raspbian.org/raspbian stretch/main armhf Packages
pi@home:~ $ sudo apt-get install libwebsockets8
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libwebsockets8 : Depends: libev4 (>= 1:4.04) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
pi@home:~ $ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
mosquitto
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 354 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 124187 files and directories currently installed.)
Removing mosquitto (1.4.12-0mosquitto1) ...
/usr/sbin/deluser: The user `mosquitto' does not exist.
Processing triggers for man-db (2.7.6.1-2) ...
pi@home:~ $ apt-cache policy libwebsockets8
libwebsockets8:
Installed: (none)
Candidate: 2.0.3-2
Version table:
2.0.3-2 500
500 http://mirrordirector.raspbian.org/raspbian stretch/main armhf Packages
pi@home:~ $ sudo apt-get install libwebsockets8
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libev4
The following NEW packages will be installed:
libev4 libwebsockets8
0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
Need to get 119 kB of archives.
After this operation, 265 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrordirector.raspbian.org/raspbian stretch/main armhf libev4 armhf 1:4.22-1 [34.0 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian stretch/main armhf libwebsockets8 armhf 2.0.3-2 [85.1 kB]
Fetched 119 kB in 0s (480 kB/s)
Selecting previously unselected package libev4.
(Reading database ... 124166 files and directories currently installed.)
Preparing to unpack .../libev4_1%3a4.22-1_armhf.deb ...
Unpacking libev4 (1:4.22-1) ...
Selecting previously unselected package libwebsockets8:armhf.
Preparing to unpack .../libwebsockets8_2.0.3-2_armhf.deb ...
Unpacking libwebsockets8:armhf (2.0.3-2) ...
Setting up libev4 (1:4.22-1) ...
Setting up libwebsockets8:armhf (2.0.3-2) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...
pi@home:~ $ apt-cache policy libwebsockets8
libwebsockets8:
Installed: 2.0.3-2
Candidate: 2.0.3-2
Version table:
*** 2.0.3-2 500
500 http://mirrordirector.raspbian.org/raspbian stretch/main armhf Packages
100 /var/lib/dpkg/status
pi@home:~ $ sudo dpkg -i mosquitto_fixed.deb
Selecting previously unselected package mosquitto.
(Reading database ... 124178 files and directories currently installed.)
Preparing to unpack mosquitto_fixed.deb ...
Unpacking mosquitto (1.4.12-0mosquitto1) ...
Setting up mosquitto (1.4.12-0mosquitto1) ...
Processing triggers for systemd (232-25+deb9u1) ...
Processing triggers for man-db (2.7.6.1-2) ...
pi@home:~ $ apt-cache policy mosquitto
mosquitto:
Installed: 1.4.12-0mosquitto1
Candidate: 1.4.12-0mosquitto1
Version table:
1.4.12-0mosquitto1 500
500 http://repo.mosquitto.org/debian stretch/main armhf Packages
*** 1.4.12-0mosquitto1 100
100 /var/lib/dpkg/status
1.4.10-3 500
500 http://mirrordirector.raspbian.org/raspbian stretch/main armhf Packages
pi@home:~ $ sudo /etc/init.d/mosquitto stop
[ ok ] Stopping mosquitto (via systemctl): mosquitto.service.
pi@home:~ $ sudo /etc/init.d/mosquitto start
[ ok ] Starting mosquitto (via systemctl): mosquitto.service.
pi@home:~ $
I can now get on with gaining some C experience getting MQTT working with some ESP8266s.
Mike
Re: STRECH and MQTT
Perhaps that works but according toDougieLawson wrote: ↑Wed Aug 23, 2017 2:00 pmCan you folks explain what part of viewtopic.php?p=1201759#p1199879 isn't working for you?
root@test1:/home/pi/Install-Programmes# apt-cache policy mosquitto
mosquitto:
Installed: (none)
Candidate: 1.4.12-0mosquitto1
Version table:
1.4.12-0mosquitto1 500
500 http://repo.mosquitto.org/debian stretch/main armhf Packages
1.4.10-3 500
500 http://mirrordirector.raspbian.org/raspbian stretch/main armhf Packages
100 /var/lib/dpkg/status
So, mosquitto is there and available to be installed.
my install is based on https://iotbytes.wordpress.com/mosquitt ... pberry-pi
BUT I did find that if I do not execute:
cd /etc/apt/sources.list.d/
sudo wget http://repo.mosquitto.org/debian/mosquitto-stretch.list #
sudo apt-get install -y mosquitto worked.
......
sudo apt-get paho-mqtt
Perhaps I am missing a more up to date install information
BD
Each pf my RPis can the act as a brocker and/or client/subscriber as required.
-
- Posts: 25
- Joined: Thu Sep 07, 2017 5:21 pm
Re: STRECH and MQTT
I am not convinced the install after editing the dependency file has worked.
First I have a Sonoff switch with the Tasmoda firmware loaded and logged on to my network. It reports:
14:00:26 MQT: Attempting connection...
14:00:27 DNS: Query done. MQTT services found 0
I then checked mosquito was running and tried mosquitto - v - that gave an error:
I then tried to subscribe and publish and got command not found:
Any help would be much appreciated.
Mike
First I have a Sonoff switch with the Tasmoda firmware loaded and logged on to my network. It reports:
14:00:26 MQT: Attempting connection...
14:00:27 DNS: Query done. MQTT services found 0
I then checked mosquito was running and tried mosquitto - v - that gave an error:
Code: Select all
pi@home:~ $ sudo /etc/init.d/mosquitto stop
[ ok ] Stopping mosquitto (via systemctl): mosquitto.service.
pi@home:~ $ sudo /etc/init.d/mosquitto start
[ ok ] Starting mosquitto (via systemctl): mosquitto.service.
pi@home:~ $ mosquitto -v
mosquitto: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
Code: Select all
pi@home:~ $ mosquitto_sub -d -t hello/world
-bash: mosquitto_sub: command not found
pi@home:~ $ mosquitto_pub -d -t hello/world -m "Hello from Terminal window 2!"
-bash: mosquitto_pub: command not found
pi@home:~ $
Mike
Re: STRECH and MQTT
You could go to the directory /usr/lib/arm...somethinhsomthing and make a symbolic link from the libssl.so.1.0.2 file to the name its looking for.
-
- Posts: 25
- Joined: Thu Sep 07, 2017 5:21 pm
Re: STRECH and MQTT
Sorry I have had enough getting nowhere. I have gone back to square one, loaded jessie and am now able to do coms from mosquitto to an ESP loaded with Sonoff-Tasmota so I can concentrate on IoT rather than Linux. It is time for someone else to take up the mantle of getting mosquitto on Stretch. When I see a solution, and others confirming it works then I will have another go. This has been three days of frustration. I think this is enough. Mike
Re: STRECH and MQTT
This tutorial/walk-through by @ASandford appears to have been endorsed as working by the person being assisted:
viewtopic.php?f=32&t=192137&p=1208936#p1206901
viewtopic.php?f=32&t=192137&p=1208936#p1206901
Re: STRECH and MQTT
It was more of a quick intro guide, but yes, it worked (as can be seen on the post - nothing edited) on a fresh card install and apt upgraded before MQTT software installation.B.Goode wrote: ↑Sat Sep 09, 2017 10:23 pmThis tutorial/walk-through by @ASandford appears to have been endorsed as working by the person being assisted:
viewtopic.php?f=32&t=192137&p=1208936#p1206901
Re: STRECH and MQTT
Clean Raspbian Stretch 2017-09-07 install, sudo apt-get install mosquitto worked for me. Also install the mosquitto-clients package for easy testing.bullockbob wrote: ↑Mon Aug 28, 2017 1:59 amDoes anyone actually have the Mosquitto broker installed and running under Stretch? If so, can they detail their exact steps for the installation process? That would be really helpful.
sudo apt-get update ; sudo apt-get dist-upgrade should work if your initial install was Stretch, if you installed third party repos or have upgraded from Jessie, all I can say apt is very good, but a long way from perfect.
- DougieLawson
- Posts: 42313
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: STRECH and MQTT
My Jessie machines that I've upgraded to Stretch (edit /etc/apt/ files, run apt-get update, apt-get dist-upgrade) have a working copy of Mosquitto.
It doesn't look like the issue with the install https://github.com/eclipse/mosquitto/issues/529 is resolved (there's lots of "me too"'s but no sane response from the developers).
It doesn't look like the issue with the install https://github.com/eclipse/mosquitto/issues/529 is resolved (there's lots of "me too"'s but no sane response from the developers).
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: STRECH and MQTT
Of course other MQ brokers are available (that can handle the MQTT protocol) if Mosquitto is broken.
Re: STRECH and MQTT
Bonzadog,
I just noticed this in an earlier post:
http://bonzodog.co.uk
I just noticed this in an earlier post:
Actually the band was "The Bonzo Dog Doo-Dah Band" also known as "The Bonzo Dog Band". Or for us just "The Bonzos"(I got a few PM regarding the name. Bonzadog was an original English Group in the 1960's. Their full name was Bonza Dog Doo Dah Band)
http://bonzodog.co.uk
Slava Ukrayini.
-
- Posts: 25
- Joined: Thu Sep 07, 2017 5:21 pm
Re: STRECH and MQTT
I have now loaded Mosquitto on both Jessie and Stretch.
In the case of Jessie I used the following code before install:
I was able to install mosquito, mosquitto clients and python mosquitto.
This delivered Mosquitto version 1.4.14
The repo list for Stetch did not enable install.
So I just used apt-get.
python-mosquitto did not install - so only able to do:
This delivered Mosquitto version 1.4.10
Stretch also had a later version of Node Red (0.17.4 vs 0.15.3 for jessie)
So in conclusion it appears that one has a choice or either
Jessie+Mosquitto 1.4.14+Node Red 0.15.3+ mosquitto clients and python-mosquitto
or:
Stretch + Mosquitto 1.4.10+Node Red 0.17.4+mosquitto clients but not python-mosquitto.
Mike
In the case of Jessie I used the following code before install:
Code: Select all
sudo wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key
cd /etc/apt/sources.list.d
sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list
Code: Select all
sudo apt-get update
sudo apt-get install mosquitto mosquitto-clients python-mosquitto
The repo list for Stetch did not enable install.
So I just used apt-get.
python-mosquitto did not install - so only able to do:
Code: Select all
sudo apt-get update
sudo apt-get install mosquitto mosquitto-clients
Stretch also had a later version of Node Red (0.17.4 vs 0.15.3 for jessie)
So in conclusion it appears that one has a choice or either
Jessie+Mosquitto 1.4.14+Node Red 0.15.3+ mosquitto clients and python-mosquitto
or:
Stretch + Mosquitto 1.4.10+Node Red 0.17.4+mosquitto clients but not python-mosquitto.
Mike
-
- Posts: 2247
- Joined: Thu Feb 05, 2015 11:25 pm
Re: STRECH and MQTT
AFAIK python-mosquitto was original method of coding MQTT stuff in Python and was superceded a while ago by paho-mqtt which is installed using pip
https://mosquitto.org/documentation/python/
https://mosquitto.org/documentation/python/
- DougieLawson
- Posts: 42313
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: STRECH and MQTT
You are not wrong. Although looking at the sample code, it's largely a re-packaging exercise.mattmiller wrote: ↑Tue Sep 19, 2017 11:55 amAFAIK python-mosquitto was original method of coding MQTT stuff in Python and was superceded a while ago by paho-mqtt which is installed using pip
https://mosquitto.org/documentation/python/
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: STRECH and MQTT
You have the option of upgrading npm and node red (this will break apt updates, but that is irrelevant on jessie):FlyingDrMike wrote: ↑Tue Sep 19, 2017 10:19 am
So in conclusion it appears that one has a choice or either
Jessie+Mosquitto 1.4.14+Node Red 0.15.3+ mosquitto clients and python-mosquitto
or:
Stretch + Mosquitto 1.4.10+Node Red 0.17.4+mosquitto clients but not python-mosquitto.
Mike
Code: Select all
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux
pi@raspberrypi:~ $ cat /etc/issue
Raspbian GNU/Linux 8 \n \l
pi@raspberrypi:~ $ node-red
Welcome to Node-RED
===================
19 Sep 23:11:59 - [info] Node-RED version: v0.15.3
19 Sep 23:11:59 - [info] Node.js version: v0.10.29
19 Sep 23:11:59 - [info] Linux 4.9.35-v7+ arm LE
19 Sep 23:12:01 - [info] Loading palette nodes
19 Sep 23:12:10 - [warn] ------------------------------------------------------
19 Sep 23:12:10 - [warn] [sensehat] Error: Can't find Sense HAT python libraries. Run sudo apt-get install sense-hat
19 Sep 23:12:10 - [warn] ------------------------------------------------------
19 Sep 23:12:10 - [info] Settings file : /home/pi/.node-red/settings.js
19 Sep 23:12:10 - [info] User directory : /home/pi/.node-red
19 Sep 23:12:10 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
19 Sep 23:12:10 - [info] Creating new flow file
19 Sep 23:12:10 - [info] Starting flows
19 Sep 23:12:10 - [info] Started flows
19 Sep 23:12:10 - [info] Server now running at http://127.0.0.1:1880/
^C19 Sep 23:12:14 - [info] Stopping flows
pi@raspberrypi:~ $ npm -v
1.4.21
pi@raspberrypi:~ $ update-nodejs-and-nodered
This script will remove any pre-installed versions of node.js and Node-RED
and replace them with node.js 6.x LTS (boron) and the latest Node-RED from Npm.
To do this it runs commands as root - please satisfy yourself that this will
not damage your Pi, or otherwise compromise your configuration.
Doing this may also be 'a bad thing' if you have installed lots of extra nodes.
Especially if they have any native binary component. Some nodes in your
~/.node-red directory will probably need to be re-installed afterwards, some
may need you to run npm update, and some may require you to run npm rebuild.
There may be a period of frustration ahead to get back to where you were...
Are you really, really sure you want to do this ?y
rm: cannot remove ‘/var/log/nodered-install.log’: No such file or directory
This can take 20-30 minutes on a Pi 1 - please wait.
.... Some time later....
Stop Node-RED ✔
Remove old version of Node-RED ✔
Remove old version of node.js ✔
Update node.js LTS ✔ Node v6.11.3 Npm 3.10.10
Clean npm cache ✔
Install Node-RED core ✔ 0.17.5
Move global nodes to local ✔
Install extra Pi nodes ✔
Npm rebuild existing nodes ✔
Add menu shortcut ✔
Update systemd script ✔
Update update script ✔
Any errors will be logged to /var/log/nodered-install.log
All done.
You can now start Node-RED with the command node-red-start
or using the icon under Menu / Programming / Node-RED
Then point your browser to localhost:1880 or http://{your_pi_ip-address}:1880
Started Tue 19 Sep 23:27:53 UTC 2017 - Finished Tue 19 Sep 23:35:42 UTC 2017
pi@raspberrypi:~ $ node-red-start
Start Node-RED
Once Node-RED has started, point a browser at http://192.168.0.219:1880
On Pi Node-RED works better with the Firefox or Chrome browser
Use node-red-stop to stop Node-RED
Use node-red-start to start Node-RED again
Use node-red-log to view the recent log output
Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot
To find more nodes and example flows - go to http://flows.nodered.org
Starting as a systemd service.
Started Node-RED graphical event wiring tool..
19 Sep 23:38:04 - [info]
Welcome to Node-RED
===================
19 Sep 23:38:04 - [info] Node-RED version: v0.17.5
19 Sep 23:38:04 - [info] Node.js version: v6.11.3
19 Sep 23:38:04 - [info] Linux 4.9.35-v7+ arm LE
19 Sep 23:38:06 - [info] Loading palette nodes
19 Sep 23:38:14 - [warn] ------------------------------------------------------
19 Sep 23:38:14 - [warn] [sensehat] Error: Can't find Sense HAT python libraries. Run sudo apt-get install sense-hat
19 Sep 23:38:14 - [warn] ------------------------------------------------------
19 Sep 23:38:14 - [info] Settings file : /home/pi/.node-red/settings.js
19 Sep 23:38:14 - [info] User directory : /home/pi/.node-red
19 Sep 23:38:14 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
19 Sep 23:38:14 - [info] Creating new flow file
19 Sep 23:38:14 - [info] Starting flows
19 Sep 23:38:14 - [info] Started flows
19 Sep 23:38:14 - [info] Server now running at http://127.0.0.1:1880/
^Cpi@raspberrypi:~ $
Code: Select all
bash <(curl -sL https://raw.githubusercontent.com/node-red/raspbian-deb-package/master/resources/update-nodejs-and-nodered)
-
- Posts: 2
- Joined: Fri Nov 03, 2017 6:02 pm
Re: STRECH and MQTT
I also got the missing libssl1.0.0 error and found the following fix :
after this you can install mosquitto and mosquitto-clients :
Code: Select all
wget http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u6_armhf.deb
sudo dpkg -i libssl1.0.0_1.0.1t-1+deb8u6_armhf.deb
Code: Select all
sudo apt-get install mosquitto
sudo apt-get install mosquitto-clients
- tinkererscott
- Posts: 7
- Joined: Sun Nov 05, 2017 5:19 pm
Re: STRECH and MQTT
Almost, but not quite:
Thanks for your help,
Scott
Code: Select all
root@roran:~# dpkg -i libssl1.0.0_1.0.1t-1+deb8u6_armhf.deb
Selecting previously unselected package libssl1.0.0:armhf.
(Reading database ... 134335 files and directories currently installed.)
Preparing to unpack libssl1.0.0_1.0.1t-1+deb8u6_armhf.deb ...
Unpacking libssl1.0.0:armhf (1.0.1t-1+deb8u6) ...
Setting up libssl1.0.0:armhf (1.0.1t-1+deb8u6) ...
root@roran:~# apt-get install mosquitto
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mosquitto : Depends: libwebsockets3 (>= 1.2) but it is not installable
E: Unable to correct problems, you have held broken packages.
root@roran:~#
Scott
Re: STRECH and MQTT
Still can't reproduce the problem
Fresh install of stretch lite (2017-09-07) apt upate and apt dist-ugrade done (plus a reboot as dbus required it) on a pi3b 1v2 (2015)
Install looks Ok
Start a sub session:
Duplicate putty session and start a pub :
Check the sub session:
Looks to be working to me.
Fresh install of stretch lite (2017-09-07) apt upate and apt dist-ugrade done (plus a reboot as dbus required it) on a pi3b 1v2 (2015)
Code: Select all
root@raspberrypi:~# apt update
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Hit:2 http://mirrordirector.raspbian.org/raspbian stretch InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
root@raspberrypi:~# apt install -y mosquitto mosquitto-clients
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libc-ares2 libev4 libmosquitto1 libuv1 libwebsockets8
Suggested packages:
apparmor
The following NEW packages will be installed:
libc-ares2 libev4 libmosquitto1 libuv1 libwebsockets8 mosquitto
mosquitto-clients
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 485 kB of archives.
After this operation, 1,055 kB of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian stretch/main armhf libev4 armhf 1:4.22-1 [34.0 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian stretch/main armhf libc-ares2 armhf 1.12.0-1+deb9u1 [76.0 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian stretch/main armhf libmosquitto1 armhf 1.4.10-3 [46.2 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian stretch/main armhf libuv1 armhf 1.9.1-3 [73.2 kB]
Get:5 http://mirrordirector.raspbian.org/raspbian stretch/main armhf libwebsockets8 armhf 2.0.3-2 [85.1 kB]
Get:6 http://mirrordirector.raspbian.org/raspbian stretch/main armhf mosquitto armhf 1.4.10-3 [119 kB]
Get:7 http://mirrordirector.raspbian.org/raspbian stretch/main armhf mosquitto-clients armhf 1.4.10-3 [51.2 kB]
Fetched 485 kB in 4s (116 kB/s)
Selecting previously unselected package libev4.
(Reading database ... 34443 files and directories currently installed.)
Preparing to unpack .../0-libev4_1%3a4.22-1_armhf.deb ...
Unpacking libev4 (1:4.22-1) ...
Selecting previously unselected package libc-ares2:armhf.
Preparing to unpack .../1-libc-ares2_1.12.0-1+deb9u1_armhf.deb ...
Unpacking libc-ares2:armhf (1.12.0-1+deb9u1) ...
Selecting previously unselected package libmosquitto1:armhf.
Preparing to unpack .../2-libmosquitto1_1.4.10-3_armhf.deb ...
Unpacking libmosquitto1:armhf (1.4.10-3) ...
Selecting previously unselected package libuv1:armhf.
Preparing to unpack .../3-libuv1_1.9.1-3_armhf.deb ...
Unpacking libuv1:armhf (1.9.1-3) ...
Selecting previously unselected package libwebsockets8:armhf.
Preparing to unpack .../4-libwebsockets8_2.0.3-2_armhf.deb ...
Unpacking libwebsockets8:armhf (2.0.3-2) ...
Selecting previously unselected package mosquitto.
Preparing to unpack .../5-mosquitto_1.4.10-3_armhf.deb ...
Unpacking mosquitto (1.4.10-3) ...
Selecting previously unselected package mosquitto-clients.
Preparing to unpack .../6-mosquitto-clients_1.4.10-3_armhf.deb ...
Unpacking mosquitto-clients (1.4.10-3) ...
Setting up libev4 (1:4.22-1) ...
Setting up libuv1:armhf (1.9.1-3) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...
Processing triggers for systemd (232-25+deb9u1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up libc-ares2:armhf (1.12.0-1+deb9u1) ...
Setting up libwebsockets8:armhf (2.0.3-2) ...
Setting up mosquitto (1.4.10-3) ...
Setting up libmosquitto1:armhf (1.4.10-3) ...
Setting up mosquitto-clients (1.4.10-3) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...
Processing triggers for systemd (232-25+deb9u1) ...
root@raspberrypi:~#
Start a sub session:
Code: Select all
root@raspberrypi:~# mosquitto_sub -d -t hello/world
Client mosqsub/999-raspberrypi sending CONNECT
Client mosqsub/999-raspberrypi received CONNACK
Client mosqsub/999-raspberrypi sending SUBSCRIBE (Mid: 1, Topic: hello/world, QoS: 0)
Client mosqsub/999-raspberrypi received SUBACK
Subscribed (mid: 1): 0
Code: Select all
root@raspberrypi:~# mosquitto_pub -d -t hello/world -m "Hello from Terminal window 2!"
Client mosqpub/1057-raspberryp sending CONNECT
Client mosqpub/1057-raspberryp received CONNACK
Client mosqpub/1057-raspberryp sending PUBLISH (d0, q0, r0, m1, 'hello/world', ... (29 bytes))
Client mosqpub/1057-raspberryp sending DISCONNECT
root@raspberrypi:~#
Code: Select all
Client mosqsub/999-raspberrypi sending PINGREQ
Client mosqsub/999-raspberrypi received PINGRESP
Client mosqsub/999-raspberrypi received PUBLISH (d0, q0, r0, m0, 'hello/world', ... (29 bytes))
Hello from Terminal window 2!
Client mosqsub/999-raspberrypi sending PINGREQ
Client mosqsub/999-raspberrypi received PINGRESP
Re: STRECH and MQTT
You can add the necessary packages then install Mosquito
cd ~
wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key
cd /etc/apt/sources.list.d/
sudo wget http://repo.mosquitto.org/debian/mosquitto-stretch.list
sudo apt-get update
cd ~
wget http://security.debian.org/debian-secur ... _armhf.deb
sudo dpkg -i libssl1.0.0_1.0.1t-1+deb8u6_armhf.deb
wget http://ftp.nz.debian.org/debian/pool/ma ... _armhf.deb
sudo dpkg -i libwebsockets3_1.2.2-1_armhf.deb
sudo apt-get install mosquitto mosquitto-clients
cd ~
wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key
cd /etc/apt/sources.list.d/
sudo wget http://repo.mosquitto.org/debian/mosquitto-stretch.list
sudo apt-get update
cd ~
wget http://security.debian.org/debian-secur ... _armhf.deb
sudo dpkg -i libssl1.0.0_1.0.1t-1+deb8u6_armhf.deb
wget http://ftp.nz.debian.org/debian/pool/ma ... _armhf.deb
sudo dpkg -i libwebsockets3_1.2.2-1_armhf.deb
sudo apt-get install mosquitto mosquitto-clients
Re: STRECH and MQTT
sonjiab wrote: ↑Tue Nov 07, 2017 5:35 amYou can add the necessary packages then install Mosquito
cd ~
wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key
cd /etc/apt/sources.list.d/
sudo wget http://repo.mosquitto.org/debian/mosquitto-stretch.list
sudo apt-get update
cd ~
wget http://security.debian.org/debian-secur ... _armhf.deb
sudo dpkg -i libssl1.0.0_1.0.1t-1+deb8u6_armhf.deb
wget http://ftp.nz.debian.org/debian/pool/ma ... _armhf.deb
sudo dpkg -i libwebsockets3_1.2.2-1_armhf.deb
sudo apt-get install mosquitto mosquitto-clients
Under what circumstances would that be necessary, given that in the preceding post @asandford appears to demonstrate that a simple
Code: Select all
apt install -y mosquitto mosquitto-clients
Re: STRECH and MQTT
Its well hidden in the thread but I believe the main goal of this thread (at start at least) was to install a newer version ( 1.4.14+) than the one in the stock repos ( 1.4.10 ).
Re: STRECH and MQTT
That might be a stretch-goal (no pun intended), but the OP makes no mention of that:
They couldn't get stock mosquitto to work.bonzadog wrote: ↑Thu Aug 17, 2017 1:59 pm17.8.2017
SOme problems with MQTT on Strech (RPI 2)
Problem 1) installing mosquitto
pi@mqtt:~/Install-Programmes $ sudo apt-get install mosquitto
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mosquitto : Depends: libssl1.0.0 (>= 1.0.1) but it is not installable
Depends: libwebsockets3 (>= 1.2) but it is not installable
----------------------------------------------------------------------------------------------------------------------------------------------------------
Problem 2)
Attempting to install: sudo apt-get install -y mosquitto-client python3-mosquitto
Reading package lists... Done
E: Unable to locate package mosquitto-client
E: Unable to locate package python3-mosquitt
On Jessie the install all worked.
Can some one please advise me and thanks
BD
If others have hijacked the thread to install a 'non-supported' version, then that's their problem and they should do a new post.