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

esp.emac: no mem for receive buffer (IDFGH-11395) #12533

Closed
hzhh110 opened this issue Nov 7, 2023 · 5 comments
Closed

esp.emac: no mem for receive buffer (IDFGH-11395) #12533

hzhh110 opened this issue Nov 7, 2023 · 5 comments
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Feature Request Feature request for IDF

Comments

@hzhh110
Copy link

hzhh110 commented Nov 7, 2023

Is your feature request related to a problem?

[WiFiGeneric.cpp:1438] hostByName(): DNS Failed for

When esp.emac: no mem for receive buffer is displayed, subsequent devices cannot be recovered, even if I release the stack

Describe the solution you'd like.

As long as I start using Bluetooth communication, the network cable can not connect to the Internet, but the LAN can communicate, or connect to the Internet line communication, I go to use Bluetooth again, after a while the same, and then I try to release the Bluetooth FreeHeap Size:179336 after 120 seconds, but the network cable keeps appearing hostByName(): DNS Failed for and cannot be recovered until the device is restarted

Describe alternatives you've considered.

No response

Additional context.

No response

@hzhh110 hzhh110 added the Type: Feature Request Feature request for IDF label Nov 7, 2023
@espressif-bot espressif-bot added the Status: Opened Issue is new label Nov 7, 2023
@github-actions github-actions bot changed the title esp.emac: no mem for receive buffer esp.emac: no mem for receive buffer (IDFGH-11395) Nov 7, 2023
@hzhh110
Copy link
Author

hzhh110 commented Nov 7, 2023

FreeHeap BLE1 :191456
initBLEJH-P130-A0009
FreeHeap BLE2 :105288
void initBLE(const char *name)
{
DebugPrint("initBLE");
DebugPrintln(name);
BLEDevice::init(name);
#if isESP32
BLEDevice::setPower(ESP_PWR_LVL_P7,ESP_BLE_PWR_TYPE_DEFAULT);
#else
// #if isESP32_C3
BLEDevice::setPower(ESP_PWR_LVL_P18,ESP_BLE_PWR_TYPE_DEFAULT);
#endif
BLEServer *pServer = BLEDevice::createServer();
_pServer = pServer;
pServer->setCallbacks(new MyServerCallbacks());
BLEService *pService = pServer->createService(SERVICE_UUID);
pTXCharacteristic = pService->createCharacteristic(CHARACTERISTIC_UUID_TX, BLECharacteristic::PROPERTY_NOTIFY);
pTXCharacteristic->addDescriptor(new BLE2902());
BLECharacteristic *pRXCharacteristic = pService->createCharacteristic(CHARACTERISTIC_UUID_RX, BLECharacteristic::PROPERTY_WRITE);
pRXCharacteristic->setCallbacks(new MyCallbacks());
pService->start();
pServer->getAdvertising()->start();
}

@hzhh110
Copy link
Author

hzhh110 commented Nov 8, 2023

I wonder if it is possible that I set ETH.config(), then removed it, and then the router recorded it, causing the problem? And how do I get dns1 and dns2 in config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1, IPAddress dns2)? Why am I getting Intranet ones and not something like 114.114.114.114 or 8.8.8.8?

@hzhh110
Copy link
Author

hzhh110 commented Nov 8, 2023

E (9267) esp.emac: no mem for receive buffer
E (9271) esp.emac: no mem for receive buffer
[WiFiGeneric.cpp:1438] hostByName(): DNS Failed

If [WiFiGeneric.cpp:1438] hostByName(): DNS Failed appears, it cannot be restored
You can take a router, and then the router is connected to the Internet at the beginning, after the router's Internet connection network cable is removed, you will find that you can not reconnect, has been DNS Failed

@kostaond
Copy link
Collaborator

kostaond commented Nov 10, 2023

Why am I getting Intranet ones and not something like 114.114.114.114 or 8.8.8.8

It depends on DHCP Server configuration and on your internet provider.

Could you please try to use IP address instead of domain name?

E (9267) esp.emac: no mem for receive buffer

Unfortunately, it seems that no mem for receive buffer may result in Ethernet to hang under specific conditions - it needs to occur multiple times in a row and so fill Ethernet DMA Rx buffer. The issue was fixed in ESP-IDF v5.x. I'll try to backport the fix to v4.4 but it will take some time till it gets to the ESP Arduino 2.x. In the meantime, you can try the following:

@kostaond
Copy link
Collaborator

kostaond commented Dec 5, 2023

esp.emac: no mem for receive buffer fix was back-ported to v4.3 and v4.4 (see f104be7 and 9374a2d)

@kostaond kostaond closed this as completed Dec 5, 2023
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Opened Issue is new labels Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Feature Request Feature request for IDF
Projects
None yet
Development

No branches or pull requests

3 participants