Ported to esp8266!?
Re: Ported to esp8266!?
fyi: There have already been 9 unique visitors to the link containing my build of the ESP8266 firmware during the last 6 hours. So a little bit of interest seems to be there
Re: Ported to esp8266!?
I tried your build. Results:kfricke wrote:Sure, check this link (valid only for two days!). Good luck with it and please report back here!
Code: Select all
>>> import pyb; dir(pyb)
['__name__', 'info', 'freq', 'millis', 'elapsed_millis', 'micros', 'elapsed_micros', 'delay', 'udelay', 'sync', 'hard_reset']
>>> import io
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: module not found
>>> import collections
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: module not found
Interestingly, the io and collections module seem to be missing, though the documentation explicitly mentions them:
- Builtin modules: gc, array, collections, io, struct, sys.
Re: Ported to esp8266!?
Hm. Finally i got some time and a fine soldering iron to solder my ESP8266 module to start into UART mode. But i am unable to connect to it. My FTDI module's TX LED flashes a few times and then esptool.py just tells "Exception: Failed to connect".
I have wired up my ESP8266 module using the 3.3V line from a pyBoard (should provide enough mA for the ESP8266 to bot up, correct?). GND is shared between pyBoard, ESP8266 module and the FTDI.
When plugging the pyboard into USB the PWR LED on my ESP8266 lights up and i can receive some rubbish on my serial console using the obvious wrong baud rate. During boot the ESP8266 uses a strange baud rate of 75000 which my picocom denies to use.
But seeing that rubbish makes me believe the UART mode has been entered and i should be able to use the esptool.py to takl to it.
Any clues!?
I have wired up my ESP8266 module using the 3.3V line from a pyBoard (should provide enough mA for the ESP8266 to bot up, correct?). GND is shared between pyBoard, ESP8266 module and the FTDI.
When plugging the pyboard into USB the PWR LED on my ESP8266 lights up and i can receive some rubbish on my serial console using the obvious wrong baud rate. During boot the ESP8266 uses a strange baud rate of 75000 which my picocom denies to use.
But seeing that rubbish makes me believe the UART mode has been entered and i should be able to use the esptool.py to takl to it.
Any clues!?
Re: Ported to esp8266!?
hello
sorry for poor my english
after Flashing ESP with firmware-combined , i would like try to connect WIFI .....
but unknow comand.....
try
import pyb is OK
pyb.hard_reset() is OK
and some other comand
but now ...
Thankyou
sorry for poor my english
after Flashing ESP with firmware-combined , i would like try to connect WIFI .....
but unknow comand.....
try
import pyb is OK
pyb.hard_reset() is OK
and some other comand
but now ...
Thankyou
Re: Ported to esp8266!?
The port is far from complete or usable. The intent of my post is to try this port out on more ESP8266 hardware and spread the word about MicroPython in the ESP8266 community.
Missing features might frighten some users, but also pulls attention of those who might be able to assist in porting the missing features.
My personal experience with this port sadly still ends at the point where i want to flash my ESP8266. I am still playing with my FTDI adapter (an USB BUB II) which seems to be a little odd. Tonight i will try one of my Raspberry Pis for this purpose. At least the esptool.py should work without the other parts of the ESP toolchain.
Missing features might frighten some users, but also pulls attention of those who might be able to assist in porting the missing features.
My personal experience with this port sadly still ends at the point where i want to flash my ESP8266. I am still playing with my FTDI adapter (an USB BUB II) which seems to be a little odd. Tonight i will try one of my Raspberry Pis for this purpose. At least the esptool.py should work without the other parts of the ESP toolchain.
Re: Ported to esp8266!?
Finally i have solved my issues. Now blaming my stupid somehow borked FTDI adapter (USB BUB II from modern devices) i simply used my Bus Pirate to flash the ESP board, which worked like a charm!
Using the ESP port is quite cool, yet not that usable. You can do the following...
Prints out all discovered SSIDs of your WLAN environment to the REPL.
Check your WLAN router for a new host and be amazed!
Does the obvious.
You already made really cool stuff come true, pfalcon and Damien (and all others involved)!
The flash chip on the ESP board is connected using SPI, so would it be possible to safely access unused areas and store/retrieve your own data there using SPI from MicroPython?
There is no kind of socket support on the ESP, or did i simply miss it? This seems to be an issue a supporter not really used to writing C code and python-bindings (like me) can not tackle, right!?
What parts of the pyb module make sense to be tested or enhanced with concrete examples? My Olimex board has lots of ports i can play with. I am just starting to think about examples we could create to show something to the ESP8266.com community.
Using the ESP port is quite cool, yet not that usable. You can do the following...
Code: Select all
>>> import esp
>>> esp.scan(print)
Code: Select all
>>> esp.connect('<ssid>', '<wlan-psk>')
Code: Select all
>>> esp.disconnect()
You already made really cool stuff come true, pfalcon and Damien (and all others involved)!
The flash chip on the ESP board is connected using SPI, so would it be possible to safely access unused areas and store/retrieve your own data there using SPI from MicroPython?
There is no kind of socket support on the ESP, or did i simply miss it? This seems to be an issue a supporter not really used to writing C code and python-bindings (like me) can not tackle, right!?
What parts of the pyb module make sense to be tested or enhanced with concrete examples? My Olimex board has lots of ports i can play with. I am just starting to think about examples we could create to show something to the ESP8266.com community.
Re: Ported to esp8266!?
I'm on business trip, so cannot reply quickly, sorry.kfricke wrote:@pfalcon: On the official ESP8266 forum i got a request for wifi connection examples. Can you provide some? Due to the fact outlined in my previous post i have not been able to work on this yet. Thanks!
Do you mean official forum on bbs.esspressif.com or unofficial on esp8266.com. I don't remember seeing topic about micropython on official Espressif's forum, it's nice if it got there.
So, you can:
Code: Select all
import esp
esp.connect("access_point", "password")
Code: Select all
esp.disconnect()
And
Code: Select all
esp.status()
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: Ported to esp8266!?
Thanks pfalcon, i figured those exampels out myself already. And also did post them on the esp8266.com (community) forum. If i find some time i will dig through the Esspressif forum and post something there as well.
Meanwhile I would like to (re)start a discussion regarding the ESP8266 port here...
The issue #992: ESP port needs wifi converted into discussion on how to implement really sophisticated socket support on the ESP8266.
My humble opinion regarding this whole port is the following:
The mentioned issue/discussion is an example of over-engineering in the first place. What this "co-operative-mode"/"event-driven platform" port really needs is a 1:1 mapping of the ESP IoT API.
Stateless stuff first (flash access, client UDP communication, ADC, GPIO, sleep modes, timers). Connection based (state-full) thingies second (TCP networking, server focused networking, AT commands) and maybe someday a high-level and socket comfortable Python API.
The "stateless stuff first" approach could avoid most problems based on the event-driven nature of this platform. Callbacks without the the ability to pass user-data can be tackled later when implementing the state-full thingies.
I think most projects based on the ESP8266 tend to be over-engineer as well. Why would one implement a network server on such an limited device? It is cheap as hell and could theoretically run in battery mode (using proper sleep modes and communication methods). So the main strength of this device is the wireless LAN transport media.
Keep it simple and possible to implement a MicroPython driven sensor network! If not MicroPython might miss a foot on the IoT ground, which is defined these days.
Actuators based on this platform should be the second milestone for this port. And networked server gadgets the last, if reasonable at all!
Implementing the initial WIFI stuff as pfalcon did is really great. This way even i can add missing API calls which need no allocated memory on the C code side of this port. (just give me some examples and a C noob can add buggy code )
Can it be possible to add python code on this platform by adding it into the flash image(s)? It could work by simply flashing some pre-compiled binaries and add a third firmware-brick containing the python code you want to "flash onto" the ESP. The esptool (not ".py") does the job of combining firmware binaries, right?
And not to forget a third topic for this post: Did someone implement a MicroPython "driver" based on the AT-command firmware on the ESP? This approach would need another MicroPython platform (e.g. pyBoard) and connect the ESP module using UART.
Meanwhile I would like to (re)start a discussion regarding the ESP8266 port here...
The issue #992: ESP port needs wifi converted into discussion on how to implement really sophisticated socket support on the ESP8266.
My humble opinion regarding this whole port is the following:
The mentioned issue/discussion is an example of over-engineering in the first place. What this "co-operative-mode"/"event-driven platform" port really needs is a 1:1 mapping of the ESP IoT API.
Stateless stuff first (flash access, client UDP communication, ADC, GPIO, sleep modes, timers). Connection based (state-full) thingies second (TCP networking, server focused networking, AT commands) and maybe someday a high-level and socket comfortable Python API.
The "stateless stuff first" approach could avoid most problems based on the event-driven nature of this platform. Callbacks without the the ability to pass user-data can be tackled later when implementing the state-full thingies.
I think most projects based on the ESP8266 tend to be over-engineer as well. Why would one implement a network server on such an limited device? It is cheap as hell and could theoretically run in battery mode (using proper sleep modes and communication methods). So the main strength of this device is the wireless LAN transport media.
Keep it simple and possible to implement a MicroPython driven sensor network! If not MicroPython might miss a foot on the IoT ground, which is defined these days.
Actuators based on this platform should be the second milestone for this port. And networked server gadgets the last, if reasonable at all!
Implementing the initial WIFI stuff as pfalcon did is really great. This way even i can add missing API calls which need no allocated memory on the C code side of this port. (just give me some examples and a C noob can add buggy code )
Can it be possible to add python code on this platform by adding it into the flash image(s)? It could work by simply flashing some pre-compiled binaries and add a third firmware-brick containing the python code you want to "flash onto" the ESP. The esptool (not ".py") does the job of combining firmware binaries, right?
And not to forget a third topic for this post: Did someone implement a MicroPython "driver" based on the AT-command firmware on the ESP? This approach would need another MicroPython platform (e.g. pyBoard) and connect the ESP module using UART.
Re: Ported to esp8266!?
Just my two cents on your ftdi adapter: it has a 10k resistor on TX line. It works OK with Arduinos, while esp doesn't like it. Remove it (short the pad) and will work.kfricke wrote:Finally i have solved my issues. Now blaming my stupid somehow borked FTDI adapter (USB BUB II from modern devices)
I know this because it got me crazy.
Ciao
Re: Ported to esp8266!?
Thanks for this explanation. Good to know. Before I did only use it with my JeeNodes (basically 3.3V Arduinos with built-in RF), so i did stupidly assume to be able to use it for other 3.3V targetssfabris wrote:Just my two cents on your ftdi adapter: it has a 10k resistor on TX line. It works OK with Arduinos, while esp doesn't like it. Remove it (short the pad) and will work.kfricke wrote:Finally i have solved my issues. Now blaming my stupid somehow borked FTDI adapter (USB BUB II from modern devices)
I know this because it got me crazy.