hoeken / PsychicHttp

Simple + Robust HTTP/S server with websockets for ESP32 based on ESP-IDF http server.
MIT License
124 stars 28 forks source link

Support Arduino Uno R4 WiFi #196

Open jeremiahrose opened 1 week ago

jeremiahrose commented 1 week ago

Looking at the listing for this library, it appears that the Arduino Uno R4 WiFi is not supported?

Are there plans to support this board at all?

jeremiahrose commented 1 week ago

Using the following test sketch in the Arduino IDE:

#include <Arduino.h>
#include <WiFiS3.h>
#include <PsychicHttp.h>

#define WIFI_SSID "TEST_SSID"
#define WIFI_PASSWORD "TEST_PASSWORD"

PsychicHttpServer server;

void setup() {
  Serial.begin(115200);
  connectToWiFi();
  startServer();
}

void loop() {
}

void connectToWiFi() {
  Serial.println("connectToWiFi");
  WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
  waitForConnection();
}

void waitForConnection() {
  Serial.println("waitForConnection");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
  }
  displayConnectionDetails();
}

void displayConnectionDetails() {
  Serial.println("displayConnectionDetails");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP().toString());
}

void startServer() {
  Serial.println("startServer");
  server.listen(80);
  server.on("/ip", [](PsychicRequest *request)
  {
    String output = "Your IP is: " + request->client()->remoteIP().toString();
    return request->reply(output.c_str());
  });
}

Produces the following compiler error:

PsychicCore.h:35:10: fatal error: esp_http_server.h: No such file or directory
 #include <esp_http_server.h>
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
hitecSmartHome commented 1 week ago

Are you using arduino as a component of idf? If you are, enable http server in the menuconfig

hoeken commented 1 week ago

I don't have any plans for that, but I would be happy to accept PRs if people are interested and it's feasible.

On Tue, Oct 29, 2024, 22:54 Jeremiah Rose @.***> wrote:

Looking at the listing https://docs.arduino.cc/libraries/psychichttp/ for this library, it appears that the Arduino Uno R4 WiFi is not supported?

Are there plans to support this board at all?

— Reply to this email directly, view it on GitHub https://github.com/hoeken/PsychicHttp/issues/196, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABEHSTO3IWZONWJFAJPGBLZ6BJ7XAVCNFSM6AAAAABQ3HHY2KVHI2DSMVQWIX3LMV43ASLTON2WKOZSGYZDEOBRGEZTAMI . You are receiving this because you are subscribed to this thread.Message ID: @.***>