# Software

Espoir is compatible with many software tools to accelerate development. This section outlines how to quickly get started with the most popular (and officially supported) ones.

# ESP-IDF (opens new window)

ESP-IDF is Espressif's IoT Development Framework, the most barebones development framework for ESP32. It is the basic building block for all other frameworks, and features drivers for all peripherals. To get started, simply follow the Getting Started guide (opens new window).

At the time of writing, most frameworks are based on ESP-IDF 4.4, and ESP-IDF 5.0 is currently in beta release.

# Arduino-ESP32 (opens new window)

To program Espoir with Arduino, simply follow the official Arduino-ESP32 documentation (opens new window). Select Connaxio's Espoir as your board, either in ArduinoIDE or PlatformIO.

If you wish to quickly test Espoir, you can run the ETH_LAN8720 example with the following modified line:

ETH.begin(0, -1, 32, 33, ETH_PHY_KSZ8081, ETH_CLOCK_GPIO0_IN);

# MicroPython (opens new window)

MicroPython for Espoir is currently supported by Connaxio (source (opens new window)).

You can download the compiled binary file here: micropython-espoir-v1.19.1.bin (opens new window).

If flashing for the first time, you should first erase Espoir's flash:

esptool.py --chip esp32 --port <PORT> erase_flash

then upload the binary file, by replacing <PORT> with the actual serial port, typically /dev/ttyUSBx for Linux and COMx for Windows:

esptool.py -p <PORT> -b 460800 --before default_reset --after hard_reset --chip esp32  write_flash --flash_mode dio --flash_size detect --flash_freq 80m 0x1000 micropython-espoir-v1.19.1.bin

esptool can be downloaded from the official GitHub repository (opens new window).

You are now ready to open a serial port to Espoir with a baudrate of 115200. After pressing ENTER once, you can type the following commands to establish your first LAN connection:

from machine import Pin
import network

lan=network.LAN(mdc=Pin(32),mdio=Pin(33),power=None,phy_type=network.PHY_KSZ8081,phy_addr=0)

lan.active(1)
lan.ifconfig() # Prints DHCP configuration.

# Tasmota (opens new window)

The preferred way to install Tasmota on Espoir is through TasmoCompiler (opens new window) on GitPod (opens new window).

The following guide outlines the main steps to get Espoir running with Tasmota 12.1.1. Refer to the official documentation (opens new window) for help.

  1. Go to TasmoCompiler on GitPod (opens new window) to compile Tasmota for Espoir.

    • Enter your preferred WiFi network parameters (or leave this empty to configure WiFi after installation).
    • Select ESP32:Generic and check Ethernet and other desired functionalities.
    • Enter the following Custom parameters:
    #ifdef ETH_TYPE
      #undef ETH_TYPE
    #endif
    #define ETH_TYPE        6   // ETH_PHY_KSZ8081
    
    #ifdef ETH_ADDRESS
      #undef ETH_ADDRESS
    #endif
    #define ETH_ADDRESS     0   // Always 0 for Espoir
    
    #ifdef ETH_CLKMODE
      #undef ETH_CLKMODE
    #endif
    #define ETH_CLKMODE     0   // ETH_CLOCK_GPIO0_IN
    
    • After compilation is done, download one of the two .BIN files:
      • FIRMWARE.FACTORY.BIN if this is the first time Tasmota is installed on the device.
      • FIRMWARE.BIN if this is an update.
  2. Flash Tasmota to your device using esptool (see above (opens new window)). Refer to Tasmota's documentation (opens new window) for more details.

esptool.py --chip esp32 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dout --flash_size detect 0x0 tasmota32.factory.bin
  1. Connect to your device's IP address in your web browser. You can find this address in your router's user interface, or with tools such as nmap for Linux or Advanced IP Scanner for Windows.

    • If you did not previously enter any WiFi settings, you will need to connect to your device's temporary WiFi network to configure its connection to your home WiFi.
  2. Configure Espoir's pins. In your device's new Tasmota Web Interface, go to Configuration -> Configure Other, and in the Template box, enter the following configuration line, activate it, and save:

{"NAME":"Espoir","GPIO":[0,0,1,0,1,1,1,1,1,1,1,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,5568,5600,1,7968,1,1,1,1],"FLAG":0,"BASE":1}
  1. (Optional) Deactivate WiFi to reduce power. Go back to the main menu, then go to Consoles -> Console, and type the command: EthIpAddress. You should see something similar to:
RESULT = {"EthIPAddress":"0.0.0.0 (192.168.1.105)"}

If both fields show 0.0.0.0, you need to verify your Ethernet connection or configuration for problems. Otherwise, it is safe to disable WiFi with the command: WiFi 0. The web interface will now be available at the IP address displayed above.

That's it, you are now ready to configure your application-specific settings through the other menus of the web interface.