-->
Page 1 of 1

Blynk Library and startup suite for ESP8266 micropython

PostPosted: Sun Oct 15, 2017 6:15 am
by blavery
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.

Re: Blynk Library and startup suite for ESP8266 micropython

PostPosted: Mon Oct 23, 2017 7:02 am
by blavery
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.

Re: Blynk Library and startup suite for ESP8266 micropython

PostPosted: Sun Jan 26, 2020 9:45 am
by Dovregubben
Have a look at https://github.com/aslake/mipy_esp
this project might be of interest regarding your post.

best regards,
Aslak