Add website.

This commit is contained in:
Roger A. Light 2018-08-08 22:43:14 +01:00
parent 79bb75ca07
commit 8aef00d3df
245 changed files with 19223 additions and 8 deletions

22
.gitignore vendored
View File

@ -7,10 +7,21 @@ cpp/*.test
*.pyc
*.vglog
build/
client/mosquitto_pub
client/mosquitto_sub
dist/
examples/mysql_log/mosquitto_mysql_log
examples/temperature_conversion/mqtt_temperature_conversion
lib/cpp/libmosquittopp.so*
lib/cpp/libmosquittopp.a
lib/libmosquitto.so*
lib/libmosquitto.a
man/mosquitto.8
man/mosquitto-tls.7
man/mosquitto.conf.5
@ -19,9 +30,11 @@ man/mosquitto_passwd.1
man/mosquitto_pub.1
man/mosquitto_sub.1
man/mqtt.7
src/db_dump/mosquitto_db_dump
src/mosquitto
src/mosquitto_passwd
test/broker/broker.pid
test/test_client
test/fake_user
@ -32,15 +45,10 @@ test/msgsps_sub.dat
test/broker/c/auth_plugin.so
test/broker/c/*.test
lib/cpp/libmosquittopp.so*
lib/cpp/libmosquittopp.a
lib/libmosquitto.so*
lib/libmosquitto.a
test/ssl/*.csr
test/lib/c/*.test
test/lib/cpp/*.test
build/
dist/
www/cache/
__pycache__

View File

@ -5,7 +5,6 @@
<xsl:param name="html.stylesheet">man.css</xsl:param>
<!-- Generate ansi style function synopses. -->
<xsl:param name="man.funcsynopsis.style">ansi</xsl:param>
<xsl:param name="funcsynopsis.style">ansi</xsl:param>
<xsl:param name="make.clean.html" select="1"></xsl:param>
<xsl:param name="make.valid.html" select="1"></xsl:param>
<xsl:param name="html.cleanup" select="1"></xsl:param>

5
man/libmosquitto.3.meta Normal file
View File

@ -0,0 +1,5 @@
.. title: libmosquitto man page
.. slug: libmosquitto-3
.. category: man
.. type: man
.. pretty_url: False

5
man/mosquitto-tls.7.meta Normal file
View File

@ -0,0 +1,5 @@
.. title: mosquitto-tls man page
.. slug: mosquitto-tls-7
.. category: man
.. type: man
.. pretty_url: False

5
man/mosquitto.8.meta Normal file
View File

@ -0,0 +1,5 @@
.. title: Mosquitto man page
.. slug: mosquitto-8
.. category: man
.. type: man
.. pretty_url: False

View File

@ -0,0 +1,5 @@
.. title: mosquitto.conf man page
.. slug: mosquitto-conf-5
.. category: man
.. type: man
.. pretty_url: False

View File

@ -0,0 +1,5 @@
.. title: mosquitto_passwd man page
.. slug: mosquitto_passwd-1
.. category: man
.. type: man
.. pretty_url: False

5
man/mosquitto_pub.1.meta Normal file
View File

@ -0,0 +1,5 @@
.. title: mosquitto_pub man page
.. slug: mosquitto_pub-1
.. category: man
.. type: man
.. pretty_url: False

5
man/mosquitto_sub.1.meta Normal file
View File

@ -0,0 +1,5 @@
.. title: mosquitto_sub man page
.. slug: mosquitto_sub-1
.. category: man
.. type: man
.. pretty_url: False

6
man/mqtt.7.meta Normal file
View File

@ -0,0 +1,6 @@
.. title: MQTT man page
.. slug: mqtt-7
.. category: man
.. type: man
.. pretty_url: False
.. hide_title: True

1421
www/conf.py Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 KiB

BIN
www/files/favicon-16x16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 915 B

BIN
www/files/favicon-32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 B

BIN
www/files/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

18
www/files/manifest.json Normal file
View File

@ -0,0 +1,18 @@
{
"name": "Mosquitto",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

BIN
www/files/mstile-70x70.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<title>Eclipse Mosquitto&trade; Sticker Generator</title>
</head>
<body style="background-color:#dddddd">
<div style="width:500px; text-align:center; margin: 0 auto;">
<h1>Eclipse Mosquitto&trade; Sticker Generator</h1>
<p>This page allows you to create a book of square stickers to buy from <a href="http://moo.com/">Moo</a>.</p>
<p>Click the logos to choose which to include, then click submit to be
taken to the Moo site with a stickerbook ready in your basket. If you
choose both logos you will get 45 of each, otherwise you will get 90 of the
one you choose.</p>
<span style="margin: 0 auto; width: 200px; text-align: center">
<img id="mono" src="mosquitto-mono.png" width="100" height="100" onclick="changeImg('mono')">
<img id="colour" src="mosquitto-colour.png" width="100" height="100" onclick="changeImg('colour')"><br/>
</span>
<form action="submit.php" method="get">
<input type="hidden" id="mono-check" name="mono" value="1">
<input type="hidden" id="colour-check" name="colour" value="1">
<input type="submit" value="Submit">
</form>
</div>
<script>
function changeImg(id){
var img = document.getElementById(id),
inp = document.getElementById(id+"-check"),
x = img.src.split("/"),
t = x.length-1,
y = x[t];
if(y.indexOf('deselected') > -1){
img.src = "mosquitto-"+id+".png";
inp.value = "1";
}else{
img.src = "mosquitto-"+id+"-deselected.png";
inp.value = "0";
}
}
</script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,12 @@
<!--
.. title: Documentation
.. slug: documentation
.. date: 2018-01-02 09:25:28 UTC
.. tags:
.. category:
.. link:
.. description:
.. type: text
-->
Write your page here.

110
www/pages/download.md Normal file
View File

@ -0,0 +1,110 @@
<!--
.. title: Download
.. slug: download
.. date: 2018-01-07 20:15:04 UTC
.. tags: tag
.. category: category
.. link: link
.. description: blah
.. type: text
-->
# Source
* [mosquitto-1.5.tar.gz](http://mosquitto.org/files/source/mosquitto-1.5.tar.gz) (319kB) ([GPG signature](http://mosquitto.org/files/source/mosquitto-1.5.tar.gz.asc))
* [mosquitto-1.4.15.tar.gz](http://www.eclipse.org/downloads/download.php?file=/mosquitto/source/mosquitto-1.4.15.tar.gz) (via Eclipse)
* [Git source code repository](https://github.com/eclipse/mosquitto) (github.com)
Older downloads are available at [http://mosquitto.org/files/](../files/)
# Binary Installation
## Windows
* [mosquitto-1.4.15a-install-win32.exe](http://www.eclipse.org/downloads/download.php?file=/mosquitto/binary/win32/mosquitto-1.4.15a-install-win32.exe) (~200 kB) (Native build, Windows Vista and up, built with Visual Studio Community 2015)
* [mosquitto-1.4.15-install-cygwin.exe](http://www.eclipse.org/downloads/download.php?file=/mosquitto/binary/cygwin/mosquitto-1.4.15-install-cygwin.exe) (~200 kB) (Cygwin build, Windows XP and up)
See the readme-windows.txt after installing for Windows specific details and dependencies.
## Mac
Mosquitto can be installed from the homebrew project. See [brew.sh](http://brew.sh/) and then use `brew install mosquitto`
## Arch Linux
* Mosquitto can be found in the community repository.
## CentOS
Download the repository config file for your CentOS version from below and copy it to /etc/yum.repos.d/ You'll now be able to install and keep mosquitto up to date using the normal package management tools.
The available packages are: mosquitto, mosquitto-clients, libmosquitto1, libmosquitto-devel, libmosquittopp1, libmosquittopp-devel, python-mosquitto.
* [CentOS 7](http://download.opensuse.org/repositories/home:/oojah:/mqtt/CentOS_CentOS-7/home:oojah:mqtt.repo)
* [CentOS 6](http://download.opensuse.org/repositories/home:/oojah:/mqtt/CentOS_CentOS-6/home:oojah:mqtt.repo)
## Debian
* Mosquitto is now in Debian proper. There will be a short delay between a new release and it appearing in Debian as part of the normal Debian procedures.
* There are also Debian repositories provided by the mosquitto project, as described at http://mosquitto.org/2013/01/mosquitto-debian-repository>
## Fedora
Mosquitto is now available from Fedora directly. Use `yum install mosquitto`, or search for "mosquitto" to find the related packages.
## FreeBSD
Mosquitto is available for FreeBSD: http://www.freshports.org/net/mosquitto/
## Gentoo
Use `emerge mosquitto`
## openSUSE
Download the repository config file for your openSUSE version from below and copy it to /etc/zypp/repos.d/ You'll now be able to install and keep mosquitto up to date using the normal package management tools.
The available packages are: mosquitto, mosquitto-clients, libmosquitto1, libmosquitto-devel, libmosquittopp1, libmosquittopp-devel, python-mosquitto.
* [openSUSE 13.2]http://download.opensuse.org/repositories/home:/oojah:/mqtt/openSUSE_13.2/home:oojah:mqtt.repo)
* [openSUSE 13.1]http://download.opensuse.org/repositories/home:/oojah:/mqtt/openSUSE_13.1/home:oojah:mqtt.repo)
## OpenWrt
If you're using a trunk snapshot use `opkg update; opkg install mosquitto`
Karl Palsson maintains a set of feeds that may be more up to date than the current OpenWrt version:
* https://github.com/remakeelectric/owrt_pub_feeds
## Raspberry Pi
Mosquitto is available through the main repository.
There are also Debian repositories provided by the mosquitto project, as described at http://mosquitto.org/2013/01/mosquitto-debian-repository/
## Redhat Enterprise Linux
Download the repository config file for your RHEL version from below and copy it to /etc/yum.repos.d/ You'll now be able to install and keep mosquitto up to date using the normal package management tools.
The available packages are: mosquitto, mosquitto-clients, libmosquitto1, libmosquitto-devel, libmosquittopp1, libmosquittopp-devel, python-mosquitto.
* [RHEL 7](http://download.opensuse.org/repositories/home:/oojah:/mqtt/RedHat_RHEL-7/home:oojah:mqtt.repo)
* [RHEL 6](http://download.opensuse.org/repositories/home:/oojah:/mqtt/RedHat_RHEL-6/home:oojah:mqtt.repo)
## SUSE Linux Enterprise Server
Add the appropriate repository to your package config from the list below, then install mosquitto from your normal package management tools.
* [SLE 15](http://download.opensuse.org/repositories/home:/oojah:/mqtt/SLE_15/)
* [SLE 12 SP3](http://download.opensuse.org/repositories/home:/oojah:/mqtt/SLE_12_SP3/)
* [SLE 12 SP2](http://download.opensuse.org/repositories/home:/oojah:/mqtt/SLE_12_SP2/)
* [SLE 12 SP1](http://download.opensuse.org/repositories/home:/oojah:/mqtt/SLE_12_SP1/)
* [SLE 12](http://download.opensuse.org/repositories/home:/oojah:/mqtt/SLE_123/)
## Ubuntu
Mosquitto is available in the Ubuntu repositories so you can install as with
any other package. If you are on an earlier version of Ubuntu or want a more
recent version of mosquitto, add the [mosquitto-dev
PPA](http://launchpad.net/%7Emosquitto-dev/+archive/mosquitto-ppa/) to your
repositories list - see the link for details. mosquitto can then be installed
from your package manager.
* `sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa`
* `sudo apt-get update`
If the command `apt-add-repository` is not recognised, it can be installed with:
* `sudo apt-get install python-software-properties`
## iPhone
You can use libmosquitto (included in the source download) on the iPhone to
build MQTT apps. It compiles as objective-c, or you can use the
[marquette](https://github.com/njh/marquette/) project which is an objective-c
wrapper and example app.

82
www/pages/index.html Normal file
View File

@ -0,0 +1,82 @@
<!--
.. title: Eclipse Mosquitto
.. slug: index
.. date: 2018-01-08 15:39:57 UTC
.. tags:
.. category:
.. link:
.. description:
.. type: text
-->
<section class="section is-small">
<div class="container">
<p>Eclipse Mosquitto is an open source (EPL/EDL licensed) message broker that
implements the MQTT protocol versions 3.1 and 3.1.1. Mosquitto
is lightweight and is suitable for use on all devices from low
power single board computers to full servers.</p>
<p>The MQTT protocol provides a lightweight method of carrying
out messaging using a publish/subscribe model. This makes it
suitable for Internet of Things messaging such as with low
power sensors or mobile devices such as phones, embedded
computers or microcontrollers.</p>
<p>The Mosquitto project also provides a C library for
implementing MQTT clients, and the very popular mosquitto_pub
and mosquitto_sub command line MQTT clients.</p>
<p>Mosquitto is part of the <a href="http://eclipse.org/">Eclipse
Foundation</a> and is an <a
href="http://iot.eclipse.org/">iot.eclipse.org</a> project.</p>
</div>
</section>
<hr/>
<section class="section is-small">
<div class="container">
<div class="columns">
<div class="column column-justify">
<h1>Download</h1>
<p>Mosquitto is highly portable and available for a wide range of
platforms. Go to the dedicated <a href="/download">download
page</a> to find the source or binaries for your platform.</p>
<p>Read the <a href="ChangeLog.txt">Change Log</a> to find out
about recent releases.</p>
</div>
<div class="column column-justify">
<h1>Test</h1>
<p>You can have your own instance of Mosquitto running in
minutes, but to make testing even easier, the Mosquitto Project
runs a test server at <a
href="http://test.mosquitto.org/">test.mosquitto.org</a> where
you can test your clients in a variety of ways: plain MQTT,
MQTT over TLS, MQTT over TLS (with <a
href="http://test.mosquitto.org/ssl/">client certificate</a>,
MQTT over WebSockets and MQTT over WebSockets with TLS.</p>
platforms.</p>
</div>
<div class="column column-justify">
<h1>Community</h1>
<ul>
<li>Report bugs or submit changes on the <a href="https://github.com/eclipse/mosquitto">Github repository</a></li>
<li>Talk to other users on the <a href="https://dev.eclipse.org/mailman/listinfo/mosquitto-dev">Mosquitto mailing list</a>.</li>
<li>Get yourself some <a href="/stickers">stickers</a>.</p>
<li><a href="/2017/06/citing-eclipse-mosquitto/">Cite Mosquitto</a> in your academic work.</li>
</ul>
</div>
<div class="column column-justify">
<h1>Security</h1>
<p>Use the <a href="/security">security</a> page to find out
how to report vulnerabilities or responses to past security
issues.</p>
</div>
</div>
</div>
</section>

44
www/pages/security.md Normal file
View File

@ -0,0 +1,44 @@
<!--
.. title: Security
.. slug: security
.. date: 2018-02-07 10:52:50 UTC
.. tags:
.. category:
.. link:
.. description:
.. type: text
-->
# Reporting security vulnerabilities
If you think you have found a security vulnerability in Mosquitto, please
follow the steps on [Eclipse Security] page to report it.
# Past vulnerabilities
Listed with most recent first. Further information on security related issues
can be found in the [security category].
* February 2018: [CVE-2017-7651] affecting versions **0.15** to **1.4.14**
inclusive, fixed in **1.4.15**. More details at
[security-advisory-cve-2017-7651-cve-2017-7652].
* February 2018: [CVE-2017-7652] affecting versions **1.0** to **1.4.14**
inclusive, fixed in **1.4.15**. More details at
[security-advisory-cve-2017-7651-cve-2017-7652].
* June 2017: [CVE-2017-9868] affecting versions **0.15** to **1.4.12**
inclusive, fixed in **1.4.13**. More details at
[security-advisory-cve-2017-9868].
* May 2017: [CVE-2017-7650] affecting versions **0.15** to **1.4.11**
inclusive, fixed in **1.4.12**. More details at
[security-advisory-cve-2017-7650].
[security-advisory-cve-2017-7651-cve-2017-7652]: /2018/02/security-advisory-cve-2017-7651-cve-2017-7652/
[CVE-2017-7651]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-7651
[CVE-2017-7652]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-7652
[Eclipse Security]: https://www.eclipse.org/security/
[CVE-2017-7650]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-7650
[security-advisory-cve-2017-7650]: /2017/05/security-advisory-cve-2017-7650/
[CVE-2017-9868]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9868
[security-advisory-cve-2017-9868]: /2017/06/security-advisory-cve-2017-9868/
[security category]: /blog/categories/security/

1
www/plugins/__init__.py Normal file
View File

@ -0,0 +1 @@
# Plugin modules go here.

View File

@ -0,0 +1,12 @@
[Core]
Name = docbookmanpage
Module = docbookmanpage
[Nikola]
PluginCategory = PageCompiler
[Documentation]
Author = Roger Light (asciidoc code by Roberto Alsina)
Version = 0.4
Website = https://github.com/ralight/nikola-docbook-manpage
Description = Compile Docbook manpages into html, based on asciidoc plugin.

View File

@ -0,0 +1,81 @@
# -*- coding: utf-8 -*-
# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the
# Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice
# shall be included in all copies or substantial portions of
# the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
# OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""Implementation of compile_html based on asciidoc.
You will need, of course, to install asciidoc
"""
import codecs
import os
import subprocess
from nikola.plugin_categories import PageCompiler
from nikola.utils import makedirs, req_missing, write_metadata
try:
from collections import OrderedDict
except ImportError:
OrderedDict = dict # NOQA
class CompileDocbookManpage(PageCompiler):
"""Compile docbookmanpage into HTML."""
name = "docbookmanpage"
demote_headers = True
def compile(self, source, dest, is_two_file=True, post=None, lang=None):
"""Compile the source file into HTML and save as dest."""
makedirs(os.path.dirname(dest))
binary = self.site.config.get('XSLTPROC_BINARY', 'xsltproc')
xslpath = os.path.join(os.path.split(__file__)[0], 'html.xsl')
try:
subprocess.check_call((binary, '-o', dest, xslpath, source))
if post is None:
if shortcode_deps:
self.logger.error(
"Cannot save dependencies for post {0} (post unknown)",
source)
except OSError as e:
print(e)
req_missing(['xsltproc'], 'build this site (compile with xsltproc)', python=False)
def create_post(self, path, content=None, onefile=False, is_page=False, **kw):
"""Create post file with optional metadata."""
metadata = OrderedDict()
metadata.update(self.default_metadata)
metadata.update(kw)
makedirs(os.path.dirname(path))
if not content.endswith('\n'):
content += '\n'
with codecs.open(path, "wb+", "utf8") as fd:
if onefile:
fd.write("////\n")
fd.write(write_metadata(metadata))
fd.write("////\n")
fd.write(content)

View File

@ -0,0 +1,18 @@
<!-- Set parameters for manpage xsl -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="/usr/share/xml/docbook/stylesheet/docbook-xsl/html/docbook.xsl"/>
<xsl:output encoding="utf-8" indent="yes"/>
<xsl:param name="html.stylesheet">man.css</xsl:param>
<!-- Generate ansi style function synopses. -->
<xsl:param name="man.funcsynopsis.style">ansi</xsl:param>
<xsl:param name="funcsynopsis.style">ansi</xsl:param>
<xsl:param name="man-funcprototype-style">ansi</xsl:param>
<xsl:param name="make.clean.html" select="1"></xsl:param>
<xsl:param name="make.valid.html" select="1"></xsl:param>
<xsl:param name="html.cleanup" select="1"></xsl:param>
<xsl:param name="docbook.css.source"></xsl:param>
<xsl:param name="css.decoration" select="1"></xsl:param>
<xsl:param name="variablelist.as.table" select="0"></xsl:param>
<xsl:param name="variablelist.term.break.after">1</xsl:param>
<xsl:param name="citerefentry.link" select="1"></xsl:param>
</xsl:stylesheet>

View File

@ -0,0 +1,12 @@
<!--
.. title: Version 0.2 released
.. slug: version-0-2-released
.. date: 2009-12-04 10:49:06
.. tags: Releases
.. category:
.. link:
.. description:
.. type: text
-->
Version 0.2 released - please see the [change log](/ChangeLog.txt).

View File

@ -0,0 +1,20 @@
<!--
.. title: Version 0.3 released
.. slug: version-0-3-released
.. date: 2009-12-17 10:52:55
.. tags: Releases
.. category:
.. link:
.. description:
.. type: text
-->
* Added logging support.
* Now restarts much more quickly even when the network socket was in use.
* Can now be configured to run on multiple network ports and restricted to
specific network addresses.
* Added host access control in the form of tcp-wrappers support.
See the [change log](/ChangeLog.txt) for full details.
Wild card support in topics is coming in the next version.

View File

@ -0,0 +1,22 @@
<!--
.. title: Mailing list / irc
.. slug: mailing-list-irc
.. date: 2010-01-11 10:18:10
.. tags: Support
.. category:
.. link:
.. description:
.. type: text
-->
We've created some new support channels for mosquitto - a mailing list and an
irc channel. Although they are both intended for providing support for
mosquitto itself, general discussion of anything to do with mqtt is strongly
encouraged. We want to reduce the barrier to getting started and provide a
place where people can share their experiences.
The mailing list is at <http://launchpad.net/~mqtt-users>
The irc channel is #mqtt on the [freenode network]
[freenode network]: http://freenode.net/

View File

@ -0,0 +1,14 @@
<!--
.. title: Version 0.4.1 released
.. slug: version-0-4-1-released
.. date: 2010-01-12 22:10:13
.. tags: Releases
.. category:
.. link:
.. description:
.. type: text
-->
This is a bugfix release:
* Fix regex used for finding retained messages to send on new subscription.

View File

@ -0,0 +1,22 @@
<!--
.. title: Version 0.4 released
.. slug: version-0-4-released
.. date: 2010-01-05 10:54:37
.. tags: Releases
.. category:
.. link:
.. description:
.. type: text
-->
* Added support for wildcard subscriptions using + and #.
* All network operations are now non-blocking and can cope with partial packets, meaning that networking should be a lot more reliable.
* Total messsages/bytes sent/received are now available in $SYS.
* Improved logging information - use client ip address and id instead of socket number.
* Keepalive==0 is now correctly treated as "never disconnect".
* Default logging destination no longer includes "topics" to prevent possible error logging to the db before it is initialised.
* Periodic $SYS messages can now be disabled.
See the [changelog] for full details.
[changelog]: /ChangeLog.txt

View File

@ -0,0 +1,18 @@
<!--
.. title: Version 0.4.2 released
.. slug: version-0-4-2-released
.. date: 2010-02-06 14:50:27
.. tags: Releases
.. category:
.. link:
.. description:
.. type: text
-->
This is a bugfix release.
* Fix segfault on client connect with invalid protocol name/version.
Get it at the [download page].
[download page]: /download

View File

@ -0,0 +1,64 @@
<!--
.. title: Google powermeter
.. slug: google-powermeter
.. date: 2010-03-31 17:37:08
.. tags: Applications
.. category:
.. link:
.. description:
.. type: text
-->
A popular use for mqtt brokers seems to be coupling them with a [CurrentCost]
(or similar) energy monitor to then log energy data and produce pretty (and
useful!) graphs.
Google recently opened up their PowerMeter API which looks to provide very nice
graphing of energy data. They are working with utility companies directly with
in home monitors, but it's also possible to use it as an individual.
Toby Evans got to the bottom of registering a device (see his [explanatory blog
post]) which just leaves getting data to Google.
If you're already logging energy data to an MQTT broker, it's as simple as
adding another subscriber to send the data to Google. You could use the
mosquitto_sub client and a script I wrote for posting to google,
[google_powermeter_update_mqtt.pl] like so:
```
mosquitto_sub -t sensors/cc128/ch1 | google_powermeter_update_mqtt.pl
```
This assumes that the data appearing on the sensors/cc128/ch1 topic is in the
format `&lt;unix timestamp&gt; &lt;power reading in Watts&gt;`.
If you're not logging your energy data to a broker, you should probably
consider doing so :) There is another script [google_powermeter_update.pl]
which may be more suitable and can be used as:
```
google_powermeter_update.pl &lt;unix timestamp&gt; &lt;power in Watts&gt;
```
Both of the scripts need your user details adding and should be easy to modify
to match your own particular need. They also assume you're using a single
cumulative variable with your device and will need modifying if you're using
more than one variable or aren't using cumulative variables.
For reference, I use the script [cc128.pl] to read data from my CurrentCost
CC128 (Envi).
# Update:
Google has a limit of 6 API requests per hour, so the above description will
only work for a short while (the 6 request limit doesn't appear to be a hard
limit when you first exceed it, but becomes increasingly stricter). I'm now
logging my CC128 data to a mysql database and sending batch updates every 15
minutes with [google_powermeter_update_mysql.pl].
[CurrentCost]: http://currentcost.com/
[explanatory blog post]: http://2cheap2meter.blogspot.com/2010/03/setting-up-google-powermeter.html
[google_powermeter_update_mqtt.pl]: /files/perl/google_powermeter_update_mqtt.pl
[google_powermeter_update.pl]: /files/perl/google_powermeter_update.pl
[cc128.pl]: /files/perl/cc128.pl">cc128.pl
[google_powermeter_update_mysql.pl]: /files/perl/google_powermeter_update_mysql.pl

View File

@ -0,0 +1,31 @@
<!--
.. title: Upgrading to 0.5.1
.. slug: upgrading-to-0-5-1
.. date: 2010-03-01 09:48:41
.. tags:
.. category:
.. link:
.. description:
.. type: text
-->
When upgrading to 0.5.1 from 0.4 or higher, there is an important change in the
location of the sqlite3-pcre library used. On Linux, the expected location of
this library has changed from /usr/lib/sqlite3-pcre.so to
/usr/lib/sqlite3/pcre.so. This is because the library is an extension
specifically for sqlite3, not a general use shared library.
If you installed sqlite3-pcre manually, or are not using Ubuntu, you should
either modify the `ext_sqlite3_regex` option in /etc/mosquitto.conf to point to
your library path, or move the library to the new location.
If you are using Ubuntu and have installed mosquitto from the launchpad ppa,
this will largely be taken care of. However, due to a mistake in the packaging
of sqlite3-pcre, you must first remove sqlite3-pcre with your package manager
and then reinstall it before updating mosquitto. You will only ever need to do
this once.
Sorry for the inconvenience caused by this change. If you have any problem or
questions, feel free to get in touch on the [mqtt users mailing list].
[mqtt users mailing list]: https://launchpad.net/~mqtt-users

View File

@ -0,0 +1,42 @@
<!--
.. title: Version 0.5.1 released
.. slug: version-0-5-1-released
.. date: 2010-03-01 09:26:28
.. tags: Releases
.. category:
.. link:
.. description:
.. type: text
-->
This announcement summarises the changes in both 0.5 and 0.5.1.
The interesting changes:
* Add mosquitto_sub and mosquitto_pub, simple clients for subscribe/publish.
* Change persistence behaviour. The database is now stored in memory even if
persistence is enabled. It is written to disk when mosquitto exits and also
at periodic intervals as defined by the new `autosave_interval` option. This
makes persistence more suitable when being used on devices with a limited
number of writes, such as flash.
* Default sqlite3-pcre path on Linux is now /usr/lib/sqlite3/pcre.so to match
new sqlite3-pcre packages.
The less interesting/bug fixes:
* No longer store QoS=0 messages for disconnected clients that do not have
clean start set.
* Rename `msg_timeout` option to `retry_interval` for better rsmb
compatibility.
* The writing of the persistence database may be forced by sending mosquitto
the SIGUSR1 signal.
* Clients that do not send CONNECT as their first command are now
disconnected.
* Boolean configuration values may now be specified with true/false as well as
1/0.
* Log message on CONNECT with invalid protocol or protocol version.
* Add man pages for clients.
* Add general man page on mqtt.
* Root privileges are now dropped only after attempting to write a pid file
(if configured). This means that the pid file can be written to /var/run/
directly and should fix bug #523183.

View File

@ -0,0 +1,30 @@
<!--
.. title: Version 0.5.2 released
.. slug: version-0-5-2-released
.. date: 2010-03-02 16:29:22
.. tags: Releases
.. category:
.. link:
.. description:
.. type: text
-->
This is a bugfix release; it is recommended that you upgrade to this version:
* Always update last backup time, so that the backup doesn't run every time
through the main loop once `autosave_interval` has been reached.
* Report $SYS/broker/uptime in the same format as rsmb.
* Make mandatory options obvious in usage output and man page of
mosquitto_pub. Fixes bug [#529990].
* Treat subscriptions with a trailing slash correctly. This should fix bugs
[#530099] and [#530369].
Mosquitto is now also available for Linux x86 statically compiled against
sqlite3, which makes it usable on older distributions such as Ubuntu Hardy that
are still supported but do not have a sufficiently new version of sqlite3. To
download this package, go to the [download page].
[#529990]: https://bugs.launchpad.net/mosquitto/+bug/529990
[#530099]: https://bugs.launchpad.net/mosquitto/+bug/530099
[#530369]: https://bugs.launchpad.net/mosquitto/+bug/530369
[download page]: /download

View File

@ -0,0 +1,21 @@
<!--
.. title: Version 0.5.3 released
.. slug: version-0-5-3-released
.. date: 2010-03-03 22:03:26
.. tags: Releases
.. category:
.. link:
.. description:
.. type: text
-->
This is a bugfix release.
* Will messages are now only sent when a client disconnects unexpectedly.
* Fix all incoming topics/subscriptions that start with a / or contain
multiple / in a row (//). This should finally fix bug [#530099].
* Do actually disconnect client when it sends an empty subscription/topic
string.
* Add missing $SYS/broker/clients/total to man page.
[#530099]: https://bugs.launchpad.net/mosquitto/+bug/530099

View File

@ -0,0 +1,19 @@
<!--
.. title: Version 0.5.4 released
.. slug: version-0-5-4-released
.. date: 2010-03-14 18:28:15
.. tags: Releases
.. category:
.. link:
.. description:
.. type: text
-->
This is a bugfix release.
* Fix memory allocation in `mqtt3_fix_sub_topic()` ([bug #531861]).
* Remove accidental limit of 100 client connections.
* Fix mosquitto_pub handling of messages with QoS&gt;0 ([bug #537061]).
[bug #531861]: https://bugs.launchpad.net/mosquitto/+bug/531861
[bug #537061]: https://bugs.launchpad.net/mosquitto/+bug/537061

View File

@ -0,0 +1,31 @@
<!--
.. title: Help wanted RPM packaging
.. slug: help-wanted-rpm-packaging
.. date: 2010-04-26 16:59:30
.. tags: Packaging,Support
.. category:
.. link:
.. description:
.. type: text
-->
I'm currently working on the finishing touches of mosquitto 0.6 and will
hopefully be releasing it some time this week in time for oggcamp. Mosquitto is
pretty usable now so I'm keen on making it as easy as possible for people to
get and use. The ultimate goal is of course to get it into the major Linux
distros so it appears in the normal package repositories. Until then, other
solutions are possible. I can provide Windows executables and have a PPA to
support Ubuntu Linux users, but don't have anything for rpm based distros.
Can you help? I'm quite happy using the opensuse build service to build and
host the final packages, but the creation of the rpm build script isn't
something I know how to do at the moment. Given the amount of time I've spent
on the Debian style packaging, I thought I'd ask for help with rpms! :)
If you've got familiarity with rpm and would like to help, please [get in
touch]. If you aren't familiar with creating rpms but want a reason to learn,
that would suit me fine as well.
Thanks in advance!
[get in touch]: /support

View File

@ -0,0 +1,21 @@
<!--
.. title: Mind control MQTT
.. slug: mind-control-mqtt
.. date: 2010-04-14 13:06:03
.. tags: Applications
.. category:
.. link:
.. description:
.. type: text
-->
If you're in the UK, you may be interested in watching the Wednesday 21st April
episode of "Bang Goes the Theory". IBM employees [Nicholas O'Leary] and [Kevin
Brown] will be in one of the segments, on controlling remote control cars with
their minds - all with MQTT under the covers!
* [BBC programme link]
[Nicholas O'Leary]: http://twitter.com/knolleary
[Kevin Brown]: http://twitter.com/kevinxbrown
[BBC programme link]: https://www.bbc.co.uk/programmes/b00s5fvq

View File

@ -0,0 +1,16 @@
<!--
.. title: Oggcamp
.. slug: oggcamp
.. date: 2010-04-26 16:45:01
.. tags: Events
.. category:
.. link:
.. description:
.. type: text
-->
I'm going to be at [oggcamp] this coming weekend. If you're there, try and find
me and say hello! I'm planning a talk on mosquitto/mqtt with Andy
Stanford-Clark, so should be relatively easy to find.
[oggcamp]: http://oggcamp.org/

View File

@ -0,0 +1,24 @@
<!--
.. title: Fedora packages available
.. slug: fedora-packages-available
.. date: 2010-05-14 15:43:10
.. tags: Packaging
.. category:
.. link:
.. description:
.. type: text
-->
Thanks to help from Chris Procter, there are now rpm packages available for
Fedora Linux. As these are the first rpm packages, there may be problems so
please report back if you find any.
There are details on where to get the packages on the [download page].
Users of other rpm based distributions are currently out of luck - the versions
of sqlite that they provide are typically either too old or else don't have
support for some required features compiled in.
Thanks to everybody else who got in touch about rpms as well!
[download page]: /download

View File

@ -0,0 +1,17 @@
<!--
.. title: Gentoo ebuilds available
.. slug: gentoo-ebuilds-available
.. date: 2010-05-18 16:48:11
.. tags: Packaging
.. category:
.. link:
.. description:
.. type: text
-->
Thanks to Neil Bothwick, there are now some Gentoo ebuilds available for
mosquitto and sqlite3-pcre. You can grab them from the links below - hopefully
they'll be integrated in the near future.
* <http://bugs.gentoo.org/show_bug.cgi?id=320159>
* <http://bugs.gentoo.org/show_bug.cgi?id=320153>

View File

@ -0,0 +1,14 @@
<!--
.. title: mosquitto.org
.. slug: mosquitto-org
.. date: 2010-05-31 17:48:08
.. tags:
.. category:
.. link:
.. description:
.. type: text
-->
I'm pleased to annouce that the mosquitto website is now available at
<http://mosquitto.org/> so please update your bookmarks! I'll be updating the
links here in a few days when the change has propagated.

View File

@ -0,0 +1,18 @@
<!--
.. title: MQTT Push on Android
.. slug: mqtt-push-on-android
.. date: 2010-05-16 22:43:34
.. tags: Applications, Obsolete
.. category:
.. link:
.. description:
.. type: text
-->
If you want to use MQTT for push in Android apps, you'll probably want to head
over to Anton L's blog post [How to Implement Push Notifications for Android].
He has a sample Android app that uses the IBM Java library to implement push
notifications using MQTT, as well as a web page solution to demo pushing
notifications to your phone.
[How to Implement Push Notifications for Android]: http://tokudu.com/2010/how-to-implement-push-notifications-for-android/

View File

@ -0,0 +1,14 @@
<!--
.. title: MQTT Wiki
.. slug: mqtt-wiki
.. date: 2010-05-17 23:35:23
.. tags: Applications,Support
.. category:
.. link:
.. description:
.. type: text
-->
A new wiki has been created, devoted to MQTT. If you want to share what you're
doing with MQTT and how to do it, or want to find any of that out, head over to
<http://mqtt.org/wiki>.

View File

@ -0,0 +1,16 @@
<!--
.. title: Version 0.6.1 released
.. slug: version-0-6-1-released
.. date: 2010-05-06 12:44:06
.. tags: Releases
.. category:
.. link:
.. description:
.. type: text
-->
This fixes an important bug that didn't get caught for 0.6 that can prevent old
database versions being upgraded.
From 0.7 onwards, mosquitto will be using release candidates to ensure this
kind of problem doesn't occur in the future.

View File

@ -0,0 +1,53 @@
<!--
.. title: Version 0.6 released
.. slug: version-0-6-released
.. date: 2010-05-05 22:57:20
.. tags: Releases
.. category:
.. link:
.. description:
.. type: text
-->
This is a new features release. It offers quite a bit of change over the
previous version. More details of the new features can be found in the
[man pages].
The substantial changes are:
* Basic support for connecting multiple MQTT brokers together (bridging).
* mosquitto_sub can now subscribe to multiple topics (limited to a global
QoS).
* mosquitto_pub can now send a file as a message.
* mosquitto_pub can now read all of stdin and send it as a message.
* mosquitto_pub can now read stdin and send each line as a message.
* Implement a more efficient database design, so that only one copy of each
message is held in the database, rather than one per subscribed client.
* Add support for automatic upgrading of the mosquitto DB from v1 to v2.
* If a retained message is received with a zero length payload, the retained
message for that topic is deleted.
* Implement the `max_inflight_messages` and `max_queued_messages` features in
the broker.
The less visible features and bug fixes are as follows:
* Add support for disabling `clean session` for the sub client.
* mosquitto will now correctly run VACUUM on the persistent database on exit.
* Add the `store_cleanup_interval` config option for dealing with the internal
message store.
* Add `persistence_file` config option to allow changing the filename of the
persistence database. This allows multiple mosquitto DBs to be stored in the
same location whilst keeping `persistence_location` compatible with rsmb.
* Don't store QoS=0 messages for disconnected clients. Fixes bug #572608. This
wasn't correctly fixed in version 0.5.
* Don't disconnect clients if they send a PUBLISH with zero length payload
(bug #573610).
* Send through zero length messages.
* Produce a warning on unsupported rsmb options instead of quitting.
* Describe clean session flag in the mqtt man page.
Get it from the [download page]. Windows and Ubuntu binaries will follow along
shortly.
[man pages]: /documentation
[download page]: /download

View File

@ -0,0 +1,86 @@
<!--
.. title: Automation: Has the oven warmed up yet?
.. slug: automation-has-the-oven-warmed-up-yet
.. date: 2010-06-07 14:55:54
.. tags: Automation
.. category:
.. link:
.. description:
.. type: text
-->
In the Bang Goes the Theory episode [The Human Power Station] a family of four
people had their electricity supplied by a large group of cyclists on cycles
hooked up to generators, the point being to highlight the amount of energy that
is used and wasted on a daily basis. There's a video on [youtube].
One example that seemed to waste a lot of energy was cooking roast dinner. The
oven was turned on to preheat (this is often the first instruction in a
recipe), but it wasn't actually used until a significant time later, wasting a
lot of energy. An example which may be more common is turning the oven on to
preheat before cooking frozen food (which requires no preparation), then
forgetting to check to see if it has preheated.
This used to happen to me, but I've solved the problem by using my electricity
monitor (I have an electric oven), mqtt and asterisk.
First off, we need to monitor electricity usage. I do this with a [CurrentCost]
CC128 (note that EON customers in the UK can apply to get one of these for free
in an [Energy Fit] pack) hooked up to a low power computer that is running
mosquitto. If you're running Linux, you can use [cc128_read.py] or
[cc128_read.pl] to read the data coming from the monitor and publish it to an
mqtt broker. A second client, [cc128_parse.pl], takes the data from the monitor
and republishes it to the broker in a friendlier format - the Unix timestamp of
the reading and the power usage, separated by a single space.
To figure out when the oven has warmed up, I look at the electricity usage with
the oven heater on - approximately 2.4kW. If the energy usage drops below this
value, I know that the oven heater has turned off and so the oven has warmed
up. This is of course slightly simplistic - I'm not actually measuring the
oven, just the electricity usage so if I turned on the kettle at the same time
it could cause my guess to be incorrect. When CurrentCost produce their
individual appliance monitors, I'll be able to be certain of how much
electricity just the oven is using.
This uncertainty means that I only want to turn the oven monitor on when I've
actually turned the oven on. Looking for an easy way to start the monitor, I
spotted my house phone - a Siemens C460IP - which is a "normal" land line phone
and an IP phone all in one. I've got Asterisk running on the same server as
mosquitto, so it's an ideal solution for controlling things. Configuring
Asterisk is way beyond the scope of this text, so I'm only going to talk about
the bits I changed. I added a new extension number 100 which, when called,
starts the oven monitor:
```
exten =&gt; 100,1,Answer()
exten =&gt; 100,n,System(echo "/usr/local/bin/oven_pub.pl" | at now)
exten =&gt; 100,n,Playback(oven-trigger)
exten =&gt; 100,n,Hangup
```
This answers the call, starts the monitor, plays a sound clip so the person
calling knows what has happened and then hangs up. I'm using the "at" command
here as a simple way of putting the job into the background, thanks to [Ed] for
the suggestion. The script [oven_monitor.pl] looks for the electricity usage to
drop beneath 2kW, then runs `oven_warmed_up.sh` and exits.
The final step is to do something in [oven_warmed_up.sh] to give feedback. I
make use of asterisk once again and initiate a call to the phone - so when the
oven has warmed up I get a phone call with a message that tells me so. The
outgoing call is initiated by moving [oven.call] to
/var/spool/asterisk/outgoing/, as shown in the script.
Do you have any suggestions on how to improve this? Or other ways of using
asterisk or mqtt like this? Let me know in the comments!
[The Human Power Station]: http://www.bbc.co.uk/programmes/b00p8469
[youtube]: http://www.youtube.com/watch?v=C93cL_zDVIM
[CurrentCost]: http://www.currentcost.com/
[Energy Fit]: http://www.eon-uk.com/media/energyfit.aspx
[cc128_read.py]: http://bitbucket.org/oojah/mosquitto/src/tip/misc/currentcost/cc128_read.py
[cc128_read.pl]: http://bitbucket.org/oojah/mosquitto/src/tip/misc/currentcost/cc128_read.pl
[parse.pl]: http://bitbucket.org/oojah/mosquitto/src/tip/misc/currentcost/cc128_parse.pl
[Ed]: http://twitter.com/ribzlike
[oven_monitor.pl]: /files/examples/oven-asterisk/oven_monitor.pl
[oven_warmed_up.sh]: /files/examples/oven-asterisk/oven_warmed_up.sh
[oven.call]: /files/examples/oven-asterisk/oven.call

View File

@ -0,0 +1 @@
{"54": {"wordpress_user_name": "roger", "title": "powermeter-example", "date_utc": "2010-06-15 13:52:24", "files_meta": [{"height": 292, "width": 632}, {"height": 138, "size": "medium", "width": 300}, {"height": 150, "size": "thumbnail", "width": 150}], "files": ["/wp-content/uploads/2010/06/powermeter-example.png", "/wp-content/uploads/2010/06/powermeter-example-300x138.png", "/wp-content/uploads/2010/06/powermeter-example-150x150.png"]}}

View File

@ -0,0 +1,177 @@
<!--
.. title: Google Powermeter : Step by step
.. slug: google-powermeter-step-by-step
.. date: 2010-06-15 14:34:50
.. tags: cc128,currentcost,google,mysql,powermeter,Applications
.. category:
.. link:
.. description:
.. type: text
-->
# Note: Google Powermeter is now defunct but this post will remain here for those interested.
This is a follow up to my previous [post on using Google Powermeter],
but this time I'm going to give a step by step guide to getting your data
uploaded. The only assumptions are that you have a CurrentCost monitor (note
that CurrentCost monitors are often rebadged by electricity suppliers such as
EON in the UK so check yours) and have already connected it to your computer,
want to use MQTT and that you're using Linux, or another Unix operating system.
# Retrieving the data
The first step is to get the data from the CurrentCost into the MQTT broker.
This is straightforward - simply read data from the serial port and send it all
to the broker. I have scripts to do this with mosquitto in both [perl] and
[python].
The data coming from the CurrentCost is in XML format and as well as providing
the real time power reading every 6 seconds, will also send historical data
periodically. I'm only going to deal with the real time readings here. The next
step is to reprocess the incoming data into something more manageable, then
republish it. An example of doing that is the script [cc128_parse.pl], which
assumes you're only using the main channel from the CurrentCost. If you have
multiple monitoring channels, you'll need to modify it to suit.
# Logging the data
Google limits the number of times we can send data to 6 per hour, so we have to
log the data and then send amalgamated updates. I use mysql for this - I'm
going to assume that you've got it installed and running. Log into the mysql
console using "mysql -u root",  "mysql -u root -p" if you know the password, or
possibly "sudo mysql". We're now going to create a database and table to hold
the powermeter data, then add a user to access and update the data.
To create the database and table enter the following:
```
CREATE DATABASE powermeter;
USE 'powermeter';
CREATE TABLE powermeter (
`id` INT NOT NULL auto_increment,
`timestamp` INT NOT NULL,
`temperature` FLOAT NOT NULL DEFAULT 0.0,
`ch1` INT NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY `timestamp` (`timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;</pre>
```
Note that there's a column there for the temperature as well.
To add the user and grant access to the database:
```
CREATE USER 'powermeter'@'localhost' IDENTIFIED BY '&lt;your password&gt;';
GRANT ALL ON powermeter.* to 'powermeter'@'localhost';
```
Finally, you'll need to get data into this database. My script
[cc128_log_mysql.pl] subscribes to the data from cc128_parse.pl and logs it
into the database. You'll need to edit it to have the correct database
details.
If you already have your power data published to an MQTT topic, it's quite
likely that you won't have it in the same format that I use above. If this is
the case, you will need to modify cc128_log_mysql.pl. Assuming your data coming
in over MQTT is just the power reading, then you can replace this:
```
@vals = split(/,/, $line);
$timestamp = @vals[0];
$temperature = @vals[1];
$ch1 = @vals[2];
```
with this:
```
$timestamp = time();
$temperature = 0;
$ch1 = $line;
```
You can of course leave the temperature column out completely if you prefer.
# Registering with Google Powermeter
Before you can send any data to Google, you need to register your device with
them. This would normally be done automatically by your device, but because
we're doing things ourselves we need to do it manually. See [2cheap2meter] and
the links it provides for more details.
We first need to decide on a few parameters for our device:
* Manufacturer (e.g. CurrentCost)
* Device model (e.g. CC128 or Envi)
* Device id (e.g. Serial number or your own made up string, 1234)
* Number of channels to log (e.g. 1)
We can then construct an address which you will paste into your web browser:
```
https://www.google.com/powermeter/device/activate?mfg=CurrentCost&amp;model=CC128&amp;did=1234&amp;dvars=1
```
`dvars` here is the number of channels (or monitors) that we wish to register.
If you have more than one channel logging, change the number accordingly - bear
in mind that you'll have to modify just about everything else in this post to
match. You will need to remember the values you put here for later.
Visiting that link will take you to the activation page, which you should
complete. After you have done this, you will be presented with authorisation
information for your new device. The piece of information we need is the 32
character string contained between "token=" and "&amp;path" (the authorisation
token) as well as the 20 digit number after "&amp;path=/user/" (your google
powermeter id).
# Sending the data
I have a script [google_powermeter_update.pl] that will query the database for
readings from the past 15 minutes and then send them. You'll need to edit the
script to put the correct database details, power meter id, authorisation token
and device details. To set it to run every fifteen minutes, I use cron. Either
add an entry to your own crontab by running "crontab -e" then entering the
following line:
```
*/15 * * * * /path/to/google_powermeter_update.pl &gt; /dev/null
```
Or by creating a file containing the line below and copying it to
/etc/cron.d/powermeter_update.cron.
```
*/15 * * * * nobody /path/to/google_powermeter_update.pl &gt; /dev/null
```
In both cases, you can change the output redirection from "/dev/null" to e.g.
"/tmp/powermeter" to allow you to check any error codes in case of a problem.
Now go to <http://www.google.com/powermeter/site/> to check your data! Here's
an example of mine:
[![powermeter example](/blog/uploads/2010/06/powermeter-example-300x138.png)](/blog/uploads/2010/06/powermeter-example.png)
# Possible changes
The above description and scripts aren't ideal - if you lose your internet
connection then data will still be recorded but won't be sent to google. One
possible change would be to add a column to the database to list whether that
particular piece of data had been sent or not, which would allow all data to
eventually be sent and deleted afterwards if desired.
A second way around this would be to make use of the historical data that the
CurrentCost monitors use. This could also be a way of reducing the need to log
things ourselves.
# Conclusion
I hope this is of use to you - please let me know if you have any problems with
any of the above steps.
[post on using Google Powermeter]: /blog/2010/03/google-powermeter/
[perl]: http://bitbucket.org/oojah/mosquitto/src/tip/misc/currentcost/cc128_read.pl
[python]: http://bitbucket.org/oojah/mosquitto/src/tip/misc/currentcost/cc128_read.py
[cc128_parse.pl]: http://bitbucket.org/oojah/mosquitto/src/tip/misc/currentcost/cc128_parse.pl
[cc128_log_mysql.pl]: http://bitbucket.org/oojah/mosquitto/src/tip/misc/currentcost/cc128_log_mysql.pl
[2cheap2meter]: http://2cheap2meter.blogspot.com/2010/03/setting-up-google-powermeter.html
[google_powermeter_update.pl]: http://bitbucket.org/oojah/mosquitto/src/tip/misc/currentcost/google_powermeter_update.pl

View File

@ -0,0 +1,15 @@
<!--
.. title: Mosquitto 0.7rc1
.. slug: mosquitto-0-7rc1
.. date: 2010-06-04 18:10:57
.. tags: Releases
.. category:
.. link:
.. description:
.. type: text
-->
Mosquitto 0.7 release candidate 1 is available for testing. Please give it a
try and report back any problems you find. The source code is available at 
<http://mosquitto.org/files/source/rc/> and I'll hopefully have various
binaries available soon.

View File

@ -0,0 +1,40 @@
<!--
.. title: Version 0.7 released
.. slug: version-0-7-released
.. date: 2010-06-15 23:38:52
.. tags: Releases
.. category:
.. link:
.. description:
.. type: text
-->
This is a new features release. Note that although the number of changes is
relatively small, there is a fairly major change in the network socket handling
(to allow &gt;1024 clients) , which is one reason this has been treated as a
separate release.
Changes:
* Use poll() instead of select() to allow &gt;1024 clients.
* Implement `max_connections`.
* Run VACUUM on in-memory database on receiving SIGUSR2.
* mosquitto_pub can now send null (zero length) messages.
* Add option to print debug messages in pub and sub clients.
* hg revision is now exported via $SYS/broker/changeset
* Add compile time option to disable heap memory tracking.
Bug fixes:
* Don't store QoS=0 messages for disconnected clients with subscriptions of QoS&gt;0.
* accept() all available sockets when new clients are connecting, rather than just one (performance advantage)
* Send Will when client exceeds keepalive timer and is disconnected.
* Check to see if a client has a will before sending it.
* Correctly deal with clients connecting with the same id multiple times.
* Fix bridge keepalive timeouts and reconnects.
* Don't attempt to drop root privileges when running on Windows as this isn't well supported (bug #586231).
Source downloads are available at the [download page] Links for binary packages
on Ubuntu and Fedora can be found on the same page.
[download page]: /download

View File

@ -0,0 +1,20 @@
<!--
.. title: Mosquitto on openSUSE 11.3
.. slug: mosquitto-on-opensuse-11-3
.. date: 2010-07-12 12:39:25
.. tags: Packaging
.. category:
.. link:
.. description:
.. type: text
-->
The upcoming release of [openSUSE], version 11.3, includes extension support
for sqlite3 which means it now has everything required for mosquitto.
I've created packages for this new version of openSUSE and details can be found
on the [download page]. You just need to wait three days until the release of
11.3!
[openSUSE]: http://www.opensuse.org/
[download page]: /download

View File

@ -0,0 +1,30 @@
<!--
.. title: MQTT client library
.. slug: mqtt-client-library
.. date: 2010-07-22 00:34:38
.. tags: Testing
.. category:
.. link:
.. description:
.. type: text
-->
I have been working on a client library for MQTT for the next release of
Mosquitto. It is now at a stage where it is usable and ready for wider testing.
There isn't any documentation yet (!) so it's only available in the source
repository at <http://bitbucket.org/oojah/mosquitto>. Use the "get source" link
in the top right corner of the page to download a snapshot. If you're
interested in developing your own open source MQTT clients, it'd be great if
you could take a look to make sure the interface is sane before I make a
release!
The library itself is written in C, with bindings for C++ and Python.
I plan to package it up in a more easy to access form in the not too distant
future, hopefully with some documentation as well.
# Update
I've put the start of a man page online, which shows an example of using
libmosquitto to subscribe to a topic and print the results: [libmosquitto.3].
[libmosquitto.3]: http://mosquitto.org/man/libmosquitto-3.html

View File

@ -0,0 +1,19 @@
<!--
.. title: Compiling mosquitto on Mac OS X
.. slug: compiling-mosquitto-on-mac-os-x
.. date: 2010-08-08 23:44:52
.. tags: Links
.. category:
.. link:
.. description:
.. type: text
-->
In a follow up to his screencast [demoing mosquitto on Mac OS X], Andy Piper
has written a blog post detailing how he got compiled mosquitto and, more
importantly, the dependencies, on the Mac.
Take a look over at [OS X mosquitto "bites"...]
[demoing mosquitto on Mac OS X]: /blog/2010/08/mosquitto-running-on-mac-os-x/
[OS X mosquitto "bites"...]: http://andypiper.co.uk/2010/08/08/os-x-mosquitto-bites/

View File

@ -0,0 +1,18 @@
<!--
.. title: Mosquitto running on Mac OS X
.. slug: mosquitto-running-on-mac-os-x
.. date: 2010-08-08 09:58:26
.. tags: demo,mac,video
.. category:
.. link:
.. description:
.. type: text
-->
Andy Piper has put together a 2 minute screencast demoing mosquitto running on
Mac OS X and showing publishing and subscribing using the mosquitto command
line clients and the IBM java gui client.
View the screen cast here: <http://www.youtube.com/watch?v=SP9Vv3Rksm8>.
Thanks Andy!

View File

@ -0,0 +1,25 @@
<!--
.. title: MQTT v3.1
.. slug: mqtt-v3-1
.. date: 2010-08-22 00:18:19
.. tags:
.. category:
.. link:
.. description:
.. type: text
-->
The MQTT v3 spec has been updated to v3.1. The significant change is the
inclusion of the option to send a username and password as part of the connect
command. The new spec is available at
<http://www.ibm.com/developerworks/webservices/library/ws-mqtt/index.html>
and is a lot more readable and clear than the original.
Mosquitto will support the v3.1 spec in a future release, along with the
ability to control both broker and topic access by username. In the meantime,
if you need this functionality, the IBM proprietary [RSMB] broker may be
suitable for testing purposes. The RSMB package now also includes an MQTT
client library, a simple publish client and a simple subscribe client, just
like mosquitto. Be sure to check the license terms before using it!
[RSMB]: http://www.alphaworks.ibm.com/tech/rsmb

View File

@ -0,0 +1,40 @@
<!--
.. title: Version 0.8.1 released
.. slug: version-0-8-1-released
.. date: 2010-08-11 23:47:18
.. tags: Packaging,Releases
.. category:
.. link:
.. description:
.. type: text
-->
This is a minor release. The primary reason for it is the amount of interest in
the Python interface to libmosquitto. This release tidies up the Python
interface considerably (it is now more "Pythonic" and easier to use), and
significantly, brings the promised packages.
This release also provides a few fixes, including to the packaging and
installation scripts. Unfortunately, it does also include a known bug that was
fixed prior to release, but accidentally left unmerged. This affects
mosquitto_pub client when using the -l option (publish line by line input from
stdin), causing it to exhibit high cpu load. I'll make a new bug fix release in
a few days with this and any other fixes that come up.
This release also provides improved packaging options. All of the available
options are now packaged for Ubuntu, including the libmosquitto0-python
package. Because there are now multiple packages, it is possible to provide
some mosquitto functionality on distributions where the version of sqlite3 is
too old. The packages available on these systems are listed as "clients only":
* Fedora 12, 13 (full support)
* openSUSE 11.3 (full support)
* openSUSE 11.1, 11.2 (clients only)
* Redhat Enterprise Linux 5 (clients only)
* CentOS 5 (clients only)
Details are available on the [download page]. Please note that some
distributions have different naming schemes, so the Python module can be called
both python-mosquitto and libmosquitto0-mosquitto for example.
[download page]: /download

View File

@ -0,0 +1,26 @@
<!--
.. title: Version 0.8.2
.. slug: version-0-8-2
.. date: 2010-08-15 19:07:04
.. tags: Releases
.. category:
.. link:
.. description:
.. type: text
-->
This is a bugfix release.
* Fix default loop() timeout value in mosquitto.py. Previous value was 0,
causing high cpu load.
* Fix message handling problem in client library when more than one message
was in the client queue.
* Fix the logic used to determine whether a QoS&gt;0 message needs to be
retried.
* Fix the Python sub.py example so that it quits on error.
See the [download page]. Includes Windows 32-bit binaries for the broker
compiled with Cygwin, and the client library and clients compiled natively with
Visual Studio to allow developing native Windows MQTT clients.
[download page]: /download

View File

@ -0,0 +1,74 @@
<!--
.. title: Version 0.8 released
.. slug: version-0-8-released
.. date: 2010-08-08 10:31:17
.. tags: Releases
.. category:
.. link:
.. description:
.. type: text
-->
This is the library release. There are a few bug fixes and changes of behaviour
for the mosquitto and the clients, but the significant part of this release is
the new mosquitto MQTT client library. The library comes in three flavours: the
C library, which is the main library, and C++ and Python bindings. If you're
interested in helping add bindings for your favourite language, please get in
touch.
The library interface (API) is to be considered experimental, although I
believe the C and C++ APIs to be complete and sane. The Python bindings are a
naïve attempt by a C programmer and will definitely be changing in the future
to something more pythonic. I'd be extremely grateful for help from experienced
python programmers to this end.
The documentation of the library is currently ongoing... There is an overview
of most of the function calls and an example in the [libmosquitto.3] man page,
but complete coverage can be found in the mosquitto.h man page. This, combined
with the class details in mosquittopp.h can be used to help use the C++
library. The python module isn't documented due to it's extremely changeable
state, but there is an example in the python directory.
Other changes:
* Topics starting with a / are treated as distinct to those not starting with
a /. For example, /topic/path is different to topic/path. This matches the
behaviour of rsmb.
* Correctly calculate the will QoS on a new client connection (bug #597451).
* Add "addresses" configuration file variable as an alias of "address", for
better rsmb compatibility.
* Bridge `clean_session` setting is now false, to give more sensible behaviour
and be more compatible with rsmb.
* Add `cleansession` variable for configuring bridges.
* Add `keepalive_interval` variable for bridges.
* Remove default topic subscription for mosquitto_sub because the old
behaviour was too confusing.
* Added a C client library, which the pub and sub clients now use.
* Added a C++ client library (bound to the C library).
* Added a Python client library (bound to the C library).
* Added CMake build scripts to allow the library and clients (not the broker)
to be compiled natively on Windows.
Get it from the [download page].
The change to using a library means that packaging mosquitto for distros is a
lot more complex. This is stretching my packaging experience, so please bear
with me on that front! Mosquitto will now likely consist of a number of
different packages on Ubuntu at least:
* mosquitto (the broker)
* mosquitto-clients (mosquitto_sub, mosquitto_pub)
* libmosquitto0 (C library)
* libmosquitto0-dev (C library development files)
* libmosquittopp0 (C++ library)
* libmosquittopp0-dev (C++ library development files)
* libmosquitto-python (Python binding)
# Update
I've been getting a few questions about the python interface. This isn't
currently packaged for Ubuntu, but hopefully will be soon. There are basic
python examples in the downloads at lib/python/sub.py and
misc/currentcost/gnome-panel/CurrentCostMQTT.py
[libmosquitto.3]: /man/libmosquitto-3.html
[download page]: /download

View File

@ -0,0 +1,18 @@
<!--
.. title: Debian packages
.. slug: debian-packages
.. date: 2010-09-27 20:14:50
.. tags: Packaging,Releases
.. category:
.. link:
.. description:
.. type: text
-->
I've created some packages for Debian on i386 and amd64. They can be found at
<http://mosquitto.org/files/binary/debian/>. They are almost identical to the
Ubuntu packages (Debian doesn't use upstart, so there is a different init
script), but compiled against Debian testing (Squeeze) instead. This is because
Debian 5 (Lenny) doesn't include a recent enough version of sqlite3.
Please let me know if you have any problems with the packages.

Some files were not shown because too many files have changed in this diff Show More