frame

How to import and use python libraries from GitHub and other sources - ESP32 (ESP32 DevKitC)

Hi, I just intsalled Zerynth and was able to connect to my board and upload simple examples from the Zerynth Examples Library, i.e. Wifi. I very much hope that Zerynth offers an easier approach to Python programming the ESP32 than MicroPython (which is what I tried before).

To take full advantage of Zerynth and Python I need to be able to import and use libraries from sources like GitHub. For instance I would like to use the Adafruit Bosch BME280 sensor library, LCD 1602 character display library, the AS3935 sensor library or a various Twitter libraries. These are obviously not in the Zerynth examples list.

How can I import / use https://github.com/adafruit/Adafruit_Python_BME280, or https://pypi.python.org/pypi/bme280, or https://github.com/bear/python-twitter, https://pypi.python.org/pypi/twitter, or http://tweepy.readthedocs.io/en/v3.5.0/ or https://github.com/pcfens/RaspberryPi-AS3935 or https://github.com/adafruit/Adafruit_Python_CharLCD ?

If these cannot imported directly, please advice how I can use them.

Thank you!

WX3080

Comments

  • You can't use Raspberry Pi or Micropython librariers in Zerynth as the APIs are different. You would have to re-do the backend side of those libraries first.
  • Hi  @wx3080,

    @riklaunim is right; you have to port source code of those libraries into Zerynth syntax since Zerynth has its own customized and optimized for embedded Python3 distribution (take a look here).
    This operation can be more or less complex depending on the source code.

    For example, here you can find some advice for implementing an I2C sensor library starting from i2c.I2C class of the Zerynth Standard Library. 

    Let me know if this can help you :)

    Matteo Cipriani
    Zerynth Support Team
  • Hi @wx3080, 

    we're planning a campaign of articles and video tutorials to help our users on implementing Zerynth/Python libraries.

    In the meantime, enjoy the new patch with support for Bosch BME280:
    https://community.zerynth.com/discussion/550/patch-p02-for-zerynth-r2-0-10-is-available-with-support-for-nodemcu-esp-32s-and-bug-fixes

    Regards
    Luigi F. Cerfeda
    Biz dev & Marketing Technologist at Zerynth
Sign In or Register to comment.

ZERYNTH Community

@ 2016 Zerynth.com, all rights reserved.