Coder Social home page Coder Social logo

permalmberg / smooth Goto Github PK

View Code? Open in Web Editor NEW
319.0 18.0 31.0 16.05 MB

C++ framework for embedded programming on top of Espressif's ESP-IDF.

License: Apache License 2.0

C++ 86.16% C 4.55% CMake 4.53% Shell 1.07% HTML 3.61% Dockerfile 0.02% Python 0.06%
esp32 esp-idf espressif

smooth's Introduction

Smooth

C++ framework for writing applications based on Espressif's ESP-IDF.

Forking?

Unless you're seriously intending to contribute to the project, please do not fork. Press that โญ-button instead - it shows your support for the project while keeping the number of (potentially) dead forks to a minimum.

Overview

Smooth provides a set of classes that makes life as a developer easier compared to working directly with ESP-IDF & FreeRTOS APIs. An application built with Smooth is entirely event driven and thread-safe*. Smooth utilizes the power of FreeRTOS, but hides all the complexities from the application programmer.

Traditionally, embedded systems require a fully static memory footprint after start-up. Smooth takes a somewhat more pragmatic view on this; it utilizes the standard library (which is not memory static) to provide cleaner code, at the cost of some extra used bytes of RAM. However, where it is appropriate, such as with the queues, things are designed so that the result is a memory static instance, i.e. a smooth::ipc::Queue will have a memory static footprint once initialized.

mock-idf provides the ability to compile even applications that uses ESP-32 hardware for Linux with the only consideration that the mocks do not actually simulate the hardware.

*) To certain limits, of course.

Requirements

  • ESP-IDF v4.x
  • GCC 8

Smooth is developed on a Linux machine so how well it compiles using the Windows toolset povided by Espressif is unknown. If you are working on Windows or you don't want to install the dependencies on your local machine you can use the docker images which are provided.

Provided functionality

Core

  • Application initialization
  • Wifi configuration / control
  • Tasks
  • Queues with support for proper C++ objects, not just plain data structures
  • Timer Events
  • Event-driven TCP Sockets, including TLS support and server sockets.
  • System events

Hardware level

  • Output
  • Input
  • Input with interrupt to event translation
  • I2C Master Device class
  • SPI Master Device class
  • Flash and SDCard initialization.

Application level

  • HTTP(s) Server
    • Simple templates
    • Websocket support
  • MQTT Client
  • Device support
    • SPI
      • Sensors
        • BME280
      • Displays
        • ILI9341
        • ST7735
        • SH1107
    • I2C
      • BME280
      • MCP23017
      • DHT12
      • AxpPMU
      • PCF8563
    • RGB LED, i.e. WS2812(B), SK6812, WS2813, (a.k.a NeoPixel).
  • Filesystem helpers

Using Smooth in your project (compiling for ESP)

In your projects's root folder, type the following to add smooth as a submodule.

git submodule add https://github.com/PerMalmberg/Smooth.git externals/smooth

Then, to retrieve Smooth and its submodules, run:

git submodule update --init --checkout --recursive

Assuming you are following IDF's recommended way of structuring projects, make your top CMakeLists.txt look something like this:

cmake_minimum_required(VERSION 3.10)

set(CMAKE_CXX_STANDARD 17)

if(${ESP_PLATFORM})
include($ENV{IDF_PATH}/tools/cmake/project.cmake)

# Include Smooth as a component
set(EXTRA_COMPONENT_DIRS
         externals/smooth/smooth_component)

project(name_of_your_project)
else()
    # Empty project when not building for ESP (i.e. when loading the project into an IDE with already configured tool chains for native Linux)
endif()

Next, your main/CMakeLists.txt should look something like this:

cmake_minimum_required(VERSION 3.10)

set(CMAKE_CXX_STANDARD 17)

set(SOURCES main.cpp
        main.cpp
        main.h
        )

idf_component_register(SRCS ${SOURCES}
        INCLUDE_DIRS
            ${CMAKE_CURRENT_LIST_DIR}
            $ENV{IDF_PATH}/components
        REQUIRES
            smooth_component
        )

Now build your project using the following commands, or via a properly setup IDE.

cd your_project_root
mkdir build && cd build
cmake .. -G "Ninja" -DESP_PLATFORM=1 -DCMAKE_TOOLCHAIN_FILE=$IDF_PATH/tools/cmake/toolchain-esp32.cmake && ninja

or, if you're using old-fashioned make

cd your_project_root
mkdir build && cd build
cmake .. -DESP_PLATFORM=1 -DCMAKE_TOOLCHAIN_FILE=$IDF_PATH/tools/cmake/toolchain-esp32.cmake && make

