You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-36Lines changed: 34 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,13 @@ The package provides a client library that simplifies connecting Internet-enable
6
6
7
7
Supported hardware:
8
8
9
-
-[ESP8266](https://en.wikipedia.org/wiki/ESP8266) boards (like [NodeMCU Dev Kit](http://www.nodemcu.com/index_en.html#fr_54747661d775ef1a3600009e) and others).
10
-
-[ESP32](https://en.wikipedia.org/wiki/ESP32) boards (like [ESP32-DevKitC](https://www.espressif.com/en/products/hardware/esp32-devkitc/overview) and others).
9
+
-[ESP8266](https://en.wikipedia.org/wiki/ESP8266) boards (like [NodeMCU Dev Kit](http://www.nodemcu.com/index_en.html#fr_54747661d775ef1a3600009e) and others).
10
+
-[ESP32](https://en.wikipedia.org/wiki/ESP32) boards (like [ESP32-DevKitC](https://www.espressif.com/en/products/hardware/esp32-devkitc/overview) and others).
The further instructions depend on your preferred ecosystem.
18
18
@@ -23,17 +23,17 @@ The [Cloud4RPi library](http://platformio.org/lib/show/2045/cloud4rpi-esp-arduin
23
23
1. Create a new PlatformIO project for your board as described in the PlatformIO documentation ([Visual Studio Code](http://docs.platformio.org/en/latest/ide/vscode.html#id3), [Atom](http://docs.platformio.org/en/latest/ide/atom.html#setting-up-the-project))
24
24
2. Open your `platformio.ini` and add the following lines to the end:
25
25
26
-
```
27
-
lib_deps =
28
-
cloud4rpi-esp-arduino
26
+
```
27
+
lib_deps =
28
+
cloud4rpi-esp-arduino
29
29
30
-
build_flags=
31
-
; Required for PubSub library
32
-
-D MQTT_MAX_PACKET_SIZE=1024
33
-
-D MQTT_MAX_TRANSFER_SIZE=128
34
-
; Enables the verbose output to Serial
35
-
-D CLOUD4RPI_DEBUG=1
36
-
```
30
+
build_flags=
31
+
; Required for PubSub library
32
+
-D MQTT_MAX_PACKET_SIZE=1024
33
+
-D MQTT_MAX_TRANSFER_SIZE=128
34
+
; Enables the verbose output to Serial
35
+
-D CLOUD4RPI_DEBUG=1
36
+
```
37
37
38
38
3. Save the `platformio.ini` file and open the `src\main.cpp` file.
39
39
4. Copy-paste the [sample code](https://github.com/cloud4rpi/cloud4rpi-esp-arduino/blob/master/examples/control/control.ino).
@@ -48,25 +48,24 @@ The [Cloud4RPi library](http://platformio.org/lib/show/2045/cloud4rpi-esp-arduin
48
48
13. Once flashing is complete, open `Serial Monitor` to monitor the device's status.
49
49
14. Notice that the device on the [Devices page](https://cloud4rpi.io/devices) went online and started sending data.
50
50
15. Go to the [Control Panels](https://cloud4rpi.io/control-panels/) page and add a new control panel.
51
-
16. Add a new **Number** widget and bind it to the `Uptime` variable.
52
-
17. Add a new **Switch** widget and bind it to the `LED On` variable.
53
-
18. Add a new **Text** widget and bind it to the `State` variable. Configure different colors for the **"IDLE"**, **"RING"** and **"BOOM!"** strings.
54
-
19. Add a new **Slider** widget and bind it to the `DesiredTemp` variable, set its minimum value to 10 and maximum value to 30.
55
-
20. Add a new **Gauge** widget and bind it to the `DesiredTemp` variable, set its minimum value to 10 and maximum value to 30.
51
+
16. Add a new **Switch** widget and bind it to the `LED On` variable.
52
+
17. Add a new **Text** widget and bind it to the `State` variable. Configure different colors for the **"IDLE"**, **"RING"** and **"BOOM!"** strings.
53
+
18. Add a new **Slider** widget and bind it to the `DesiredTemp` variable, set its minimum value to 10 and maximum value to 30.
54
+
19. Add a new **Gauge** widget and bind it to the `DesiredTemp` variable, set its minimum value to 10 and maximum value to 30.
56
55
57
56
## Arduino
58
57
59
58
1. Open **Arduino** and select your board in the **Tools** | **Board** menu. Add [ESP8266](https://github.com/esp8266/Arduino#installing-with-boards-manager) or [ESP32](https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/boards_manager.md) support if it is not added yet.
60
59
2. Install the Cloud4RPi library from the **Library Manager**. To do this, open the **Sketch** | **Include Library** | **Manage Libraries** menu, enter `cloud4rpi` into the search field and install the **cloud4rpi-esp-arduino** package.
61
60
3. Install the dependencies: **ArduinoJson** and **PubSubClient** libraries.
62
61
4. Configure the installed libraries:
63
-
1. Open the `%HOMEPATH%\Documents\Arduino\libraries\PubSubClient\src\PubSubClient.h` (`~/Documents/Arduino/libraries/PubSubClient/src/PubSubClient.h` on Mac) file with any text editor (for instance, [VS Code](https://code.visualstudio.com)).
64
-
2. Add the following define directives at the beginning:
65
-
```c
66
-
#define MQTT_MAX_PACKET_SIZE 1024
67
-
#define MQTT_MAX_TRANSFER_SIZE 128
68
-
```
69
-
3. [Optional] Open the `%HOMEPATH%\Documents\Arduino\libraries\cloud4rpi-esp-arduino\src\Cloud4RPi.h` (`~/Documents/Arduino/libraries/cloud4rpi-esp-arduino/src/Cloud4RPi.h` on Mac) file and add the `#define CLOUD4RPI_DEBUG 1` line at the beginning to enable verbose output.
62
+
1. Open the `%HOMEPATH%\Documents\Arduino\libraries\PubSubClient\src\PubSubClient.h` (`~/Documents/Arduino/libraries/PubSubClient/src/PubSubClient.h` on Mac) file with any text editor (for instance, [VS Code](https://code.visualstudio.com)).
63
+
2. Add the following define directives at the beginning:
64
+
```c
65
+
#defineMQTT_MAX_PACKET_SIZE 1024
66
+
#define MQTT_MAX_TRANSFER_SIZE 128
67
+
```
68
+
3.[Optional] Open the `%HOMEPATH%\Documents\Arduino\libraries\cloud4rpi-esp-arduino\src\Cloud4RPi.h` (`~/Documents/Arduino/libraries/cloud4rpi-esp-arduino/src/Cloud4RPi.h` on Mac) file and add the `#define CLOUD4RPI_DEBUG 1` line at the beginning to enable verbose output.
70
69
5. Use the **File** | **Examples** | **cloud4rpi-esp-arduino** menu item to open the sample code. Restart Arduino IDE if this item does not appear.
71
70
6. Select the **ESP32 Dev Module** board in **Tools** menu.
72
71
7.[Log in to your Cloud4RPi account](https://cloud4rpi.io/signin) or [create a new one](https://cloud4rpi.io/register).
@@ -80,16 +79,15 @@ The [Cloud4RPi library](http://platformio.org/lib/show/2045/cloud4rpi-esp-arduin
80
79
15. Once flashing is complete, open `Serial Monitor` to monitor the device's status.
81
80
16. Notice that the device on the [Devices page](https://cloud4rpi.io/devices) went online and started sending data.
82
81
17. Go to the [Control Panels](https://cloud4rpi.io/control-panels/) page and add a new control panel.
83
-
18. Add a new **Number** widget and bind it to the `Uptime` variable.
84
-
19. Add a new **Switch** widget and bind it to the `LED On` variable.
85
-
20. Add a new **Text** widget and bind it to the `State` variable. Configure different colors for the **"IDLE"**, **"RING"** and **"BOOM!"** strings.
86
-
21. Add a new **Slider** widget and bind it to the `DesiredTemp` variable, set its minimum value to 10 and maximum value to 30.
87
-
22. Add a new **Gauge** widget and bind it to the `DesiredTemp` variable, set its minimum value to 10 and maximum value to 30.
82
+
18. Add a new **Switch** widget and bind it to the `LED On` variable.
83
+
19. Add a new **Text** widget and bind it to the `State` variable. Configure different colors for the **"IDLE"**, **"RING"** and **"BOOM!"** strings.
84
+
20. Add a new **Slider** widget and bind it to the `DesiredTemp` variable, set its minimum value to 10 and maximum value to 30.
85
+
21. Add a new **Gauge** widget and bind it to the `DesiredTemp` variable, set its minimum value to 10 and maximum value to 30.
88
86
89
87
## See Also
90
88
91
-
- [Library and Examples for ESP8266 with MicroPython](https://github.com/cloud4rpi/cloud4rpi-esp8266-micropython)
92
-
- [Examples for Raspberry Pi](https://github.com/cloud4rpi/cloud4rpi-raspberrypi-python)
93
-
- [Examples for Next Thing Co. C.H.I.P.](https://github.com/cloud4rpi/cloud4rpi-chip-python)
94
-
- [Examples for Onion Omega2](https://github.com/cloud4rpi/cloud4rpi-omega2-python)
0 commit comments