https://www.lairdconnect.com/iot-devices/iot-sensors
15
© Copyright 2019 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610
Figure 22: Create a new key pair
Your AWS instance is now running.
Note
:
To avoid being charged, make sure no instance is running after the 12 month trial period.
You must SSH into the AWS EC2 instance and install the MQTT broker. To SSH to it with the generated key pair above,
complete the following:
a. For Linux, open a terminal and type:
ssh -i <keyfile> ubuntu@<instance hostname or IP address>
b. For Windows, follow steps provided in
Note
:
The IP address for your AWS instance is in
Services > EC2 > running instances > IPv4 Public IP
.
Once logged in, to ensure APT package manager has the latest sources, type:
sudo apt-get update
To retrieve and install the broker and clients, type:
sudo apt-get install mosquitto mosquitto-clients
To create a username and password, type:
sudo mosquitto_passwd -c /etc/mosquitto/passwd <user_name>.
When prompted, enter a strong password and confirm it.
Force mosquitto to use the login and password by creating a configuration file. And for extra security, disallow anonymous
users by setting "allow_anonymous" to "false," as follows:
printf "allow_anonymous false\npassword_file /etc/mosquitto/passwd\nlistener 1883
0.0.0.0\nprotocol mqtt\n" > /tmp/listeners.conf
sudo cp /tmp/listeners.conf /etc/mosquitto/conf.d/
Mosquitto must be restarted to apply changes. To restart, type:
sudo systemctl restart mosquitto
Test for connecting to the MQTT broker. Type:
mosquitto_sub -h localhost -u <USERNAME> -P <PASSWORD> -t '#' -d -v
Содержание Sentrius RG1 Series
Страница 1: ...A Version 1 2...