Connecting XinaBox IoT with Zerynth to Cloud Part 1: Introduction and Simple Example
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/.
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.
Programming the XinaBox CW02
Device Setup in Zerynth Studio
After installation, launch the Zerynth Studio.
- 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.
- Connect the XinaBox to your PC through USB.
- 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).
- Register the device by clicking the “Z” button from the Zerynth Studio.
- Create a Virtual Machine for the device by clicking the “Z” button for the second time.
- 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”
- Navigate to ‘Example’ tab.
- Click the “Hello Zerynth”. A window pops up.
- Click “Clone”.
- Change the file path if you want to clone this example project to another place.
- Click “Create”.
- Some lines show up in the console at the bottom. It indicates you successfully clone the example.
- Double click the “main.py” in the left panel. The program code shows up.
- Click the “Verify” button first and “Uplink” afterwards.
- Click the “Open console” button at the top. A console pops up and you can see the same result of the below picture.
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.
1. Building a Hill Fire Detection IoT with LoRa
2. Connecting XinaBox IoT with Zerynth to Cloud
3. XinaBox Weather Station with ubidots Cloud