-
Notifications
You must be signed in to change notification settings - Fork 108
Support for Arduino WiFi MKR 1010 and Arduino Nano 33 IOT #155
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2837f73
Create AdafruitIO_MKR1010.cpp
MxWinters b3633cf
Create AdafruitIO_MKR1010.h
MxWinters cf8597c
Updated to add support for the MKR1010
MxWinters 2fb6f02
Updated to add support for the MKR1010
MxWinters a862fd9
Add support for the MKR1010
MxWinters 1df9135
Update AdafruitIO_MKR1010.cpp
MxWinters f7c62e9
Update AdafruitIO_MKR1010.h
MxWinters 91224bc
Update AdafruitIO_WINC1500.h
MxWinters 8570f62
Update AdafruitIO_WiFi.h
MxWinters e9ac466
Update AdafruitIO_WINC1500.h
MxWinters 55efac3
Changes to support MKR 1010 and Nano 33 IOT
darumsdad 007e135
updated examples
darumsdad 3e3f93f
Changes to support MKR 1010 and Nano 33 IOT
darumsdad fe6d93d
formatting changes
darumsdad 0647433
Update AdafruitIO_Definitions.h
darumsdad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/*! | ||
* @file AdafruitIO_MKR1010.h | ||
* | ||
* Adafruit invests time and resources providing this open source code. | ||
* Please support Adafruit and open source hardware by purchasing | ||
* products from Adafruit! | ||
* | ||
* Copyright (c) 2015-2016 Adafruit Industries | ||
* Authors: David Goldstein, Morgan Winters | ||
* Licensed under the MIT license. | ||
* | ||
* All text above must be included in any redistribution. | ||
*/ | ||
|
||
#ifndef ADAFRUITIO_MKR1010_H | ||
#define ADAFRUITIO_MKR1010_H | ||
|
||
#include "AdafruitIO.h" | ||
#include "Adafruit_MQTT.h" | ||
#include "Adafruit_MQTT_Client.h" | ||
#include "Arduino.h" | ||
#include "SPI.h" | ||
#include "WiFiNINA.h" | ||
#include "WiFiSSLClient.h" | ||
|
||
class AdafruitIO_MKR1010 : public AdafruitIO { | ||
|
||
public: | ||
AdafruitIO_MKR1010(const char *user, const char *key, const char *ssid, | ||
const char *pass) | ||
: AdafruitIO(user, key) { | ||
_ssid = ssid; | ||
_pass = pass; | ||
_client = new WiFiSSLClient; | ||
_mqtt = new Adafruit_MQTT_Client(_client, _host, _mqtt_port); | ||
_http = new HttpClient(*_client, _host, _http_port); | ||
} | ||
~AdafruitIO_MKR1010() { | ||
if (_client) | ||
delete _client; | ||
if (_mqtt) | ||
delete _mqtt; | ||
} | ||
|
||
aio_status_t networkStatus() { | ||
switch (WiFi.status()) { | ||
case WL_CONNECTED: | ||
return AIO_NET_CONNECTED; | ||
case WL_CONNECT_FAILED: | ||
return AIO_NET_CONNECT_FAILED; | ||
case WL_IDLE_STATUS: | ||
return AIO_IDLE; | ||
default: | ||
return AIO_NET_DISCONNECTED; | ||
} | ||
} | ||
|
||
const char *connectionType() { return "wifi"; } | ||
|
||
protected: | ||
void _connect() { | ||
if (strlen(_ssid) == 0) { | ||
_status = AIO_SSID_INVALID; | ||
} else { | ||
_disconnect(); | ||
|
||
WiFi.begin(_ssid, _pass); | ||
_status = networkStatus(); | ||
} | ||
} | ||
|
||
void _disconnect() { | ||
WiFi.disconnect(); | ||
delay(AIO_NET_DISCONNECT_WAIT); | ||
} | ||
|
||
const char *_ssid; | ||
const char *_pass; | ||
|
||
WiFiSSLClient *_client; | ||
}; | ||
|
||
#endif ADAFRUITIO_MKR1010_H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.