remibert / pycameresp

Motion detection with image notification for Esp32CAM and Esp32 flasher with GUI based on esptool.py.
Other
73 stars 21 forks source link

cam support for Freenove ESP32-Wrover and clones ESP32-Wrover-Dev #9

Open jenswes opened 12 months ago

jenswes commented 12 months ago

Hello,

thanks for this nice project, i'm trying to bring it to run :-)

rzeldent Rene 's nice esp32cam-rtsp and maxgerhardt 's pio-esp32cam have some more esp32cam versions supported by looking into the following configs,

https://github.com/rzeldent/esp32cam-rtsp/blob/develop/include/lookup_camera_config.h
https://github.com/maxgerhardt/pio-esp32cam/blob/main/src/camera_pins.h

i would guess the following could support my cam: The board is some clone of Freenove ESP32-Wrover CAM Board (i think, it looks like)

    # wrover dev camera device
        video.video.Camera.gpio_config(
            pin_pwdn=-1, pin_reset=-1, pin_xclk=21, pin_sscb_sda=26, pin_sscb_scl=27,
            pin_d7=35, pin_d6=34, pin_d5=39, pin_d4=36,
            pin_d3=19,  pin_d2=18, pin_d1=5, pin_d0=4,
            pin_vsync=25, pin_href=23, pin_pclk=22, xclk_freq_hz=20000000, ledc_timer=0,
            ledc_channel=0 , pixel_format=3, frame_size=13, jpeg_quality=0, fb_count=2, flash_led=14)
        tools.sdcard.SdCard.set_slot(slot=None) # No sdcard available
jenswes commented 12 months ago

Hi, Yes, the settings above are working :-) I did some ugly quick hack to pycameresp.py

        if video.video.Camera.is_activated():
            import tools.sdcard                                                                                                                  
            if True:
                if True:
                    # ESP32ONE device
                    #video.video.Camera.gpio_config(
                    #   pin_pwdn=32, pin_reset=-1, pin_xclk=4, pin_sscb_sda=18, pin_sscb_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, xclk_freq_hz=20000000,
                    #   ledc_timer=0, ledc_channel=0, pixel_format=3, frame_size=13, jpeg_quality=12, fb_count=1, flash_led=0)
                    #tools.sdcard.SdCard.set_slot(slot=None) # The slot is good but not working I don't know why
                # wrover dev camera device
                    video.video.Camera.gpio_config(
                        pin_pwdn=-1, pin_reset=-1, pin_xclk=21, pin_sscb_sda=26, pin_sscb_scl=27,
                        pin_d7=35, pin_d6=34, pin_d5=39, pin_d4=36,
                        pin_d3=19,  pin_d2=18, pin_d1=5, pin_d0=4,
                        pin_vsync=25, pin_href=23, pin_pclk=22, xclk_freq_hz=20000000, ledc_timer=0,
                        ledc_channel=0 , pixel_format=3, frame_size=13, jpeg_quality=0, fb_count=2, flash_led=14)
                    tools.sdcard.SdCard.set_slot(slot=None) # No sdcard available
                elif features.device == "M5CAMERA-B":
                    # M5CAMERA-B device

and after installing ESP32CAM-firmware.bin instead of GENERIC_SPIRAM-firmware.bin my cam appears.

remibert commented 12 months ago

In fact the esp32cam firmware was historically created for the esp32cam, and in the meantime I added other cameras. The generic spiram one does not have the camera module and does not reserve memory space for the camera.

Are you having wifi difficulties with your freenove cam? .

I suffered with this module, the video streaming only worked very poorly, I had to unsolder all the connectors, without much success, and I managed to make it work when I soldered a socket and moved the small resistance, to connect an external antenna, since then it works perfectly, but it was very careful to do.

jenswes commented 11 months ago

I had trouble with my modules running https://github.com/rzeldent/esp32cam-rtsp

so i checked against your project :-) well, i'm impressed how stable and fast µPython is. No, my wlan is good to very good, but i've many other issues caused by the wroover-dev clone hardware. best is avoid getting them.

i'm afraid the soldering is just bad...

Since 10 hours my modul is up running a 640x480 stream

remibert commented 11 months ago

well, i'm impressed how stable and fast µPython is. The reason is that the µPython code is in the firmware, and I not use python string but bytes for the speed.

picture is disturbed by random horizontal lines Probably the camera, I had the same problem, and I changed just camera the problem has been solved.

Since 10 hours my modul is up running a 640x480 stream The max uptime of pycameresp is 120 days, I didn't push further because I wanted to install new firmware. Normally pycameresp detects camera and wifi problems, and if they occur too frequently it forces a reboot, because over the years I have managed to correct the problems without having to reboot. I have a camera that runs constantly outside in all weathers in direct sunlight in temperatures of 45 degrees (esp32cam) since january 2019, and I am always amazed that the hardware still works. Have fun, and if you have the opportunity don't hesitate to publicize the project. Best regards

pdjm commented 11 months ago

Hi Thank you for pycameresp, using it for some time in esp32cam. I recently purchased a Seeed Studio XIAO ESP32S3 Sense, i don't know how to make picameraresp work with it, can you add it please? Thank you

remibert commented 11 months ago

Hi,

I don't have this board, so I have no way to verify that this works, it will be up to you to do so.

The closest firmware is https://github.com/remibert/pycameresp/releases/download/V19/FREENOVE_CAM_S3-SPIRAM_OCT-firmware.bin. There should normally be no need to rebuild a firmware, however you need to change the contents of main.py and pycameresp.py in the board.

I got the camera pinout from this site https://files.seeedstudio.com/wiki/SeeedStudio-XIAO-ESP32S3/res/XIAO_ESP32S3_ExpBoard_v1.0_SCH.pdf In the other hand, I didn't understand how the SD card was wired it needs to improve.

In the main.py change the device name by : device = "Seeed Studio XIAO ESP32S3 Sense",  And change the content of pycameresp.py by this file : 

The modification in pycameresp.py is : if features.device == "Seeed Studio XIAO ESP32S3 Sense":

Seeed Studio XIAO ESP32S3 Sense

                video.video.Camera.gpio_config(
                    pin_pwdn=-1, # ?
                    pin_reset=-1,
                    pin_xclk=10,
                    pin_sscb_sda=40,
                    pin_sscb_scl=39,
                    pin_d7=48, #Y9
                    pin_d6=11, #Y8
                    pin_d5=12, #Y7
                    pin_d4=14, #Y6
                    pin_d3=16, #Y5
                    pin_d2=18, #Y4
                    pin_d1=17, #Y3
                    pin_d0=15, #Y2
                    pin_vsync=38,
                    pin_href=47,
                    pin_pclk=13,
                    xclk_freq_hz=20000000,
                    ledc_timer=0,
                    ledc_channel=0,
                    pixel_format=3,
                    frame_size=13,
                    jpeg_quality=0,
                    fb_count=1,
                    flash_led=0)
                tools.sdcard.SdCard.set_slot(slot=None) # <- To do...

I don't have the ability to test, so I can't promise it will work.

Best regards.

Le 21 oct. 2023 à 03:28, pdjm @.***> a écrit :

Hi Thank you for pycameresp, using it for some time in esp32cam. I recently purchased a Seeed Studio XIAO ESP32S3 Sense, i don't know how to make picameraresp work with it, can you add it please? Thank you

— Reply to this email directly, view it on GitHub https://github.com/remibert/pycameresp/issues/9#issuecomment-1773587696, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP3HE2ET47C7PHQKZKYA5FDYAMQMXAVCNFSM6AAAAAA5X3P6UOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZTGU4DONRZGY. You are receiving this because you commented.