Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/golain-io/golain-platformio-sdk

PlatformIO SDK to connect to Golain IoT Platform
https://github.com/golain-io/golain-platformio-sdk

esp32 golain gsm iot iot-platform mqtt platformio protobuf

Last synced: about 1 month ago
JSON representation

PlatformIO SDK to connect to Golain IoT Platform

Awesome Lists containing this project

README

        

# Golain PlatformIO SDK

## Introduction

The Golain PlatformIO SDK is a C++ Software Development Kit designed for seamless integration with the Golain IoT
Platform. This SDK leverages the PlatformIO framework to facilitate quick and efficient setup, enabling developers to
connect their IoT devices using various communication methods. The SDK supports Wi-Fi, GSM, 4G, LTE, LoRaWAN, and NB-IoT
via TinyGSM, providing a robust solution for diverse IoT applications.

## Features

| Feature | Status |
|------------------|----------|
| Device Shadow | ✔ |
| Device Logs | ✔ |
| Device Data | ✔ |
| User Association | ✔ |
| OTA | ✔ |
| BLE | `alpha` |
| Embedded RPC | ✘ |

## Supported Hardware and Testing Status

| Hardware | Status | Tested |
|------------------------|----------|-----------|
| ESP32-WROOM32-D | `stable` | ✔ |
| ESP32-C3 | `stable` | ✔ |
| ESP32-S3 | `stable` | ✔ |
| ESP32-C6 | `stable` | ✔ |
| nRF52840-DK + SIM7600E | `dev` | ✔ |
| nRF52832-DK + SIM800L | `dev` | ✔ ; |
| nRF9160 | `dev` | ✔ |

Refer to Example Projects for more details.

## Getting Started

### Prerequisites

1. **Visual Studio Code**
- Download and install Visual Studio Code from [here](https://code.visualstudio.com/download).

2. **PlatformIO Extension for VS Code**
- Install the PlatformIO extension for Visual Studio Code from [here](https://platformio.org/install/ide?install=vscode).

3. **ProtoCompiler**
- `protoc` is required for Golain SDKs and should be available in your `PATH`.
- **Windows** - Download and install from [here](https://github.com/protocolbuffers/protobuf/releases).
- **Linux**:
- **Debian/Ubuntu**:
```bash
sudo apt install protobuf-compiler
```
- **Fedora**:
```bash
sudo dnf install protobuf-compiler
```
- **Arch**:
```bash
sudo pacman -S protobuf
```
- **MacOS**:
- via Homebrew:
```bash
brew install protobuf
```
- via MacPorts:
```bash
sudo port install protobuf3-cpp
```

### Setup

1. Create a new PlatformIO project
- Open VS Code and click on the PlatformIO icon on the left sidebar.
- Click on `New Project` and select your board.
- Select a project name and click on `Finish`.

2. Add these lines in platformio.ini

```ini
[env:esp32dev]
board = esp32dev
framework = arduino
monitor_speed = 115200
build_flags = -D "MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED"
-D ROOT_TOPIC='"/xxxxx/"' // single
-D DEVICE_NAME='"xxxxx"'
lib_deps =
ga/golain-platformio-sdk@^0.2
custom_nanopb_protos =
+
custom_nanopb_options =
--error-on-unmatched

3. Update metadata
- Update the `ROOT_TOPIC` in this format: `'"/xxxxx/"'` (replace xxxxx with your topic)
- Update the `DEVICE_NAME` in this format: `'"xxxxx"'` (replace xxxx with your device name)

4. **Get device credentials from [Golain Console](https://web.golain.io)**
- Login to Golain Console and navigate to the `Devices` section.
- Click on `Add Device` and follow the instructions.
- Download the PlatformIO `certs.h` file and place it in your project's `include` folder.
- Also, download the `project template` and place its contents in the `src` folder.

![template](assets/template.png)

5. **Update `main.cpp`**
- Replace the content of `main.cpp` with the content from the `main.ino` file provided during the header download.

6. **Install dependencies**
- From the quick access of PIO Home, go to libraries and install the following dependencies: `golain-platformio-sdk`.

7. **Verify your ESP32 board connection**
- Ensure your ESP32 board appears on the `Serial Port` from the `device` section in PIO Home.

8. **Build and flash the program**
- Once all dependencies and files are placed and modified, build the program. Your build will be flashed onto the board.

9. **Verify device status**
- If everything is done correctly, you should be able to see your device online on the [Golain Console](https://web.golain.io).

## Contributing
We welcome contributions to enhance the Golain PlatformIO SDK. Please submit pull requests to the GitHub repository.

## Support
For support and troubleshooting, please visit the Golain [support page](https://scheduler-web-development.azo.dev/consumers/event/166/golain-solutions) or contact us via [email]([email protected]).

## License
This project is licensed under the MIT License. See the [LICENSE file](https://github.com/golain-io/golain-platformio-sdk/blob/main/LICENSE) for details.