Skip to content

Commit e3da73a

Browse files
committed
update an example step-by-step instruction
1 parent ba8f7ea commit e3da73a

File tree

1 file changed

+34
-36
lines changed

1 file changed

+34
-36
lines changed

README.md

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ The package provides a client library that simplifies connecting Internet-enable
66

77
Supported hardware:
88

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).
1111

1212
Supported ecosystems:
1313

14-
- [PlatformIO](http://platformio.org/platformio-ide)
15-
- [Arduino IDE](https://www.arduino.cc/en/main/software)
14+
- [PlatformIO](http://platformio.org/platformio-ide)
15+
- [Arduino IDE](https://www.arduino.cc/en/main/software)
1616

1717
The further instructions depend on your preferred ecosystem.
1818

@@ -23,17 +23,17 @@ The [Cloud4RPi library](http://platformio.org/lib/show/2045/cloud4rpi-esp-arduin
2323
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))
2424
2. Open your `platformio.ini` and add the following lines to the end:
2525

26-
```
27-
lib_deps =
28-
cloud4rpi-esp-arduino
26+
```
27+
lib_deps =
28+
cloud4rpi-esp-arduino
2929
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+
```
3737

3838
3. Save the `platformio.ini` file and open the `src\main.cpp` file.
3939
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
4848
13. Once flashing is complete, open `Serial Monitor` to monitor the device's status.
4949
14. Notice that the device on the [Devices page](https://cloud4rpi.io/devices) went online and started sending data.
5050
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.
5655

5756
## Arduino
5857

5958
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.
6059
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.
6160
3. Install the dependencies: **ArduinoJson** and **PubSubClient** libraries.
6261
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+
#define MQTT_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.
7069
5. Use the **File** | **Examples** | **cloud4rpi-esp-arduino** menu item to open the sample code. Restart Arduino IDE if this item does not appear.
7170
6. Select the **ESP32 Dev Module** board in **Tools** menu.
7271
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
8079
15. Once flashing is complete, open `Serial Monitor` to monitor the device's status.
8180
16. Notice that the device on the [Devices page](https://cloud4rpi.io/devices) went online and started sending data.
8281
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.
8886

8987
## See Also
9088

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)
95-
- [Documentation Repository](https://github.com/cloud4rpi/docs)
89+
- [Library and Examples for ESP8266 with MicroPython](https://github.com/cloud4rpi/cloud4rpi-esp8266-micropython)
90+
- [Examples for Raspberry Pi](https://github.com/cloud4rpi/cloud4rpi-raspberrypi-python)
91+
- [Examples for Next Thing Co. C.H.I.P.](https://github.com/cloud4rpi/cloud4rpi-chip-python)
92+
- [Examples for Onion Omega2](https://github.com/cloud4rpi/cloud4rpi-omega2-python)
93+
- [Documentation Repository](https://github.com/cloud4rpi/docs)

0 commit comments

Comments
 (0)