Fatal error: mbedtls/net.h: No such file or directory

Hello all,
I am getting this fatal error: mbedtls/net.h: No such file or directory and I have installed espressif systems version 3.0.3 from board manager.

Hi @libraiot. I see you have installed a library at this location on your computer:

C:\Program Files (x86)\Arduino\libraries\esp32

In order to provide you with effective assistance, we must know where you got that library. The generic folder name "esp32" doesn't give us any clues.

So please provide a link to where you downloaded that library from in a reply here on the forum thread.

That doesn't work:

The organization that owns this item doesn't allow you to access it

Are you trying to tell me that you sourced this library from Google Drive? Or did you source it from somewhere on the public Internet and you are just unnecessarily introducing Google Drive into this situation to make our life more difficult?

If you sourced the library from the public Internet, the give us the link to the page on the public Internet. That will be much more useful than a Google Drive link.

And that is a really wrong place for a library

Hii
Please share your mail id.

One of the reasons I haven't been active on this forum is because the people here generally suck. @ptillisch you think maybe this is a place where people come to try to figure things out because they don't know what they are doing? Do you just like to complain about things like Google Drive because you think you are superior, or maybe, just maybe, you could try being kind when answering someones question.

I'm having the same exact issue. I got a new macbook and I just installed esp32 by expressif. The problem is, this error is being thrown by a library:

ESP32_Mail_Client/src/ssl_client32.h:36:10: fatal error: mbedtls/net.h: No such file or directory
36 | #include "mbedtls/net.h"
| ^~~~~~~~~~~~~~~

So I dont know what this is, what it is supposed to be, or where to find information on it. That's because I only code for arduino here and there, not because im stupid or trying to make anyones life harder. If it's not too much of a burden, it would be great to get an answer to this. I imagine it's something simple, like installing the correct esp32 library, or another library.

For anyone else looking for an answer:

Starting around ESP32 Arduino Core 2.0.x, Espressif updated mbedTLS. The older net.h was removed or replaced by net_sockets.h. ESP32 Arduino Core 1.0.6, the file mbedtls/net.h still exists.

The solution is to go into your Arduino Board manager, and downgrade esp32 by expressif to version 1.0.6 for your project. That's basically it, and the problem is solved.

The examples and GitHub README for ESP32 Mail Client say it has been deprecated (four years ago) at version 2.1.6

ESP Mail Client is also available in the IDE Library Manager. The latest version is 3.4.23; the SMTP > Sent_Text example compiled fine on the recent 3.0.7 esp32 board.

1 Like