{"action":"created","issue":{"url":"https://api.github.com/repos/micropython/micropython/issues/992","labels_url":"https://api.github.com/repos/micropython/micropython/issues/992/labels{/name}","comments_url":"https://api.github.com/repos/micropython/micropython/issues/992/comments","events_url":"https://api.github.com/repos/micropython/micropython/issues/992/events","html_url":"https://github.com/micropython/micropython/issues/992","id":50398280,"number":992,"title":"ESP8266 port needs wifi","user":{"login":"dpgeorge","id":6187689,"avatar_url":"https://avatars.githubusercontent.com/u/6187689?v=3","gravatar_id":"","url":"https://api.github.com/users/dpgeorge","html_url":"https://github.com/dpgeorge","followers_url":"https://api.github.com/users/dpgeorge/followers","following_url":"https://api.github.com/users/dpgeorge/following{/other_user}","gists_url":"https://api.github.com/users/dpgeorge/gists{/gist_id}","starred_url":"https://api.github.com/users/dpgeorge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpgeorge/subscriptions","organizations_url":"https://api.github.com/users/dpgeorge/orgs","repos_url":"https://api.github.com/users/dpgeorge/repos","events_url":"https://api.github.com/users/dpgeorge/events{/privacy}","received_events_url":"https://api.github.com/users/dpgeorge/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/micropython/micropython/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/micropython/micropython/labels/ports","name":"ports","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":36,"created_at":"2014-11-28T19:09:30Z","updated_at":"2015-01-07T18:37:29Z","closed_at":null,"body":"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.\r\n\r\nWifi 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.\r\n\r\nConfiguration 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.\r\n\r\nBefore any Python bindings are made, there are 2 main categories of C functions that need to be written:\r\n\r\n1. Functions to configure the wifi, set IP, etc.\r\n\r\n2. Functions to mimic the POSIX socket, connect, accept, bind, listen, send, recv functions.\r\n\r\nOnce these C functions exist, bindings to Python scripts is straight forward (and can be copied from stmhal port).\r\n\r\nUsage of the wifi within a script will then look something like:\r\n```python\r\nimport network\r\nwifi = network.ESP8266() # create wifi driver\r\nwifi.listap() # list access points\r\nwifi.connect('ssid', 'password') # connect to an access point\r\n\r\nimport socket\r\ns = socket.socket()\r\ns.connect(('192.168.0.1', 8080))\r\ns.send('some data')\r\n```\r\nSee issue #876 for background on this scheme."},"comment":{"url":"https://api.github.com/repos/micropython/micropython/issues/comments/69068583","html_url":"https://github.com/micropython/micropython/issues/992#issuecomment-69068583","issue_url":"https://api.github.com/repos/micropython/micropython/issues/992","id":69068583,"user":{"login":"danicampora","id":7749335,"avatar_url":"https://avatars.githubusercontent.com/u/7749335?v=3","gravatar_id":"","url":"https://api.github.com/users/danicampora","html_url":"https://github.com/danicampora","followers_url":"https://api.github.com/users/danicampora/followers","following_url":"https://api.github.com/users/danicampora/following{/other_user}","gists_url":"https://api.github.com/users/danicampora/gists{/gist_id}","starred_url":"https://api.github.com/users/danicampora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danicampora/subscriptions","organizations_url":"https://api.github.com/users/danicampora/orgs","repos_url":"https://api.github.com/users/danicampora/repos","events_url":"https://api.github.com/users/danicampora/events{/privacy}","received_events_url":"https://api.github.com/users/danicampora/received_events","type":"User","site_admin":false},"created_at":"2015-01-07T18:37:29Z","updated_at":"2015-01-07T18:37:29Z","body":"Yes the CC3100 BOOST is available since a while ago, but I think that @dpgeorge was talking about something like the adafruit module, which could be used for production. The CC3100 BOOST is more like a development board.\r\n\r\nBut yes, that CC3100 board is one of the options available now.\r\n\r\n> On Jan 7, 2015, at 7:07 PM, Bryan Morrissey <notifications@github.com> wrote:\r\n> \r\n> @danicampora, @ARMWorks -\r\n> \r\n> The CC3100 modules are not yet available, but they should be soon. Remember that both chips (CC3200 and CC3100) are quite new and productions quality samples were made available only 3 months ago.\r\n> \r\n> Strange, I have two of the CC3100BOOST modules which I purchased from Digikey about two months ago. I even managed to test them with the pyboard thanks to some code provided by user nelfata from the micropython forum: http://forum.micropython.org/viewtopic.php?f=2&t=401\r\n> \r\n> He ask me to post it to github for him: https://github.com/blmorris/micropython-cc3100\r\n> \r\n> Unfortunately it is a bit beyond me to extend it, so I have moved on for now. The boards belong to my employer but I might be able to pass them along to someone better able than me to develop the micropython drivers for them.\r\n> -Bryan\r\n> \r\n> —\r\n> Reply to this email directly or view it on GitHub.\r\n> "}}