|
1 | | -# Arduino Library Manager list |
| 1 | +# NikkiClientESP |
2 | 2 |
|
3 | | -This repository contains the list of libraries in the |
4 | | -[Arduino Library Manager](https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries#using-the-library-manager) index. |
| 3 | +**NikkiClientESP** is an Arduino library for **ESP32** that connects to the [Nikki.Build Playground](https://nikki.build) — a fun platform for ** rapid prototyping and applied learning ** using real IoT devices. |
5 | 4 |
|
6 | | -## Table of Contents |
7 | | - |
8 | | -<!-- toc --> |
9 | | - |
10 | | -- [Frequently asked questions](#frequently-asked-questions) |
11 | | -- [Adding a library to Library Manager](#adding-a-library-to-library-manager) |
12 | | - - [Instructions](#instructions) |
13 | | - - [If the problem is with the pull request:](#if-the-problem-is-with-the-pull-request) |
14 | | - - [If the problem is with the library:](#if-the-problem-is-with-the-library) |
15 | | -- [Changing the URL of a library already in Library Manager](#changing-the-url-of-a-library-already-in-library-manager) |
16 | | -- [Removing a library from Library Manager](#removing-a-library-from-library-manager) |
17 | | -- [Report a problem with Library Manager](#report-a-problem-with-library-manager) |
18 | | -- [Security & Malware Reporting](#security--malware-reporting) |
19 | | - |
20 | | -<!-- tocstop --> |
21 | | - |
22 | | -## Frequently asked questions |
23 | | - |
24 | | -For more information about Arduino Library Manager and how the index is maintained, please see [the FAQ](FAQ.md). |
25 | | - |
26 | | -## Adding a library to Library Manager |
27 | | - |
28 | | -If you would like to make a library available for installation via Library Manager, just submit a |
29 | | -[pull request](https://docs.github.com/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests) |
30 | | -that adds the repository URL to [the list](repositories.txt). You are welcome to add multiple libraries at once. |
31 | | - |
32 | | -See the instructions below for detailed instructions on how to do this via the GitHub web interface. |
33 | | - |
34 | | -### Instructions |
| 5 | +This library makes it easy for students, makers, and educators to connect their ESP32 boards to the Nikki Playground over **WebSocket (WSS)** and exchange data in real time. |
35 | 6 |
|
36 | 7 | --- |
37 | 8 |
|
38 | | -⚠ If you behave irresponsibly in your interactions with this repository, your Library Manager Registry privileges will be revoked. |
39 | | - |
40 | | -Carefully read and follow the instructions in any comments the bot and human maintainers make on your pull requests. If you are having trouble following the instructions, add a comment that provides a detailed description of the problem you are having and a human maintainer will provide assistance. |
| 9 | +## 🚀 Features |
41 | 10 |
|
42 | | -Although we have set up automation for the most basic tasks, this repository is maintained by humans. So behave in a manner appropriate for interacting with humans, including clearly communicating what you are hoping to accomplish. |
| 11 | +- Connect ESP32 to **Nikki Playground** securely via `wss://` |
| 12 | +- Send and receive real-time data using JSON |
| 13 | +- Auto-reconnect and status event callbacks |
| 14 | +- Great for **IoT learning**, **STEM education**, and **rapid prototypes** |
43 | 15 |
|
44 | 16 | --- |
45 | 17 |
|
46 | | -1. You may want to first take a look at |
47 | | - [the requirements for admission into the Arduino Library Manager index](FAQ.md#submission-requirements). Each submission will be checked for |
48 | | - compliance before being accepted. |
49 | | -1. Click the following link:<br /> |
50 | | - https://github.com/arduino/library-registry/fork<br /> |
51 | | - The "**Create a new fork**" page will open. |
52 | | -1. Click the <kbd>Create fork</kbd> button in the "**Create a new fork**" page.<br /> |
53 | | - A "**Forking arduino/library-registry**" page will open while the fork is in the process of being created. |
54 | | -1. Wait for the "Forking" process to finish.<br /> |
55 | | - The home page of your [fork](https://docs.github.com/get-started/quickstart/fork-a-repo) of the **library-registry** repository will open. |
56 | | -1. Click on the file `repositories.txt` under the list of files you see in that page.<br /> |
57 | | - The "**library-registry/repositories.txt**" page will open. |
58 | | -1. Click the pencil icon ("Edit this file") at the right side of the toolbar in the "**library-registry/repositories.txt**" page.<br /> |
59 | | - The `repositories.txt` file will open in the online text editor. |
60 | | -1. Add the library repository's URL to the list (it doesn't matter where in the list). This should be the URL of the repository home page. For example: |
61 | | - `https://github.com/arduino-libraries/Servo` |
62 | | -1. Click the <kbd>Commit changes...</kbd> button located near the top right corner of the page.<br /> |
63 | | - The "**Commit changes**" dialog will open. |
64 | | -1. Click the <kbd>Commit changes</kbd> button in the "**Commit changes**" dialog.<br /> |
65 | | - The "**library-registry/repositories.txt**" page will open. |
66 | | -1. Click the "**library-registry**" link at the top of the "**library-registry/repositories.txt**" page.<br /> |
67 | | - The home page of your fork of the **library-registry** repository will open. |
68 | | -1. You should see a banner on the page that says: |
69 | | - |
70 | | - > **This branch is 1 commit ahead of arduino:main.** |
71 | | -
|
72 | | - Click the "**Contribute**" link near the right side of that banner.<br /> |
73 | | - A menu will open. |
| 18 | +## 📦 Installation |
74 | 19 |
|
75 | | -1. Click the <kbd>Open pull request</kbd> button in the menu.<br /> |
76 | | - The "**Open a pull request**" page will open. |
77 | | -1. In the **"Open a pull request"** window that opens, click the <kbd>Create pull request</kbd> button. |
| 20 | +### Option 1 — From Arduino Library Manager |
| 21 | +1. Open Arduino IDE |
| 22 | +2. Go to **Tools → Manage Libraries** |
| 23 | +3. Search for **"NikkiClientESP"** |
| 24 | +4. Click **Install** |
78 | 25 |
|
79 | | -The library will be automatically checked for compliance as soon as the pull request is submitted. If no problems were |
80 | | -found, the pull request will be immediately merged and the library will be available for installation via Library |
81 | | -Manager within a day's time. |
| 26 | +### Option 2 — From GitHub |
| 27 | +1. Download this repo as ZIP |
| 28 | +2. In Arduino IDE, go to **Sketch → Include Library → Add .ZIP Library...** |
| 29 | +3. Select the downloaded ZIP file |
82 | 30 |
|
83 | | -If any problems are found, a bot will comment on the pull request to tell you what is wrong. The problem may be either |
84 | | -with your pull request or with the library. |
85 | | - |
86 | | -#### If the problem is with the pull request: |
87 | | - |
88 | | -Edit the file in the |
89 | | -[branch](https://docs.github.com/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches) |
90 | | -you submitted the pull request from in your fork of the `arduino/library-registry` repository, then commit. |
91 | | - |
92 | | -Doing this will update the pull request and cause the automated checks to run again. |
| 31 | +--- |
93 | 32 |
|
94 | | -#### If the problem is with the library: |
| 33 | +## 🧩 Basic Example |
95 | 34 |
|
96 | | -1. Make the necessary fix in the library repository. |
97 | | -1. Increment the `version` value in the library's |
98 | | - [library.properties file](https://arduino.github.io/arduino-cli/latest/library-specification/#library-metadata). |
99 | | -1. Create a |
100 | | - [release](https://docs.github.com/repositories/releasing-projects-on-github/managing-releases-in-a-repository) |
101 | | - or [tag](https://git-scm.com/docs/git-tag). The Library Manager index always uses tagged versions of the libraries, |
102 | | - so even if the development version of the library is compliant, it can't be accepted until the latest release or tag |
103 | | - is compliant. Alternatively, you can redo the existing release/tag if you prefer. |
104 | | -1. Comment on your pull request here in the `arduino/library-registry` repository, mentioning **@ArduinoBot** in the |
105 | | - comment. Doing this will cause the automated check to run again. |
| 35 | +```cpp |
| 36 | +#include <WiFi.h> |
| 37 | +#include <NikkiClientESP.h> |
106 | 38 |
|
107 | | -## Changing the URL of a library already in Library Manager |
| 39 | +const char* WIFI_SSID = "YourWiFi"; |
| 40 | +const char* WIFI_PASS = "YourPassword"; |
108 | 41 |
|
109 | | -Submit a pull request that changes the URL as desired in [repositories.txt](repositories.txt). This can be done by |
110 | | -following [the instructions above](#instructions). |
| 42 | +const char* SERVICE_DEF_JSON = R"({ |
111 | 43 |
|
112 | | -Since this type of request must be reviewed by a human maintainer, please write an explanation in the pull request |
113 | | -description, making it clear that the URL is intentionally being changed. |
| 44 | + // replace this line with your serviceDef.json content here |
114 | 45 |
|
115 | | -## Removing a library from Library Manager |
| 46 | +})"; |
116 | 47 |
|
117 | | -Submit a pull request that removes the URL from [repositories.txt](repositories.txt). This can be done by following |
118 | | -[the instructions above](#instructions). |
| 48 | +const char* SERVICE_TOKEN_JSON = R"({ |
119 | 49 |
|
120 | | -Since this type of request must be reviewed by a human maintainer, please write an explanation in the pull request |
121 | | -description, making it clear that the URL is intentionally being removed. |
| 50 | + // replace this line with your serviceDef.json content here |
122 | 51 |
|
123 | | -## Report a problem with Library Manager |
| 52 | +})"; |
124 | 53 |
|
125 | | -First, please take a look at [the FAQ](FAQ.md). If a library release is missing from Library Manager, it is usually |
126 | | -because it was not compliant with all [the requirements](FAQ.md#update-requirements) listed in that document. |
| 54 | +NikkiClientESP nikki(SERVICE_DEF_JSON, SERVICE_TOKEN_JSON, true); |
127 | 55 |
|
128 | | -This repository is not an appropriate place to request support or report problems with a library. Check the library's |
129 | | -own documentation for instructions or ask on the [Arduino Forum](https://forum.arduino.cc/). |
| 56 | +void setup() { |
| 57 | + Serial.begin(115200); |
| 58 | + WiFi.begin(WIFI_SSID, WIFI_PASS); |
| 59 | + while (WiFi.status() != WL_CONNECTED) delay(500); |
| 60 | + nikki.begin(); |
| 61 | +} |
130 | 62 |
|
131 | | -If the problem is about something else, please submit an issue report [here](https://github.com/arduino/library-registry/issues/new/choose). |
| 63 | +void loop() { |
| 64 | + nikki.loop(); |
| 65 | + if (nikki.isConnected()) { |
| 66 | + |
| 67 | + if (nikki.isConnected()) { |
| 68 | + // Send a simple integer |
| 69 | + nikki.send(42); |
| 70 | + delay(5000); |
132 | 71 |
|
133 | | -## Security & Malware Reporting |
| 72 | + // Send a string |
| 73 | + nikki.send("Hello Nikki!"); |
| 74 | + delay(5000); |
134 | 75 |
|
135 | | -If you think you found a vulnerability, malware or other security-related defect in any Arduino Library projects, please take a look at our security policy and report it to our Security Team 🛡️. |
| 76 | + // Send a float |
| 77 | + nikki.send(23.7); |
| 78 | + delay(5000); |
136 | 79 |
|
137 | | -Thank you! |
| 80 | + // Send a JSON object |
| 81 | + DynamicJsonDocument doc(256); |
| 82 | + doc["temp"] = 27.3; |
| 83 | + doc["humidity"] = 62; |
| 84 | + doc["unit"] = "C"; |
| 85 | + nikki.send(doc.as<JsonVariant>()); |
138 | 86 |
|
139 | | - |
| 87 | + } |
| 88 | + delay(5000); |
| 89 | + } |
| 90 | +} |
0 commit comments