-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for other boards and shields #8
Support for other boards and shields #8
Conversation
This looks perfectly done. Thank you for that. I have no idea if it would be possible but It would be great to be able to detect various boards and do the right thing™ in choosing a default UDP lib. So the API could stay simple. Any idea on how that could be achieved? |
This is very tricky, I don't have an answer unfortunately. For non-ESP8266 boards, the user can plug in different shields (Ethernet, WiFi 101, etc.). Usually there's no built-in networking capabilities like the ESP8266's WiFi. As far as I know, there's no way to detect what shield is connected at run time. The user will also have to install the appropriate library to support the hardware via the library manager. The new MKR1000 board has a built-in WINC1500 module that is supported by the WiFi101 library, so for this case a I was discussing this earlier with @cmaglie, and the proposal in this PR was the optimal way to support the most boards as possible. It also future proofs things, because when a new Arduino compatible networking board or shield comes out, as long as it provides a class that extends the |
👍 This sounds like a good reason for not doing some fancy tricks to get this working. Changing the API now sounds like the right move. I don't have much time to maintain this library so I think it would be the best if I would give you commit access to this repository and you can add yourself as an maintainer, only if you are okay that? |
Let me discuss this with @cmaglie next week and get back to you. Thank you for reviewing and being open to this change. |
Ok. Will let this stay open till next week. |
@FWeinb it would be great if you could give myself and @cmaglie commit access to this repo. We would also be open to transferring this library to the arduino-libraries Github organization. |
+1 for transferring it to official arduino-libraries |
@sandeepmistry I added you both as contributors to this library. I am open for moving this into the arduino-libraries org too. |
@FWeinb great, thank you! A few questions for you:
|
I would like to bring this to 3.0.0 with your additions and than only do bug fixes.
As long as there is no API change involved you can merge it. When there are API changes I would like to review it.
As long as it are patches you can do a release. In general I would like to move this to the |
Ok, this sounds good. Please go ahead with a 3.0.0 release if things look good. We might make some other changes in the next week or two, but can deal with those later. As for transferring to |
Will I keep commit rights after transferring? If that is the case I would start by transferring to @cmaglie and than start merging and release 3.0.0 |
The 'write' permission should be kept after the transfer IIRC. |
Okay. Just started the transfer. |
Done, it seems that all the permissions have been preserved, let me know if you find any problem. |
Everything look good! Let's make a plan for 3.0.0. I will merge this now and open an issue for what we want in 3.0.0 |
This is a great library! With a few changes it could support running on non-ESP8266 boards as well.
In this patch, I've added an UDP instance argument in constructor to support more architectures. This way other networking libraries like Ethernet, WiFi, and WiFi101 can also be supported.
However, the tradeoffs are:
#include <WiFiUdp.h>
WiFiUDP
instance:WiFiUDP ntpUDP;
WiFiUDP
instance to constructor:NTPClient timeClient(ntpUDP, ....);
For Ethernet shield users:
#include <Ethernet.h>
is needed instead of#include <ESP8266WiFi.h>
#include <EthernetUdp.h>
is needed instead ofWiFiUdp.h
EthernetUDP
instance instead ofWiFiUdp.h
What do you think?