I added LAN-Support in my MicroPython-Fork.
I would like to create a merge request, to make it available for everybody, but I have 3 Problems:
1. I am not completly familiar with Github. Can someone tell me the steps to create a merge request for the main repo? Especially what do I have to consider so that my code will be accepted?
2. I only have an Olimex EVB-Board with a LAN8710-Chip. It works with the LAN8720-Driver, but I don't have an IP101, RTL8201 or DP83848-Chip to test my code. Could someone help me?
3. I am also not completly sure how to test my code in general. I tried to connect to the network, get the current status of the Driver and Ping the Board. What else could I test?
If someone would like to try the code: You can find it here:
https://github.com/eydam-prototyping/mi ... ee/eth-dev
There are also some other changes in this commit, but I could make a new, clean branch for the merge request.
Here is some code to test:
Code: Select all
import network
import machine
import time
print("Initializing LAN")
l = network.LAN(mdc = machine.Pin(23), mdio = machine.Pin(18), phy_type = network.PHY_LAN8720, phy_addr=0)
while l.status() != network.ETH_INITIALIZED:
print(".")
time.sleep(1)
print("Done. Starting LAN")
l.active(True)
while (l.status() != network.ETH_STARTED) & (l.status() != network.ETH_CONNECTED):
print(".")
time.sleep(1)
print("Done. Waiting for IP")
while l.status() != network.ETH_GOT_IP:
print(".")
time.sleep(1)
print("Got IP: {}".format(l.ifconfig()[0]))
print(" Subnet: {}".format(l.ifconfig()[1]))
print(" Gateway: {}".format(l.ifconfig()[2]))
print(" DNS: {}".format(l.ifconfig()[3]))
print(" MAC: {}".format(":".join(["{:02x}".format(b) for b in l.config("mac")])))
Code: Select all
Initializing LAN
Done. Starting LAN
.
Done. Waiting for IP
.
.
.
.
Got IP: 192.168.178.70
Subnet: 255.255.255.0
Gateway: 192.168.178.1
DNS: 192.168.178.1
MAC: 24:0a:c4:9e:ec:3f