Unable to receive data using Ethernet

dharmanshu24
Posts: 3
Joined: Wed Feb 26, 2020 7:27 am

Unable to receive data using Ethernet

Postby dharmanshu24 » Wed Feb 26, 2020 7:41 am

When I try to receive data from ethernet. I get error "can't set buf and length to null" and it gets stuck on it. Even though there is enough memory available it is showing me this error.

Code: Select all

D (29138) APP: HTTP_EVENT_HEADER_SENT
D(29413) HTTP_CLIENT: on_message_begin
D (29413) HTTP_CLIENT: HEADER=Server:nginx/1.16.0
D (29413) APP: HTTP_EVENT_ON_HEADER, key=Server, value=nginx/1.16.0
D (29459) HTTP_CLIENT: HEADER=Date:Wed, 26 Feb 2020 07:11:22 GMT
D (29533) APP: HTTP_EVENT_ON_HEADER, key=Date, value=Wed, 26 Feb 2020 07:11:22 GMT
D (29625) HTTP_CLIENT: HEADER=Content-Type:application/json
E (29670) SOCKET: Ping received :) 
I (29743) SOCKET: Pong send :) 
E (29789) emac_esp32: emac_esp32_receive(232): can't set buf and length to null
E (29884) emac_esp32: emac_esp32_receive(232): can't set buf and length to null
E (29980) emac_esp32: emac_esp32_receive(232): can't set buf and length to null
E (30076) emac_esp32: emac_esp32_receive(232): can't set buf and length to null
E (30172) emac_esp32: emac_esp32_receive(232): can't set buf and length to null
E (30268) emac_esp32: emac_esp32_receive(232): can't set buf and length to null
D (30363) APP: HTTP_EVENT_ON_HEADER, key=Content-Type, value=application/json
D (30450) HTTP_CLIENT: HEADER=Content-Length:27746
D (30508) APP: HTTP_EVENT_ON_HEADER, key=Content-Length, value=27746
D (30585) HTTP_CLIENT: HEADER=Connection:keep-alive
D (30645) APP: HTTP_EVENT_ON_HEADER, key=Connection, value=keep-alive
D (30723) HTTP_CLIENT: HEADER=Allow:POST, PUT, OPTIONS
D (30785) APP: HTTP_EVENT_ON_HEADER, key=Allow, value=POST, PUT, OPTIONS
D (30867) HTTP_CLIENT: HEADER=X-Frame-Options:SAMEORIGIN
E (30920) emac_esp32: emac_esp32_receive(232): can't set buf and length to null
D (31027) APP: HTTP_EVENT_ON_HEADER, key=X-Frame-Options, value=SAMEORIGIN
D (31110) HTTP_CLIENT: HEADER=Vary:Cookie, Accept-Encoding
D (31177) APP: HTTP_EVENT_ON_HEADER, key=Vary, value=Cookie, Accept-Encoding
E (31200) emac_esp32: emac_esp32_receive(232): can't set buf and length to null
E (31358) emac_esp32: emac_esp32_receive(232): can't set buf and length to null
D (31454) HTTP_CLIENT: http_on_headers_complete, status=200, offset=244, nread=244
D (31546) HTTP_CLIENT: http_on_body 268
D (31593) APP: HTTP_EVENT_ON_DATA, len=268
D (31643) HTTP_CLIENT: content_length = 27746
I (31696) SITE_PASS: Content = 27746
D (31747) HTTP_CLIENT: is_data_remain=1, is_chunked=0
D (31808) HTTP_CLIENT: need_read=19, byte_to_read=19, rlen=19, ridx=5
D (31886) HTTP_CLIENT: http_on_body 19
E (31921) emac_esp32: emac_esp32_receive(232): can't set buf and length to null
E (32028) emac_esp32: emac_esp32_receive(232): can't set buf and length to null
E (32124) emac_esp32: emac_esp32_receive(232): can't set buf and length to null
E (32220) emac_esp32: emac_esp32_receive(232): can't set buf and length to null
D (32315) APP: HTTP_EVENT_ON_DATA, len=19
D (32364) HTTP_CLIENT: is_data_remain=1, is_chunked=0
D (32426) HTTP_CLIENT: need_read=1, byte_to_read=1, rlen=1, ridx=0
D (32501) HTTP_CLIENT: http_on_body 1
D (32546) APP: HTTP_EVENT_ON_DATA, len=1
D (32594) HTTP_CLIENT: is_data_remain=1, is_chunked=0
D (32655) HTTP_CLIENT: need_read=1, byte_to_read=1, rlen=1, ridx=0
D (32730) HTTP_CLIENT: http_on_body 1
D (32775) APP: HTTP_EVENT_ON_DATA, len=1
D (32823) HTTP_CLIENT: is_data_remain=1, is_chunked=0
D (32884) HTTP_CLIENT: need_read=1, byte_to_read=1, rlen=1, ridx=0
E (32921) emac_esp32: emac_esp32_receive(232): can't set buf and length to null
E (33055) emac_esp32: emac_esp32_receive(232): can't set buf and length to null
E (33151) emac_esp32: emac_esp32_receive(232): can't set buf and length to null

ESP_morris
Posts: 290
Joined: Wed Sep 05, 2018 6:23 am

Re: Unable to receive data using Ethernet

Postby ESP_morris » Wed Feb 26, 2020 7:56 am

Could you tell me which version you're using for your application by git describe .

From my side, it's impossible if malloc succeed but failed the check in https://sourcegraph.com/github.com/espr ... p32.c#L233

dharmanshu24
Posts: 3
Joined: Wed Feb 26, 2020 7:27 am

Re: Unable to receive data using Ethernet

Postby dharmanshu24 » Wed Feb 26, 2020 8:41 am

ESP_morris wrote:
Wed Feb 26, 2020 7:56 am
Could you tell me which version you're using for your application by git describe .

From my side, it's impossible if malloc succeed but failed the check in https://sourcegraph.com/github.com/espr ... p32.c#L233
Version: v4.0-beta2-303-gb0d6c01b0
More than ~100K bytes space is left in heap. So there is no reason for malloc to fail. But it looks like it is failing.

Who is online

Users browsing this forum: No registered users and 70 guests