{"id":3490,"date":"2023-08-29T23:02:59","date_gmt":"2023-08-30T06:02:59","guid":{"rendered":"https:\/\/digitalnigel.com\/wordpress\/?p=3490"},"modified":"2023-08-29T23:23:32","modified_gmt":"2023-08-30T06:23:32","slug":"wired-ethernet-on-esp32","status":"publish","type":"post","link":"https:\/\/digitalnigel.com\/wordpress\/?p=3490","title":{"rendered":"Wired Ethernet on ESP32"},"content":{"rendered":"\n<p>I&#8217;ve used the ESP32 microcontrollers for a number of projects at this point, often using the built-in WiFi radio. However, there are use cases where WiFi may be less than ideal. In my case, I&#8217;m interested in the higher reliability a wired connection offers, as well as consistent latency performance.<\/p>\n\n\n\n<p>Fortunately, the ESP32 includes a built-in Ethernet MAC, which is the controller that manages a wired Ethernet connection. If we can pair that with a PHY, which drives the actual electrical signals on the wire, we should be able to get a working connection.<\/p>\n\n\n\n<p>Before getting into a specific project, I wanted to put together a test board to feel out how it would work, and resolve any issues before putting it to real use. Fortunately, there&#8217;s a few references around, including a very nice open source design from <a href=\"https:\/\/www.olimex.com\/Products\/IoT\/ESP32\/ESP32-POE\/open-source-hardware\">Olimex<\/a> that proved to be a useful reference combined with the part datasheets.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0325-scaled.jpeg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" data-id=\"3491\" src=\"https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0325-1024x768.jpeg\" alt=\"\" class=\"wp-image-3491\" srcset=\"https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0325-1024x768.jpeg 1024w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0325-300x225.jpeg 300w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0325-150x113.jpeg 150w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0325-768x576.jpeg 768w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0325-1536x1152.jpeg 1536w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0325-2048x1536.jpeg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0326-scaled.jpeg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" data-id=\"3493\" src=\"https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0326-1024x768.jpeg\" alt=\"\" class=\"wp-image-3493\" srcset=\"https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0326-1024x768.jpeg 1024w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0326-300x225.jpeg 300w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0326-150x113.jpeg 150w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0326-768x576.jpeg 768w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0326-1536x1152.jpeg 1536w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0326-2048x1536.jpeg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0328-scaled.jpeg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" data-id=\"3492\" src=\"https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0328-1024x768.jpeg\" alt=\"\" class=\"wp-image-3492\" srcset=\"https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0328-1024x768.jpeg 1024w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0328-300x225.jpeg 300w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0328-150x113.jpeg 150w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0328-768x576.jpeg 768w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0328-1536x1152.jpeg 1536w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/IMG_0328-2048x1536.jpeg 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p>I didn&#8217;t bother to include Power over Ethernet like their design does, though that is another potential benefit over WiFi, where you can have a single cable provide power and data to a project.<\/p>\n\n\n\n<p>I ended up testing my design by coding up a simple NTP server, and feeding the board from a GPS signal. I started with MicroPython, which is quite handy for putting together an application a lot faster than writing it in C++, but ran into performance issues that negatively impacted the quality of the time responses the board was able to return.<\/p>\n\n\n\n<p>After rewriting in C++, the board returns fairly accurate timing responses, and would be an interesting basis for future work, though isn&#8217;t really in a state suitable for publishing currently.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><a href=\"https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-29-at-22.55.47.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"114\" src=\"https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-29-at-22.55.47-1024x114.png\" alt=\"\" class=\"wp-image-3495\" srcset=\"https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-29-at-22.55.47-1024x114.png 1024w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-29-at-22.55.47-300x33.png 300w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-29-at-22.55.47-150x17.png 150w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-29-at-22.55.47-768x85.png 768w, https:\/\/digitalnigel.com\/wordpress\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-29-at-22.55.47.png 1172w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve used the ESP32 microcontrollers for a number of projects at this point, often using the built-in WiFi radio. However, there are use cases where WiFi may be less than ideal. In my case, I&#8217;m interested in the higher reliability &hellip; <a href=\"https:\/\/digitalnigel.com\/wordpress\/?p=3490\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,6],"tags":[],"class_list":["post-3490","post","type-post","status-publish","format-standard","hentry","category-electronics","category-technology"],"_links":{"self":[{"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3490","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3490"}],"version-history":[{"count":2,"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3490\/revisions"}],"predecessor-version":[{"id":3508,"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/3490\/revisions\/3508"}],"wp:attachment":[{"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digitalnigel.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}