0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

RaspberryPiでPub/Sub(Mosquitto)を動かす

0
Last updated at Posted at 2018-06-22

Pub/Subのクラウドサービスもありますが、ちょっとローカルで試したい時など簡単に利用できるPub/Sub Mosquitto をRaspberryPiに用意します。

Mosquitto

RaspberryPiの環境

$ uname -a
Linux ##### 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux

Mosquitto Debian repository

新しいリポジトリを使用するには、最初にリポジトリパッケージ署名キーをインポートする必要があります。

$ wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
$ sudo apt-key add mosquitto-repo.gpg.key

次に、リポジトリをaptに利用可能にします。

$ cd /etc/apt/sources.list.d/

次に、使用しているDebianのバージョンに応じて、次のいずれかを行います。

$ sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list

次に、apt情報を更新します。

$ apt-get update

パッケージのキャッシュを確認する

$ apt-cache search mosquitto

インストール

$ sudo apt-get install mosquitto

起動します

$ sudo sysytemctl start mosquitto

確認します

$ mosquitto -v
1529654205: mosquitto version 1.4.10 (build date Fri, 22 Dec 2017 08:19:25 +0000) starting
1529654205: Using default config.
1529654205: Opening ipv4 listen socket on port 1883.
1529654205: Error: Address already in use
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?