diff --git a/Firebase.cpp b/Firebase.cpp index 40f8dfe1..154a72f3 100644 --- a/Firebase.cpp +++ b/Firebase.cpp @@ -15,109 +15,169 @@ // #include "Firebase.h" -const char* firebaseFingerprint = "7A 54 06 9B DC 7A 25 B3 86 8D 66 53 48 2C 0B 96 42 C7 B3 0A"; -const uint16_t firebasePort = 443; +// Detect whether stable version of HTTP library is installed instead of +// master branch and patch in missing status and methods. +#ifndef HTTP_CODE_TEMPORARY_REDIRECT +#define HTTP_CODE_TEMPORARY_REDIRECT 307 +#define USE_ESP_ARDUINO_CORE_2_0_0 +#endif -Firebase::Firebase(const String& host) : _host(host) { - _http.setReuse(true); +namespace { +const char* kFirebaseFingerprint = "7A 54 06 9B DC 7A 25 B3 86 8D 66 53 48 2C 0B 96 42 C7 B3 0A"; +const uint16_t kFirebasePort = 443; + +String makeFirebaseURL(const String& path, const String& auth) { + String url; + if (path[0] != '/') { + url = "/"; + } + url += path + ".json"; + if (auth.length() > 0) { + url += "?auth=" + auth; + } + return url; +} + +} // namespace + +Firebase::Firebase(const String& host) : host_(host) { + http_.setReuse(true); } Firebase& Firebase::auth(const String& auth) { - _auth = auth; + auth_ = auth; return *this; } -String Firebase::get(const String& path) { - sendRequest("GET", path); - return readBody(); +FirebaseGet Firebase::get(const String& path) { + return FirebaseGet(host_, auth_, path, &http_); +} + +FirebaseSet Firebase::set(const String& path, const String& value) { + return FirebaseSet(host_, auth_, path, value, &http_); } -String Firebase::push(const String& path, const String& value) { - sendRequest("POST", path, value); - return readBody(); +FirebasePush Firebase::push(const String& path, const String& value) { + return FirebasePush(host_, auth_, path, value, &http_); } -void Firebase::remove(const String& path) { - sendRequest("DELETE", path); +FirebaseRemove Firebase::remove(const String& path) { + return FirebaseRemove(host_, auth_, path, &http_); } -Firebase& Firebase::stream(const String& path) { - _error.reset(); - String url = makeURL(path); - const char* headers[] = {"Location"}; - _http.setReuse(true); - _http.begin(_host.c_str(), firebasePort, url.c_str(), true, firebaseFingerprint); - _http.collectHeaders(headers, 1); - _http.addHeader("Accept", "text/event-stream"); - int statusCode = _http.sendRequest("GET", (uint8_t*)NULL, 0); - String location; - // TODO(proppy): Add a max redirect check - while (statusCode == 307) { - location = _http.header("Location"); - _http.setReuse(false); - _http.end(); - _http.setReuse(true); - _http.begin(location, firebaseFingerprint); - statusCode = _http.sendRequest("GET", (uint8_t*)NULL, 0); +FirebaseStream Firebase::stream(const String& path) { + // TODO: create new client dedicated to stream. + return FirebaseStream(host_, auth_, path, &http_); +} + +// FirebaseCall +FirebaseCall::FirebaseCall(const String& host, const String& auth, + const char* method, const String& path, + const String& data, HTTPClient* http) : http_(http) { + String url = makeFirebaseURL(path, auth); + http_->setReuse(true); + http_->begin(host, kFirebasePort, url, true, kFirebaseFingerprint); + + bool followRedirect = false; + if (method == "STREAM") { + method = "GET"; + http_->addHeader("Accept", "text/event-stream"); + followRedirect = true; } - if (statusCode != 200) { - _error.set(statusCode, - "stream " + location + ": " - + HTTPClient::errorToString(statusCode)); + + if (followRedirect) { + const char* headers[] = {"Location"}; + http_->collectHeaders(headers, 1); } - return *this; -} -String Firebase::makeURL(const String& path) { - String url; - if (path[0] != '/') { - url = "/"; + int status = http_->sendRequest(method, (uint8_t*)data.c_str(), data.length()); + + // TODO: Add a max redirect check + if (followRedirect) { + while (status == HTTP_CODE_TEMPORARY_REDIRECT) { + String location = http_->header("Location"); + http_->setReuse(false); + http_->end(); + http_->setReuse(true); + http_->begin(location, kFirebaseFingerprint); + status = http_->sendRequest("GET", (uint8_t*)NULL, 0); + } } - url += path + ".json"; - if (_auth.length() > 0) { - url += "?auth=" + _auth; + + if (status != 200) { +#ifdef USE_ESP_ARDUINO_CORE_2_0_0 + error_ = FirebaseError(status, String(method) + " " + url + ": " + status); +#else + error_ = FirebaseError(status, String(method) + " " + url + ": " + HTTPClient::errorToString(status)); +#endif + } + + // if not streaming. + if (!followRedirect) { + response_ = http_->getString(); } - return url; } -void Firebase::sendRequest(const char* method, const String& path, const String& value) { - String url = makeURL(path); - _http.begin(_host.c_str(), firebasePort, url.c_str(), true, firebaseFingerprint); - int statusCode = _http.sendRequest(method, (uint8_t*)value.c_str(), value.length()); - _error.reset(); - if (statusCode < 0) { - _error.set(statusCode, - String(method) + " " + url + ": " - + HTTPClient::errorToString(statusCode)); - } +// FirebaseGet +FirebaseGet::FirebaseGet(const String& host, const String& auth, + const String& path, + HTTPClient* http) + : FirebaseCall(host, auth, "GET", path, "", http) { + if (!error()) { + // TODO: parse json + json_ = response(); + } } -String Firebase::readBody() { - if (_error.code() != 0) { - return ""; +// FirebaseSet +FirebaseSet::FirebaseSet(const String& host, const String& auth, + const String& path, const String& value, + HTTPClient* http) + : FirebaseCall(host, auth, "PUT", path, value, http) { + if (!error()) { + // TODO: parse json + json_ = response(); } - // no _http.end() because of connection reuse. - return _http.getString(); +} +// FirebasePush +FirebasePush::FirebasePush(const String& host, const String& auth, + const String& path, const String& value, + HTTPClient* http) + : FirebaseCall(host, auth, "POST", path, value, http) { + if (!error()) { + // TODO: parse name + name_ = response(); + } +} + +// FirebasePush +FirebaseRemove::FirebaseRemove(const String& host, const String& auth, + const String& path, + HTTPClient* http) + : FirebaseCall(host, auth, "DELETE", path, "", http) { } -bool Firebase::connected() { - return _http.connected(); +// FirebaseStream +FirebaseStream::FirebaseStream(const String& host, const String& auth, + const String& path, + HTTPClient* http) + : FirebaseCall(host, auth, "STREAM", path, "", http) { } -bool Firebase::available() { - return _http.getStreamPtr()->available(); +bool FirebaseStream::available() { + return http_->getStreamPtr()->available(); } -Firebase::Event Firebase::read(String& event) { - auto client = _http.getStreamPtr(); - Event type;; +FirebaseStream::Event FirebaseStream::read(String& event) { + auto client = http_->getStreamPtr(); + Event type; String typeStr = client->readStringUntil('\n').substring(7); if (typeStr == "put") { - type = Firebase::Event::PUT; + type = Event::PUT; } else if (typeStr == "patch") { - type = Firebase::Event::PATCH; + type = Event::PATCH; } else { - type = Firebase::Event::UNKNOWN; + type = Event::UNKNOWN; } event = client->readStringUntil('\n').substring(6); client->readStringUntil('\n'); // consume separator diff --git a/Firebase.h b/Firebase.h index ac7ff6ca..5691038d 100644 --- a/Firebase.h +++ b/Firebase.h @@ -25,51 +25,145 @@ #include #include -// FirebaseError represents a Firebase API error with a code and a -// message. +class FirebaseGet; +class FirebaseSet; +class FirebasePush; +class FirebaseRemove; +class FirebaseStream; + +// Firebase REST API client. +class Firebase { + public: + Firebase(const String& host); + Firebase& auth(const String& auth); + + // Fetch json encoded `value` at `path`. + FirebaseGet get(const String& path); + + // Set json encoded `value` at `path`. + FirebaseSet set(const String& path, const String& json); + + // Add new json encoded `value` to list at `path`. + FirebasePush push(const String& path, const String& json); + + // Delete value at `path`. + FirebaseRemove remove(const String& path); + + // Start a stream of events that affect value at `path`. + FirebaseStream stream(const String& path); + + private: + HTTPClient http_; + String host_; + String auth_; +}; + class FirebaseError { public: - operator bool() const { return _code < 0; } - int code() const { return _code; } - const String& message() const { return _message; } - void reset() { set(0, ""); } - void set(int code, const String& message) { - _code = code; - _message = message; + FirebaseError() {} + FirebaseError(int code, const String& message) : code_(code), message_(message) { + } + operator bool() const { return code_ != 0; } + int code() const { return code_; } + const String& message() const { return message_; } + private: + int code_ = 0; + String message_ = ""; +}; + +class FirebaseCall { + public: + FirebaseCall() {} + FirebaseCall(const String& host, const String& auth, + const char* method, const String& path, + const String& data = "", + HTTPClient* http = NULL); + const FirebaseError& error() const { + return error_; } + const String& response() { + return response_; + } + protected: + HTTPClient* http_; + FirebaseError error_; + String response_; +}; + +class FirebaseGet : public FirebaseCall { + public: + FirebaseGet() {} + FirebaseGet(const String& host, const String& auth, + const String& path, HTTPClient* http = NULL); + + const String& json() const { + return json_; + } + private: - int _code = 0; - String _message = ""; + String json_; }; -// Firebase is the connection to firebase. -class Firebase { +class FirebaseSet: public FirebaseCall { public: - Firebase(const String& host); - Firebase& auth(const String& auth); - const FirebaseError& error() const { - return _error; + FirebaseSet() {} + FirebaseSet(const String& host, const String& auth, + const String& path, const String& value, HTTPClient* http = NULL); + + const String& json() const { + return json_; } - String get(const String& path); - String push(const String& path, const String& value); - void remove(const String& path); - bool connected(); - Firebase& stream(const String& path); + + private: + String json_; +}; + +class FirebasePush : public FirebaseCall { + public: + FirebasePush() {} + FirebasePush(const String& host, const String& auth, + const String& path, const String& value, HTTPClient* http = NULL); + + const String& name() const { + return name_; + } + + private: + String name_; +}; + +class FirebaseRemove : public FirebaseCall { + public: + FirebaseRemove() {} + FirebaseRemove(const String& host, const String& auth, + const String& path, HTTPClient* http = NULL); +}; + + +class FirebaseStream : public FirebaseCall { + public: + FirebaseStream() {} + FirebaseStream(const String& host, const String& auth, + const String& path, HTTPClient* http = NULL); + + // Return if there is any event available to read. bool available(); + + // Event type. enum Event { UNKNOWN, PUT, PATCH }; - Event read(String& event); - private: - String makeURL(const String& path); - void sendRequest(const char* method, const String& path, const String& value = ""); - String readBody(); - HTTPClient _http; - String _host; - String _auth; + // Read next json encoded `event` from stream. + Event read(String& event); + + const FirebaseError& error() const { + return _error; + } + + private: FirebaseError _error; }; diff --git a/README.md b/README.md index 227bce02..7228979c 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ # firebase-arduino +[![Join the chat at https://gitter.im/googlesamples/firebase-arduino](https://badges.gitter.im/googlesamples/firebase-arduino.svg)](https://gitter.im/googlesamples/firebase-arduino?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + This sample shows how to call [Firebase](https://www.firebase.com/) from the [ESP8266 Arduino core](https://github.com/esp8266/Arduino). ## Requirements - 1 [ESP8266 Arduino board](https://www.adafruit.com/products/2821). -- [Arduino 1.6.x](https://www.arduino.cc/en/Main/Software) -- ESP8266 Arduino board definition [(master branch)](https://github.com/esp8266/Arduino#using-git-version-) +- [Arduino 1.6.7](https://www.arduino.cc/en/Main/Software) +- [ESP8266 Arduino board definition](https://github.com/esp8266/Arduino#installing-with-boards-manager) ## Setup diff --git a/examples/FirebasePush_ESP8266/FirebasePush_ESP8266.ino b/examples/FirebasePush_ESP8266/FirebasePush_ESP8266.ino index d04b6fed..3584102e 100644 --- a/examples/FirebasePush_ESP8266/FirebasePush_ESP8266.ino +++ b/examples/FirebasePush_ESP8266/FirebasePush_ESP8266.ino @@ -21,7 +21,7 @@ // create firebase client. Firebase fbase = Firebase("example.firebaseio.com") - .auth("secret_or_token"); + .auth("secret_or_token"); void setup() { Serial.begin(9600); @@ -37,19 +37,27 @@ void setup() { Serial.print("connected: "); Serial.println(WiFi.localIP()); - // add a new entry. - String l = fbase.push("/logs", "{\".sv\": \"timestamp\"}"); - // handle error. - if (fbase.error()) { - Serial.println("Firebase request failed"); - Serial.println(fbase.error().message()); + // add a new entry. + FirebasePush push = fbase.push("/logs", "{\".sv\": \"timestamp\"}"); + if (push.error()) { + Serial.println("Firebase push failed"); + Serial.println(push.error().message()); return; } - // print response. - Serial.println(l); - // print all entries. - Serial.println(fbase.get("/logs")); + + // print key. + Serial.println(push.name()); + + // get all entries. + FirebaseGet get = fbase.get("/logs"); + if (get.error()) { + Serial.println("Firebase get failed"); + Serial.println(push.error().message()); + return; + } + // print json. + Serial.println(get.json()); } void loop() { -} \ No newline at end of file +} diff --git a/examples/FirebaseStream_ESP8266/FirebaseStream_ESP8266.ino b/examples/FirebaseStream_ESP8266/FirebaseStream_ESP8266.ino index 13bb2174..e4f10e64 100644 --- a/examples/FirebaseStream_ESP8266/FirebaseStream_ESP8266.ino +++ b/examples/FirebaseStream_ESP8266/FirebaseStream_ESP8266.ino @@ -20,11 +20,13 @@ #include #include #include +#include #define OLED_RESET 10 Adafruit_SSD1306 display(OLED_RESET); -Firebase fbase = Firebase("publicdata-cryptocurrency.firebaseio.com"); +Firebase fbase("publicdata-cryptocurrency.firebaseio.com"); +FirebaseStream stream; void setup() { Serial.begin(9600); @@ -42,32 +44,37 @@ void setup() { Serial.println(); Serial.print("connected: "); Serial.println(WiFi.localIP()); - - fbase.stream("/bitcoin"); + stream = fbase.stream("/bitcoin"); } void loop() { - if (fbase.error()) { + if (stream.error()) { Serial.println("streaming error"); - Serial.println(fbase.error().message()); + Serial.println(stream.error().message()); } - if (fbase.available()) { + + if (stream.available()) { String event; - auto type = fbase.read(event); + auto type = stream.read(event); Serial.print("event: "); Serial.println(type); - if (type != Firebase::Event::UNKNOWN) { + if (type == FirebaseStream::Event::PUT) { + StaticJsonBuffer<200> buf; Serial.print("data: "); Serial.println(event); + JsonObject& json = buf.parseObject((char*)event.c_str()); + String path = json["path"]; + float data = json["data"]; // TODO(proppy): parse JSON object. display.clearDisplay(); - display.setTextSize(1); + display.setTextSize(2); display.setTextColor(WHITE); display.setCursor(0,0); - display.println(event); + display.println(path.c_str()+1); + display.println(data); display.display(); } - } -} \ No newline at end of file + } +} diff --git a/hardware/FirebaseArduinoShield/fireshield.brd b/hardware/FirebaseArduinoShield/fireshield.brd new file mode 100644 index 00000000..0808c179 --- /dev/null +++ b/hardware/FirebaseArduinoShield/fireshield.brd @@ -0,0 +1,923 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<h3>SparkFun Electronics' preferred foot prints</h3> +In this library you'll find boards and modules: Arduino footprints, breadboards, non-RF modules, etc.<br><br> +We've spent an enormous amount of time creating and checking these footprints and parts, but it is the end user's responsibility to ensure correctness and suitablity for a given componet or application. If you enjoy using this library, please buy one of our products at www.sparkfun.com. +<br><br> +<b>Licensing:</b> Creative Commons ShareAlike 4.0 International - https://creativecommons.org/licenses/by-sa/4.0/ +<br><br> +You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +GND +GND ++5V +RST +VIN ++3.3V +0 +1 +2 +3 +4 +5 +Analog In +GND +13 +12 +11 +AREF +10 +9 +8 +7 +6 +5 +4 +3 +2 +TX +RX + + +SDA +SCL + + +IOREF + + + + + + + + + + + + + + + + + + + + + +<B>LED</B><p> +3 mm, round + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>RESISTOR</b><p> +type 0207, grid 10 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>PIN HEADER</b> + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + +<b>Omron Switches</b><p> +<author>Created by librarian@cadsoft.de</author> + + +<b>OMRON SWITCH</b> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +1 +2 +3 +4 + + + + + + +ESP8266 Module 01 + + + + + + + + + + + + + + + +ESP-01 +>Name +>Value + + + + +<h3>SparkFun Electronics' preferred foot prints</h3> +In this library you'll find drivers, regulators, and amplifiers.<br><br> +We've spent an enormous amount of time creating and checking these footprints and parts, but it is the end user's responsibility to ensure correctness and suitablity for a given componet or application. If you enjoy using this library, please buy one of our products at www.sparkfun.com. +<br><br> +<b>Licensing:</b> Creative Commons ShareAlike 4.0 International - https://creativecommons.org/licenses/by-sa/4.0/ +<br><br> +You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage. + + +<b>VOLTAGE REGULATOR</b> + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +A15,2mm +- +I +O + + + + + + + + + + + +<h3>SparkFun Electronics' preferred foot prints</h3> +In this library you'll find resistors, capacitors, inductors, test points, jumper pads, etc.<br><br> +We've spent an enormous amount of time creating and checking these footprints and parts, but it is the end user's responsibility to ensure correctness and suitablity for a given componet or application. If you enjoy using this library, please buy one of our products at www.sparkfun.com. +<br><br> +<b>Licensing:</b> Creative Commons ShareAlike 4.0 International - https://creativecommons.org/licenses/by-sa/4.0/ +<br><br> +You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage. + + + + + +>Name +>Value + + + + + + + + + + + + + + + + + + + + +<b>EAGLE Design Rules</b> +<p> +Die Standard-Design-Rules sind so gewählt, dass sie für +die meisten Anwendungen passen. Sollte ihre Platine +besondere Anforderungen haben, treffen Sie die erforderlichen +Einstellungen hier und speichern die Design Rules unter +einem neuen Namen ab. +<b>EAGLE Design Rules</b> +<p> +The default Design Rules have been set to cover +a wide range of applications. Your particular design +may have different requirements, so please make the +necessary adjustments and save your customized +design rules under a new name. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hardware/FirebaseArduinoShield/fireshield.sch b/hardware/FirebaseArduinoShield/fireshield.sch new file mode 100644 index 00000000..c1856a97 --- /dev/null +++ b/hardware/FirebaseArduinoShield/fireshield.sch @@ -0,0 +1,4448 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<h3>SparkFun Electronics' preferred foot prints</h3> +In this library you'll find boards and modules: Arduino footprints, breadboards, non-RF modules, etc.<br><br> +We've spent an enormous amount of time creating and checking these footprints and parts, but it is the end user's responsibility to ensure correctness and suitablity for a given componet or application. If you enjoy using this library, please buy one of our products at www.sparkfun.com. +<br><br> +<b>Licensing:</b> Creative Commons ShareAlike 4.0 International - https://creativecommons.org/licenses/by-sa/4.0/ +<br><br> +You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +GND +GND ++5V +RST +VIN ++3.3V +0 +1 +2 +3 +4 +5 +Analog In +GND +13 +12 +11 +AREF +10 +9 +8 +7 +6 +5 +4 +3 +2 +TX +RX + + +SDA +SCL + + +IOREF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +GND +GND ++5V +RST +VIN ++3.3V +0 +1 +2 +3 +4 +5 +Analog In +GND +13 +12 +11 +AREF +10 +9 +8 +7 +6 +5 +4 +3 +2 +TX +RX + + +SDA +SCL + + +IOREF + + + + + + + + + + + + + + + + + + + +<h3>Arduino R3 Shield Footprint w/ 6-pin (2x3) ICSP Header</h3> + + + + +>Name +>Value + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<h3>Arduino R3 Shield Footprint w/ 6-pin (2x3) ICSP Header</h3> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ESP8266 Module 01 + + + + + + + + + + + + + + + +ESP-01 +>Name +>Value + + + + +ESP8266 Wifi module 01 + + + + + + + + + + + + +>Name +>Value + + + + +ESP8266 Wifi module 01 + + + + + + + + + + + + + + + + + + + + + + + + +<b>Omron Switches</b><p> +<author>Created by librarian@cadsoft.de</author> + + +<b>OMRON SWITCH</b> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +1 +2 +3 +4 + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + +<b>OMRON SWITCH</b> + + + + + + + + + + + + + + + + + + + + + + + + + + + +<b>CHICAGO MINIATURE LAMP, INC.</b><p> +7022X Series SMT LEDs 1206 Package Size + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + +<B>LED</B><p> +5 mm, square, Siemens + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<B>LED</B><p> +2 x 5 mm, rectangle + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + +<B>LED</B><p> +3 mm, round + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<B>LED</B><p> +5 mm, round + + + + + + + + + + + +>NAME +>VALUE + + +<B>LED</B><p> +1 mm, round, Siemens + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<B>LED BLOCK</B><p> +1 LED, Siemens + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>LED HOLDER</b><p> +Siemens + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>LED HOLDER</b><p> +Siemens + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>LED HOLDER</b><p> +Siemens + + + + + + + + + + + + + + + + + +A+ +K- +>NAME +>VALUE + + + + + +<b>LED HOLDER</b><p> +Siemens + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE ++ +- + + +<B>IR LED</B><p> +infrared emitting diode, Infineon +TO-18, lead spacing 2.54 mm, cathode marking<p> +Inifineon + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<B>IR LED</B><p> +infrared emitting diode, Infineon +TO-18, lead spacing 2.54 mm, cathode marking<p> +Inifineon + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<B>LED</B><p> +rectangle, 5.7 x 3.2 mm + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<B>IR LED</B><p> +IR transmitter Siemens + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + +<b>TOPLED® High-optical Power LED (HOP)</b><p> +Source: http://www.osram.convergy.de/ ... ls_t675.pdf + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +A +C + + + + + + + +<b>BLUE LINETM Hyper Mini TOPLED® Hyper-Bright LED</b><p> +Source: http://www.osram.convergy.de/ ... LB M676.pdf + + + + + + + + + + + + + + +A +C +>NAME +>VALUE + + + + + + + +<b>Super SIDELED® High-Current LED</b><p> +LG A672, LP A672 <br> +Source: http://www.osram.convergy.de/ ... LG_LP_A672.pdf (2004.05.13) + + + + + + + + + + + + + + + + + + + +C +A +>NAME +>VALUE + + + + + + + +<b>SmartLEDTM Hyper-Bright LED</b><p> +Source: http://www.osram.convergy.de/ ... LA_LO_LS_LY L896.pdf + + + + + + + +>NAME +>VALUE + + + + + +<b>Hyper TOPLED® RG Hyper-Bright LED</b><p> +Source: http://www.osram.convergy.de/ ... LA_LO_LS_LY T776.pdf + + + + + + + + + + + + + + + + +>NAME +>VALUE +A +C + + + + + + + + + + +<b>Hyper Micro SIDELED®</b><p> +Source: http://www.osram.convergy.de/ ... LA_LO_LS_LY Y876.pdf + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + +<b>Power TOPLED®</b><p> +Source: http://www.osram.convergy.de/ ... LA_LO_LA_LY E67B.pdf + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +C +A +C +C + + + + + + + + + + + +<b>Hyper CHIPLED Hyper-Bright LED</b><p> +LB Q993<br> +Source: http://www.osram.convergy.de/ ... Lb_q993.pdf + + + + +>NAME +>VALUE + + + + + + + +<b>Hyper CHIPLED Hyper-Bright LED</b><p> +LB R99A<br> +Source: http://www.osram.convergy.de/ ... lb_r99a.pdf + + + + +>NAME +>VALUE ++ + + + + + + + +<b>Mini TOPLED Santana®</b><p> +Source: http://www.osram.convergy.de/ ... LG M470.pdf + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + +<b>CHIPLED</b><p> +Source: http://www.osram.convergy.de/ ... LG_R971.pdf + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + +<b>CHIPLED</b><p> +Source: http://www.osram.convergy.de/ ... LG_LY N971.pdf + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + +<b>CHIPLED</b><p> +Source: http://www.osram.convergy.de/ ... LG_LY Q971.pdf + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + +<b>CHIPLED-0603</b><p> +Recommended Solder Pad useable for SmartLEDTM and Chipled - Package 0603<br> +Package able to withstand TTW-soldering heat<br> +Package suitable for TTW-soldering<br> +Source: http://www.osram.convergy.de/ ... LO_LS_LY L89K.pdf + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + + +<b>SmartLED TTW</b><p> +Recommended Solder Pad useable for SmartLEDTM and Chipled - Package 0603<br> +Package able to withstand TTW-soldering heat<br> +Package suitable for TTW-soldering<br> +Source: http://www.osram.convergy.de/ ... LO_LS_LY L89K.pdf + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +A +K + + +<b>RESISTOR</b><p> +chip + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip, wave soldering + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip, wave soldering + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip, wave soldering + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +chip, wave soldering + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +chip + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip, wave soldering + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip, wave soldering + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip, wave soldering + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip, wave soldering + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip, wave soldering + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +chip, wave soldering + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +MELF 0.10 W + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +MELF 0.25 W + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +MELF 0.12 W + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +MELF 0.10 W + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +MELF 0.25 W + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +MELF 0.25 W + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +MELF 0.12 W + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +MELF 0.25 W + + + + + + + + + + +>NAME +>VALUE + + + + + +<b>RESISTOR</b><p> +type 0204, grid 5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0204, grid 7.5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0207, grid 10 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0207, grid 12 mm + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + +<b>RESISTOR</b><p> +type 0207, grid 15mm + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + +<b>RESISTOR</b><p> +type 0207, grid 2.5 mm + + + + + + + +>NAME +>VALUE + + +<b>RESISTOR</b><p> +type 0207, grid 5 mm + + + + + + + +>NAME +>VALUE + + +<b>RESISTOR</b><p> +type 0207, grid 7.5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0309, grid 10mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0309, grid 12.5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0411, grid 12.5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0411, grid 15 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0411, grid 3.81 mm + + + + + + +>NAME +>VALUE + + + +<b>RESISTOR</b><p> +type 0414, grid 15 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0414, grid 5 mm + + + + + + +>NAME +>VALUE + + + +<b>RESISTOR</b><p> +type 0617, grid 17.5 mm + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0617, grid 22.5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0617, grid 5 mm + + + + + + +>NAME +>VALUE + + + +<b>RESISTOR</b><p> +type 0922, grid 22.5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + +<b>RESISTOR</b><p> +type 0613, grid 5 mm + + + + + + +>NAME +>VALUE + + + +<b>RESISTOR</b><p> +type 0613, grid 15 mm + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type 0817, grid 22.5 mm + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +0817 + + + + +<b>RESISTOR</b><p> +type 0817, grid 6.35 mm + + + + + + +>NAME +>VALUE +0817 + + + +<b>RESISTOR</b><p> +type V234, grid 12.5 mm + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type V235, grid 17.78 mm + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>RESISTOR</b><p> +type V526-0, grid 2.5 mm + + + + + + + + + + +>NAME +>VALUE + + +<b>Mini MELF 0102 Axial</b> + + + + +>NAME +>VALUE + + + +<b>RESISTOR</b><p> +type 0922, grid 7.5 mm + + + + + + +>NAME +>VALUE +0922 + + + +<b>CECC Size RC2211</b> Reflow Soldering<p> +source Beyschlag + + + + + + +>NAME +>VALUE + + +<b>CECC Size RC2211</b> Wave Soldering<p> +source Beyschlag + + + + + + +>NAME +>VALUE + + +<b>CECC Size RC3715</b> Reflow Soldering<p> +source Beyschlag + + + + + + +>NAME +>VALUE + + +<b>CECC Size RC3715</b> Wave Soldering<p> +source Beyschlag + + + + + + +>NAME +>VALUE + + +<b>CECC Size RC6123</b> Reflow Soldering<p> +source Beyschlag + + + + + + +>NAME +>VALUE + + +<b>CECC Size RC6123</b> Wave Soldering<p> +source Beyschlag + + + + + + +>NAME +>VALUE + + +<b>RESISTOR</b><p> +type RDH, grid 15 mm + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +RDH + + + + +<b>RESISTOR</b><p> +type 0204, grid 2.5 mm + + + + + + +>NAME +>VALUE + + +<b>RESISTOR</b><p> +type 0309, grid 2.5 mm + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + +<b>PIN HEADER</b> + + + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + +>NAME +>VALUE + + + + + + + +<b>LED</b><p> +<u>OSRAM</u>:<br> + +- <u>CHIPLED</u><br> +LG R971, LG N971, LY N971, LG Q971, LY Q971, LO R971, LY R971 +LH N974, LH R974<br> +LS Q976, LO Q976, LY Q976<br> +LO Q996<br> + + +- <u>Hyper CHIPLED</u><br> +LW Q18S<br> +LB Q993, LB Q99A, LB R99A<br> + +- <u>SideLED</u><br> +LS A670, LO A670, LY A670, LG A670, LP A670<br> +LB A673, LV A673, LT A673, LW A673<br> +LH A674<br> +LY A675<br> +LS A676, LA A676, LO A676, LY A676, LW A676<br> +LS A679, LY A679, LG A679<br> + +- <u>Hyper Micro SIDELED®</u><br> +LS Y876, LA Y876, LO Y876, LY Y876<br> +LT Y87S<br> + +- <u>SmartLED</u><br> +LW L88C, LW L88S<br> +LB L89C, LB L89S, LG L890<br> +LS L89K, LO L89K, LY L89K<br> +LS L896, LA L896, LO L896, LY L896<br> + +- <u>TOPLED</u><br> +LS T670, LO T670, LY T670, LG T670, LP T670<br> +LSG T670, LSP T670, LSY T670, LOP T670, LYG T670<br> +LG T671, LOG T671, LSG T671<br> +LB T673, LV T673, LT T673, LW T673<br> +LH T674<br> +LS T676, LA T676, LO T676, LY T676, LB T676, LH T676, LSB T676, LW T676<br> +LB T67C, LV T67C, LT T67C, LS T67K, LO T67K, LY T67K, LW E67C<br> +LS E67B, LA E67B, LO E67B, LY E67B, LB E67C, LV E67C, LT E67C<br> +LW T67C<br> +LS T679, LY T679, LG T679<br> +LS T770, LO T770, LY T770, LG T770, LP T770<br> +LB T773, LV T773, LT T773, LW T773<br> +LH T774<br> +LS E675, LA E675, LY E675, LS T675<br> +LS T776, LA T776, LO T776, LY T776, LB T776<br> +LHGB T686<br> +LT T68C, LB T68C<br> + +- <u>Hyper Mini TOPLED®</u><br> +LB M676<br> + +- <u>Mini TOPLED Santana®</u><br> +LG M470<br> +LS M47K, LO M47K, LY M47K<br> + +<p> +Source: http://www.osram.convergy.de/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<B>RESISTOR</B>, American symbol + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<b>PIN HEADER</b> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<h3>SparkFun Electronics' preferred foot prints</h3> +In this library you'll find drivers, regulators, and amplifiers.<br><br> +We've spent an enormous amount of time creating and checking these footprints and parts, but it is the end user's responsibility to ensure correctness and suitablity for a given componet or application. If you enjoy using this library, please buy one of our products at www.sparkfun.com. +<br><br> +<b>Licensing:</b> Creative Commons ShareAlike 4.0 International - https://creativecommons.org/licenses/by-sa/4.0/ +<br><br> +You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage. + + +<b>VOLTAGE REGULATOR</b> + + + + + + + + + + + + + + + + + + + + + + +>NAME +>VALUE +A15,2mm +- +I +O + + + + + + + + + + + + + + + +>NAME +>VALUE +GND +IN +OUT + + + + + + + +LD1117VXX voltage regulator. We carry the 3.3V version (COM-00526) in TO-220 package. + + + + + + + + + + + + + + + + + + + +<h3>SparkFun Electronics' preferred foot prints</h3> +In this library you'll find resistors, capacitors, inductors, test points, jumper pads, etc.<br><br> +We've spent an enormous amount of time creating and checking these footprints and parts, but it is the end user's responsibility to ensure correctness and suitablity for a given componet or application. If you enjoy using this library, please buy one of our products at www.sparkfun.com. +<br><br> +<b>Licensing:</b> Creative Commons ShareAlike 4.0 International - https://creativecommons.org/licenses/by-sa/4.0/ +<br><br> +You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage. + + + + + + +>Name +>Value + + + + + +>Name +>Value + + + + + + + + + + + + + + + +>NAME +>VALUE + + + + + + + + +CAP-08440 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +