Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Latest commit

 

History

History
227 lines (142 loc) · 8.86 KB

README.md

File metadata and controls

227 lines (142 loc) · 8.86 KB

AsyncTCP_RP2040W

arduino-library-badge GitHub release contributions welcome GitHub issues

Donate to my libraries using BuyMeACoffee



Table of contents



Why do we need this AsyncTCP_RP2040W library

Features

This library is based on, modified from:

  1. Hristo Gochkov's ESPAsyncTCP

to apply the better and faster asynchronous feature of the powerful ESPAsyncTCP Library into RASPBERRY_PI_PICO_W with CYW43439 WiFi, and will be the base for future and more advanced Async libraries, such as AsyncWebServer_RP2040W, AsyncHTTPRequest_RP2040W, AsyncHTTPSRequest_RP2040W

Why Async is better

  • Using asynchronous network means that you can handle more than one connection at the same time
  • You are called once the request is ready and parsed
  • When you send the response, you are immediately ready to handle other connections while the server is taking care of sending the response in the background
  • Speed is OMG
  • Easy to use API, HTTP Basic and Digest MD5 Authentication (default), ChunkedResponse
  • Easily extensible to handle any type of content
  • Supports Continue 100
  • Async WebSocket plugin offering different locations without extra servers or ports
  • Async EventSource (Server-Sent Events) plugin to send events to the browser
  • URL Rewrite plugin for conditional and permanent url rewrites
  • ServeStatic plugin that supports cache, Last-Modified, default index and more
  • Simple template processing engine to handle templates

Currently supported Boards

  1. RASPBERRY_PI_PICO_W with CYW43439 WiFi using arduino-pico core v2.4.0+


Prerequisites

  1. Arduino IDE 1.8.19+ for Arduino. GitHub release
  2. Earle Philhower's arduino-pico core v2.4.0+ for RASPBERRY_PI_PICO_W with CYW43439 WiFi, etc. GitHub release


Installation

Use Arduino Library Manager

The best and easiest way is to use Arduino Library Manager. Search for AsyncTCP_RP2040W, then select / install the latest version. You can also use this link arduino-library-badge for more detailed instructions.

Manual Install

Another way to install is to:

  1. Navigate to AsyncTCP_RP2040W page.
  2. Download the latest release AsyncTCP_RP2040W-master.zip.
  3. Extract the zip file to AsyncTCP_RP2040W-master directory
  4. Copy whole AsyncTCP_RP2040W-master folder to Arduino libraries' directory such as ~/Arduino/libraries/.

VS Code & PlatformIO

  1. Install VS Code
  2. Install PlatformIO
  3. Install AsyncTCP_RP2040W library by using Library Manager. Search for AsyncTCP_RP2040W in Platform.io Author's Libraries
  4. Use included platformio.ini file from examples to ensure that all dependent libraries will installed automatically. Please visit documentation for the other options and examples at Project Configuration File


Orignal documentation

For ESP32, check AsyncTCP Library

Join the ESPAsyncWebServer chat Join the chat at https://gitter.im/me-no-dev/ESPAsyncWebServer

This is a fully asynchronous TCP library, aimed at enabling trouble-free, multi-connection network environment for Espressif's ESP8266 MCUs.

AsyncClient and AsyncServer

The base classes on which everything else is built. They expose all possible scenarios, but are really raw and require more skills to use.

AsyncPrinter

This class can be used to send data like any other Print interface (Serial for example).

The object then can be used outside of the Async callbacks (the loop) and receive asynchronously data using onData. The object can be checked if the underlying AsyncClientis connected, or hook to the onDisconnect callback.

AsyncTCPbuffer

This class is really similar to the AsyncPrinter, but it can buffer some of the incoming data.

SyncClient

It is exactly what it sounds like. This is a standard, synchronous blocking TCP Client you're used to.



Debug

Debug is enabled by default on Serial.

You can also change the debugging level _ASYNCTCP_RP2040W_LOGLEVEL_ from 0 to 4 in the library cpp files

#define _ASYNCTCP_RP2040W_LOGLEVEL_     1

Troubleshooting

If you get compilation errors, more often than not, you may need to install a newer version of the core for Arduino boards.

Sometimes, the library will only work if you update the board core to the latest version because I am using newly added functions.



Issues

Submit issues to: AsyncTCP_RP2040W issues


TO DO

  1. Search for bug and improvement.

DONE

  1. RASPBERRY_PI_PICO_W with CYW43439 WiFi


Contributions and Thanks

Many thanks for everyone for bug reporting, new feature suggesting, testing and contributing to the development of this library.


Contributions and Thanks

  1. Based on and modified from Hristo Gochkov's ESPAsyncTCP. Many thanks to Hristo Gochkov for great ESPAsyncTCP Library
me-no-dev
⭐️⭐️ Hristo Gochkov


Contributing

If you want to contribute to this project:

  • Report bugs and errors
  • Ask for enhancements
  • Create issues and pull requests
  • Tell other people about this library


License

  • The library is licensed under GPLv3

Copyright

Copyright 2022- Khoi Hoang