You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Move to the folder containing C analyser code. In order to compile the code run the following command in the terminal.
101
+
```cpp
102
+
$ gcc -L${DEST_PATH}/paho.mqtt.c/build/output -o server analyser.c -lpaho-mqtt3c -lpthread
103
+
```
104
+
3. In order to run the server type the command.
105
+
```cpp
106
+
$ ./server
107
+
```
108
+
109
+
### Install Mosquittto Broker
110
+
1. Install the mosquitto package.
111
+
```cpp
112
+
$ sudo apt install -y mosquitto
113
+
```
114
+
2. The mosquitto package should now load on your server. Confirm the status of the mosquitto service (Ensure that the mosquittto package is loaded and active).
115
+
```cpp
116
+
$ sudo systemctl status mosquitto
117
+
```
118
+
3. Once running, you can manage the mosquitto services by executing the following commands.
119
+
- Stop the mosquitto service:
120
+
```cpp
121
+
$ sudo systemctl stop mosquitto
122
+
```
123
+
- Start the mosquitto service:
124
+
```cpp
125
+
$ sudo systemctl start mosquitto
126
+
```
127
+
- Restart the mosquitto service:
128
+
```cpp
129
+
$ sudo systemctl restart mosquitto
130
+
```
131
+
4. By default, the mosquittto broker will not handle anonymous connections. The server compiled by analyser.c and the client written in the sketch doesn't use any authentication service. In order to make the mosquittto broker listen to anonymous clients, we need to tweak the configration file as shown below.
132
+
```
133
+
$ sudo nano /etc/mosquitto/conf.d/default.conf
134
+
```
135
+
Now add the following lines in the file :
136
+
```
137
+
listener 1883
138
+
allow_anonymous true
139
+
```
140
+
5. Restart the mosquittto broker.
141
+
142
+
143
+
### Install FastLED library.
144
+
145
+
1. Click here to download the [FastLED library ](https://github.com/FastLED/FastLED) from the offical github repository in .zip format.
146
+
2. Open the Arduino IDE. Move to the *Sketch > Include Library > Add .ZIP library*.
147
+
3. Enter the destination of the downloaded fastLED zip folder.
0 commit comments