Next, flash your project to the target device.

idf.py -C .. --baud 921600 -p /dev/ttyUSB1 app-flash monitor

If it's the first time, use this command instead to also flash the partition table:

idf.py -C .. --baud 921600 -p /dev/ttyUSB1 flash monitor

Menuconfig / sdkconfig

Don't forget to configure your target properly by running ninja menuconfig to update your file sdkconfig before building. There is an sdkconfig file included with Smooth and used in the test projects. While you can use it for as a base by copying it to your project root, you are encouraged to adjust it to your specific needs and use case.

Sample/test applications

Please see the the different test projects under the test folder. When compiling these, open the root of the repo as a CMake project. Select the project you wish to build by setting selected_test_project in the top CMakeLists.txt. You will likely have to re-generate your build files after changing the selection.

Using Smooth in your project (compiling for Linux or MacOS)

System Libraries

Some libraries provided in the ESP distribution need to be installed as system libraries on the host. On Debian / Ubuntu:

apt-get install libsodium-dev libmbedtls-dev

With Homebrew on MacOS:

brew install libsodium mbedtls

CMake Config

To build your application on the host platform you must maintain a parallel build configuration as follows:

Top CMakeList.txt

if(${ESP_PLATFORM})
    include($ENV{IDF_PATH}/tools/cmake/project.cmake)

    # Include Smooth as a component
    set(EXTRA_COMPONENT_DIRS
             externals/smooth/smooth_component)
    project(your_project_name)
else()
    if(${APPLE})
        include_directories(SYSTEM /usr/local/include)
        link_directories(/usr/local/lib)
    endif()


    add_subdirectory(main)
    add_subdirectory(externals/smooth/lib)
    add_subdirectory(externals/smooth/mock-idf)
endif()

Your main/CMakeList.txt:

cmake_minimum_required(VERSION 3.10)

set(SOURCES} app.cpp app.h)

if(${ESP_PLATFORM})
    idf_component_register(SRCS ${SOURCES}
                            INCLUDE_DIRS
                                ${CMAKE_CURRENT_LIST_DIR}
                                $ENV{IDF_PATH}/components
                            REQUIRES
                                smooth_component)
else()
    project(your_project_name.elf)
    add_executable(${PROJECT_NAME} ${SOURCES})
    target_link_libraries(${PROJECT_NAME} smooth pthread)
    target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR})
endif()

Building on MacOS

Currently only GCC is supported. You can install GCC via homebrew and then pass flags to CMake to use that compiler:

brew install gcc
mkdir cmake-macos
cd cmake-macos
cmake -DCMAKE_C_COMPILER=gcc-9 -DCMAKE_CXX_COMPILER=g++-9 ..
make

Here's an example of how your main.cpp could look like if you want to compile for both ESP and Linux. The example assumes you have named your main class App and it is derived from smooth::core::Application, which most applications based on Smooth do. Doing so is not mandatory, it saves you some setup; see Application.cpp for details on what it does for you.

extern "C"
{
#ifdef ESP_PLATFORM
void app_main()
{
    App app{};
    app.start();
}
#else
int main(int /*argc*/, char** /*argv*/)
{
    App app{};
    app.start();
    return 0;
}
#endif

}

Running CI scripts locally

If you want to test your changes in Smooth, you need to pass the CI on Github. To test your changes on your local system you can use docker:

  • to compile the host binaries: docker-compose run --rm smooth ./CI/build_smooth_host.sh
  • to run the host unit test: docker-compose run --rm -w /src/build/host/test/linux_unit_tests smooth ./linux_unit_tests
  • to compile the esp32 binaries: docker-compose run --rm smooth ./CI/build_smooth_esp32.sh

To run these commands at once you can run this script: ./CI/build_test.sh

Run a host build with TCP ports

On default docker-compose is not opening the ports in in the run mode. To open the TCP ports for server testing you need to enter the docker image in this way:

docker-compose run --service-ports --rm smooth

Choose different release branches for the ESP32 build

For the esp32 binaries the mainline branch is used on default. If you want to use a release branch you have to set the environment variable ESP_IDF_VERSION. Here is an example with the v4.2 release branch: ESP_IDF_VERSION=release-v4.2 docker-compose run --rm smooth ./CI/build_smooth_esp32.sh

In CI, all compatible branches of IDF are checked on each push and pull request.

smooth's People

Contributors

com8 avatar enelson1001 avatar jeremyjh avatar jsmestad avatar kerryrj avatar paul-simpson avatar permalmberg avatar peterus avatar squonk11 avatar tmiw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smooth's Issues

Extend "WiFi" class with support for access point mode

In my application for wifi both modes (station and access point) are needed. The current implementation of the WiFi class supports the station mode only. So, an extension of the WiFi class for access point mode is needed. I will try to implement it and provide a PR.

Feature request

Per
This is not an issue with the Smooth library just a feature request.
Could you add RMT to your io's and maybe some event handling. Hopefully this is something you been thinking about doing.
Right now I have written code using Task from esp32-snippets and think it could be vastly improved with your library. I am using both RMT transmitter and an RMT receiver.
In Project Simulator I use the the RMT transmitter to simulates the transmission of a message from product XYZ. I have the RMT transmitter in a Task waiting for me to feed it std::vector<rmt_item32_t> data to send out. The simulator has a class that builds a raw message from data provided to it and another class that converts the raw message to and RMT message. This class then passes the RMT data to the RMT transmitter. The message sent out includes sync bits + message + end of message bit. I have this project working.
In Project App I use the RMT receiver in a Task that is constantly sending chucks of RMT messages received to another Task that is converting RMT bits to raw bits (sync, data, end of message) and looking for a signature that indicates that a real message has been received. In the real world the RMT receiver is constantly receiving a stream of bits (most of the time its junk). The raw byte message received is then passed to another Task to parse the message and get the data from it. I am still working on this project.

  1. Do you foresee adding RMT in the near future (ie 2-3 months).
  2. If you are not adding RMT in the near future what pieces of your existing code would you recommend I look at to create an RMT io.
  3. Or is it possible to use what you current have and just add xxx to provide RMT.
  4. Have you thought about a uart io. Has similar properties: transmitter and receiver.

Thanks

Implement a Carrier for event queues

The Queue<T> class (and compositions thereof) can be enhanced to allow more than one type to be queued. In short, this is accomplished by using a Carrier-class and a base class that 'executes' the carried event via a known interface.

Platform IO

Hi,

I looked at your library and I like it quite a bit.
Have you considered register Smooth with Platform IO? It would be very easy and useful. I could help with that as well since I started to work on my implementation (before finding Smooth that is).

Undefined refernce to esp pthread set cfg

I am trying to build a simple hello world. I am using VSCode for IDE and have been using nkolban esp32 snippets without any problem. This is the error I am seeing on the build.

