CanAirIO firmware upload alternatives

Overview

CanAirIO device supports ESP32 boards with Bluetooth and Wifi features, all boards with it should be able to receive the current firmware. We have five alternatives for uploading it:

Alternative Difficulty Software Requeriments
CanAirIO Loader Easy Arduino Droid App Android and OTG cable
CanAirIO Loader Basic Arduino IDE USB drivers on Windows and MacOSX
Espressif Uploader Basic Espressif tool Only works on Windows
CanAirIO Installer Basic Python3 USB drivers on Windows and MacOSX
Source code Advanced PlatformIO No needs drivers on Linux

The current supported boards with these methods are here

Boards supported

The last release of CanAirIO Device supports the next boards:

Firmware Name Boards supported Display Guide and schematics
TTGO_TDISPLAY TTGO T-Display eTFT CanAirIO Bike
TTGO_T7 TTGO T7, D1Mini, ** OLED 64x48 CanAirIO v2.1
ESP32DevKit ESP32DevKit, NodeMCU V3, ** OLED 128x64 HacksterIO
TTGO_TQ TTGO TQ Builtin OLED TTGO_TQ board
WEMOSOLED WemosOLED and similar boards OLED 128x64 ESP32 OLED board
HELTEC ESP32 Heltec board OLED 128x64  

** is possible that the current firmware supports more boards and sensors. Also you can choose the sensor brand or type on the CanAirIO Android app.

CanAirIO Loader

With this method you will able to upload the latest version of CanAir.IO firmware automatically via a simple Arduino sketch

You can run it from your Arduino IDE or from your Android phone using ArduinoDroid app (recommended) with a simple OTG cable connected to your board. (see the video below)

Steps

  1. Install Arduino IDE or Arduino Droid app
  2. Install the Arduino Json Library v6.x from ther Library Manager
  3. Configure your board: ESP32 Dev Module or similar board
  4. Select partion schema to minimal (OTA with 1.9Mb to app 190kbs to SPIFFS)
  5. Configure your WiFi credentials in the downloaded sketch
  6. Build and upload, wait for, the last version of CanAirIO will be installed
  7. (optional) see the progress on Serial console or monitor.
  8. Android app guide for using the device like a mobile or fixed air quality station

Video demo

Youtube CanAirIO basic loader guide

Troubleshooting

Not happen anything after upload

Please view the output messages in the serial monitor, maybe you have internet connection issues, for that:

  • Wait for complete upload firmware (i.e 100%)
  • Enter to serial monitor (button on top right)
  • Press and hold the reset button
  • The serial output in Arduino Droid app for example is similar like this:

serial monitor output example

  • The output in Arduino IDE monitor is the same.

When I try to compile have errors

For example if you have the next error:

serial monitor output example

loader (1).ino:53:5: error: redefinition of 'int_payloadVersion'

maybe you have two or more files open in the IDE, please review the opened tabs:

serial monitor output example

Espressif Uploader

This option you don’t need compiling the binaries, you can download the pre-built binaries and follow the next steps:

Steps

  1. Download the zip file from assets section with the name canairio_revxxx_20xxXXXX.zip and uncompress it

    Firmware releases - Assets section

  2. Please download the official Espressif software: Flash Download Tools (ESP8266 & ESP32) from https://www.espressif.com/en/support/download/other-tools

  3. Please connect your board using a USB data cable, some power bank or charger cables could not work. If you Windows machine don’t have the drivers, please download it before.

  4. Open the software Flash Download Tools.

  5. Please choose “Developer Mode” and then, the third square “ESP32 DownloadTool”.

  6. After that, the window for load the binaries files will be show:

    Firmware releases - Assets section

  7. Please load the four files like is showed in the screenshot with the next values:

     bootloader_dio_40m.bin... @ 0x1000
     partitions.bin... @ 0x8000
     boot_app0.bin.... @ 0xe000
     canairio_ESP32DEVKIT_rev680_20201121.bin... @ 0x10000
    

    Please note that you should choose the right binary for your CanAirIO device model, for example if you have a ESP32DEVKIT board, you should load the binary: canairio_ESP32DEVKIT_rev793.bin. The others binary files are located in the directory called system into the canairio installer zip.

  8. check the speed:

     SPI SPEED: 40MHz
     SPI MODE: DIO
    
  9. check the option: DoNotChgBin.

  10. Please show your serial comm port and velocity.

  11. Please click in the START button.

  12. When the firmware downloading finished, please click STOP button.

  13. Disconnect your board from the USB cable.

  14. Reboot your device and CanAirIO home screen will be showed.

CanAirIO Installer

This option you don’t need compiling the binaries, you can download the pre-built binaries and follow the next steps:

Prerequisites

Please before install Python3 and esptool package. More information here

Steps

  1. Connect your CanAirIO device to your USB
  2. Download the last firmware release
  3. Unzip and execute the next command for your model board*, like this:
unzip canairio_rev414_20190829.zip
cd canairio_installer
./install.sh canairio_TTGO_T7_rev605_20200925.bin

Advanced options

For more options run ./canairio_installer help.

USB parameters

For example you can increment the upload speed:

./install.sh usb canairio_TTGO_T7_rev792.bin /dev/ttyUSB0 1500000

OTA parameters

Send OTA updates to any board supported in your local network, like this:

./install.sh ota canairio_d1mini_rev414_20190829.bin

Also you can specify the IP address:

./install.sh ota canairio_xxx.bin 192.168.1.10

Via Source Code

The last steps for build and upload a version of CanAirIO firmware are here