Engineering and technology notes

Get Started – ESP32 – — ESP-IDF Programming Guide latest documentation

Encountered Issues While Flashing?

If you run the given command and see errors such as “Failed to connect”, there might be several reasons for this. One of the reasons might be issues encountered by esptool.py, the utility that is called by the build system to reset the chip, interact with the ROM bootloader, and flash firmware. One simple solution to try is manual reset described below, and if it does not help you can find more details about possible issues in Troubleshooting.

esptool.py resets ESP32 automatically by asserting DTR and RTS control lines of the USB to serial converter chip, i.e., FTDI or CP210x (for more information, see Establish Serial Connection with ESP32). The DTR and RTS control lines are in turn connected to GPIO0 and CHIP_PU (EN) pins of ESP32, thus changes in the voltage levels of DTR and RTS will boot ESP32 into Firmware Download mode. As an example, check the schematic for the ESP32 DevKitC development board.

In general, you should have no problems with the official esp-idf development boards. However, esptool.py is not able to reset your hardware automatically in the following cases:

  • Your hardware does not have the DTR and RTS lines connected to GPIO0 and CHIP_PU

  • The DTR and RTS lines are configured differently

  • There are no such serial control lines at all

Depending on the kind of hardware you have, it may also be possible to manually put your ESP32 board into Firmware Download mode (reset).

  • For development boards produced by Espressif, this information can be found in the respective getting started guides or user guides. For example, to manually reset an esp-idf development board, hold down the Boot button (GPIO0) and press the EN button (CHIP_PU).

  • For other types of hardware, try pulling GPIO0 down.

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/

Get Started – ESP32 – — ESP-IDF Programming Guide latest documentation was last modified: April 7th, 2021 by Jovan Stosic

Streaming webcam to HTTP using VLC | by Pete Houston | Medium

One of very common task working with webcam is to streaming it to web via HTTP. There are many ways to do it, and I will tell you how to do with VLC.

First is to make sure the webcam is connected and playing well, confirm it by,

$ vlc v4l2:///dev/video0

If you see the webcam playing on VLC, it works fine.

In VLC, to make an output stream, you will need to out –sout option with specified output module. Since we are trying to streaming out to HTTP, we will use std module with access option set to http, along with mpjpeg muxer. So, the command will be,

$ vlc v4l2:///dev/video0 --sout ‘#std{access=http,mux=mpjpeg,dst=IP:PORT}’

To confirm the output stream,

$ vlc http://IP:PORT

Well, up to this point, it just might work well for several cameras, not all. The reason is that default streaming output format from webcam often being YUYV as I mentioned in previous article.

To solve this, we can just apply the transcode module from VLC,

$ vlc v4l2:///dev/video0 --sout ‘#transcode{vcodec=mjpg}:std{access=http,mux=mpjpeg,dst=IP:PORT}’

Try to play the HTTP stream again, it should work. To make the output HTTP stream to be able to be played via web HTML5 video, MIME should be present,

$ vlc v4l2:///dev/video0 --sout ‘#transcode{vcodec=mjpg}:std{access=http{mime=multipart/x-mixed-replace;boundary=-7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=IP:PORT}’

To enable GPU (hardware-acceleration), use the chroma= option as I mentioned before.

$ vlc v4l2:///dev/video0:chroma=mjpg --sout ‘#std{access=http{mime=multipart/x-mixed-replace;boundary=-7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=IP:PORT}’

Have fun 🙂

Code / Design / Love @ https://petehouston.com

Dec 23, 2015

To force hardware-acceleration, which makes use of GPU, while playing or streaming from webcam, we need to add chroma= option to the input device. For example, if I want to force GPU for H264 codec on /dev/video0 device.

$ vlc v4l2:///dev/video0:chroma=h264

The value of chroma option is the codec, or pixelformat, supported by the webcam. So you need to check what output format supported by camera beforehand.


Dec 23, 2015

Streaming connected camera to RTSP using VLC is pretty much easy,

$ vlc v4l2:///dev/video0 --sout ‘#rtp{mux=ts,sdp=rtsp://IP:PORT/cam.sdp}’

Make sure to have camera plugged into the computer or host.

$ vlc rtsp://IP:PORT/cam.sdp

Have fun 🙂

1


Dec 23, 2015

Sometimes, you don’t want to play audio from the input, you can disable it easily via command-line by adding the option –no-audio,

$ vlc video.mp4 — no-audio

Specifically, it is useful for playing from camera, you don’t need sound and want to make an output for streaming, such as RTSP…you will need to add acodec=none to the transcode module.

$ vlc v4l2:///dev/video0 --sout ‘#transcode{acodec=none,vcodec=h264}:rtp{mux=ts,sdp=rtsp://IP:PORT/cam.sdp}’

That’s it, VLC will remove audio stream while streaming.

To view the camera connected to the computer, you can use VLC to play it with V4L2 driver.

$ vlc v4l2://

Since we don’t provide a explicit device name, VLC will look for the first available camera device, which is usually /dev/video0. If there are more connected devices, you should provide the device to play. Check the list of available device by issuing this command,

$ v4l2-ctl --list-devices
HD Pro Webcam C920 (usb-0000:00:1a.0–1.3):
 /dev/video0

and to play,

$ vlc v4l2:///dev/video0

While playing VLC will try to determine which is default supported format of camera, which is usually, YUYV

Read more · 1 min read

v4l-utils is a popular package that helps manipulate and control video device on Linux. Install this package on Debian-based distros is pretty much easy.

$ sudo apt-get update$ sudo apt-get install v4l-utils

After installation, some of v4l2 utilities should be available to use, you can confirm by issuing the following command,

$ v4l2-ctl General/Common options: — all display all information available -C, — get-ctrl=<ctrl>[,<ctrl>…] get the value of the controls [VIDIOC_G_EXT_CTRLS] -c, — set-ctrl=<ctrl>=<val>[,<ctrl>=<val>…] set the value of the controls [VIDIOC_S_EXT_CTRLS] -D, — info show driver info [VIDIOC_QUERYCAP] -d, — device=<dev> use device <dev> instead of /dev/video0 if <dev>…

Source: Streaming webcam to HTTP using VLC | by Pete Houston | Medium

Streaming webcam to HTTP using VLC | by Pete Houston | Medium was last modified: April 4th, 2021 by Jovan Stosic

CHDK quick install Guide 

This guide was based off the canon powershot s100.

It might work for other cameras but,

if it does not work for your camera visit

Prepare your SD card for more help and info.

Step 1

Download and run camera version 1.3 to get camera version.
http://chdk.setepontos.com/index.php?topic=4743.0
(ACID is good too by the way….I have both )

Camera Version 1.3

CameraVersion1.3

ACID

ACID

This one hangs for a bit sometimes

when you try to use it

Step 2

Browse your computer and then Open a picture taken with your

camera with the program to get your camera version number.

Step 3

Locate and download correct CHDK version from:
http://www.mighty-hoernsche.de/trunk/

S100 trunk

Step 4

Unzip the files on your computer.

SD card reader

For the next’ few

steps you need’ an

SD card reader

step 5

make your sd card bootable
(I used EOScard 1.2, can be found here http://pel.hu/getpage.php?ac=2 or here http://pel.hu/down/)

(Press refresh, click on chdk, then hit save, and your done)

EOScard 1.2

Step 6

Place CHDK files on the root of the SD card.

SD card root

Step 7

Lock the card by sliding the small switch and place the SD card in the camera.

SD card Lock switch

Step 8

A.

To start CHDK in play mode:

Press and hold the play button until the CHDK logo appears.

  • while in play mode half press shutter takes you to shooting mode.

B.

To start CHDK in Shooting mode (does not work on all cameras):

Press and hold on/off button until the CHDK logo appears.

  • while in shooting mode press and hold the play button to go to play mode

CHDK LOGO

Source: CHDK quick install Guide | CHDK Wiki | Fandom

CHDK quick install Guide  was last modified: April 2nd, 2021 by Jovan Stosic

Script commands | CHDK Wiki | Fandom

Additional uBASIC and Lua Scripting Commands
get_config_value
set_config_value
get_movie_status
get_video_recording
set_movie_status
get_video_button
get_display_mode
get_propset
get_zoom_steps
get_exp_count
get_drive_mode
get_flash_mode
get_flash_ready
get_IS_mode
get_orientation_sensor
get_min_av96
get_max_av96
get_nd_present
get_nd_value_ev96
get_nd_current_ev96
get_histo_range
shot_histo_enable
autostarted
get_shooting
get_ev
set_ev
get_autostart & set_autostart
get_temperature
select/case function
changed RANDOM command
playsound
print_screen
get_time
get_mode
get_quality
get_resolution
set_quality
set_resolution
get_platform_id
set_backlight()
set_lcd_display()
set_draw_title_line
get_draw_title_line
get_sd_over_modes
set_aflock
set_mf
set_aelock
set_record(state)
set_capture_mode_canon(value)
set_capture_mode(modenum)
is_capture_mode_valid(modenum)
get_capture_mode
set_console_layout
set_console_autoredraw
console_redraw
reboot([file])
restore
set_exit_key
set_yield
get_curve_file
set_curve_file
get_curve_state
set_curve_state
get_focus_mode
get_focus_state
get_focus_ok
get_focal_length
get_min_stack_dist
set_file_attributes
get_partitionInfo
swap_partitions
get_buildinfo
get_dofinfo
get_video_details
textbox
get_raw_support
get_digic
set_clock
set_focus_interlock_bypass
APEX96 Conversion Functions
iso_to_sv96
sv96_to_iso
iso_real_to_market
iso_market_to_real
sv96_real_to_market
sv96_market_to_real
aperture_to_av96
av96_to_aperture
usec_to_tv96
tv96_to_usec
seconds_to_tv96
APEX96 Example Lua Script
Live View Exposure Functions
get_imager_active
get_current_tv96
get_current_av96

Source: Script commands | CHDK Wiki | Fandom

Script commands | CHDK Wiki | Fandom was last modified: April 2nd, 2021 by Jovan Stosic