8000 ESP8266 port needs wifi · Issue #992 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content
ESP8266 port needs wifi #992
Closed
Closed
@dpgeorge

Description

@dpgeorge

The ESP8266 port gives a Python REPL over UART, but there is currently no interface to the wifi capabilities of the chip. This issue is intended to point potential contibutors in the right direction for implementing wifi.

Wifi bindings will be most useful if they fit in the standard POSIX mould of socket, connect, accept, bind listen, send, recv, etc. These functions can then be made available in the standard Python socket library.

Configuration functions, like list-access-points, and set-wpa-password, need to go in a dedicated ESP wifi driver, which is available to Python scripts from the network module.

Before any Python bindings are made, there are 2 main categories of C functions that need to be written:

  1. Functions to configure the wifi, set IP, etc.
  2. Functions to mimic the POSIX socket, connect, accept, bind, listen, send, recv functions.

Once these C functions exist, bindings to Python scripts is straight forward (and can be copied from stmhal port).

Usage of the wifi within a script will then look something like:

import network
wifi = network.ESP8266() # create wifi driver
wifi.listap() # list access points
wifi.connect('ssid', 'password') # connect to an access point

import socket
s = socket.socket()
s.connect(('192.168.0.1', 8080))
s.send('some data')

See issue #876 for background on this scheme.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature requests, new feature implementationsportsRelates to multiple ports, or a new/proposed port

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0