Skip to content

Hello rhomb.IoT

In previous articles we have explained how to create a PlatformIO project and configure the platformio.ini and conf-user.h files.

It's time to download rhomb.iot, put it in our project and start writing an example of hello world.

Download rhomb.IoT

In order to download rhomb.IoT you can either clone the Git repository or download a zip file from the Releases section of our repository.

To clone the repository you can use the following command:

git clone https://gitlab.com/rhombio/things360/rhomb.iot.git

If you want to contribute to the development of rhomb.IoT you'll want to read the developers Contribution Guidelines.

File Structure

This is the file structure of your PlatformIO project with rhomb.IoT:

.
├── lib/
│   └── rhomb.iot/
|       ├── data/
|       ├── docs/
|       ├── src/
|       |   └── rhomb.iot.h
|       └── test
├── src/
│   └── main.cpp
├── test/
|   └── [...]
└── platformio.ini

As you can see we have placed the rhomb.iot directory inside lib. Now we can edit the main.cpp to have something like this:

#include <Arduino.h>
#include <Wire.h>
#include "rhomb.iot.h"

void setup() {
  core::setup();
}

void loop() {
  core::loop();
}

That's it! now it's time to compile and flash our project. If you want to know what happens behind the scenes of this main.cpp see the life cycle of the application in the developers docs.

Compile and Upload

At the bottom of VS Code there is a toolbar with some options:

Platformio dialog box new project
  1. Connect your device to the computer with the USB cable
  2. Look at the COM port assigned to your device by your computer and configure the file platformio.ini
  3. Push the build button or upload. Upload will do also a build.
  4. If all is OK your device is ready, open the serial monitor and you should see and output like this:
------------------------------------
RHOMB.IOT - The Modular IoT Firmware
       version 0.1.0

[I] 0 setup MAIN interruption on pin: 0
[I] 0 INIT ESP32 SPIFFS Memory
[I] 0 Rolling Log File
[I] 0 INIT Timer
[I] 0 Use default config - Version: 1
[I] 0 [info] Previus config loaded
[I] 0 SET Opmode: 1
[I] 0 SET new device ID: 4245060915
[I] 0 INIT device
[I] 0 SET OPMODE NORMAL
[I] 1 SET Opmode: 1
[I] 2 Enable WiFi
[I] 2 home: 1111aaaa
[I] 2 Trying to connect WiFi...: 255
[I] 3 Wifi Connected
[E][WiFiClient.cpp:309] setOption(): fail on fd -1, errno: 9, "Bad file number"
[I] 3 SET Opmode: 4

Comments