The use of the ESP8266 in the world of IoT

User avatar
By blavery
#70869 I have posted on github a start-up suite and a blynk library for micropython on ESP8266.

https://github.com/BLavery/psuite-upython

Features include:
-- Initial delay to allow breaking from reboot cycling
-- Wifi start manager (AP and STA modes)
-- SNTP time syncing including network error tolerance, custom timeservers, scheduled repeat sync
-- Rich blynk library including stable network handling, auto or custom GPIO I/O, bridge, LCD, user task.

The blynk library is easily separable if that is all you want.
User avatar
By blavery
#71123 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.