MIT License

项目介绍

EnAccess/Cicada-FW 是一个托管在 GitHub 上的开源项目,主要使用 C++ 编写,采用 MIT License 许可证,目前获得 25 个 Star、10 次 Fork。

仓库全名
EnAccess/Cicada-FW
开源许可证
MIT License
Star 数
25
Fork 数
10
未关闭 Issue
1

README 摘要

src="https://enaccess.org/wp-content/uploads/2023/04/Cicada-graphic-GitHub-2240-%c3%97-800-.svg" alt="Cicada GSM" width="640" IoT Communications Module for Energy Access. A quick way to get production ready, bi-directional communications for your IoT embedded device. alt="Project Status" alt="GitHub Workflow Status" alt="License" Cicada - IoT Communications Module for Energy Access An easy way to get production…

完整内容见 GitHub 原始 README 或本页 。

常见问题

Cicada-FW 用什么语言开发?

主要使用 C++ 编写,采用 MIT License 许可证,目前有 25 个 Star。

Cicada-FW 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 Cicada-FW 的源码?

可以直接克隆仓库:git clone https://github.com/EnAccess/Cicada-FW.git,默认分支为 main;安装与运行步骤见仓库 README。

Cicada-FW 最近还在维护吗?

仓库最近一次更新为 7月21日,当前有 1 个未关闭 Issue;Star 数为 25,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

IoT Communications Module for Energy Access. An easy way to get production ready, bi-directional communications for your IoT embedded device. Proiect supported by the EnAccess Foundation - https://enaccess.org

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
54
价值分
18
活跃状态
活跃

语言占比

C
C++
Meson

README

Cicada GSM

IoT Communications Module for Energy Access. A quick way to get production ready, bi-directional communications for your IoT embedded device.

Project Status GitHub Workflow Status License


Cicada - IoT Communications Module for Energy Access

An easy way to get production ready, bi-directional communications for your IoT embedded device.

This repository contains the source code for UART drivers, 2G, 3G, 4G and Wifi modems. This library is platform agnostic, designed to be portable - including examples for mbed, FreeRTOS, or bare metal.

Cicada uses the MQTT protocol to connect to the cloud but it can be used for general IP communication as well.

Dialing up the cellular modem, opening an IP channel and sending a MQTT packet can be done in less than 50 lines of code.

It’s easy to add support for a new microcontroller or embedded os. There is also support for Unix (Linux, OS X) to test code on a PC without the need of having access to actual microcontroller hardware.

Supported UARTs

  • STM32F1
  • Mbed
  • Unix (Linux / OS X) termios

Supported communication modules

  • Simcom SIM7x00 (3G/4G)
  • Simcom SIM800 (2G)
  • Espressif modules with AT Firmware V1.7 or V2.1 (Wifi)

The source code for each of these modules can be found in the cicada/commdevices directory.

Hardware

This library is designed to be adapted to different hardware use cases, but Okra has also designed and manufactured PCBAs for all three supported communication modules, which can be used in conjunction with this library. See the Cicada Wifi and Cicada Cellular repos for further details.

Documentation

View the hosted Doxygen here.

Build and test

Build toolchain

  • Meson + Ninja

Unit tests

  • CppUnit

Build setup

To setup build dependencies, do: git submodule init git submodule update

Native build (for testing an a host PC)

Run meson <builddirectory> to generate build files. Finally, change to the builddirectory and run ninja.

Cross build (for microcontrollers)

Run meson <builddirectory> --cross-file <crossfile>

Example: meson stm32build --cross-file stm32.cross.build

Getting started

The following code shows a simple example for STM32 which dials up the modem, connects to a host and sends an MQTT packet:

int main(int argc, char* argv[])
{
    // System configuration for microcontroller
    System_Config();

    // Set up serial port
    Stm32Uart serial(UART4, GPIOC);

    // Set up modem driver, replace this with the driver you want
    Sim7x00CommDevice commDev(serial);

    // Set up task scheduler to call the modem driver's run() function
    Task* taskList[] = {&commDev, NULL};
    Scheduler s(&eTickFunction, taskList);

    // Set up MQTT client
    BlockingCommDevice bld(commDev, eTickFunction, yieldFunction, &s);
    MQTT::Client<BlockingCommDevice, MQTTCountdown> client =
        MQTT::Client<BlockingCommDevice, MQTTCountdown>(bld);

    // Dial up modem and connect to IP host
    commDev.setApn("internet");
    commDev.setHostPort("test.mosquitto.org", 1883);
    commDev.connect();
    while (!commDev.isConnected()) {
        yieldFunction(&s);
    }

    // Connect MQTT client
    MQTTPacket_connectData data = MQTTPacket_connectData_initializer;
    data.MQTTVersion = 3;
    data.clientID.cstring = (char*)"enaccess";
    client.connect(data);

    // Send a message
    MQTT::Message message;
    message.qos = MQTT::QOS0;
    message.payload = (void*)"Hello World!";
    message.payloadlen = 13;
    client.publish("enaccess/test", message);

    // Disconnect everything
    client.disconnect();
    commDev.disconnect();
    while (!commDev.isIdle()) {
        yieldFunction(&s);
    }
}

See examples/ directory for full example code.

评论

暂无评论