Python and LoRaWAN: from «Hello World» to professional IoT solutions

Luigi F. Cerfeda The Things Conference 2019 [email protected]

Zerynth - Confidential | © 2018 www.zerynth.com Abstract

You will learn how to build IoT and Industry 4.0 applications in Python using Zerynth and The Things Network.

The coding and prototyping session will include: - how to run multithreading Python scripts on a generic 32-bit in a few clicks; - how to read data from a digital sensors using Python; - how use Python to send data from an ESP32 board to The Things Network for Industrial LoRaWAN Applications.

Zerynth - Confidential | © 2018 www.zerynth.com 2 Materials

What we’ll provide: ● 1 x Flip&Click by Mikroelektronika ● 1 x Weather Click by Mikroelektronika; ● 1 x LoRa Click by Mikroelektronika (based on Microchip’s RN2483 chip); ● 1 x XinaBox CW02 ● 1 x Xinabox SW01 ● 1x 4zerobox, a modular electronic board for Industrial IoT applications, based on ESP32 by Espressif Systems and programmable in Python using Zerynth.

Required Your computer with Zerynth Studio installed. You can download it for free here: https://www.zerynth.com/zerynth-studio/

Zerynth - Confidential | © 2018 www.zerynth.com 3 Facing the IoT Challenge

Zerynth - Confidential | © 2018 www.zerynth.com 4 IoT - linking the physical and the digital world

The main purpose of IoT is to link the physical world with the digital world. The process is quite simple, in theory at least:

1. Collect data from real-world objects using embedded hardware technologies

2. Communicate and aggregate those data into information

3. Present clear results to systems or users so that decisions can be made

Zerynth - Confidential | © 2018 www.zerynth.com 5 The spread of embedded hardware technologies

Fact: In the last years the performances of embedded technologies are continuously increased and their price is decreased year by year.

Anyway, IoT products and solutions aren’t so pervasive in our society as we can expect.

Why?

Zerynth - Confidential | © 2018 www.zerynth.com 6 IoT is a Challenge

The software barriers to entry into IoT were still high. As the need for embedded programming to support the latest IoT designs grown, companies and developers were (and still are) challenged identifying the right software solutions to bring IoT to life.

Our Mission

Reducing the complexity and provide an easy, performant and cost-effective way of programming IoT devices.

Zerynth - Confidential | © 2018 www.zerynth.com 7 Enabling Python for

Zerynth opens IoT and embedded development to the huge community of Python programmers.

Zerynth - Confidential | © 2018 www.zerynth.com 8 Zerynth is the middleware for IoT and Industry 4.0

Zerynth is a software toolkit that allows programming in Python or hybrid /Python the most popular 32-bit microcontrollers, and connect them to the leading Cloud Infrastructures.

Zerynth - Confidential | © 2018 www.zerynth.com 9 The Zerynth Tools

Zerynth Studio Zerynth VM Zerynth ADM Zerynth App

A free, cross-platform, A virtual machine built on An Advanced Device A mobile app to monitor powerful IDE and a top a multithreaded RTOS Manager to simplify testing and control Zerynth Toolchain for developing that provides code reuse on of device provisioning, powered devices through Python or hybrid C/Python 32-bit microcontrollers, in Over-The-Air fully customizable HTML/JS applications and managing just 60-80kB of Flash and updates, and Remote Graphical User Interface. boards. 3-5kB of RAM. Procedure Calls.

Free Download Free Download www.zerynth.com/zerynth-studio/ www.zerynth.com/zerynth-app/

Zerynth - Confidential | © 2018 www.zerynth.com 10 Zerynth speeds up the IoT development

Zerynth provides developers with an ecosystem of software tools to program microcontrollers in Python or C and connect them to the Cloud.

Zerynth - Confidential | © 2018 www.zerynth.com 11 Zerynth Integrations

Microcontrollers / Boards Cloud / IoT Dashboards Sensors / Actuators

