Missing functions on the ESP8266

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
audacity363
Posts: 2
Joined: Sat Jan 23, 2016 4:01 pm
Location: Germany

Missing functions on the ESP8266

Post by audacity363 » Sat Jan 23, 2016 4:31 pm

Hey,
I'm completely new to the hole MicroPython on the ESP8266 thing.
I have found this instructions from Adafruit.
First i flashed my ESP with the pre compiled firmware from adafruit to see some LEDs blinking and hey: It Works.
Second i wanted to connected to my wifi AP. No Problems at all.

Then i wanted to run my own python scripts. So i installed the ESP SDK. Cloned the MicroPython Repository, edit the main.py script in "micropython/esp8266/scripts", compiled the MicroPython Firmware and flashed it.

No Problems at all.
I connected to the Serial Port, reset the ESP Modul and see the following message:
Traceback (most recent call last):
File "", line 5, in <module>
AttributeError: no such attribute
So i looked in my script and the corresponding line:

Code: Select all

esp.connect("myap", "mypasswd")
I compared the Firmware Version:
Adafruit Firmware: v. 1.4.2-99
My Firmware: v. 1.5.2-71

My Firmware is missing the connect, disconnect, scan and status functions in the esp module.

My question is now: How can i connect to a AP without the right functions?

Turbinenreiter
Posts: 288
Joined: Sun May 04, 2014 8:54 am

Re: Missing functions on the ESP8266

Post by Turbinenreiter » Sat Jan 23, 2016 5:49 pm

The API changed.
You can find the documentation here:
http://docs.micropython.org/en/latest/library/esp.html
http://docs.micropython.org/en/latest/l ... ocket.html

You will also need the network module. Here is the docs for that:
http://docs.micropython.org/en/latest/l ... twork.html
And here's the implementation of that for the the ESP:
https://github.com/micropython/micropyt ... dnetwork.c

... I hope someone else can help you out better, or maybe you can figure it out with the docs.

audacity363
Posts: 2
Joined: Sat Jan 23, 2016 4:01 pm
Location: Germany

Re: Missing functions on the ESP8266

Post by audacity363 » Sun Jan 24, 2016 10:36 am

You helped me a lot.

Yes i read the MicroPython docs for the ESP (but only for the ESP) and wondered why there is no documentation for the AP connection or the current status.
The Network Module was the right hit.
Thank you.

Post Reply