2024-05-14 16:11:08 +03:00

2.8 KiB

HTTP Example

This is nRF24L01 and HTTP gateway application.

            +-----------+           +-----------+           +-----------+
            |           |           |           |           |           |
            |HTTP Client|--(HTTP)-->|   ESP32   |--(SPI)--->| nRF24L01  |==(Radio)==>
            |           |           |           |           |           |
            +-----------+           +-----------+           +-----------+

            +-----------+           +-----------+           +-----------+
            |           |           |           |           |           |
==(Radio)==>| nRF24L01  |--(SPI)--->|   ESP32   |--(HTTP)-->|HTTP Server|
            |           |           |           |           |           |
            +-----------+           +-----------+           +-----------+

Configuration

config-top config-app

WiFi Setting

config-wifi

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)==>
            |           |           |           |           |           |
            +-----------+           +-----------+           +-----------+

config-radio-1

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|
            |           |           |           |           |           |
            +-----------+           +-----------+           +-----------+

config-radio-2

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