Skip to content

Commit

Permalink
- Added setAutoReboot Documentation
Browse files Browse the repository at this point in the history
- Updated Async Mode Documentation
- Removed "Next" from navbar
  • Loading branch information
ayushsharma82 committed Oct 19, 2023
1 parent 883090f commit 742d2a7
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 6 deletions.
17 changes: 16 additions & 1 deletion docs/async-mode.md
Expand Up @@ -4,13 +4,16 @@ sidebar_label: Async Mode
sidebar_position: 7
---

> NOTE: Async Mode is supported for ESP8266 & ESP32 microcontrollers only
## Introduction

One of the features of ElegantOTA is the async mode, which provides asynchronous web server functionality for handling OTA updates. This mode should only be enabled if you are using ESPAsyncWebServer library in your project/firmware.


## Enabling Async Mode

To enable async mode for ElegantOTA, follow these steps:
### For Arduino IDE:

1. Locate the `ELEGANTOTA_USE_ASYNC_WEBSERVER` macro in the `ElegantOTA.h` file, and set it to `1`:

Expand All @@ -22,6 +25,18 @@ To enable async mode for ElegantOTA, follow these steps:
3. You are now ready to use ElegantOTA in async mode for your OTA updates, utilizing the ESPAsyncWebServer library.
### For PlatformIO:
If you use PlatformIO then we can use a neat trick! You can set `build_flags` in your `platformio.ini` file that enables Async Mode of ElegantOTA.
1. Open `platformio.ini` file of your project
2. Paste this line `build_flags=-DELEGANTOTA_USE_ASYNC_WEBSERVER=1` at bottom
3. Done!
PlatformIO will now compile ElegantOTA in Async Mode!
## Benefits of Async Mode
Enabling async mode for ElegantOTA offers several advantages:
Expand Down
34 changes: 34 additions & 0 deletions docs/autoreboot.md
@@ -0,0 +1,34 @@
---
title: Auto Reboot
sidebar_label: Auto Reboot
sidebar_position: 6
---

## Introduction

Often there comes a situation where you don't want to reboot automatically. In these cases, you can use the `setAutoReboot` function which will enable/disable automatic reboot of your microcontroller after a successful OTA update.

## Setting Auto Reboot

You can set up auto reboot for your device using the `ElegantOTA.setAutoReboot(false);` function. This functions takes `true` or `false` to enable / disable automatic reboot. You can use this function anywhere in your code.

### Example Usage

```cpp
#include <ElegantOTA.h>

void setup() {
// Initialize your hardware and other configurations here

// Disable Auto Reboot
ElegantOTA.setAutoReboot(false);

// Additional setup code
}

void loop() {
// Your main loop code here
}
```

In the above example, the `ElegantOTA.setAutoReboot(false);` function call disables automatic reboot.
6 changes: 1 addition & 5 deletions docusaurus.config.js
Expand Up @@ -39,6 +39,7 @@ const config = {
anonymizeIP: true,
},
docs: {
disableVersioning: true,
routeBasePath: '/',
sidebarPath: require.resolve('./sidebars.js'),
},
Expand Down Expand Up @@ -78,11 +79,6 @@ const config = {
// label: 'Docs',
// },
// {to: '/blog', label: 'Blog', position: 'left'},
{
type: 'docsVersionDropdown',
position: 'right',
dropdownActiveClassDisabled: true,
},
{
href: "https://github.com/ayushsharma82/ElegantOTA/",
position: "right",
Expand Down

0 comments on commit 742d2a7

Please sign in to comment.