Olimex Esp32 EVB Ethernet ?


#1

I am totally new with the use of Zerynth.
I would like to know if someone has managed to operate the ethernet port of the Olimex ESP32 EVB board.
It seems that there is still no suitable driver for LAN8710A chip. I’m right?
Does anyone know any date for which the driver will be available?
I am very interested in any information on this matter.
Thank you


#2

Hi Manuel,
to use and test the ethernet functionalities of the Olimex ESP32 EVB (or Gateway) you can import esp32eth module from the espressif.esp32net library and you can handle this module with the eth.py module of the standard library (here the docs) without worrying about the low-level driver of the chip.
Here few lines of code to implement a request through the ethernet connection:

import streams
import json
import eth

# import the http module
import requests
import socket

# import eth module
from espressif.esp32net import esp32eth as eth_driver

streams.serial()
eth_driver.init()

print("Establishing Link...")
try:
    eth.link()

except Exception as e:
print(“ooops, something wrong while linking :(”, e)
while True:
sleep(1000)

Example basic get time from http request

for i in range(3):
try:
print(“Trying to connect…”)
response = requests.get(“http://now.httpbin.org/”)
print(“Http Status:”,response.status)
break
except Exception as e:
print(e)

try:
# check status and print the result
if response.status==200:
print(“Success!!”)
print("-------------")
print(“Headers are:”,response.headers)
print("-------------")
print(“And the result is:”,response.content)
print("-------------")
js = json.loads(response.content)
print(“Date:”,js[“now”][“rfc2822”][:16])
print(“Time:”,js[“now”][“rfc2822”][17:])
except Exception as e:
print(“ooops, something very wrong! :(”,e)`

Let me know if this can help you :)

#3

Hello Matteo,
Thank you very much for your code example. I just tried it and it actually worked.
It was very helpful to me.