DesignSpark Electrical Logolinkedin
Menu Search
Ask a Question

Connecting XinaBox IoT with Zerynth to Cloud Part 1: Introduction and Simple Example

IoT plays a crucial role to digitalise the real-world data and present this data in a visual way. Zerynth and XinaBox are the user-friendly tools for IoT prototyping. Here's a hands-on example to help you. Let's check it out.

Parts List

Product
See more products

What is XinaBox?

XinaBox is focusing on modular electronics, which helps you prototype in a short period of time. There are different core modules and sensor modules. CW01 core module and SW03 sensor module are used in this project. CW01 is the core module equipped with a ESP8266/ESP-12F Wi-Fi chip. SW03 is the weather sensor module to collect data from surrounds.

Information about XinaBox can be found at https://xinabox.cc.

What is Zerynth?

According to Zerynth, "Zerynth is a software toolkit that allows programming the most popular 32-bit microcontrollers in Python or hybrid C/Python". So, you can program a 32-bit microcontroller, like XinaBox, without touching the C code, which reduces the complexity of the project. You may check the supported devices at Zerynth Supported Devices

For more information on Zerynth, please find at https://www.zerynth.com/.

Hardware Setup

Connect the core, sensor and programming interface module as shown below.

For some of you want to know more about the pin mapping etc. technical specifications of XinaBox core module CW02, please visit XinaBox CW02 in Zerynth Docs and Technical Specifications in XinaBox website.

Zerynth Studio Setup

Zerynth Studio is one of the software tools from Zerynth. It is free and cross-platform which supports Windows 64-bit, Linux 64-bit and Mac OS X. It is an IDE for embedded programming in Python. Click the link below to download the one that is suitable for your PC OS.

Download Zerynth Studio: https://www.rs-online.com/designspark/zerynth

It is very easy to install with just a few steps. Click the link below to check the installation guide.

https://docs.zerynth.com/latest/official/core.zerynth.docs/installationguide/docs/index.html

Programming the XinaBox CW02

Device Setup in Zerynth Studio

After installation, launch the Zerynth Studio. 

  1. Create a RS DesignSpark User Account to access Zerynth. Here is the link to creat a new DesignSpark account. More quotas of virtual machine if you log in the Zerynth Studio with DesignSpark account.
  2. Connect the XinaBox to your PC through USB.
  3. Select the XinaBox CW02 (ESP32) on Device Management Toolbar in Zerynth Studio (unplug and plug it again if XinaBox CW02 is not shown; also ensure the driver is installed).
  4. Register the device by clicking the “Z” button from the Zerynth Studio.
  5. Create a Virtual Machine for the device by clicking the “Z” button for the second time.
  6. Virtualize the device by clicking the “Z” button for the third time.

Steps are shown in the video (steps are the same as CW02)

After that, you are ready to program the XinaBox.

Hands-on Example - “Hello Zerynth”

  1. Navigate to ‘Example’ tab.
  2. Click the “Hello Zerynth”. A window pops up.
  3. Click “Clone”.
  1. Change the file path if you want to clone this example project to another place.
  2. Click “Create”. 

 

  1. Some lines show up in the console at the bottom. It indicates you successfully clone the example.
  2. Double click the “main.py” in the left panel. The program code shows up.
  3. Click the “Verify” button first and “Uplink” afterwards. 
  4. Click the “Open console” button at the top. A console pops up and you can see the same result of the below picture.

Next

We will discuss how the XinaBox collects SW03 sensor data and sends it to Cloud in Part 2: Uploading Data to OKdo Cloud and Visualising Data in Dashboard. Also, thanks to DanielBerman, an interesting easy-to-build example in DesignSpark blog, Temperature Controlled Desk Fan, with XinaBox and Zerynth, allows you to play with Xinabox and Zerynth Studio.

 

My articles

1. Building a Hill Fire Detection IoT with LoRa 

Part 1: Introduction

Part 2: Details of the system

2. Connecting XinaBox IoT with Zerynth to Cloud

Part 1: Introduction and Simple Example

Part 2: Uploading Data to OKdo Cloud and Visualising Data

3. XinaBox Weather Station with ubidots Cloud

TamHoSing has not written a bio yet…