Zerynth Tutorial to connect to LiveIntersect
The article will introduce how and why to build IoT solutions in Python using Zerynth and LiveIntersect IoT application enablement platform. Zerynth provides a software development suite that enables programming firmware in Python on 32-bit Microcontrollers and easy connectivity to LiveIntersect IoT Cloud.
During this article you will learn:
- how microcontrollers are used in IoT and Industrial IoT applications (e.g. ESP32)
- how to use Python to read data from analog and digital sensors attached to a microcontroller powered by Zerynth;
- how to use Python to easily exchange data between an Espressif ESP32 board powered by Zerynth and LiveIntersect IoT cloud
Python on ESP32 in just a few clicks using Zerynth
As already done for the ESP8266 chip, Zerynth worked hard to provide the large community of ESP32-lovers a tool to easily develop embedded and IoT applications in Python.
Searching for “Espressif” in the Zerynth Supported Devices page, you now get this boards list (and more are coming in the next months):
|Espressif ESP32 (Xtensa lx6)|
|XinaBox CW02 (ESP32)||NodeMCU ESP-32S|
|Sparkfun ESP32 Thing||DFRobot FireBeetle ESP32|
|Pycom WiPy 3.0||Esp32 Pico v4|
|Pycom FiPy 1.0||Esp32 DevKitC|
|Olimex Esp32 Gateway||DOIT Esp32 DevKit v1|
|Olimex Esp32 EVB||ESP WROOM 32|
|Espressif ESP32 (Xtensa lx6)|
|Wireless Tag WT8266-DK V2||NodeMcu v3|
|Wio Link||NodeMCU v2|
|Wemos D1 Mini||DFRobot FireBeetle ESP8266|
|Sparkfun Esp8266 Thing Dev||Adafruit Feather Huzzah|
|K64 NXP ARM Cortex M0, M3, M4|
|Mikroelektronika – NXP Hexiwear|
|NRF52832 Nordic ARM Cortex M4|
|Redbear Nano BLE 2|
|Redbear Blend BLE 2|
|SAM3X8 Microchip/Atmel ARM Cortex M3|
|Arduino Due||MikroElektronika Flip-n-Click|
|SAM D21 Xplained Dev Board||Adafruit Feather M0 Wi-Fi|
|Arduino/Genuino Zero||SAM G55 Xplained Dev Board|
|Arduino MKR1000||SAM L21 Xplained Dev Board|
|STM32F103 ST Microelectronics ARM Cortex M3|
|Particle Core||IoT DevKit AZ3166|
|Particle Photon||MikroElektronika Quail|
|Particle Electron||Sparkfun Photon RedBoard|
|ST Nucleo F401RE||ST Nucleo F429ZI|
Visit page for the updated list of supported boards here
In particular, Zerynth supports some of the most widely adopted ESP32 development boards:
- ESP32 DevKitC: created by Espressif to evaluate its official ESP-WROOM-32 More info here.
- Sparkfun ESP32 Thing. More info here.
- Olimex ESP32 Gateway. More info here.
- Olimex ESP32 EVB. More info here.
Zerynth’s goal is to let you get right into the application design and development without worrying about tedious and annoying setups and configurations.
Unlike other Python implementations for microcontrollers, with Zerynth you can make your board programmable in Python with just a few clicks!
What you DON’T need:
- you don’t need to clone any repository from Github or copy/paste scripts from here and there in the web;
- you don’t need to drag-and-drop any file in any folder or via FTP;
- you don’t need to install Python on your PC (Zerynth installs its own distribution of Python under the hood);
- you don’t need “esptool” to flash your ESP32 and you don’t need any binary file;
- you don’t need to install Putty or similar software on your PC (Zerynth Studio comes up with its own serial monitor).
What you need:
- the only thing you need is to install Zerynth Studioon your PC.
Getting Started with ESP32 and Python using Zerynth
Only 3 preliminary steps:
- Install Zerynth Studio;
- Create a Zerynth User Account;
- Connect, Register and Virtualize your ESP32 board (drivers may be needed depending on your system)
That’s it, now you can program your device in Python!
Let’s start with the Zerynth LiveIntersect Agent
- ESP32 DevKitC (Or other compatible hardware)
- Zerynth Studio (version r2.1.1 or higher)
- LiveIntersect Zerynth Extension
download from: https://docs.zerynth.com/latest/official/lib.liveintersect.iot/docs/index.html
Clone Asset Simulation project:
LiveIntersect Agent for Zerynth Microcontroller environments
Change WiFi credentials
Configure SSL Certificate [ or set ctx=none for non-ssl traffic ]
SSL certificate must match the LiveIntersect server provided in the configuration
Configure LiveIntersect Parameters
Edit the JSON file with the LiveIntersect parameters including:
baseUrl : address of LiveIntersect environment, typically https://sandbox.liveintersect.com
apiKey: apikey secret associated with the organization that you are using. (Note: API-Key included in the example config will not work in your environment. Please contact Esprida LiveIntersect to get the new API-key)
srNo: unique identifier for the asset
assetName: user friendly name for your asset
assetTypeCode: identifier for he asset type model of the asset.
- register_asset() – registers assets or sub-assets to LiveIntersect cloud
- get_asset_info() – downloads all asset configuration from the LiveIntersect cloud
- post_metric() – sends sensor data, and telemetry information to the LiveIntersect cloud
- post_attribute() – sends configuration data (such as communication frequency, model information or other parameters) to LiveIntersect cloud
Try it yourself
Get started today with Zerynth and LiveIntersect
Bring your microcontrollers to life with Python instead of C with Zerynth Studio and manage your devices at scale with the LiveIntersect integration.
To get started just setup your ESP32 board following this quick tutorial, then uplink the example “Publish and get period“ <@update link once posted on Zerynth site>
To signup for an account on Zerynth & LiveIntersect click here.
Connecting Microcontrollers to Esprida’s LiveIntersect Cloud with ZerynthRead The Article