Skip to content

How to install EN

Denis Kirin edited this page Apr 29, 2021 · 7 revisions

How to build

We know that the world of the IoT ecosystem is endless. It is filled with things of different shapes and sizes, sometimes very exotic. For this reason, we make the OWLOS Thing firmware as polymorphic and flexible as possible. You can think of OWLOS Thing as a constructor. And every time you need a new IoT thing, you take OWLOS and assembling your new thing for yourself.

Below, we provide instructions on what parts of the constructor we have for assembling IoT things and launching the thing to the IoT ecosystem.

if your board based on ESP8266, please use -> ESP8266 prepared assembly

  1. Install PlatformIO IDE

  2. Install COM port drivers for your board

  3. In PlatformIO open OWLOS workspace

  4. Setup your build configuration in config.h file

    4.1. Select WiFi Mode Access Point, Station or both Access Point and Station DEFAULT_WIFI_ACCESS_POINT_AVAILABLE 1 Access Point mode is on DEFAULT_WIFI_STATION_AVAILABLE 1 Station mode is on - setup your DEFAULT_WIFI_STATION_SSID and DEFAULT_WIFI_STATION_PASSWORD

    4.2 Enable USE_HTTPS_SERVER for on build-in HTTPS RESTful API server (see: how to generate certificates

    4.3 Enable USE_HTTP_SERVER for on build-in HTTP RESTful API server

    4.4 Enable USE_HTTP_CLIENT for on build-in HTTP RESTful API client (sends PUSH to target server)

    4.5 Enable USE_UPDATE_SERVICE for on update OWLOS firmware over GitHub

    4.6 Enable USE_OTA_SERVICE for on upload OWLOS firmware "Over The Air" with use PlatformIO

    4.7 Enable USE_MQTT for on MQTT client (not supported for ESP8266)

    4.7.1 At OWLOS/drivers/NetworkDriver.cpp use DEFAULT_MQTT_nnn defines to setup MQTT client connection parameters

    4.8 Enable USE_UART for on build-in AT+ UART command interface

    4.9 Enable USE_DRIVERS for on build-in actuators and sensors driver manager

    4.9.1 Enable drivers what you need to use (USE_nnn_DRIVER defines)

  5. build and upload OWLOS firmware to your board

    5.1 If you use OWLOS with WiFi module at Access Point mode - from your desktop or phone, scan available Access Point and select DEFAULT_WIFI_ACCESS_POINT_SSID. Open browser, and at address string navigate to http://192.168.4.1 or https://192.168.4.1 (if you use HTTPS server). OWLOS default page will be showed.

    5.2 If you use OWLOS with WiFi module at station mode, you need to know IP address of OWLOS at your local network. You can do it at two ways: - Open your router admin page and look connected OWLOS WiFi stations at client list. - Enable OWLOS Debug Mode and see the IP address at PlatformIO Terminal out. When you know local IP address, navigate your browser here. Like example http://192.168.1.100, OWLOS default page will be showed.

    5.3 If you disable WiFi features, you can use UART AT+ commands at PlatformIO terminal, or use OWLOS IoT Ecosystem Browser to communicate with.

    5.4 When you WiFi connection with OWLOS Thing is setup, and you know IP address, you can configure OWLOS Web UX for work with it. For to do this: - Going to OWLOS/data/ folder and open restclient.js file - At this file change "var boardhost =" to your IP address value. - Then just open index.html file local at your browser

    5.5 You can pack and upload configured OWLOS Web UX files to your OWLOS Thing, in this way OWLOS switch to stand alone Web Server with Web UX. After connecting OWLOS/data WebUX to ESP32 [5.4](the ESP32 IP is required in restclient.js), you need to do the following (Windows only):

    5.5.1 Install the 7z.exe archiver (it allows you to create .gz archives)

    5.5.2 Specify the path to 7z.exe in the System Path or remember the absolute path. In our case, this is "D:\7Zip\7z.exe"

    5.5.3 Open the file OWLOS\compile_UI_only.bat and correct the path to 7z.exe as required.

    5.5.4 Run OWLOS\compile_UI_only.bat, this will pack all the necessary WebUX files from OWLOS\ data folder to OWLOS\data\CompressedFull

    5.5.5 Several packed archives at OWLOS\data\CompressedPackOne folder:

    • index.html.gz
    • owlos.css.gz
    • owlos.js.gz

    5.5.6 Using the WebUX you configured 5.4, go to the Node\Files menu and Upload these three files to your ESP32.

    5.5.7 Navigate to http://(your ESP32 IP) in your browser - this should load OWLOS WebUX from ESP32. And you no need more to use OWLOS/data local WebUX files. Now ESP32 is stand alone IoT thing with WebUX.

    5.5.8 If you don't want to deal with packing files, start with 5.5.6, just upload three archives to ESP32, but in this case, each time you will have to enter the IP address of ESP32.

    5.5.9 If you want to connect ESP32 with the built-in WebUX from the Internet (which is possible, but very dangerous, only as an experiment) - specify the external address in the restclient.js

Clone this wiki locally