micropython / micropython/micropython

esp32/network_lan: Add default arguments for network.LAN()

Open
#19,181 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement port-esp32
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.