LD build/hello_world.elf
/home/ed/esp32/projects/sandbox/hello_world/build/smooth/libsmooth.a(Task.o):(.literal._ZN6smooth4core4Task5startEv+0x10): undefined reference to esp_pthread_set_cfg(esp_pthread_cfg_t const*)' /home/ed/esp32/projects/sandbox/hello_world/build/smooth/libsmooth.a(Task.o): In function smooth::core::Task::start()':
/home/ed/esp32/esp-idf/components/smooth/include/smooth/core/Task.h:78: undefined reference to `esp_pthread_set_cfg(esp_pthread_cfg_t const*)'
collect2: error: ld returned 1 exit status
/home/ed/esp32/esp-idf/make/project.mk:405: recipe for target '/home/ed/esp32/projects/sandbox/hello_world/build/hello_world.elf' failed
make: *** [/home/ed/esp32/projects/sandbox/hello_world/build/hello_world.elf] Error 1
The terminal process terminated with exit code: 2

Any idea what is going on?

I am using commit 2f32356. as I was having problems with the latest commit. Even with this commit I had to change smooth/include/smooth/core/json/Value.h line #6 from #include <json/cJSON/cJSON.h> to #include <cJSON.h> or else compiler could not find thecJSON.h file.

Thanks

Investigate crash

I (372211) MemStat: [INTERNAL]
I (372222) MemStat: 8-bit F:64700 LB:32664 M:44576 | 32-bit: F:78536 LB:32664 M:58392
I (372224) MemStat: [INTERNAL & DMA]
I (372237) MemStat: 8-bit F:64836 LB:32664 M:44576 | 32-bit: F:64836 LB:32664 M:44576
I (372239) MemStat: [SPIRAM]
I (372253) MemStat: 8-bit F:3356996 LB:3311200 M:3338372 | 32-bit: F:3353884 LB:3311200 M:3338372
I (372255) MemStat: Name	Stack	Min free stack
I (372260) MemStat: MainTask	25600	16316
I (372268) MemStat: SocketDispatcher	20480	2784
I (373340) Socket: [, 0, 57, 0x3fff236c]: Could not get buffer container
I (373345) Socket: [, 0, 57, 0x3fff236c]: Socket stopping
abort() was called at PC 0x401ebf8f on core 0
0x401ebf8f: __cxxabiv1::__terminate(void (*)()) at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:47


ELF file SHA256: cc3a727c7b571b062530e969af4ca4858f703abea5e0f7a2fd9071d72e7d8c6c

Backtrace: 0x400936e9:0x3ffc5230 0x40093b5c:0x3ffc5260 0x401ebf8f:0x3ffc5290 0x401ebfda:0x3ffc52b0 0x401ec053:0x3ffc52d0 0x401160e6:0x3ffc52f0 0x4011553e:0x3ffc5410 0x40116b36:0x3ffc5510 0x4010afe7:0x3ffc5540 0x40144dc6:0x3ffc5580 0x40144962:0x3ffc5670 0x400d5466:0x3ffc5730 0x40149045:0x3ffc58c0 0x400983ea:0x3ffc58e0
0x400936e9: invoke_abort at /home/permal/esp/esp-idf/components/esp32/panic.c:155

0x40093b5c: abort at /home/permal/esp/esp-idf/components/esp32/panic.c:172

0x401ebf8f: __cxxabiv1::__terminate(void (*)()) at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:47

0x401ebfda: std::terminate() at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:57

0x401ec053: __cxa_pure_virtual at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/pure.cc:50

0x401160e6: smooth::application::network::http::HTTPServerClient::send_first_part() at ??:?

0x4011553e: smooth::application::network::http::HTTPServerClient::event(smooth::core::network::event::TransmitBufferEmptyEvent const&) at ??:?

0x40116b36: non-virtual thunk to smooth::application::network::http::HTTPServerClient::event(smooth::core::network::event::TransmitBufferEmptyEvent const&) at ??:?

0x4010afe7: smooth::core::ipc::TaskEventQueue<smooth::core::network::event::TransmitBufferEmptyEvent>::forward_to_event_listener() at ??:?

0x40144dc6: smooth::core::Task::exec() at ??:?

0x40144962: smooth::core::Task::start() at ??:?

0x400d5466: app_main at ??:?

0x40149045: main_task at /home/permal/esp/esp-idf/components/esp32/cpu_start.c:549

0x400983ea: vPortTaskWrapper at /home/permal/esp/esp-idf/components/freertos/port.c:143


CPU halted.

HTTP Server - on packet assembly error, after the fifth error no more connections can be accepted

Run this command five times (https to non-https port)

curl --verbose --cacert root_ca.crt -X POST -d"123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345" https://localhost:8080/pos

Seen in the log:
(E)Socket: [, 0, 5 0x60c000035450]: Error during receive: Bad address (14)
(V)Socket: [, 0, 5, 0x60c000035450]: Socket stopping
(V)SocketDispatcher: Shutting down socket 0x60c000035450
(V)Socket: [, 0, -1, 0x60c000035450]: Disconnected

Main task and Btask not running

Per
I modified your hello world program and adding a second task and broke out the tasks into separate files.
This is my project structure.
GreetingCPPv2
|
------- CMakeList.txt
------- partitions.csv
-------- sdkconfig
------- build
------- include
|
------- GreetingCPPv2.h
-------- ATask.h
-------- BTask.h
------- main
|
------ CMakeList.txt
------ GreetingCPPv2.cpp
------- ATask.cpp
------- BTask.cpp
------ main.cpp
I can compile the program without any errors but this is the output I see. As you can see the Main Task is not running and the BTask is not running. It looks like MainTask and BTask don't finish initializing?
image

This is my top level CMakeList.txt
/home/ed/vscode-workspace-esp32/sandbox/GreetingCPPv2/CMakeLists.txt

This is GreetingCPPv2.h
/home/ed/vscode-workspace-esp32/sandbox/GreetingCPPv2/include/GreetingCPPv2.h

This is ATask.h
/home/ed/vscode-workspace-esp32/sandbox/GreetingCPPv2/include/ATask.h

This is BTask.h
/home/ed/vscode-workspace-esp32/sandbox/GreetingCPPv2/include/BTask.h

This is GreetingCPPv2.cpp
/home/ed/vscode-workspace-esp32/sandbox/GreetingCPPv2/main/GreetingCPPv2.cpp

This is ATask.cpp
/home/ed/vscode-workspace-esp32/sandbox/GreetingCPPv2/main/ATask.cpp

This is BTask.cpp
/home/ed/vscode-workspace-esp32/sandbox/GreetingCPPv2/main/BTask.cpp

This is main.cpp
/home/ed/vscode-workspace-esp32/sandbox/GreetingCPPv2/main/main.cpp

This is CMakeList.txt inside main directory
/home/ed/vscode-workspace-esp32/sandbox/GreetingCPPv2/main/CMakeLists.txt

Can you tell me what I did wrong?
Thanks

Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled. Core 1 register dump:

Hello Smooth.
i'm using framework Smooth for esp32
getting below error and my esp32 gets rebooting ,
please suggest how to fix it,
**Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x4008c484 PS : 0x00060733 A0 : 0x8008c522 A1 : 0x3ffc2bb0
0x4008c484: prvCheckTasksWaitingTermination at /home/luutran/kante/esp/esp-idf/components/freertos/tasks.c:4740

A2 : 0x00000005 A3 : 0x00000001 A4 : 0x00000000 A5 : 0x3ffc24ec
A6 : 0x00000000 A7 : 0x00000001 A8 : 0x8008c46e A9 : 0x3ffc2b90
A10 : 0x3ffc0b44 A11 : 0x00000000 A12 : 0x007d317b A13 : 0x00000001
A14 : 0x00060021 A15 : 0x00000000 SAR : 0x00000000 EXCCAUSE: 0x0000001c
EXCVADDR: 0x0000004d LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace: 0x4008c484:0x3ffc2bb0 0x4008c51f:0x3ffc2bd0
0x4008c484: prvCheckTasksWaitingTermination at /home/luutran/kante/esp/esp-idf/components/freertos/tasks.c:4740

0x4008c51f: prvIdleTask at /home/luutran/kante/esp/esp-idf/components/freertos/tasks.c:4740

Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:5736
load:0x40078000,len:7684
load:0x40080000,len:7384

Build system

Due to recent(?) changes in the IDf CMake build system, the project_description.json file is no longer generated which prevents us from running idf-py monitor etc.

Are these includes needed?

Per
First off I am no where near your experience as a C++ programmer, I still am a novice.
I was looking thru the code to try an understand how Task Event Queue works (still trying to figure it out) and saw some includes that I had questions on. There may be reason why you include stuff that I am not aware of (maybe future enhancements?) but here is what i have found so far.

TaskEventQueue.h
//
// Created by permal on 6/27/17.
//

#pragma once

#include <smooth/core/Task.h>
#include "ITaskEventQueue.h"
#include "IEventListener.h"
#include "Link.h" //// <----- is this required
#include "QueueNotification.h"
#include <smooth/core/logging/log.h>

QueueNotification.h
//
// Created by permal on 10/18/17.
//

#pragma once

#include
#include
#include
#include
#include <condition_variable> //////////////// <--- added ?????
#include "ITaskEventQueue.h"
#include <smooth/core/timer/ElapsedTime.h> ////////// <---- is this required

namespace smooth
{
namespace core
{
//class Task; ////////////////// <---------Is this required

QueueNotifications.cpp
//
// Created by permal on 10/18/17.
//

#include /// <----- is this required ?
#include <smooth/core/Task.h> /// <------ is this required ?
#include <smooth/core/ipc/QueueNotification.h>
#include <smooth/core/timer/ElapsedTime.h> //// <----- is this required ?
#include <smooth/core/logging/log.h>

Thanks

Support for websocket?

Hi, congratulations for these nice classes for the ESP32. I am currently searching for a HTTP(S) webserver software with the following attributes:

  1. esp-idf based (not Arduino)
  2. c++ based
  3. TLS cabable
  4. support for websockets (according to RFC6455)
    I see that 1. - 3. is already provided by your classes. The only thing missing for me is the support for websocket communication. Is there a plan to implement the websocket protocol also?
    Best regards
    Lothar

Build Smooth as a IDF-component

Smooth is currently built using IDF as 3rd-party library. While that is a nice separation, it brings with it extra work in keeping it functional. Try building Smooth as an IDF-component and see if that makes it easier.

Smooth must still be able to be used as a base for native Linux builds.

Allow sockets to be put in a back-off state for some time.

Use case:
SocketDispatcher calls readable()
ServerSocket calls accept_request()
No ServerSocketClient available

Next tick() in SocketDispatcher, the process repeats. If accept_request() can tell SocketDispatcher to back off for that particular socket for X milliseconds, it would reduce the load of the system to allow already in-use ServerSocketClients to finish their work to be reused for the socket waiting to be accepted.

HTTP Server - why are two packets seen as the "first" packet

Run Postman at https://localhost:8443/post with the following in a request key to trigger the behaviour:

123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345123451234512345

BME280 code bug

&& read_16bit(DIG_P8_REG, trimming.dig_P8) && read_16bit(DIG_P9_REG, trimming.dig_P8)

Using dig_P8 twice.

Add mock classes for IO

Adding mock classes for IO allows building any application also for Linux even though it uses IO.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.