Skip to content

Commit

Permalink
Merge branch 'main' into add-connect-handler
Browse files Browse the repository at this point in the history
  • Loading branch information
csenet committed Nov 21, 2023
2 parents 9250171 + 64ee02b commit c2ff66c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
4 changes: 2 additions & 2 deletions backend/state-manager/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func main() {
"version": version,
"commit": commit,
},
LogLevel: slog.LevelInfo,
LogLevel: slog.LevelDebug,
},
),
),
Expand Down Expand Up @@ -166,7 +166,7 @@ func main() {
return ctx.Err()
}
})
//go operation.Handler()
// go operation.Handler()
eg.Go(func() error {
slog.Default().Info("start mqtt handler")
err := mqttHandler.Start(ctx)
Expand Down
14 changes: 11 additions & 3 deletions hardware/esp32-cam-udp/platformio.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
[env:main]
[platformio]
default_envs=xiao_esp32s3

[env]
platform=espressif32
framework=arduino
board=esp32cam
; board_build.filesystem=littlefs
; targets=upload
targets=upload
lib_deps=
esp32-camera
; https://github.com/dvarrel/AsyncTCP.git
; https://github.com/dvarrel/ESPAsyncWebSrv.git


[env:esp_eye]
board=esp32cam

[env:xiao_esp32s3]
board=seeed_xiao_esp32s3
17 changes: 12 additions & 5 deletions hardware/esp32-cam-udp/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ uint8_t t=0;

static camera_config_t cam_cfg={// https://github.com/espressif/esp-who/blob/master/docs/en/Camera_connections.md
.pin_pwdn=-1,.pin_reset=-1,

#ifdef ARDUINO_XIAO_ESP32S3
.pin_xclk=10,.pin_sccb_sda=40,.pin_sccb_scl=39,

.pin_d7=48,.pin_d6=11,.pin_d5=12,.pin_d4=14,.pin_d3=16,.pin_d2=18,.pin_d1=17,.pin_d0=15,
.pin_vsync=38,.pin_href=47,.pin_pclk=13,
#else
.pin_xclk=4,.pin_sccb_sda=18,.pin_sccb_scl=23,

.pin_d7=36,.pin_d6=37,.pin_d5=38,.pin_d4=39,.pin_d3=35,.pin_d2=14,.pin_d1=13,.pin_d0=34,
.pin_vsync=5,.pin_href=27,.pin_pclk=25,
#endif

.xclk_freq_hz=20000000,//EXPERIMENTAL: Set to 16MHz on ESP32-S2 or ESP32-S3 to enable EDMA mode
.ledc_timer=LEDC_TIMER_0,.ledc_channel=LEDC_CHANNEL_0,
Expand All @@ -31,21 +39,20 @@ static camera_config_t cam_cfg={// https://github.com/espressif/esp-who/blob/mas
};

void setup(){
psramInit();pinMode(21,OUTPUT);pinMode(22,OUTPUT);
psramInit();pinMode(21,OUTPUT);digitalWrite(21,HIGH);delay(200);digitalWrite(21,LOW);

WiFi.begin();
for(uint8_t i=0;WiFi.status()!=WL_CONNECTED;i++){
if(i>20){
digitalWrite(21,HIGH);
WiFi.beginSmartConfig();while(!WiFi.smartConfigDone());

WiFi.beginSmartConfig();while(!WiFi.smartConfigDone()){delay(200);digitalWrite(21,HIGH);delay(200);digitalWrite(21,LOW);};
}
delay(500);
}
MDNS.begin("udp-cam");
host=MDNS.queryHost(HOST);
digitalWrite(21,LOW);
esp_camera_init(&cam_cfg);
digitalWrite(22,HIGH);
digitalWrite(21,HIGH);
}

void loop(){
Expand Down

0 comments on commit c2ff66c

Please sign in to comment.