-
Notifications
You must be signed in to change notification settings - Fork 94
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
Error UDP Packet #37
Comments
Hi bloob, First time I see this. See the list of error codes However, values for size etc.. seem reasonable so unfortunately cannot tell you what you're doing wrong... Error 12 is ENOMEM, but the heap looks good. So maybe lowering the image size or buffer might help?! Let me know or update the issue if you find something?! |
Hi rzeldent, I’m triggering the rtsp stream with motioneye, after erasing the board compliantly and build the sketch again it seams to work. Also I had to set the camera options in motioneye to tcp. Has been set to udp. But I haven’t been able to open the connection over the browser and iFrame. A notier problem i have is that the camera ssh log is writhing a message that the picture is send about every 170ms and writing an error that it’s running out off memory. (Sry not at home) But stays working. thy for helping |
Hi bloob, The framerate can be changed in the web GUI. See the section about setting up. You could consider, as the rate is now 170 ms, to set it to 200ms, so 5 frames per second. Maybe this gives the esp some time to "breathe" Kind regards, Rene |
Thanks again! Thy |
I suspect you're connecting to motion eye web server. Is this possible?
You can see the IP of the ESP32CAM in the logging when it is booting and
connected to a serial terminal.
Look for the line: [ 8056][D][WiFiGeneric.cpp:991] _eventCallback(): STA
IP: *192.168.1.194*, MASK: 255.255.255.0, GW: 192.168.50.1
Here in bold is the address.of the ESP32 CAM webserver, probably another
address in your setup.
Connect using a browser on the same subnet to this address with a
web browser using HTTP. Here you should be able to log in and configure the
device.
…On Sun, Feb 5, 2023 at 8:15 PM bloop16 ***@***.***> wrote:
Thanks again!
I´ve tried to reach the /config site, but always getting the answer Server
already running.
What can i do to reach the config site again?
—
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2ENB5LXY3IBEO7KYZLCA3WV733XANCNFSM6AAAAAAUN5RKAY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
No, I’m connecting to the Cam IP with http://192.168.0.49/config. The motioneye connection is closed. A reboot off the cam also didn’t help. |
Just stopping by to say that I'm also affected by this... I installed the latest PlatformIO using pip and set it all up using the command line (not that I think it'll make a difference). I am wondering if there's been a change in the ESP32/Arduino code which has caused this? I tried all low resolutions and low frame rates and nothing I tried resolved the problem. |
Hi Steve/bloop, I just did a complete rebuild (using platformIo), retested the current develop with the latest espressIf/Arduino code and I do not have any issues. Tested the build-in snapshot url and tested with VLC. No problems with both. Could you explain a bit more what you're doing with motioneye? Can you confirm it works with VLC? Kind regards, Rene |
I'm not doing anything with Motioneye ... I built the code and installed it to my ESP32-CAM (ESP32-S, AI Thinker Camera), used VLC to connect to the RTSP stream and got several pages of the UDP errors ( [ 46818][E][WiFiUdp.cpp:183] endPacket(): could not send data: 12 ) as per the initial issue. I have two of them and can confirm that it happens on both, so I can rule it out being a board issue. This was the packages used at build time:
|
Hi Steve,
Yes, I also saw a few of them but everything works normal; streaming is
working fine.
I do not know where they originate from but it does not seem to be a
problem... Is it?
Rene
…On Sun, Feb 5, 2023 at 10:16 PM SteveWiFi ***@***.***> wrote:
I'm not doing anything with Motioneye ...
I built the code and installed it to my ESP32-CAM (ESP32-S, AI Thinker
Camera), used VLC to connect to the RTSP stream and got several pages of
the UDP errors ( [ 46818][E][WiFiUdp.cpp:183] endPacket(): could not send
data: 12 ) as per the initial issue.
I have two of them and can confirm that it happens on both, so I can rule
it out being a board issue.
—
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2ENB42PRBO4Y4NY4Q73BTWWAKCTANCNFSM6AAAAAAUN5RKAY>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Hi Rene, Given that I replicated it on both boards, I could only guess that there's a bug in one of the dependencies I used to build it. I was hoping we could compare which packages we built it with to narrow it down. |
So I'm seeing the exact same issue, recent checkout and using VSCode/PIO as per your instructions on the README. Trying to play with VLC, getting lots of lines of that same UDP error. My CPU model When I hit the I'm watching the log output via Serial Monitor, not seeing any errors. PlatformIO is v3.0.0
Any more I can do to help or check, let me know so this can be tracked down. EDIT: So I checked the PIO outdated dependencies,
So I updated that, and now even after PIO clean, it fails to build.
I went into the |
Hi Drizz, Strange, did you do a pull the repo? The automatic CI build is working fine and just retested it with a fresh clone. Kind regards, Rene |
@rzeldent I hadn't updated from repo to local, just did, and that fixed the compile issue. Hasn't fixed the UDP error unfortunately, though. |
So, got an RTSP stream to work, 1 buffer, 640x480, quality 35 (is 1 low or high?), 100ms frame rate (10fps). However it tends to stutter, seems that the CPU can't keep up when the inter-frame changes seem to be a lot? Strangely, when I tried 1280x1024 q=15 (lower seems to be better quality), I did get that to manage to work. It started to connect, gave the UDP error, but I let VLC continue, and it re-initialized and then started to playback the video. Something really strange seems to be going on. While it's running, I checked, Free Heap: 128.42 KB, Max free blocks: 75.99 KB. Does run kinda slow/jerky. Trying at 33ms frame rate (30.3fps), sometimes slightly smoother, mostly about as jerky. I wonder if it's the CPU readout, or if the current compile only is using 1 of the 2 cores rather than spreading the load, or what. When I switched back to 2 buffers, I got the UDP error spamming the output. Just some more data, hope this helps some. Really would love to get this to work, this is much better sized than an RPi Zero 2 W + HQ camera module for my needs.
|
So it is the line: 12 should be ENOMEM but there is enough heap space available so strange. However, mention at espressif/esp-idf#6852 it states that an error 12 is returned when the client is disconnected. So more investigation needed?! int WiFiUDP::endPacket(){ |
@rzeldent so that's ready for me to do a pull and recompile? Would it be helpful for me to do a Wireshark recording? |
Hi Drizz,
I just merged 10 minutes ago so you can use the develop branch. So, yes,
that would be sufficient.
I'm now updating some names in the config and later this evening will merge
that also.
Enjoy!
…On Thu, Feb 9, 2023 at 7:54 PM Drizzt321 ***@***.***> wrote:
@rzeldent <https://github.com/rzeldent> so that's ready for me to do a
pull and recompile?
Would it be helpful for me to do a Wireshark recording?
—
Reply to this email directly, view it on GitHub
<#37 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB2ENB7BIIB7TU5TXZ4BUDTWWU4O5ANCNFSM6AAAAAAUN5RKAY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
What client are you using to receive the stream? VLC? |
Yes, VLC to test, then I'll be using Frigate NVR for long term usage. But validating it works and positioning/view/etc with VLC first. |
Strange, over here it works fine with VLC on the same WiFi network. I see in the logging that your device has PSRAM (There is some variation in the ESP32CAM modules) so this is fine. I see in the logging a gap of 26 seconds where no data is sent. This is strange especially because streaming should start after the play. Do you have maybe some UDP filtering in place? 00:28:22.659 > RTSP received PLAY |
Hey, I am also having the UDP packet issue. Camera initializes, I can access the web gui, change the settings, but if I try and connect to the rtsp stream via VLC I get the error below. I originally thought it was the new pfsense router I had setup in the last week, but I swapped back to my old router and the same thing. I can connect to all my other, non-esp32 cameras via RTSP just fine as well. Creating TSP streamer EDIT: I have the same problem on all 3 of my ESP32-CAMs. |
I had the same problem, I added an external antenna and it greatly reduced the problem |
Either it's a power issue (need a 22uf capacitor on power) or too weak signal from wifi |
I removed the code to check for OTA updates. This is in the develop branch. |
I can add an observation: We use the LwIP networkstack on ESP32-S3 with ESP-IDF 5.1.2 but have a custom communication backend that is not related to the ESP-IDF Wi-Fi driver. Our transmit callback that handles outgoing messages from LwIP down to the phy interface always succeeds. But the iperf UDP benchmark gets this ENOMEM from sendto() after 4 datagrams and succeeds in the following calls. It fails very rarely a second time. The issue only appears if the datagram fits into one Wi-Fi frame, for example with 100 Byte datagrams and also 1400 Byte datagrams. The issue disappears if the datagram is too big and IP fragmentation is used. My conclusion is, that the UDP ENOMEM is caused by LwIP and is not related to the Wi-Fi driver and all its settings. I walked down the sendto implementation and placed debug messages on all places where an allocation could fail and ENOMEM is generated. This lead to no addiotinal outputs so far. I must have missed something. |
Hello,
I can`t run the stream, always get the Error:
17:11:43.778 > [ 46825][E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
17:11:43.783 > error sending udp packet
17:10:56.510 >
17:10:56.510 > rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
17:10:56.515 > configsip: 0, SPIWP:0xee
17:10:56.518 > clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
17:10:56.523 > mode:DIO, clock div:2
17:10:56.526 > load:0x3fff0030,len:1184
17:10:56.529 > load:0x40078000,len:13104
17:10:56.532 > load:0x40080400,len:3036
17:10:56.532 > entry 0x400805e4
17:10:56.948 > [ 2][V][WiFiServer.h:42] WiFiServer(): WiFiServer::WiFiServer(port=80, ...)
17:10:56.954 > [ 3][V][WebServer.cpp:87] WebServer(): WebServer::Webserver(port=80)
17:10:56.977 > [ 31][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz
17:10:57.426 > [ 479][I][esp32-hal-psram.c:96] psramInit(): PSRAM enabled
17:10:57.451 > [ 505][I][main.cpp:267] setup(): CPU Freq: 240 Mhz
17:10:57.454 > [ 505][I][main.cpp:268] setup(): Free heap: 238040 bytes
17:10:57.460 > [ 506][I][main.cpp:269] setup(): Starting ESP32CAM-RTSP...
17:10:57.465 > Config version: 1.3
17:10:57.468 > Config size: 392
17:10:57.468 > Loading configurations
17:10:57.471 > [iwcAll]
17:10:57.471 > |-- [iwcSys]
17:10:57.474 > | |-- 'iwcThingName' with value: 'ESP32CAM-RTSP'
17:10:57.476 > | |-- 'iwcApPassword' with value:
17:10:57.482 > | |-- [iwcWifi0]
17:10:57.482 > | | |-- 'iwcWifiSsid' with value: 'TP-Link_2.5Ghz'
17:10:57.488 > | | -- 'iwcWifiPassword' with value:
17:10:57.493 > | -- 'iwcApTimeout' with value: '30'
17:10:57.496 > |-- [iwcCustom]
17:10:57.499 > | -- [settings]
17:10:57.499 > | |-- 'config' with value: 'AI THINKER'
17:10:57.504 > | |-- 'fd' with value: '20'
17:10:57.507 > | |-- 'fs' with value: 'SVGA (800x600)'
17:10:57.510 > | |-- 'fb' with value: '2'
17:10:57.513 > | |-- 'q' with value: '12'
17:10:57.515 > | -- 'li' with value: '0'
17:10:57.518 > -- [hidden]
17:10:57.521 > State changing from: 0 to 2
17:10:57.541 > [ 595][D][WiFiGeneric.cpp:931] _eventCallback(): Arduino Event: 0 - WIFI_READY
17:10:57.641 > Setting up AP: ESP32CAM-RTSP
17:10:57.641 > Use password:
17:10:57.643 > AP IP address: [ 695][V][WiFiGeneric.cpp:392] _arduino_event_cb(): AP Started
17:10:57.652 > 192[ 695][D][WiFiGeneric.cpp:931] _eventCallback(): Arduino Event: 10 - AP_START
17:10:57.657 > .168.4.1
17:10:57.660 > AP timeout (ms): 30000
17:10:57.660 > State changed from: 0 to 2
17:11:27.653 > State changing from: 2 to 3
17:11:27.667 > [ 30721][V][WiFiGeneric.cpp:395] _arduino_event_cb(): AP Stopped
17:11:27.672 > [ 30722][D][WiFiGeneric.cpp:931] _eventCallback(): Arduino Event: 11 - AP_STOP
17:11:27.678 > [ 30725][V][WiFiGeneric.cpp:392] _arduino_event_cb(): AP Stated
17:11:27.683 > E (43814) wifi_init_default: esp_wifi_get_mac failed with 12289
17:11:27.689 > Connecting to [TP-Link_2.5Ghz] (password is hidden)
17:11:27.694 > WiFi timeout (ms): [ 30735][V][WiFiGeneric.cpp:395] _arduino_event_cb(): AP Stopped
17:11:27.700 > [ 30729][D][WiFiGeneric.cpp:931] _eventCallback(): Arduino Event: 10 - AP_START
17:11:27.708 > [ 30754][D][WiFiGeneric.cpp:931] _eventCallback(): Arduino Event: 11 - AP_STOP
17:11:27.714 > 30000
17:11:27.731 > [ 30786][D][WiFiGeneric.cpp:931] _eventCallback(): Arduino Event: 0 - WIFI_READY
17:11:27.737 > [ 30792][V][WiFiGeneric.cpp:340] _arduino_event_cb(): STA Started
17:11:27.743 > [ 30793][V][WiFiGeneric.cpp:97] set_esp_interface_ip(): Configuring Station static IP: 0.0.0.0, MASK: 0.0.0.0, GW:0.0.0.0
17:11:27.754 > [ 30794][D][WiFiGeneric.cpp:931] _eventCallback(): Arduino Event: 2 - STA_START
17:11:27.762 > State changed from: 2 to 3
17:11:27.798 > [ 30852][V][WiFiGeneric.cpp:355] _arduino_event_cb(): STA Connected: SSID: TP-Link_2.5Ghz, BSSID:
0c:9d:92:cf:59:20, Channel: 6, Auth: WPA2_PSK
17:11:27.809 > [ 30854][D][WiFiGeneric.cpp:931] _eventCallback(): Arduino Event: 4 - STA_CONNECTED
17:11:28.395 > [ 31450][V][WiFiGeneric.cpp:369] _arduino_event_cb(): STA Got New IP:192.168.0.49
17:11:28.401 > [ 31450][D][WiFiGeneric.cpp:931] _eventCallback(): Arduino Event: 7 - STA_GOT_IP
17:11:28.409 > [ 31453][D][WiFiGeneric.cpp:996] _eventCallback(): STA IP: 192.168.0.49, MASK: 255.255.255.0, GW: 192.168.0.2
17:11:28.418 > WiFi connected
17:11:28.421 > IP address: 192.168.0.49
17:11:28.421 > State changing from: 3 to 4
17:11:31.521 > [ 34575][W][ESPmDNS.cpp:222] queryService(): No results found!
17:11:31.526 > Active mDNS services: 0
17:11:31.526 > Accepting connection
17:11:31.529 > [ 34577][V][main.cpp:238] on_connected(): on_connected
17:11:31.537 > [ 34591][I][ArduinoOTA.cpp:141] begin(): OTA server at: esp32-30c6f7207d4c.local:3232
17:11:31.542 > [ 34592][V][main.cpp:221] start_rtsp_server(): start_rtsp_server
17:11:31.548 > [ 34594][V][main.cpp:200] initialize_camera(): initialize_camera
17:11:31.554 > [ 34599][I][main.cpp:201] initialize_camera(): Camera config: AI THINKER
17:11:31.562 > [ 34606][I][main.cpp:203] initialize_camera(): Frame size: SVGA (800x600)
17:11:31.567 > [ 34612][I][main.cpp:205] initialize_camera(): Frame buffers: 2
17:11:31.573 > [ 34618][I][main.cpp:207] initialize_camera(): JPEG quality: 12
17:11:31.578 > [ 34624][I][main.cpp:209] initialize_camera(): Frame rate: 20 ms
17:11:31.796 > [ 34851][I][main.cpp:229] start_rtsp_server(): Camera initialized
17:11:31.802 > [ 34851][V][WiFiServer.h:42] WiFiServer(): WiFiServer::WiFiServer(port=554, ...)
17:11:31.807 > [ 34853][I][rtsp_server.cpp:9] rtsp_server(): Starting RTSP server
17:11:31.815 > State changed from: 3 to 4
17:11:38.886 > Creating TSP streamer
17:11:38.886 > Created streamer width=800, height=600
17:11:38.888 > Creating RTSP session
17:11:39.885 > RTSP received OPTIONS
17:11:40.930 > RTSP received DESCRIBE
17:11:42.576 > RTSP received SETUP
17:11:43.642 > RTSP received PLAY
17:11:43.764 > [ 46818][E][WiFiUdp.cpp:183] endPacket(): could not send data: 12
17:11:43.769 > error sending udp packet
What am I doing wrong?
Thank`s for helping!
The text was updated successfully, but these errors were encountered: