Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTSP UDP Streaming issues #5

Closed
j-broyles opened this issue Jan 5, 2020 · 11 comments
Closed

RTSP UDP Streaming issues #5

j-broyles opened this issue Jan 5, 2020 · 11 comments

Comments

@j-broyles
Copy link

j-broyles commented Jan 5, 2020

Excellent project! I'm inexperienced with PlatformIO, but have used Arduino IDE for some time. Was finally able to get the bin file made & uploaded. See the attached txt file for my issues.

rtsp.txt
Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@rzeldent
Copy link
Owner

rzeldent commented Jan 5, 2020

Put contents of file in bug so easier to see.

Relative fresh install of VS & Platform.IO - only loaded a couple of instances of Tasmota & tried to compile, and did not know how.

Started VS
Extracted folder from ZIP to desktop
Dragged folder into project workspace
Answered make folder a project
Clicked Platformio.Build

Executing task in folder esp32cam-ready-master: C:\Users\temp.platformio\penv\Scripts\platformio.exe run <

Processing esp32cam (platform: espressif32; board: esp32cam; framework: arduino)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32cam.html
PLATFORM: Espressif 32 1.11.1 > AI Thinker ESP32-CAM
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: toolchain-xtensa32 2.50200.80 (5.2.0), tool-openocd-esp32 1.1000.20190708 (10.0), framework-arduinoespressif32 2.10004.191002 (1.0.4), tool-esptoolpy 1.20600.0 (2.6.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- 0.1.6
| |-- 1.0
|-- 1.1.0
| |-- 1.0
|--
| |-- 1.1.0
| | |-- 1.0
| |-- 1.0
| | |-- 1.0
| | |-- 1.0
| |-- 1.0
|-- 1.0
| |-- 1.0
|-- 0.0.0
| |-- 1.0
| |-- 0.1.6
| | |-- 1.0
| |-- 1.0
| | |-- 1.0
|-- 1.0
| |-- 1.0
| |-- 1.0
Building in release mode
Compiling .pio\build\esp32cam\src\espcam_webserver.cpp.o
Compiling .pio\build\esp32cam\src\main.cpp.o
Generating partitions .pio\build\esp32cam\partitions.bin
Compiling .pio\build\esp32cam\libe64\WiFi\ETH.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFi.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFiAP.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFiClient.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFiGeneric.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFiMulti.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFiSTA.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFiScan.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFiServer.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFiUdp.cpp.o
Archiving .pio\build\esp32cam\libe64\libWiFi.a
Compiling .pio\build\esp32cam\lib89a\Micro-RTSP_ID6071\CRtspSession.cpp.o
Compiling .pio\build\esp32cam\lib89a\Micro-RTSP_ID6071\CStreamer.cpp.o
Compiling .pio\build\esp32cam\lib89a\Micro-RTSP_ID6071\JPEGSamples.cpp.o
Compiling .pio\build\esp32cam\lib89a\Micro-RTSP_ID6071\OV2640.cpp.o
Compiling .pio\build\esp32cam\lib89a\Micro-RTSP_ID6071\OV2640Streamer.cpp.o
Compiling .pio\build\esp32cam\lib89a\Micro-RTSP_ID6071\SimStreamer.cpp.o
Archiving .pio\build\esp32cam\lib89a\libMicro-RTSP_ID6071.a
Compiling .pio\build\esp32cam\lib8df\DNSServer\DNSServer.cpp.o
Archiving .pio\build\esp32cam\lib8df\libDNSServer.a
Compiling .pio\build\esp32cam\libc93\FS\FS.cpp.o
Compiling .pio\build\esp32cam\libc93\FS\vfs_api.cpp.o
Archiving .pio\build\esp32cam\libc93\libFS.a
Compiling .pio\build\esp32cam\lib2be\WebServer\Parsing.cpp.o
Compiling .pio\build\esp32cam\lib2be\WebServer\WebServer.cpp.o
Compiling .pio\build\esp32cam\lib2be\WebServer\detail\mimetable.cpp.o
Archiving .pio\build\esp32cam\lib2be\libWebServer.a
Compiling .pio\build\esp32cam\lib5dc\WifiProvisioning\wifi_provisioning.cpp.o
Archiving .pio\build\esp32cam\lib5dc\libWifiProvisioning.a
Compiling .pio\build\esp32cam\lib257\ESPmDNS\ESPmDNS.cpp.o
Archiving .pio\build\esp32cam\lib257\libESPmDNS.a
Compiling .pio\build\esp32cam\lib3c6\RtspServer\rtsp_server.cpp.o
Archiving .pio\build\esp32cam\lib3c6\libRtspServer.a
Archiving .pio\build\esp32cam\libFrameworkArduinoVariant.a
Compiling .pio\build\esp32cam\FrameworkArduino\Esp.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\FunctionalInterrupt.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\IPAddress.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\IPv6Address.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\MD5Builder.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\Print.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\Stream.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\StreamString.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\WString.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\base64.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\cbuf.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-adc.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-bt.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-cpu.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-dac.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-gpio.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-i2c.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-ledc.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-matrix.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-misc.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-psram.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-rmt.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-sigmadelta.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-spi.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-time.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-timer.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-touch.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-uart.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\libb64\cdecode.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\libb64\cencode.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\main.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\stdlib_noniso.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\wiring_pulse.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\wiring_shift.c.o
Archiving .pio\build\esp32cam\libFrameworkArduino.a
Linking .pio\build\esp32cam\firmware.elf
Building .pio\build\esp32cam\firmware.bin
esptool.py v2.6
Retrieving maximum program size .pio\build\esp32cam\firmware.elf
Checking size .pio\build\esp32cam\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
DATA: [== ] 22.5% (used 73840 bytes from 327680 bytes)
PROGRAM: [=== ] 28.8% (used 906418 bytes from 3145728 bytes)
========================= [SUCCESS] Took 358.68 seconds =========================

Terminal will be reused by tasks, press any key to close it.

Connected ESP32-CAM to CH340 & connected to USB.
Jumpered GPIO0 to GND
Changed platformio.ini
upload_protocol = esptool
Clicked platformio.upload

Executing task in folder esp32cam-ready-master: C:\Users\temp.platformio\penv\Scripts\platformio.exe run --target upload <

Processing esp32cam (platform: espressif32; board: esp32cam; framework: arduino)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32cam.html
PLATFORM: Espressif 32 1.11.1 > AI Thinker ESP32-CAM
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: toolchain-xtensa32 2.50200.80 (5.2.0), tool-openocd-esp32 1.1000.20190708 (10.0), tool-mkspiffs 2.230.0 (2.30), framework-arduinoespressif32 2.10004.191002 (1.0.4), tool-esptoolpy 1.20600.0 (2.6.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- 0.1.6
| |-- 1.0
|-- 1.1.0
| |-- 1.0
|--
| |-- 1.1.0
| | |-- 1.0
| |-- 1.0
| | |-- 1.0
| | |-- 1.0
| |-- 1.0
|-- 1.0
| |-- 1.0
|-- 0.0.0
| |-- 1.0
| |-- 0.1.6
| | |-- 1.0
| |-- 1.0
| | |-- 1.0
|-- 1.0
| |-- 1.0
| |-- 1.0
Building in release mode
Retrieving maximum program size .pio\build\esp32cam\firmware.elf
Checking size .pio\build\esp32cam\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
DATA: [== ] 22.5% (used 73840 bytes from 327680 bytes)
PROGRAM: [=== ] 28.8% (used 906418 bytes from 3145728 bytes)
Configuring upload protocol...
AVAILABLE: esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: COM3
Uploading .pio\build\esp32cam\firmware.bin
esptool.py v2.6
Serial port COM3
Connecting.....
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: 24:6f:28:16:f0:3c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 15856 bytes to 10276...
Wrote 15856 bytes (10276 compressed) at 0x00001000 in 0.2 seconds (effective 511.5 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 119...
Wrote 3072 bytes (119 compressed) at 0x00008000 in 0.0 seconds (effective 1228.8 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 3449.3 kbit/s)...
Hash of data verified.
Compressed 906528 bytes to 494758...
Wrote 906528 bytes (494758 compressed) at 0x00010000 in 12.2 seconds (effective 596.5 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
========================= [SUCCESS] Took 30.05 seconds =========================

Terminal will be reused by tasks, press any key to close it.

remove GPIO0 jumper
open serial terminal
reset esp32-cam

Executing task in folder esp32cam-ready-master: C:\Users\temp.platformio\penv\Scripts\platformio.exe device monitor <

--- Miniterm on COM3 115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5816
entry 0x400806ac
[I][main.cpp:31] setup(): Starting ESP32Cam...
[I][main.cpp:36] setup(): Instance_name: esp32cam-3cf016286f24
[I][main.cpp:38] setup(): Connecting...
I (1447) wifi: wifi driver task: 3ffb5a20, prio:23, stack:3584, core=0
I (3035) wifi: wifi firmware version: 7997e4b
I (3035) wifi: config NVS flash: enabled
I (3035) wifi: config nano formating: disabled
I (3036) wifi: Init dynamic tx buffer num: 32
I (3040) wifi: Init data frame dynamic rx buffer num: 32
I (3045) wifi: Init management frame dynamic rx buffer num: 32
I (3051) wifi: Init management short buffer num: 32
I (3056) wifi: Init static rx buffer size: 1600
I (3060) wifi: Init static rx buffer num: 16
I (3064) wifi: Init dynamic rx buffer num: 32
I (3136) wifi: mode : sta (24:6f:28:16:f0:3c)
[I][wifi_provisioning.cpp:17] connect(): Connecting... Retries left: 1
I (3260) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (3261) wifi: state: init -> auth (b0)
I (3265) wifi: state: auth -> assoc (0)
I (3271) wifi: state: assoc -> run (10)
I (3490) wifi: connected with ATT696, channel 1, BW20
I (3495) wifi: pm start, type: 1

[I][wifi_provisioning.cpp:21] connect(): Connection result: 3
[I][main.cpp:53] setup(): Connected! IP address:192.168.10.28
[I][main.cpp:55] setup(): Starting servers...
[I][espcam_webserver.cpp:19] begin(): Starting rtsp_server
[I][rtsp_server.cpp:20] begin(): Starting rtsp server
[E][ESPmDNS.cpp:148] addService(): Failed adding service rtsp.tcp.

[I][espcam_webserver.cpp:22] begin(): Starting web server
[E][WebServer.cpp:617] _handleRequest(): request handler not found
[I][espcam_webserver.cpp:39] handle_root(): handle_root
[E][WebServer.cpp:617] _handleRequest(): request handler not found
[I][espcam_webserver.cpp:39] handle_root(): handle_root

connected with web browser (wifi credentials retained from previous flashing with micro-rtsp, reset config works)

ESP32CAM
rtsp stream available at: rtsp://esp32cam-3cf016286f24.local:554/mjpeg/1
Options
Single frame
Stream frames
Light on
Light off
Reset configuration and restart

Issue 1: number following device name in URL is mac address with octets in reverse order. MAC of this device is 24:6f:28:16:f0:3c - Can it be made to use the MAC correctly?

Serial monitor:
[I][espcam_webserver.cpp:102] handle_jpg(): handle_jpg
[E][WebServer.cpp:617] _handleRequest(): request handler not found
[I][espcam_webserver.cpp:39] handle_root(): handle_root
[E][WebServer.cpp:617] _handleRequest(): request handler not found
[I][espcam_webserver.cpp:39] handle_root(): handle_root
[I][espcam_webserver.cpp:116] handle_light_on(): handle_light_on
[E][WebServer.cpp:617] _handleRequest(): request handler not found
[I][espcam_webserver.cpp:39] handle_root(): handle_root
[E][WebServer.cpp:617] _handleRequest(): request handler not found
[I][espcam_webserver.cpp:39] handle_root(): handle_root
[I][espcam_webserver.cpp:126] handle_light_off(): handle_light_off
[E][WebServer.cpp:617] _handleRequest(): request handler not found
[I][espcam_webserver.cpp:39] handle_root(): handle_root
[E][WebServer.cpp:617] _handleRequest(): request handler not found
[I][espcam_webserver.cpp:39] handle_root(): handle_root

Each option of web page works correctly, but monitor logs error after each is completed.

Using VLC, streaming url opened

Serial monitor:
Creating TSP streamer
Created streamer width=800, height=600
Creating RTSP session
RTSP received OPTIONS
RTSP received DESCRIBE
client has closed the socket
client closed socket, exiting
closing UDP socket
closing UDP socket
closing TCP socket
Creating TSP streamer
Created streamer width=800, height=600
Creating RTSP session
RTSP received SETUP
RTSP received PLAY
RTSP received OPTIONS
RTSP received OPTIONS
RTSP received OPTIONS

No display in VLC

Serial monitor - line repeated every few minutes:
RTSP received OPTIONS

Closed down VLC

Serial Monitor:
RTSP received OPTIONS
RTSP received TEARDOWN
closing UDP socket
closing UDP socket
closing TCP socket

Previous attempts gave error messages while attempting to stream rtsp taking about being unambe to forward UDP packets - multiple occurances, but unable to duplicate while documenting this. May be related to when web server starts:

Serial Monitor:
[I][rtsp_server.cpp:20] begin(): Starting rtsp server
[E][ESPmDNS.cpp:148] addService(): Failed adding service rtsp.tcp.

@rzeldent
Copy link
Owner

rzeldent commented Jan 5, 2020

MAC Id issue should be solved.

@j-broyles
Copy link
Author

j-broyles commented Jan 5, 2020

ok, I pulled your revised version (MAC is right now :) )and caught the UDP error:

Executing task in folder esp32cam-ready-master: C:\Users\temp.platformio\penv\Scripts\platformio.exe device monitor <

--- Miniterm on COM3 115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5816
entry 0x400806ac
[I][main.cpp:38] setup(): Starting ESP32Cam...
[I][main.cpp:43] setup(): Instance_name: esp32cam-246f2816f03c
[I][main.cpp:45] setup(): Connecting...
I (1448) wifi: wifi driver task: 3ffb5a20, prio:23, stack:3584, core=0
I (3037) wifi: wifi firmware version: 7997e4b
I (3037) wifi: config NVS flash: enabled
I (3037) wifi: config nano formating: disabled
I (3038) wifi: Init dynamic tx buffer num: 32
I (3042) wifi: Init data frame dynamic rx buffer num: 32
I (3047) wifi: Init management frame dynamic rx buffer num: 32
I (3053) wifi: Init management short buffer num: 32
I (3058) wifi: Init static rx buffer size: 1600
I (3062) wifi: Init static rx buffer num: 16
I (3066) wifi: Init dynamic rx buffer num: 32
I (3139) wifi: mode : sta (24:6f:28:16:f0:3c)
[I][wifi_provisioning.cpp:17] connect(): Connecting... Retries left: 1
I (3263) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (3263) wifi: state: init -> auth (b0)
I (3267) wifi: state: auth -> assoc (0)
I (3273) wifi: state: assoc -> run (10)
I (3565) wifi: connected with ATT696, channel 1, BW20
I (3605) wifi: pm start, type: 1

[I][wifi_provisioning.cpp:21] connect(): Connection result: 3
[I][main.cpp:60] setup(): Connected! IP address:192.168.10.28
[I][main.cpp:62] setup(): Starting servers...
[I][espcam_webserver.cpp:19] begin(): Starting rtsp_server
[I][rtsp_server.cpp:20] begin(): Starting rtsp server
[E][ESPmDNS.cpp:148] addService(): Failed adding service rtsp.tcp.

[I][espcam_webserver.cpp:22] begin(): Starting web server
[E][WebServer.cpp:617] _handleRequest(): request handler not found
[I][espcam_webserver.cpp:39] handle_root(): handle_root
[E][WebServer.cpp:617] _handleRequest(): request handler not found
[I][espcam_webserver.cpp:39] handle_root(): handle_root
[I][espcam_webserver.cpp:116] handle_light_on(): handle_light_on
[E][WebServer.cpp:617] _handleRequest(): request handler not found
[I][espcam_webserver.cpp:39] handle_root(): handle_root
[E][WebServer.cpp:617] _handleRequest(): request handler not found
[I][espcam_webserver.cpp:39] handle_root(): handle_root
[I][espcam_webserver.cpp:126] handle_light_off(): handle_light_off
[E][WebServer.cpp:617] _handleRequest(): request handler not found
[I][espcam_webserver.cpp:39] handle_root(): handle_root
[E][WebServer.cpp:617] _handleRequest(): request handler not found
[I][espcam_webserver.cpp:39] handle_root(): handle_root
[I][espcam_webserver.cpp:102] handle_jpg(): handle_jpg
[E][WebServer.cpp:617] _handleRequest(): request handler not found
[I][espcam_webserver.cpp:39] handle_root(): handle_root
[E][WebServer.cpp:617] _handleRequest(): request handler not found
[I][espcam_webserver.cpp:39] handle_root(): handle_root
Creating TSP streamer
Created streamer width=800, height=600
Creating RTSP session
RTSP received OPTIONS
RTSP received DESCRIBE
client has closed the socket
client closed socket, exiting
closing UDP socket
closing UDP socket
closing TCP socket
Creating TSP streamer
Created streamer width=800, height=600
Creating RTSP session
RTSP received SETUP
RTSP received PLAY
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
RTSP received TEARDOWN
closing UDP socket
closing UDP socket
closing TCP socket

Build:

Executing task in folder esp32cam-ready-master: C:\Users\temp.platformio\penv\Scripts\platformio.exe run <

Processing esp32cam (platform: espressif32; board: esp32cam; framework: arduino)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32cam.html
PLATFORM: Espressif 32 1.11.1 > AI Thinker ESP32-CAM
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: toolchain-xtensa32 2.50200.80 (5.2.0), framework-arduinoespressif32 2.10004.191002 (1.0.4), tool-esptoolpy 1.20600.0 (2.6.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- 0.1.6
| |-- 1.0
|-- 1.1.0
| |-- 1.0
|--
| |-- 1.1.0
| | |-- 1.0
| |-- 1.0
| | |-- 1.0
| | |-- 1.0
| |-- 1.0
|-- 1.0
| |-- 1.0
|-- 0.0.0
| |-- 1.0
| |-- 0.1.6
| | |-- 1.0
| |-- 1.0
| | |-- 1.0
|-- 1.0
| |-- 1.0
| |-- 1.0
Building in release mode
Compiling .pio\build\esp32cam\src\espcam_webserver.cpp.o
Compiling .pio\build\esp32cam\src\main.cpp.o
Generating partitions .pio\build\esp32cam\partitions.bin
Compiling .pio\build\esp32cam\libe64\WiFi\ETH.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFi.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFiAP.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFiClient.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFiGeneric.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFiMulti.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFiSTA.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFiScan.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFiServer.cpp.o
Compiling .pio\build\esp32cam\libe64\WiFi\WiFiUdp.cpp.o
Archiving .pio\build\esp32cam\libe64\libWiFi.a
Compiling .pio\build\esp32cam\lib89a\Micro-RTSP_ID6071\CRtspSession.cpp.o
Compiling .pio\build\esp32cam\lib89a\Micro-RTSP_ID6071\CStreamer.cpp.o
Compiling .pio\build\esp32cam\lib89a\Micro-RTSP_ID6071\JPEGSamples.cpp.o
Compiling .pio\build\esp32cam\lib89a\Micro-RTSP_ID6071\OV2640.cpp.o
Compiling .pio\build\esp32cam\lib89a\Micro-RTSP_ID6071\OV2640Streamer.cpp.o
Compiling .pio\build\esp32cam\lib89a\Micro-RTSP_ID6071\SimStreamer.cpp.o
Archiving .pio\build\esp32cam\lib89a\libMicro-RTSP_ID6071.a
Compiling .pio\build\esp32cam\lib8df\DNSServer\DNSServer.cpp.o
Archiving .pio\build\esp32cam\lib8df\libDNSServer.a
Compiling .pio\build\esp32cam\libc93\FS\FS.cpp.o
Compiling .pio\build\esp32cam\libc93\FS\vfs_api.cpp.o
Archiving .pio\build\esp32cam\libc93\libFS.a
Compiling .pio\build\esp32cam\lib2be\WebServer\Parsing.cpp.o
Compiling .pio\build\esp32cam\lib2be\WebServer\WebServer.cpp.o
Compiling .pio\build\esp32cam\lib2be\WebServer\detail\mimetable.cpp.o
Archiving .pio\build\esp32cam\lib2be\libWebServer.a
Compiling .pio\build\esp32cam\lib5dc\WifiProvisioning\wifi_provisioning.cpp.o
Archiving .pio\build\esp32cam\lib5dc\libWifiProvisioning.a
Compiling .pio\build\esp32cam\lib257\ESPmDNS\ESPmDNS.cpp.o
Archiving .pio\build\esp32cam\lib257\libESPmDNS.a
Compiling .pio\build\esp32cam\lib3c6\RtspServer\rtsp_server.cpp.o
Archiving .pio\build\esp32cam\lib3c6\libRtspServer.a
Archiving .pio\build\esp32cam\libFrameworkArduinoVariant.a
Compiling .pio\build\esp32cam\FrameworkArduino\Esp.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\FunctionalInterrupt.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\IPAddress.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\IPv6Address.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\MD5Builder.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\Print.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\Stream.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\StreamString.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\WString.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\base64.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\cbuf.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-adc.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-bt.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-cpu.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-dac.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-gpio.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-i2c.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-ledc.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-matrix.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-misc.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-psram.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-rmt.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-sigmadelta.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-spi.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-time.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-timer.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-touch.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\esp32-hal-uart.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\libb64\cdecode.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\libb64\cencode.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\main.cpp.o
Compiling .pio\build\esp32cam\FrameworkArduino\stdlib_noniso.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\wiring_pulse.c.o
Compiling .pio\build\esp32cam\FrameworkArduino\wiring_shift.c.o
Archiving .pio\build\esp32cam\libFrameworkArduino.a
Linking .pio\build\esp32cam\firmware.elf
Building .pio\build\esp32cam\firmware.bin
esptool.py v2.6
Retrieving maximum program size .pio\build\esp32cam\firmware.elf
Checking size .pio\build\esp32cam\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
DATA: [== ] 22.5% (used 73832 bytes from 327680 bytes)
PROGRAM: [=== ] 28.8% (used 906666 bytes from 3145728 bytes)
========================= [SUCCESS] Took 559.79 seconds =========================

Terminal will be reused by tasks, press any key to close it.


upload:

Executing task in folder esp32cam-ready-master: C:\Users\temp.platformio\penv\Scripts\platformio.exe run --target upload <

Processing esp32cam (platform: espressif32; board: esp32cam; framework: arduino)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32cam.html
PLATFORM: Espressif 32 1.11.1 > AI Thinker ESP32-CAM
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: toolchain-xtensa32 2.50200.80 (5.2.0), tool-mkspiffs 2.230.0 (2.30), framework-arduinoespressif32 2.10004.191002 (1.0.4), tool-esptoolpy 1.20600.0 (2.6.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 29 compatible libraries
Scanning dependencies...
Dependency Graph
|-- 0.1.6
| |-- 1.0
|-- 1.1.0
| |-- 1.0
|--
| |-- 1.1.0
| | |-- 1.0
| |-- 1.0
| | |-- 1.0
| | |-- 1.0
| |-- 1.0
|-- 1.0
| |-- 1.0
|-- 0.0.0
| |-- 1.0
| |-- 0.1.6
| | |-- 1.0
| |-- 1.0
| | |-- 1.0
|-- 1.0
| |-- 1.0
| |-- 1.0
Building in release mode
Retrieving maximum program size .pio\build\esp32cam\firmware.elf
Checking size .pio\build\esp32cam\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
DATA: [== ] 22.5% (used 73832 bytes from 327680 bytes)
PROGRAM: [=== ] 28.8% (used 906666 bytes from 3145728 bytes)
Configuring upload protocol...
AVAILABLE: esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: COM3
Uploading .pio\build\esp32cam\firmware.bin
esptool.py v2.6
Serial port COM3
Connecting....................................
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: 24:6f:28:16:f0:3c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 15856 bytes to 10276...
Wrote 15856 bytes (10276 compressed) at 0x00001000 in 0.2 seconds (effective 511.5 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 119...
Wrote 3072 bytes (119 compressed) at 0x00008000 in 0.0 seconds (effective 1228.8 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 3276.8 kbit/s)...
Hash of data verified.
Compressed 906784 bytes to 494904...
Wrote 906784 bytes (494904 compressed) at 0x00010000 in 12.1 seconds (effective 597.2 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
========================= [SUCCESS] Took 63.83 seconds =========================

Terminal will be reused by tasks, press any key to close it.

@rzeldent
Copy link
Owner

rzeldent commented Jan 5, 2020

monitor logs errors after redirect should be solved now.

@rzeldent
Copy link
Owner

rzeldent commented Jan 5, 2020

Regardung the UDP streaming issues. I checked what this could be and think it might have something to do with the libraries used. It might be caused by these issues:

In the logging that you send me there are no timestamps but because the stream was closed and reopened this might be plausible. See line
Creating TSP streamer in logging.

The other errorline in the log:
[E][ESPmDNS.cpp:148] addService(): Failed adding service rtsp.tcp.
is caused because the rtsp service is already present in the mdns responder and should be a warning.

@j-broyles
Copy link
Author

compiled your current revision, downloaded & run- including serial monitor (most):

[I][wifi_provisioning.cpp:21] connect(): Connection result: 3
[I][main.cpp:60] setup(): Connected! IP address:192.168.10.28
[I][main.cpp:62] setup(): Starting servers...
[I][espcam_webserver.cpp:19] begin(): Starting rtsp_server
[I][rtsp_server.cpp:20] begin(): Starting rtsp server
[E][ESPmDNS.cpp:148] addService(): Failed adding service rtsp.tcp.

[I][espcam_webserver.cpp:22] begin(): Starting web server
[I][espcam_webserver.cpp:39] handle_root(): handle_root
[I][espcam_webserver.cpp:102] handle_jpg(): handle_jpg
[I][espcam_webserver.cpp:116] handle_light_on(): handle_light_on
[I][espcam_webserver.cpp:39] handle_root(): handle_root
[I][espcam_webserver.cpp:126] handle_light_off(): handle_light_off
[I][espcam_webserver.cpp:39] handle_root(): handle_root
[I][espcam_webserver.cpp:82] handle_jpg_stream(): handle_jpg_stream
[E][WiFiClient.cpp:392] write(): fail on fd 59, errno: 104, "Connection reset by peer"
[E][WiFiClient.cpp:392] write(): fail on fd 59, errno: 104, "Connection reset by peer"

Monitor log looks better. Got the errors at the end when I clicked browser back while jpeg streaming.

Looked at the 2 other issues that you attached. Immediately seemed interesting as I have a home net with wifi mesh extenders, but the esp32-cam, pc w/ VS & web browser, and tablet with VLC are all on the same subnet. I then considered that I had always tried the web control page a bit before trying the rtsp stream, so I rebooted the ESP32-cam and immediately went into VLC, and got the same messages and errors as before.

Any idea what library might be an issue that I should check?

@rzeldent
Copy link
Owner

rzeldent commented Jan 5, 2020

Hi J-broyles,

Strange, I cannot reproduce it. If I start the ESP32-Cam and go directly to VLC, I do not see any errors and have a fine image in VLC. Have you tried it with the PC version of VLC? I'm using 3.0.8 Vetinari?

--- Miniterm on COM6 115200,8,N,1 ---
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
etsRչ␁ 8���� �Ғ�:5S��!��:0� ��]�RO�%U�E�JI�ot���3 (*�}FA��e1AS�%=�T)C��nf�֥�: � ��IW���5
�녑:0�f�␖��c,���10�SH�녑:0�␓��80�,�YK�89S��+�i0x␓�4�bb�n:���j ��R� ␚��ck�V�i1
e���A0�␓���6�H�[I][main.cpp:38] setup(): Starting ESP32Cam...
[I][main.cpp:43] setup(): Instance_name: esp32cam-30aea4d4ceac
[I][main.cpp:45] setup(): Connecting...
I (1446) wifi: wifi driver task: 3ffb5a20, prio:23, stack:3584, core=0
I (3033) wifi: wifi firmware version: 7997e4b
I (3034) wifi: config NVS flash: enabled
I (3034) wifi: config nano formating: disabled
I (3035) wifi: Init dynamic tx buffer num: 32
I (3038) wifi: Init data frame dynamic rx buffer num: 32
I (3043) wifi: Init management frame dynamic rx buffer num: 32
I (3049) wifi: Init management short buffer num: 32
I (3054) wifi: Init static rx buffer size: 1600
I (3058) wifi: Init static rx buffer num: 16
I (3062) wifi: Init dynamic rx buffer num: 32
I (3139) wifi: mode : sta (30:ae:a4:d4:ce:ac) + softAP (30:ae:a4:d4:ce:ad)
I (3142) wifi: Total power save buffer number: 16
I (3143) wifi: Init max length of beacon: 752/752
I (3144) wifi: Init max length of beacon: 752/752
I (3149) wifi: mode : sta (30:ae:a4:d4:ce:ac)
[I][wifi_provisioning.cpp:17] connect(): Connecting... Retries left: 1
I (3278) wifi: n:6 0, o:1 0, ap:255 255, sta:6 0, prof:1
I (3279) wifi: state: init -> auth (b0)
I (3288) wifi: state: auth -> assoc (0)
I (3296) wifi: state: assoc -> run (10)
I (3332) wifi: connected with ZiggoXXXXXXX, channel 6, BW20
I (3338) wifi: pm start, type: 1

[I][wifi_provisioning.cpp:21] connect(): Connection result: 3
[I][main.cpp:60] setup(): Connected! IP address:192.168.178.32
[I][main.cpp:62] setup(): Starting servers...
[I][espcam_webserver.cpp:20] begin(): Starting rtsp_server
[I][rtsp_server.cpp:20] begin(): Starting rtsp server
[E][ESPmDNS.cpp:148] addService(): Failed adding service rtsp.tcp.

[I][espcam_webserver.cpp:23] begin(): Starting web server
Creating TSP streamer
Created streamer width=800, height=600
Creating RTSP session
RTSP received OPTIONS
RTSP received DESCRIBE
RTSP received SETUP
RTSP received PLAY

@rzeldent
Copy link
Owner

rzeldent commented Jan 5, 2020

By the way, thank you for reporting issues!

@j-broyles
Copy link
Author

before I got your comment, I'd looked back at the serial monitor output from my previous run, and nestled in between the udp packet errors was a warning, which I doubt has any relevance, but reporting it anyway:

[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet
[W][rtsp_server.cpp:55] doLoop(): warning exceeding max frame rate of 210 ms
[E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
error sending udp packet

After your comment, I loaded VLC/win v

@rzeldent
Copy link
Owner

The warning: "warning exceeding max frame rate of 210 ms" means that the data for one image/frame is larger than can be sent. This might be caused by the strength of the WiFi connection or other infrastructure related bottlenecks. If this is the case I suggest to lower the resolution or frame rate.

@rzeldent
Copy link
Owner

Looks like the issues are resolved or explained. Closing the issue,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants