pubnub / arduino

The Official PubNub Arduino-based API!
Other
103 stars 49 forks source link

Change request for Pubnub.h to match Adafruit Feather M0 #14

Closed Wayne91 closed 7 years ago

Wayne91 commented 7 years ago

I'm glad to see that you have posted a library modficiation for the Adafruit Feather M0. It's important to note that Adafruit publishes their own Wifi101 equivalent library called _AdafruitWINC1500.h Fortunately this takes care of all the pin differences and more. Seeing that I am successfully using the Adafruit library already, it gets messy with mismatching later because the Wifi101.h libarary is called in the pubnub.cpp file.

That said, I cannot even get Arduino 1.6.8 to even compile the basic example files. Getting declaration errors relative to WiFi and WiFiClient. Could there be an issue with Arduino IDE versioning requirements?

Regarding SSL Support: The comments below are copied from PubNub.h. However the Adafruit Feather M0 WINC1500 does support SSL. How do we resolve this?

/* Some notes:
 *
 * (i) There is no SSL support on Arduino, it is unfeasible with
 * Arduino Uno or even Arduino Mega's computing power and memory limits.
 * All the traffic goes on the wire unencrypted and unsigned. 

Can this be better annotated to show exactly which lines needed to be modified? Or better yet create a library that is default for wifi with reference to Adafruit_WINC1500.h , instead of asking the user to change all the ethernet defaults? Less obstacles means easier adoption of PubNub. Hopefully you can help. Thanks

vveljko commented 7 years ago

With version prior to 2.0.0, you had to update PubNub.h to make it work with your HW of choice, which wasn't very user-friendly.

With version 2.0.0 the library supports any HW that has a "driver"/library that is compatible with Arduino de-facto standard interfaces/classes. There is a ready-made example which works with Adafruit Feather M0 WINC1500. So, you should be able to just replace #include <WiFi101.h> with #include <Adafruit_WINC1500.h> and it should "just work". For any other HW, read documentation on how to use your HW of choice.

As for SSL, we haven't yet tried to make Adafruit Feather M0 WINC1500 work with SSL. You could try to use WiFiSSLClient instead of WiFiClient. We'll update the library with a working example when we make it work.