This library does the same thing the Circuit Python library does. We can write micropython to talk to the atm90e32. An example is included.
TODO: I did not implement all the mehods/properties that are in the Arduino port. I am hoping through Open Source that someone (you?) would like to add more.
There is so much prior work that made it easier to write a CP library for the atm90e32. Efforts include:
- Circuit Setup's Split Single Phase Energy Meter. I am delighted that John is providing us with this open source energy monitor! It makes it easy to figure out how much electricity is being used. Thank you John. Thank you for helping me get started with your product.
- Tisham Dhar's atm90e26 Arduino library. Tisham deserves a HUGE THANK YOU for his open source atm90e* hw and sw design. Tisham's excellent work and friendly help are inspirational.
- The atm90e26 Circuit Python library I wrote
- Circuit Setup's atm90e32 Arduino library
I used a wemos D1.
The micropython docs have a tutorial on getting micropython onto the esp8266. We used what is currently the latest esp8266-20190529-v1.11.bin
.
Following the install instructions,
- erase the flash:
esptool.py --port /dev/tty.wchusbserial1410 erase_flash
- Copy micropython:
esptool.py --port /dev/tty.wchusbserial1410 --baud 460800 write_flash --flash_size=detect 0 esp8266-20190125-v1.11.bin
I started using uPyCraft. It is super easy to install micropython from the uPyCraft IDE.
The difference between the Circuit Python and micropython libraries is captured in the __init__
and _spi_rw
methods of atm90e32_u.py.