@@ -127,11 +127,22 @@ or newer).
127
127
But, sometimes Arduino online repository for its Library manager takes
128
128
time to update to new releases of Pubnub SDK, so, you might want to
129
129
install it manually. To do so, download a release from
130
- [ Arduino SDK on Github] ` https://github.com/pubnub/arduino/ ` and move
130
+ [ Arduino SDK on Github] ( https://github.com/pubnub/arduino/ ) and move
131
131
the contents to your Arduino libraries directory (on Linux, default
132
132
would be: ` ~/sketchbook/libraries/PubNub/ ` ) and restart your Arduino
133
133
IDE. Try out the examples!
134
134
135
+ Keep in mind that if you both install the library via Arduino Library
136
+ Manager _ and_ manually, and the versions mismatch, Arduino IDE will
137
+ issue warnings like:
138
+
139
+ Invalid version found: x.y.z
140
+
141
+ Where ` x.y.z ` would be the version ID ofthe manually installed library.
142
+ This is just a warning, the build and upload process is not impacted in
143
+ any way by this.
144
+
145
+
135
146
##Supported Hardware
136
147
137
148
In general, the most widely available Arduino boards and shields are
@@ -155,8 +166,8 @@ please let us know.
155
166
For this to work, all you need to do is to include the Ethernet
156
167
Shield Arduino library and start your sketch with:
157
168
158
- #include <EthernetClient>
159
- #include <Pubnub.h>
169
+ #include <EthernetClient>
170
+ #include <Pubnub.h>
160
171
161
172
As ` EthernetClient ` is the default ` Pubnub_BASE_CLIENT ` .
162
173
@@ -176,16 +187,16 @@ library.
176
187
177
188
So, for any WiFi101 compatible hardware, you would:
178
189
179
- #include <WiFi101.h>
180
- #define Pubnub_BASE_CLIENT WiFiClient
181
- #include <Pubnub.h>
190
+ #include <WiFi101.h>
191
+ #define Pubnub_BASE_CLIENT WiFiClient
192
+ #include <Pubnub.h>
182
193
183
194
For hadware that doesn't use WiFi101 library, but provides a
184
195
` WiFiClient ` class, like ESP8266, you would:
185
196
186
197
#include <ESP8266WiFi.h>
187
- #define Pubnub_BASE_CLIENT WiFiClient
188
- #include <Pubnub.h>
198
+ #define Pubnub_BASE_CLIENT WiFiClient
199
+ #include <Pubnub.h>
189
200
190
201
Of course, please keep in mind that you need to initialize your WiFi
191
202
hardware, connect to a WiFi network and possibly do some maintenance,
@@ -199,46 +210,46 @@ that, it expects a working network. We provide examples for some HW.
199
210
more different files in you project, but only in one file. In all
200
211
other source files (if you have them) ` #include <PubNubDefs.h> ` ,
201
212
which doesn't define the global ` PubNub ` object. This shouldn't be
202
- much of an inconvenience, as most Arduino project have only one
213
+ much of an inconvenience, as most Arduino projects have only one
203
214
file - the sketch itself.
204
215
205
216
* We don't provide any SSL/TLS support, because of modest resource of
206
- most Arduino compatible boards. But, some shields/boards have SSL
207
- ("Secure") clients and you may succeed in using them instead of the
208
- non-secure clients (say ` WiFiClientSecure ` instead of
209
- ` WiFiClient ` ). How to do that depends on the specific hardware and
210
- library.
217
+ most Arduino compatible boards. But, some shields/boards have SSL
218
+ ("Secure") clients and you may succeed in using them instead of the
219
+ non-secure clients (say ` WiFiClientSecure ` instead of
220
+ ` WiFiClient ` ). How to do that depends on the specific hardware and
221
+ library.
211
222
212
223
* We re-resolve the origin server IP address before each request.
213
- This means some slow-down for intensive communication, but we rather
214
- expect light traffic and very long-running sketches (days, months),
215
- where refreshing the IP address is quite desirable.
224
+ This means some slow-down for intensive communication, but we rather
225
+ expect light traffic and very long-running sketches (days, months),
226
+ where refreshing the IP address is quite desirable.
216
227
217
228
* We let the users read replies at their leisure instead of
218
- returning an already preloaded string so that (a) they can do that
219
- in loop() code while taking care of other things as well (b) we don't
220
- waste precious RAM by pre-allocating buffers that are never needed.
229
+ returning an already preloaded string so that (a) they can do that
230
+ in loop() code while taking care of other things as well (b) we don't
231
+ waste precious RAM by pre-allocating buffers that are never needed.
221
232
222
233
* If you are having problems connecting, maybe you have hit
223
- a bug in Debian's version of Arduino pertaining the DNS code. Try using
224
- an IP address as origin and/or upgrading your Arduino package.
234
+ a bug in Debian's version of Arduino pertaining the DNS code. Try using
235
+ an IP address as origin and/or upgrading your Arduino package.
225
236
226
237
* The optional timeout parameter allows you to specify a timeout
227
- period after which the subscribe call shall be retried. Note
228
- that this timeout is applied only for reading response, not for
229
- connecting or sending data; use retransmission parameters of
230
- the network library to tune this. As a rule of thumb, timeout
231
- smaller than 30 seconds may still block longer with flaky
232
- network.
238
+ period after which the subscribe call shall be retried. Note
239
+ that this timeout is applied only for reading response, not for
240
+ connecting or sending data; use retransmission parameters of
241
+ the network library to tune this. As a rule of thumb, timeout
242
+ smaller than 30 seconds may still block longer with flaky
243
+ network.
233
244
234
245
* The vendor firmware for the WiFi shield has dubious TCP implementation;
235
- for example, TCP ports of outgoing connections are always chosen from the
236
- same sequence, so if you reset your Arduino, some of the new connections
237
- may interfere with an outstanding TCP connection that has not been closed
238
- before the reset; i.e. you will typically see a single failed request
239
- somewhere down the road after a reset.
246
+ for example, TCP ports of outgoing connections are always chosen from the
247
+ same sequence, so if you reset your Arduino, some of the new connections
248
+ may interfere with an outstanding TCP connection that has not been closed
249
+ before the reset; i.e. you will typically see a single failed request
250
+ somewhere down the road after a reset.
240
251
241
252
* In general, there may be many issues with different shields and
242
- Arduino-compatible boards. A common issue is the firmware
243
- version. Please look to the available info on your shield and board
244
- for troubleshooting.
253
+ Arduino-compatible boards. A common issue is the firmware
254
+ version. Please look to the available info on your shield and board
255
+ for troubleshooting.
0 commit comments