Skip to main content

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

Qty Product Part number
1 XinaBox xCHIP Wi-Fi & Bluetooth Core Module CW02 174-3702
1 XinaBox SW03, Weather Sensor Module for MPL3115A2 174-3746
1 XinaBox, USB Programming Interface Module for FT232R - IP01 174-3703
1 Zerynth Studio

What is XinaBox?

IMG_7176_b6817bd951a2302f206e607ba1a239dbb2ea6c4e.jpg

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.

IMG_0828_copy_bca0cfee1948f24bfede25b222823da0cd6b9e60.jpg

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).Screenshot_2019-08-19_at_13.38_.04_2__4e48b6459967077c38061837cc3e5c35bead4422.png
  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”.Screenshot_2019-08-19_at_13.55_.34_2__0acd4e31fb1cf6043b886ec504fe13c3b3f829b4.png
  1. Change the file path if you want to clone this example project to another place.
  2. Click “Create”.Screenshot_2019-08-19_at_14.00_.31_1_9514a8633bdbe0bda24db2d8978ec392a1fb78db.png
  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.Screenshot_2019-08-19_at_14.00_.31__9514a8633bdbe0bda24db2d8978ec392a1fb78db.png
  4. Click the “Open console” button at the top. A console pops up and you can see the same result of the below picture.Screenshot_2019-08-19_at_14.22_.50__84cb6d702de6fa4615361e342c4795d350a888fd.png

Next

We will discuss how the XinaBox collects SW03 sensor data and sends it to Cloud inPart 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

A student studying electronic and information technology and keen to learn new skills.