ESP32-CAM upgrade CameraWebServer with flash on ESP32 Framework 2.0.4

Home Forums esp32 ESP32-CAM upgrade CameraWebServer with flash on ESP32 Framework 2.0.4

Viewing 29 reply threads
  • Author
    Posts
    • #21991
      rodyeo
      Participant

        Hi! I have been following this blog page link example for a few days now trying to get the generic Example of ESP32 CameraWebServer with Flash from ESP32 Framework 1.0.6 to be ported into current latest ESP32 Framework 2.0.4 to work but failed.

        Blog page link example …

        ESP32-CAM: upgrade CameraWebServer with flash feature – 2

        I came to understand the ESP32 Framework 2.0.4 has changed a lot compare to the old Framework 1.0.6 and it will not work even though there is no compilation errors.

        Attached are two sets of files I dedicated for this ESP32 CameraWebServer Flash Light project for your analysis and troubleshooting on ESP32 Framework 2.0.4 Board Manager Library under Arduino IDE version 1.8.19 software on Windows 10.

        Please take note to use this latest bugs fix repo… from https://github.com/espressif/arduino-esp32/pull/6993
        https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples/Camera/CameraWebServer

        This is the old existing bugs not fix yet repo…
        https://github.com/espressif/arduino-esp32/tree/2.0.4/libraries/ESP32/examples/Camera/CameraWebServer

      • #21993
        rodyeo
        Participant

          I have created a set of batch files to aid in flashing 20 pcs of of Ai-Thinker ESP32-CAM to work on ESP32 Framework 1.0.6 and 2.0.4 for the purposes of easy trouble free batch processing.

        • #21996
          Renzo Mischianti
          Keymaster

            Hi Rodyeo,
            I check the 2.0.4 version of CameraWebServer, and I put on working with these changes.
            In the main CameraWebServer.ino I add these lines.

            
            const int pwmfreq = 50000;     // 50K pwm frequency
            const int pwmresolution = 9;   // duty cycle bit range
            ledcSetup(config.ledc_channel, pwmfreq, pwmresolution);  // configure LED PWM channel
            ledcAttachPin(4, config.ledc_channel);            // attach the GPIO pin to the channel
            

            after the setting of camera_config_t config; structure

            And in the file app_attpd.cpp after the include I add these lines:

            
            //
            // LED Illuminator
            //
            #define CONFIG_LED_ILLUMINATOR_ENABLED
            #define CONFIG_LED_LEDC_PIN 4
            #define CONFIG_LED_MAX_INTENSITY 255
            //#define CONFIG_LED_LEDC_LOW_SPEED_MODE
            // CONFIG_LED_LEDC_HIGH_SPEED_MODE is not set
            #define CONFIG_LED_LEDC_TIMER LEDC_TIMER_0
            #define CONFIG_LED_LEDC_CHANNEL LEDC_CHANNEL_0
            // end of LED Illuminator
            

            I have also attached the modified files.

            Bye Renzo

          • #21999
            rodyeo
            Participant

              I copied the two files you gave and override the sample file I attached earlier in my previous post and this are the compilation error I got…

              This errors looks similar to my previous bug report to Espressif github … Error Compiling… Arduino IDE version 1.8.19 … Board Manager … ESP32 Espressif System version 2.0.4 INSTALLED #6996 https://github.com/espressif/arduino-esp32/issues/6996

              Solution response at GitHub …
              https://github.com/espressif/arduino-esp32/pull/6993

              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp: In function ‘esp_err_t stream_handler(httpd_req_t*)’:
              app_httpd.cpp:782:35: error: ‘ra_filter_run’ was not declared in this scope
              uint32_t avg_frame_time = ra_filter_run(&ra_filter, frame_time);
              ^~~~~~~~~~~~~
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:782:35: note: suggested alternative: ‘ra_filter_t’
              uint32_t avg_frame_time = ra_filter_run(&ra_filter, frame_time);
              ^~~~~~~~~~~~~
              ra_filter_t
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp: In function ‘void startCameraServer()’:
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1225:25: warning: missing initializer for member ‘httpd_uri::is_websocket’ [-Wmissing-field-initializers]
              .user_ctx = NULL};
              ^
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1225:25: warning: missing initializer for member ‘httpd_uri::handle_ws_control_frames’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1225:25: warning: missing initializer for member ‘httpd_uri::supported_subprotocol’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1231:25: warning: missing initializer for member ‘httpd_uri::is_websocket’ [-Wmissing-field-initializers]
              .user_ctx = NULL};
              ^
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1231:25: warning: missing initializer for member ‘httpd_uri::handle_ws_control_frames’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1231:25: warning: missing initializer for member ‘httpd_uri::supported_subprotocol’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1237:25: warning: missing initializer for member ‘httpd_uri::is_websocket’ [-Wmissing-field-initializers]
              .user_ctx = NULL};
              ^
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1237:25: warning: missing initializer for member ‘httpd_uri::handle_ws_control_frames’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1237:25: warning: missing initializer for member ‘httpd_uri::supported_subprotocol’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1243:25: warning: missing initializer for member ‘httpd_uri::is_websocket’ [-Wmissing-field-initializers]
              .user_ctx = NULL};
              ^
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1243:25: warning: missing initializer for member ‘httpd_uri::handle_ws_control_frames’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1243:25: warning: missing initializer for member ‘httpd_uri::supported_subprotocol’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1249:25: warning: missing initializer for member ‘httpd_uri::is_websocket’ [-Wmissing-field-initializers]
              .user_ctx = NULL};
              ^
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1249:25: warning: missing initializer for member ‘httpd_uri::handle_ws_control_frames’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1249:25: warning: missing initializer for member ‘httpd_uri::supported_subprotocol’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1255:25: warning: missing initializer for member ‘httpd_uri::is_websocket’ [-Wmissing-field-initializers]
              .user_ctx = NULL};
              ^
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1255:25: warning: missing initializer for member ‘httpd_uri::handle_ws_control_frames’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1255:25: warning: missing initializer for member ‘httpd_uri::supported_subprotocol’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1261:25: warning: missing initializer for member ‘httpd_uri::is_websocket’ [-Wmissing-field-initializers]
              .user_ctx = NULL};
              ^
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1261:25: warning: missing initializer for member ‘httpd_uri::handle_ws_control_frames’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1261:25: warning: missing initializer for member ‘httpd_uri::supported_subprotocol’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1267:25: warning: missing initializer for member ‘httpd_uri::is_websocket’ [-Wmissing-field-initializers]
              .user_ctx = NULL};
              ^
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1267:25: warning: missing initializer for member ‘httpd_uri::handle_ws_control_frames’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1267:25: warning: missing initializer for member ‘httpd_uri::supported_subprotocol’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1273:25: warning: missing initializer for member ‘httpd_uri::is_websocket’ [-Wmissing-field-initializers]
              .user_ctx = NULL};
              ^
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1273:25: warning: missing initializer for member ‘httpd_uri::handle_ws_control_frames’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1273:25: warning: missing initializer for member ‘httpd_uri::supported_subprotocol’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1279:25: warning: missing initializer for member ‘httpd_uri::is_websocket’ [-Wmissing-field-initializers]
              .user_ctx = NULL};
              ^
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1279:25: warning: missing initializer for member ‘httpd_uri::handle_ws_control_frames’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1279:25: warning: missing initializer for member ‘httpd_uri::supported_subprotocol’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1285:25: warning: missing initializer for member ‘httpd_uri::is_websocket’ [-Wmissing-field-initializers]
              .user_ctx = NULL};
              ^
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1285:25: warning: missing initializer for member ‘httpd_uri::handle_ws_control_frames’ [-Wmissing-field-initializers]
              C:\Users\god\Downloads\esp32_new_camera_web_server\app_httpd.cpp:1285:25: warning: missing initializer for member ‘httpd_uri::supported_subprotocol’ [-Wmissing-field-initializers]
              Multiple libraries were found for “WiFi.h”
              Used: C:\Users\god\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.4\libraries\WiFi
              Not used: C:\Program Files (x86)\Arduino\libraries\WiFi
              Using library WiFi at version 2.0.0 in folder: C:\Users\god\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.4\libraries\WiFi
              exit status 1
              ‘ra_filter_run’ was not declared in this scope

            • #22002
              rodyeo
              Participant

                Here are the error compilation I encountered with the two files you shared. Please advise? Thanks.

                Submitted a bug report to Espressif System version 2.0.4 with sample code at … Examples \ ESP32 \ Camera \ WebCamServer compile error … https://github.com/…/ESP32/examples/Camera/CameraWebServer

                Problem posted at GitHub …
                https://github.com/espressif/arduino-esp32/issues/6996

                Solution response at GitHub …
                https://github.com/espressif/arduino-esp32/pull/6993

              • #22008
                rodyeo
                Participant

                  Hi! I used your inserted your code modification into my CameraWebServer204FlashFailed.zip version I send you earlier with no compilation errors cause I used the latest fix copy from the Espressif Developer … https://github.com/…/ESP32/examples/Camera/CameraWebServer

                • #22013
                  rodyeo
                  Participant

                    Here is the final compiled and uploaded result in the ESP32-CAM with no errors.

                  • #22021
                    rodyeo
                    Participant

                      Yes! Great! Thanks alot! Your new code is working now with the LED Illuminator slider function. It will be nice to also have the Flash toggle switch On / OFF to as a flash light features too if possible similar to Framework version 1.0.6 style?

                    • #22024
                      rodyeo
                      Participant

                        Hi! Renzo your work have help the ESP32 Community closed pending request …

                        ESP32-CAM web ui LED Flash light switch option #7009
                        https://github.com/espressif/arduino-esp32/issues/7009

                        A big thank you my friend Renzo 😉

                        Rodney

                      • #22026
                        rodyeo
                        Participant

                          Hello! Renzo,

                          Your creations also address in another long awaited thread months back…

                          https://github.com/espressif/arduino-esp32/issues/6790

                          A big thank you buddy 🙂

                          You are indeed the GOD of ESP32 programming guru!

                        • #22028
                          rodyeo
                          Participant

                            Bonjour Renzo 😉

                            Finally I hope to see your version 3 of the ESP32 CameraWebServer Flash Light LED Illuminator works publish soon at your blog site … 🙂

                            Rodney

                          • #22029
                            rodyeo
                            Participant

                              I shall wait for your add on Flash Light LED Illuminator Toggle Switch function 😉

                            • #22032
                              Renzo Mischianti
                              Keymaster

                                Thanks to you for helping to find the solution.
                                Bye Renzo

                                • #22034
                                  rodyeo
                                  Participant

                                    I shall help you promote your great works to all my IoT group members globally 😉 Thank you again sir Renzo. I am so happy to have bump into your blog and your great dedication to Open SOurce Community projects. Bravo!

                                • #22035
                                  rodyeo
                                  Participant

                                    Another thread which was pending solution too…

                                    https://github.com/espressif/arduino-esp32/pull/6791

                                    Thanks to you. Sir Renzo their headache is over 😉

                                  • #22037
                                    rodyeo
                                    Participant

                                      Here is a little sequential order documentation of all the changes starting from your contribution modification Sir Renzo … CameraWebServer204FlashNew1.PNG

                                    • #22039
                                      rodyeo
                                      Participant

                                        Here is a little sequential order documentation of all the changes starting from your contribution modification Sir Renzo … CameraWebServer204FlashNew2.PNG

                                      • #22041
                                        rodyeo
                                        Participant

                                          Here is a little sequential order documentation of all the changes starting from your contribution modification Sir Renzo … CameraWebServer204FlashNew3.PNG

                                        • #22043
                                          rodyeo
                                          Participant

                                            Here is a little sequential order documentation of all the changes starting from your contribution modification Sir Renzo … CameraWebServer204FlashNew4.PNG

                                          • #22045
                                            rodyeo
                                            Participant

                                              Here is a little sequential order documentation of all the changes starting from your contribution modification Sir Renzo … CameraWebServer204FlashNew5.PNG

                                            • #22049
                                              rodyeo
                                              Participant

                                                Here is a little sequential order documentation of all the changes starting from your contribution modification Sir Renzo … CameraWebServer204FlashNew7.PNG

                                              • #22051
                                                rodyeo
                                                Participant

                                                  Here is a little sequential order documentation of all the changes starting from your contribution modification Sir Renzo … CameraWebServer204FlashNew60.PNG

                                                • #22054
                                                  rodyeo
                                                  Participant

                                                    This is the said working source code “CameraWebServer204Flash.zip” with the LED Illuminator slider features which activated when Still Image Photo or Video Streaming Video is triggered.

                                                  • #22059
                                                    rodyeo
                                                    Participant

                                                      I decide not to be over demand in request porting version 1.0.6 flash codes into this 2.0.4 LED illuminator source code in respect of the author Renzo creations, therefore this new LED illuminator intensity control slider features is much better than previous LED Flash toggle switch method at older source code implementation. Many thanks to Sir Renzo for all his hard work and effort. Bravo! … CeraWebServer204LEDilluminator.zip

                                                    • #22061
                                                      rodyeo
                                                      Participant

                                                        Signing off… this is Rodney * Ham Radio Operator @ 9W2YJ signing off for now 73 de …

                                                        Hi There! IoT @ https://my.cytron.io/referral?referral_id=b3f22146431542

                                                      • #22074
                                                        rodyeo
                                                        Participant

                                                          A little contribution to the author Renzo @ https://github.com/espressif/arduino-esp32/issues/7009

                                                        • #22076
                                                          rodyeo
                                                          Participant

                                                            I am totally satisfied with final results of the ESP32-CAM CameraWebServer LED Intensity illuminator control function. Thank you Sir Renzo.

                                                          • #22081
                                                            Renzo Mischianti
                                                            Keymaster

                                                              Good work Rodyeo!
                                                              Bye Renzo

                                                            • #22113
                                                              rodyeo
                                                              Participant

                                                                *** Note the default is set to 50K PWM frequency for the LED Flash Light to sync with certain country AC electric supply at 50Hz. I experiences horizontal running lines on the web ui video output screen. My country AC is 60Hz therefore my PWM frequency is supposed to be 60K instead. Correct me if I am wrong?

                                                              • #22115
                                                                Renzo Mischianti
                                                                Keymaster

                                                                  Hi,
                                                                  I think the frequencies is only for the pin PWM and you can use 50K.
                                                                  Bye Renzo

                                                                • #22116
                                                                  rodyeo
                                                                  Participant

                                                                    A shortcut link to the original blog post for visitors …

                                                                    ESP32-CAM: upgrade CameraWebServer with flash feature – 2

                                                                Viewing 29 reply threads
                                                                • You must be logged in to reply to this topic.
                                                                Exit mobile version