micropython / micropython/micropython

ESP8266 - Allow `network.STA_IF` to `connect` on specific channel

Open
#9,662 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

port-esp8266
Dominant language
C
Stars
22.1k
Forks
9k
Avg merge
6d 4h
Merged PRs (30d)
16

Description

Same request as in https://forum.micropython.org/viewtopic.php?f=16&t=12065
Also see https://www.bakke.online/index.php/2017/06/24/esp8266-wifi-power-reduction-avoiding-network-scan/

I'd also like to do this for power saving on a battery powered device.

I believe micropython isn't able to do this yet, because it's missing from connect:

(call does not allow channel as kwarg)

https://github.com/micropython/micropython/blob/89b320737652829edbab921e86d7ad3962d86d9e/ports/esp8266/modnetwork.c#L111-L117

Additionally, it's also not possible to set this from esp_config:

(setter only for AP, not STA):

https://github.com/micropython/micropython/blob/89b320737652829edbab921e86d7ad3962d86d9e/ports/esp8266/modnetwork.c#L395-L399

(getter only for AP, not STA):

https://github.com/micropython/micropython/blob/89b320737652829edbab921e86d7ad3962d86d9e/ports/esp8266/modnetwork.c#L465-L468

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 ports/esp8266/modnetwork.c at the connect implementation and the esp_config setter and getter locations linked in the issue. Trace the existing STA and AP channel handling and the relevant ESP8266 networking interfaces; done means the requested STA channel behavior is available through the stated API and configuration paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
api, embedded-iot, networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.