micropython / micropython/micropython
esp32/network_lan: Add default arguments for network.LAN()
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 22.1k
- Forks
- 9k
- Avg merge
- 6d 4h
- Merged PRs (30d)
- 16
Description
Description
Follow up from https://github.com/micropython/micropython/pull/19036#issuecomment-4358153042
Currently, network.LAN() requires the user to specify arguments for what pins to use, the PHY type, and the PHY address. This requires the user to dig through documentation, schematics, and possibly PHY datasheets to find these values. It would be much easier for these values to be defined in mpconfigboard.h so the user can simply call network.LAN() with no arguments to get the default LAN object for their board.
Code Size
This could be enabled per board, but I don't imagine it affecting code size significantly.
Implementation
I hope the MicroPython maintainers or community will implement this feature
Code of Conduct
Yes, I agree
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ESP32 network.LAN() implementation and the board-specific mpconfigboard.h files, using the linked LAN quick reference to understand the current required values. Define board defaults so network.LAN() works without arguments where supported, then verify that existing explicit-argument behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- embedded-iot, networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100