- Mon Oct 23, 2017 7:02 am
As an exercise, I have tried a (fairly rough) porting of the pSuite
from "classic" (is that what we call it?) MicroPython to CircuitPython (2.1.0, released a few days ago) instead.
The result: CircuitPython is NOT MicroPython (ie MicroPython as you otherwise thought you knew it).
Here are some items I found:
- Many inbuilt modules are renamed. utime becomes time again.
- Much hardware now has two different implementations, uP functions and CP functions.
- time.sleep_ms() needs to use sleep() instead
- time.ticks() becomes 1000*time.monotonic()
- framebuf is omitted. Instead a framebuf.mpy is supplied to be uploaded to flash. But the basic fb.text() is not implemented. So no oled.
- time.localtime() is replaced with a different time.struct_time()
- code that worked in boot.py needs to move to main.py (different vm)
- Various included standard uP frozen modules are retained unchanged (eg ntptime) but break because CP has different modules.
- "settings.py" is a new reserved filename, executing at start like main.py. I had to rename my settings.py!
- Silly diagnostics at boot, (scandone, state: 2 -> 3, and what looks like emitted assembler code.)
- Extra wifi connection outputs, incl (thankfully) the AP that client mode connected to.
- The (uart) REPL needs extra keystrokes to get started. It's inconvenient.
- uPyLoader IDE still works, thankfully, but the terminal keystrokes needed for REPL makes file transfer awkward/flakey.
- Lots of CP documentation still retains classic MP sections that clearly are wrong for CP, wrong modules, wrong functions.
SO, what worked after a couple of hours of hacking (sorry, porting)?
- wifi logon = succeed
- sntp (my version) = succeed. Inbuilt ntptime = NG
- oled/ssd1306 = NG, framebuf ng
- blynk = succeed. Surprise!
Conclusion. I don't like the CircuitPython ESP8266 version.
It's quite uncooked.
It's complicating the micropython scene mightily.
The ESP8266 CP feels like a neglected tack-on to the SAMD CP effort.