79 lines
2.8 KiB
Markdown
79 lines
2.8 KiB
Markdown
|
# HTTP Example
|
||
|
This is nRF24L01 and HTTP gateway application.
|
||
|
```
|
||
|
+-----------+ +-----------+ +-----------+
|
||
|
| | | | | |
|
||
|
|HTTP Client|--(HTTP)-->| ESP32 |--(SPI)--->| nRF24L01 |==(Radio)==>
|
||
|
| | | | | |
|
||
|
+-----------+ +-----------+ +-----------+
|
||
|
|
||
|
+-----------+ +-----------+ +-----------+
|
||
|
| | | | | |
|
||
|
==(Radio)==>| nRF24L01 |--(SPI)--->| ESP32 |--(HTTP)-->|HTTP Server|
|
||
|
| | | | | |
|
||
|
+-----------+ +-----------+ +-----------+
|
||
|
```
|
||
|
|
||
|
|
||
|
|
||
|
# Configuration
|
||
|

|
||
|

|
||
|
|
||
|
## WiFi Setting
|
||
|
|
||
|

|
||
|
|
||
|
|
||
|
## Radioi Setting
|
||
|
|
||
|
### HTTP to Radio
|
||
|
Subscribe with HTTP and send to Radio.
|
||
|
ESP32 acts as HTTP Server.
|
||
|
You can use curl as HTTP Client.
|
||
|
```sh ./http-client.sh```
|
||
|
|
||
|
```
|
||
|
+-----------+ +-----------+ +-----------+
|
||
|
| | | | | |
|
||
|
|HTTP Client|--(HTTP)-->| ESP32 |--(SPI)--->| nRF24L01 |==(Radio)==>
|
||
|
| | | | | |
|
||
|
+-----------+ +-----------+ +-----------+
|
||
|
```
|
||
|
|
||
|

|
||
|
|
||
|
|
||
|
### Radio to HTTP
|
||
|
Receive from Radio and publish as HTTP.
|
||
|
ESP32 acts as HTTP Client.
|
||
|
You can use nc(netcat) as HTTP Server.
|
||
|
```sh ./http-server.sh```
|
||
|
|
||
|
```
|
||
|
+-----------+ +-----------+ +-----------+
|
||
|
| | | | | |
|
||
|
==(Radio)==>| nRF24L01 |--(SPI)--->| ESP32 |--(HTTP)-->|HTTP Server|
|
||
|
| | | | | |
|
||
|
+-----------+ +-----------+ +-----------+
|
||
|
```
|
||
|
|
||
|

|
||
|
|
||
|
|
||
|
|
||
|
### Specifying an HTTP Server
|
||
|
You can specify your HTTP Server in one of the following ways:
|
||
|
- IP address
|
||
|
```192.168.10.20```
|
||
|
- mDNS host name
|
||
|
```http-server.local```
|
||
|
- Fully Qualified Domain Name
|
||
|
```http-server.public.io```
|
||
|
|
||
|
|
||
|
# Communicate with Arduino Environment
|
||
|
Run this sketch.
|
||
|
ArduinoCode\Peer-to-peer\StringTest
|
||
|
|