• Stars
    star
    1,531
  • Rank 30,574 (Top 0.7 %)
  • Language
    C
  • License
    BSD 3-Clause "New...
  • Created over 9 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Open source FreeRTOS-based ESP8266 software framework

esp-open-rtos

A community developed open source FreeRTOS-based framework for ESP8266 WiFi-enabled microcontrollers. Intended for use in both commercial and open source projects.

Originally based on, but substantially different from, the Espressif IOT RTOS SDK.

Resources

Build Status

Email discussion list: https://groups.google.com/d/forum/esp-open-rtos

IRC channel: #esp-open-rtos on Freenode (Web Chat Link).

Github issues list/bugtracker: https://github.com/superhouse/esp-open-rtos/issues

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Quick Start

  • Install esp-open-sdk, build it with make toolchain esptool libhal STANDALONE=n, then edit your PATH and add the generated toolchain bin directory. The path will be something like /path/to/esp-open-sdk/xtensa-lx106-elf/bin. (Despite the similar name esp-open-sdk has different maintainers - but we think it's fantastic!)

    (Other toolchains may also work, as long as a gcc cross-compiler is available on the PATH and libhal (and libhal headers) are compiled and available to gcc. The proprietary Tensilica "xcc" compiler will probably not work.)

  • Install esptool.py and make it available on your PATH. If you used esp-open-sdk then this is done already.

  • The esp-open-rtos build process uses GNU Make, and the utilities sed and grep. If you built esp-open-sdk then you have these already.

  • Use git to clone the esp-open-rtos project (note the --recursive):

git clone --recursive https://github.com/Superhouse/esp-open-rtos.git
cd esp-open-rtos
  • To build any examples that use WiFi, create include/private_ssid_config.h defining the two macro defines:
#define WIFI_SSID "mywifissid"
#define WIFI_PASS "my secret password"
  • Build an example project (found in the 'examples' directory) and flash it to a serial port:
make flash -j4 -C examples/http_get ESPPORT=/dev/ttyUSB0

Run make help -C examples/http_get for a summary of other Make targets.

(Note: the -C option to make is the same as changing to that directory, then running make.)

The Build Process wiki page has in-depth details of the build process.

Goals

  • Provide professional-quality framework for WiFi-enabled RTOS projects on ESP8266.
  • Open source code for all layers above the MAC layer, ideally lower layers if possible (this is a work in progress, see Issues list.
  • Leave upstream source clean, for easy interaction with upstream projects.
  • Flexible build and compilation settings.

Current status is alpha quality, actively developed. AP STATION mode (ie wifi client mode) and UDP/TCP client modes are tested. Other functionality should work. Contributors and testers are welcome!

Code Structure

  • examples contains a range of example projects (one per subdirectory). Check them out!
  • include contains header files from Espressif RTOS SDK, relating to the binary libraries & Xtensa core.
  • core contains source & headers for low-level ESP8266 functions & peripherals. core/include/esp contains useful headers for peripheral access, etc. Minimal to no FreeRTOS dependencies.
  • extras is a directory that contains optional components that can be added to your project. Most 'extras' components will have a corresponding example in the examples directory. Extras include:
    • mbedtls - mbedTLS is a TLS/SSL library providing up to date secure connectivity and encryption support.
    • i2c - software i2c driver (upstream project)
    • rboot-ota - OTA support (over-the-air updates) including a TFTP server for receiving updates (for rboot by @raburton)
    • bmp180 driver for digital pressure sensor (upstream project)
  • FreeRTOS contains FreeRTOS implementation, subdirectory structure is the standard FreeRTOS structure. FreeRTOS/source/portable/esp8266/ contains the ESP8266 port.
  • lwip contains the lwIP TCP/IP library. See Third Party Libraries wiki page for details.
  • libc contains the newlib libc. Libc details here.

Open Source Components

For details of how third party libraries are integrated, see the wiki page.

Binary Components

Binary libraries (inside the lib dir) are all supplied by Espressif as part of their RTOS SDK. These parts were MIT Licensed.

As part of the esp-open-rtos build process, all binary SDK symbols are prefixed with sdk_. This makes it easier to differentiate binary & open source code, and also prevents namespace conflicts.

Espressif's RTOS SDK provided a "libssl" based on axTLS. This has been replaced with the more up to date mbedTLS library (see below).

Some binary libraries appear to contain unattributed open source code:

  • libnet80211.a & libwpa.a appear to be based on FreeBSD net80211/wpa, or forks of them. (See this issue).
  • libudhcp has been removed from esp-open-rtos. It was released with the Espressif RTOS SDK but udhcp is GPL licensed.

Licensing

  • BSD license (as described in LICENSE) applies to original source files, lwIP. lwIP is Copyright (C) Swedish Institute of Computer Science.

  • FreeRTOS (since v10) is provided under the MIT license. License details in files under FreeRTOS dir. FreeRTOS is Copyright (C) Amazon.

  • Source & binary components from the Espressif IOT RTOS SDK were released under the MIT license. Source code components are relicensed here under the BSD license. The original parts are Copyright (C) Espressif Systems.

  • Newlib is covered by several copyrights and licenses, as per the files in the libc directory.

  • mbedTLS is provided under the Apache 2.0 license as described in the file extras/mbedtls/mbedtls/apache-2.0.txt. mbedTLS is Copyright (C) ARM Limited.

Components under extras/ may contain different licenses, please see those directories for details.

Contributions

Contributions are very welcome!

  • If you find a bug, please raise an issue to report it.

  • If you have feature additions or bug fixes then please send a pull request.

  • There is a list of outstanding 'enhancements' in the issues list. Contributions to these, as well as other improvements, are very welcome.

If you are contributing code, please ensure that it can be licensed under the BSD open source license. Specifically:

  • Code from Espressif IoT SDK cannot be merged, as it is provided under either the "Espressif General Public License" or the "Espressif MIT License", which are not compatible with the BSD license.

  • Recent releases of the Espressif IoT RTOS SDK cannot be merged, as they changed from MIT License to the "Espressif MIT License" which is not BSD compatible. The Espressif binaries used in esp-open-rtos were taken from revision ec75c85, as this was the last MIT Licensed revision.

For code submissions based on reverse engineered binary functionality, please either reverse engineer functionality from MIT Licensed Espressif releases or make sure that the reverse engineered code does not directly copy the code structure of the binaries - it cannot be a "derivative work" of an incompatible binary.

The best way to write suitable code is to first add documentation somewhere like the esp8266 reverse engineering wiki describing factual information gained from reverse engineering - such as register addresses, bit masks, orders of register writes, etc. Then write new functions referring to that documentation as reference material.

Coding Style

For new contributions in C, please use BSD style and indent using 4 spaces.

For assembly, please use the following:

  • Instructions indented using 8 spaces.
  • Inline comments use # as a comment delimiter.
  • Comments on their own line(s) use /*..*/.
  • First operand of each instruction should be vertically aligned where possible.
  • For xtensa special registers, prefer wsr aX, SR over wsr.SR aX

If you're an emacs user then there is a .dir-locals.el file in the root which configures cc-mode and asm-mode (you will need to approve some variable values as safe). See also the additional comments in .dir-locals.el, if you're editing assembly code.

Upstream code is left with the indentation and style of the upstream project.

Sponsors

Work on parts of esp-open-rtos has been sponsored by SuperHouse Automation.

More Repositories

1

D1MSHO

Shield outline for the WeMos D1 Mini with ESP8266
Eagle
43
star
2

SecuritySensor4ToMQTT

Arduino sketch to read the status of up to 4 security sensors using End Of Line resistors and push events to MQTT
Arduino
39
star
3

ESPF

USB-C programming adapter for Espressif ESP8266 and ESP32, with auto-reset control
33
star
4

AirQualitySensorD1Mini

Particulate Matter Sensor firmware for a Plantower PMS5003 connected to a Wemos D1 Mini
32
star
5

AQS

Air quality sensor hardware
C++
31
star
6

LightSwitchControllerMQTT

Reads light switches using an Arduino and publishes events to MQTT
Arduino
30
star
7

D1MTERMINAL

Terminal Shield for the WeMos D1 Mini with ESP8266
21
star
8

BasicOTARelay

Control a Sonoff / Slampher using MQTT with OTA support
Arduino
19
star
9

Z2T

Zigbee Coordinator based on the Wemos D1 Mini, using the Zigbee2Tasmota firmware
18
star
10

ESPFlash

ESPFlash programming header for ESP8266, ESP8285, and ESP32 MCUs
17
star
11

D1MPOWER

Power supply shield for the WeMos D1 Mini with ESP8266
17
star
12

RACK32

ESP32 board with Ethernet, PoE, micro SD, and other features for the Universal Rack Controller
16
star
13

LSC

Home automation light switch controller
11
star
14

D1MBLUE

Bluetooth serial shield for the WeMos D1 Mini with ESP8266
Eagle
11
star
15

D1MPROTO

Prototyping shield for the WeMos D1 Mini with ESP8266
Eagle
11
star
16

ZEROSTICK

Zero deflection joystick
C++
10
star
17

EtherUno

Arduino-compatible board with onboard Ethernet and USB-C
9
star
18

D1MSERVO

Servo controller shield for the WeMos D1 Mini with ESP8266
Eagle
8
star
19

WMC

Open Source wheelchair control system motor drive module with CAN bus interface
C#
8
star
20

BasicOTABlink

Minimal Arduino sketch for Sonoff / Slampher with OTA support
Arduino
8
star
21

UniversalButtonEM

Arduino sketch to publish to MQTT when a button is pressed
Arduino
7
star
22

UT61EWIFI

WiFi adapter for the UNI-T UT61E multimeter
C++
7
star
23

IOTAP

WiFi internet access point designed for managing IoT devices with personal pre-shared keys
Shell
7
star
24

POESP32

ESP32 module with Ethernet and PoE support
7
star
25

OutputControllerRelay8x2

Arduino sketch for controlling outputs on a pair of Relay8 shields for a home automation controller. See http://www.superhouse.tv/12-building-an-arduino-home-automation-controller for more information
Arduino
7
star
26

axtls

git-svn mirror of axTLS SVN repo, plus a branch with embedded-friendly tweaks
C
6
star
27

IORJ45

I/O Breakout To RJ45
6
star
28

TelloMqtt

Connect DJI / Ryze Tello drone to an MQTT broker
Python
6
star
29

AXAWIFI

AXA electric window controller with LINbus and WiFi using an ESP8266 (ESP-12 version)
6
star
30

LightSwitch4

Illuminated push button breakout with an RJ45 socket (4-button)
5
star
31

URC

Universal Rack Controller
5
star
32

Testomatic

PCB testing system
5
star
33

D1ZIG

D1 Mini Zigbee shield
4
star
34

IOBRMEGA

I/O breakout shield for Arduino Mega compatible boards
4
star
35

CBMINI

Wheelchair control system breakout with CAN bus support
C++
4
star
36

IOSEC8

I/O breakout to 8 security sensors
4
star
37

SMARTSWITCH

Home automation light switch with illuminated buttons and WiFi
4
star
38

PCBCONVEYOR

Conveyor belt for PCB assembly lines
C
4
star
39

LightSwitch2

Illuminated push button breakout with an RJ45 socket (2-way)
4
star
40

ESPMAX

ESP Max prototyping board for ESP8266
3
star
41

I2CRJ45X8

8-port RJ45 breakout with I2C interface for home automation light switches
3
star
42

EtherBear

ATmega1284P development board with Wiznet W6100 Ethernet interface and PoE support
3
star
43

OXRS-SHA-StateIO-ESP32-FW

OXRS firmware for ESP32 that supports both inputs and outputs
C++
3
star
44

SONOFFPROG

Sonoff programming adapter for FTDI cables
3
star
45

INJ4SS

4-Channel Power over Ethernet midspan injector (single sided)
Eagle
3
star
46

BCARDLIGHT

Business card on a PCB with a light sensor and an ATtiny85 MCU
3
star
47

PWC

Permobil Wheelchair Controller with ESP32 and ZeroStick interface
C++
3
star
48

SUPERBUTTON

Firmware for the SuperButton assistive technology button
C++
3
star
49

I2CRJ45X24

Home automation light switch breakout with 24 x RJ45 connections and I2C interface
2
star
50

FSI6CAN

CAN interface for Flysky FS-i6 transmitter
C++
2
star
51

I2CRJ45

I2C to RJ45 breakout boards for building a home automation light switch controller
2
star
52

OXRS-SHA-Rack32-ESP32-LIB

C++
2
star
53

AXAWIFIESP01

AXA electric window controller with LINbus and WiFi using an ESP8266 (ESP-01 version)
2
star
54

LINMOD

LIN bus interface module that can be used with an Arduino or a computer
2
star
55

AXARemoteSerialLinbus

Simple menu-driven Arduino controller for AXA window motors with LIN bus interface
Arduino
2
star
56

I2CPANEL

Control panel for rack mount cases with I2C interface
2
star
57

ESPREMOTE

ESP8266 board with connections for an RF remote control
2
star
58

ESPFA

Header adapter board for the ESPFlasher ESP8266 / ESP32 programmer
2
star
59

OXRS-SHA-StateMonitor-ESP32-FW

ESP32 state monitor firmware for the Open eXtensible Rack System
C
2
star
60

SHASwitch4

4-button light switch with WiFi and RF
1
star
61

OXRS-SHA-LCD-ESP32-LIB

ESP32 LCD library for Open eXtensible Rack System projects
C
1
star
62

SHASwitchOutput

Smart light switch output driver board, 4 channel
1
star
63

I2CRJ45X16

16-port RJ45 breakout with I2C interface for home automation light switches
1
star
64

BRAINCHIP

Home automation controller based on CHIP
1
star
65

BRAIN

Building Brain home automation controller
1
star
66

CHAIRI2C

I2C interface adapter for electric wheelchairs, to allow the joystick input to be controlled electronically
C++
1
star
67

OXRS-SHA-StateController-ESP32-FW

ESP32 state controller firmware for the Open eXtensible Rack System
C
1
star
68

MOAC

Mini Open Adaptive Controller
C++
1
star
69

LSS

2-Channel light switch shield
1
star
70

HomeSenseBasicOTAFirmware

Firmware for the HomeSense Basic home automation environmental sensor with OTA update support
C++
1
star
71

FlyskyTrainer2JoystickInput

Reads from wheelchair joysticks and sends their positions as PPM signals to a Flysky transmitter trainer port
C++
1
star
72

CHIPPROTO

Prototyping DIP (add-on board) for the C.H.I.P.
1
star
73

HandHeaterFirmware

Firmware for a hand heater controlled by an ATtiny85
C++
1
star
74

AXAWindowMQTT

Control AXA window motors using LIN bus connections and MQTT
Arduino
1
star
75

LightSwitch3

Illuminated push button breakout with an RJ45 socket (3-way)
1
star
76

SMINIPROG

Sonoff Mini Programming Jig
1
star
77

PCBTEMPLATES

PCB project templates to help you design boards that will fit into existing off-the-shelf enclosures
1
star
78

IORELAY8

I/O breakout to 8 relay drivers
1
star
79

SMARTCONTROL

Home automation smart switch control board
1
star
80

FEEDERLINK

Link 4 x MGRL0816 pick and place feeders to a 10-way IDC cable
1
star
81

OpenKayo

Protocol converter for Kayo pick-and-place machines to allow control by OpenPnP
C
1
star
82

GLUONC

Innfos Gluon controller
1
star