Zerynth is multi-board compatible. It Zerynth is compatible with many Cloud Zerynth allows rapid integration with supports 32-bit microcontrollers and providers, such as Microsoft Azure, sensors, actuators, and industrial development boards from top vendors. Amazon Web Services, IBM Bluemix, protocols, reducing product development Google Cloud IoT and many others. time and efforts.

Learn More Learn More Learn More www.zerynth.com/zerynth- www.zerynth.com/cloud-integrations/ www.zerynth.com/zerynth-libraries/ supported-devices/

Zerynth - Confidential | © 2018 www.zerynth.com 12 Simple Multi-Blink Example

Zerynth - Confidential | © 2018 www.zerynth.com 13 Connecting ESP32 to Google Cloud IoT using Zerynth

MQTT client connecting to Google Cloud IoT Core and publishing at a default period, waiting for updates requested as changes to device config.

Only 50 lines of easy and readable Python (comments included).

Zerynth - Confidential | © 2018 www.zerynth.com 14 Connecting ESP32 to AWS using Zerynth

MQTT client connecting to AWS IoT service, sending data and receiving Shadow updates.

Only 40 lines of easy and readable Python.

Zerynth - Confidential | © 2018 www.zerynth.com Connecting Microchip MCU to AWS using Zerynth

MQTT client connecting to AWS IoT service, sending data and receiving Shadow updates.

Only 40 lines of easy and readable Python.

Zerynth - Confidential | © 2018 www.zerynth.com 16 Zerynth Virtual Machine - Licensing

Zerynth Studio is free, while Zerynth Virtual Machines are licensed for each specific microcontroller and come in two versions.

The user registers to create a Zerynth account and receives a free welcome pack of 10 Zerynth VM Licenses with FreeRTOS (5 “Starter” and 5 “Premium”) to use on any of the supported boards.

● The user can program as many boards as the number of VM in his possession. A specific section of Zerynth Studio reports the available assets. ● Mass programming: we provide scripts to automate flashing big volumes of Virtual Machine in the production phase.

PRICING Current Licenses pricing is shown at store.zerynth.com, where the user can buy additional Zerynth VM licenses (up to 1000). Higher volumes can be ordered at [email protected]

Zerynth - Confidential | © 2018 www.zerynth.com 17 Zerynth Virtual Machine - Licensing Embedded devices “Powered by Zerynth”, sold with Zerynth VM licenses inside

Zerynth - Confidential | © 2018 www.zerynth.com Zerynth Virtual Machine - Licensing Embedded devices “Powered by Zerynth”, sold with Zerynth VM licenses inside 4ZeroBox XinaBox The Industrial toolkit for IoT solution providers Fast-Tracked Python IoT Development Kit

More info: More info: https://www.zerynth.com/blog/zerynth-and- http://www.thingsoninternet.it/4zeroplatform/ xinabox-partnership-brings-an-innovative-iot-toolkit/

Zerynth - Confidential | © 2018 www.zerynth.com Partners

Interested in integrating your technology with Zerynth? Contact us at [email protected]

Zerynth - Confidential | © 2018 www.zerynth.com 20 The Things Network and Zerynth

Zerynth - Confidential | © 2018 www.zerynth.com 21 Zerynth is the initiator of TTN in Pisa (Italy)

Zerynth - Confidential | © 2018 www.zerynth.com 22 The Things Conference Italy – Powered by Zerynth

More info: https://www.zerynth.com/the-things-conference-italy-2018/

Zerynth - Confidential | © 2018 www.zerynth.com 23 Zerynth & Security Zerynth listed as a Trusted IoT Platform Partner by Microchip

More info: https://www.zerynth.com/blog/zerynth-listed-as-a-trusted-iot-platform-partner-by-microchip/

Zerynth - Confidential | © 2018 www.zerynth.com 24 DesignSpark Zerynth - RS Components The biggest embedded engineers community

More info: https://www.zerynth.com/blog/rs-components-and-zerynth-partnership-designspark-zerynth-studio-middleware-toolkit-available-for-download/

Zerynth - Confidential | © 2018 www.zerynth.com 25