robotzero1 / esp32cam-timelapse

Create timelapse images using the ESP32-CAM and other ESP32 based camera modules
58 stars 15 forks source link

WIFI #1

Closed maba64 closed 4 years ago

maba64 commented 4 years ago

Hello thanks a lot for the code

there is a possibility to use the code even without WIFI (Outdoor) ev as acces point

Best Regards

Markus

error7404 commented 4 years ago

Hello I don't know if this is going to help you but https://youtu.be/Sb08leLWOgA?t=206

include

include

include

define AP_SSID "The_name_of_the_AP"

define AP_PASS "The_password" //need to be 8 caracter long

WebServer server(80);

void handleCapture(){ auto img = esp32cam::capture(); if (img == nullptr){ server.send(500, "", ""); return; } server.setContentLength(img->size()); server.send(200, "image/jpeg"); WiFiClient client = server.client(); img->writeTo(client); }

void setup() { auto res = esp32cam::Resolution::find(1024, 768); esp32cam::Config cfg; cfg.setPins(esp32cam::pins::AiThinker); cfg.setResolution(res); cfg.setJpeg(80); esp32cam::Camera.begin(cfg); WiFi.softAP(AP_SSID, AP_PASS); server.on("/capture.jpg", handleCapture); server.begin(); }

void loop() { server.handleClient(); }