https://github.com/whitecatboard/Lua-RTOS-ESP32 Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Project management - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] [search-key] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this organization All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} whitecatboard / Lua-RTOS-ESP32 * Notifications * Star 798 * Fork 170 Lua RTOS for ESP32 View license 798 stars 170 forks Star Notifications * Code * Issues 45 * Pull requests 11 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 12 branches 0 tags Code Clone HTTPS GitHub CLI [https://github.com/w] Use Git or checkout with SVN using the web URL. [gh repo clone whitec] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @jolivepetrus jolivepetrus Merge pull request #387 from zagaria/docker-patch-1 ... dd95c85 Apr 20, 2021 Merge pull request #387 from zagaria/docker-patch-1 TTGO Lora32 support and Dockerfile for keep environment and dependencies dd95c85 Git stats * 1,666 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .settings Added Lua RTOS RMT driver Apr 2, 2019 boards Support for TTGO Lora32 Apr 17, 2021 cloud bugfix/Lua RTOS build fails due to esp-idf commit espressif/ esp-idf@3... Oct 19, 2017 components Support for TTGO Lora32 Apr 17, 2021 docker Change container name Apr 17, 2021 main pthread general revission & improvements Mar 2, 2018 make Lua RTOS updated to last esp-idf commit espressif/esp-idf@23b6d40 Dec 10, 2018 .cproject Control power down in CPU driver Dec 23, 2016 .gitignore Added ROM file system (ROMFS) Oct 3, 2018 .project Removed references to ucred struct Nov 3, 2016 .travis.yml Update .travis.yml Sep 23, 2019 LICENSE Updated copyright messages Oct 24, 2020 Makefile Lua RTOS updated to last esp-idf commit espressif/esp-idf@cc9b06d Mar 16, 2019 README.md typo Dec 17, 2019 env build system/remove OS enrironment variable from env script Feb 15, 2018 partitions.csv Added Lua RTOS RMT driver Apr 2, 2019 prepare support of Oled 128x64 i2c screen was added (d-duino esp32 like), sup... Sep 23, 2017 View code What's Lua RTOS? How is it programmed? How to get the Lua RTOS firmware? Prerequisites Method 1: get a precompiled firmware Method 2: build by yourself Connect to the console README.md What's Lua RTOS? Lua RTOS is a real-time operating system designed to run on embedded systems, with minimal requirements of FLASH and RAM memory. Currently Lua RTOS is available for ESP32, ESP8266 and PIC32MZ platforms, and can be easilly ported to other 32-bit platforms. Lua RTOS has a 3-layer design: 1. In the top layer there is a Lua 5.3.4 interpreter which offers to the programmer all the resources provided by the Lua programming language, plus special modules for access the hardware (PIO, ADC, I2C, RTC, etc ...), and middleware services provided by Lua RTOS (Lua Threads, LoRa WAN, MQTT, ...). 2. In the middle layer there is a Real-Time micro-kernel, powered by FreeRTOS. This is the responsible for that things happen in the expected time. 3. In the bottom layer there is a hardware abstraction layer, which talk directly with the platform hardware. [687474703a] For porting Lua RTOS to other platforms is only necessary to write the code for the bottom layer, because the top and the middle layer are the same for all platforms. How is it programmed? The Lua RTOS compatible boards can be programmed with The Whitecat IDE in two ways: using the Lua programming language directly, or using a block-based programming language that translates blocks to Lua. No matter if you use Lua or blocks, both forms of programming are made from the same programming environment. The programmer can decide, for example, to made a fast prototype using blocks, then change to Lua, and finally back to blocks. The Whitecat IDE is available at: https://ide.whitecatboard.org. [687474703a] [687474703a] In our wiki you have more information about this. How to get the Lua RTOS firmware? Prerequisites 1. Please note you need probably to download and install drivers for your board's USB-TO-SERIAL adapter for Windows and Mac OSX versions. The GNU/Linux version usually doesn't need any drivers. This drivers are required for connect to your board through a serial port connection. Board WHITECAT ESP32 N1 ESP32 CORE ESP32 THING 2. For Linux, the currently logged user should have read and write access the sUSB-TO-SERIAL device. On most Linux distributions, this is done by adding the user to dialout group with the following command: $ sudo usermod -a -G dialout $USER Method 1: get a precompiled firmware 1. Install The Whitecat Console. The Whitecat Console is a command line tool that allows the programmer to flash a Lua RTOS compatible board with the last available firmware. + Download The Whitecat Console binary for your platform. o Ubuntu o Mac OS o Windows + Copy The Whitecat Console binary to a folder accessed by the system path. For example: o Ubuntu: sudo cp wcc /usr/bin o Mac OS: sudo cp wcc /usr/bin o Windows: runas /noprofile /user:Administrator "copy wcc.exe c:\windows\system32" + Test that The Whitecat Console binary works well. For Ubuntu / Mac OS open a terminal and type: $ wcc wcc -p port | -ports [-ls path | [-down source destination] | [-up source destination] | [-f | -ffs] | [-erase] | -d] -ports: list all available serial ports on your computer -p port: serial port device, for example /dev/tty.SLAB_USBtoUART -ls path: list files present in path -down src dst: transfer the source file (board) to destination file (computer) -up src dst: transfer the source file (computer) to destination file (board) -f: flash board with last firmware -ffs: flash board with last filesystem -erase: erase flash board -d: show debug messages For Windows open a "command" window and type wcc.exe 2. Find which serial device is used by your board. Open a terminal with your board unplugged. $ wcc -ports Available serial ports on your computer: /dev/cu.Bluetooth-Incoming-Port /dev/cu.Bluetooth-Modem Now plug your board. $ wcc -ports Available serial ports on your computer: /dev/cu.Bluetooth-Incoming-Port /dev/cu.Bluetooth-Modem /dev/cu.SLAB_USBtoUART In the above example, board is using /dev/cu.SLAB_USBtoUART serial device. This device will be used in the following steps as parameter value -p. For windows use wcc.exe instead of wcc. 3. Flash your board. Open a terminal with your board plugged. $ wcc -p /dev/cu.SLAB_USBtoUART -f If you want to flash the default file system add the -ffs option. $ wcc -p /dev/cu.SLAB_USBtoUART -f -ffs If you are flashing the Lua RTOS firmware for first time you will get an error: Unknown board model. Maybe your firmware is corrupted, or you haven't a valid Lua RTOS firmware installed. Do you want to install a valid firmware now [y/n])? Enter "y" if you want to install a valid firmware: Please, enter your board type: 1: WHITECAT N1 2: WHITECAT N1 WITH OTA 3: ESP32 CORE BOARD 4: ESP32 CORE BOARD WITH OTA 5: ESP32 THING 6: ESP32 THING WITH OTA 7: GENERIC 8: GENERIC WITH OTA Type: Finally enter your board type and your board will be flashed. For windows use wcc.exe instead of wcc. To upgrade a board with a Lua RTOS firmware installed on it: $ wcc -p /dev/cu.SLAB_USBtoUART -f If you need to change the firmware type on a board with a Lua RTOS firmware installed on it, for example to change an OTA firmware to a non OTA firmware: $ wcc -p /dev/cu.SLAB_USBtoUART -erase $ wcc -p /dev/cu.SLAB_USBtoUART -f Method 2: build by yourself 1. Install ESP32 toolchain for your desktop platform. Please, follow the instructions provided by ESPRESSIF: + Windows + Mac OS + Linux 2. Clone or pull esp-idf repository from ESPRESSIF: If you are build Lua RTOS for first time, clone the esp-idf repository: git clone --recursive https://github.com/espressif/esp-idf.git otherwise, pull last esp-idf changes from your esp-idf folder: git pull git submodule update --init --recursive 3. Clone or pull Lua RTOS repository: If you are building Lua RTOS for first time, clone Lua RTOS repository: git clone --recursive https://github.com/whitecatboard/Lua-RTOS-ESP32 otherwise, pull last Lua RTOS changes from your Lua Lua-RTOS-ESP32 folder: git pull origin master 4. Setup the build environment: Go to Lua-RTOS-ESP32 folder: cd Lua-RTOS-ESP32 Edit the env file and change PATH, IDF_PATH, LIBRARY_PATH, PKG_CONFIG_PATH, CPATH for fit to your installation locations. Now do: source ./env 5. Build: $ make flash If you are building Lua RTOS for first time, select your board type, and press enter: Please, enter your board type: 1: Whitecat N1 ESP32 2: Whitecat N1 ESP32 with OTA 3: Whitecat N1 ESP32 DEVKIT 4: Whitecat N1 ESP32 DEVKIT with OTA 5: Espressif Systems ESP32-CoreBoard 6: Espressif Systems ESP32-CoreBoard with OTA 7: SparkFun ESP32 Thing 8: SparkFun ESP32 Thing with OTA Board type: When the Lua RTOS build process finish, the board will be flashed. It is possible that for certain operating systems, or boards, the flashing process fails, due to a not compatible device name for your board's USB-TO-SERIAL adapter. In this case change the default configuration to met your board or operating system requirements, as described above. 6. Change the default configuration: You can change the default configuration: $ make menuconfig Check the device name for your board's USB-TO-SERIAL adapter under the "Serial flasher config / Default serial port" category. 7. Build for other board: If you have already build Lua RTOS previously and want to build for other board type: $ make clean Go to step 5. Connect to the console You can connect to the Lua RTOS console using your favorite terminal emulator program, such as picocom, minicom, hyperterminal, putty, etc ... The connection parameters are: * speed: 115200 bauds * data bits: 8 * stop bits: 1 * parity: none * terminal emulation: VT100 For example, if you use picocom: picocom --baud 115200 /dev/tty.SLAB_USBtoUART /\ /\ / \_____/ \ /_____________\ W H I T E C A T Lua RTOS beta 0.1 build 1479953238 Copyright (C) 2015 - 2017 whitecatboard.org cpu ESP32 at 240 Mhz spiffs0 start address at 0x180000, size 512 Kb spiffs0 mounted spi2 at pins sdi=012/sdo=013/sck=014/cs=015 sd0 is at spi2, pin cs=015 sd0 type II, size 1943552 kbytes, speed 15 Mhz sd0a partition type 0b, sector 227, size 1943438 kbytes fat init file system fat0 mounted redirecting console messages to file system ... Lua RTOS beta 0.1 powered by Lua 5.3.4 Executing /system.lua ... Executing /autorun.lua ... / > --------------------------------------------------------------------- Lua RTOS is free for you, but funds are required for make it possible. Feel free to donate as little or as much as you wish. Every donation is very much appreciated. paypal About Lua RTOS for ESP32 Topics iot lua esp32 iot-platform freertos lora espressif lorawan rtos lua-rtos Resources Readme License View license Releases No releases published Packages 0 No packages published Contributors 17 * @jolivepetrus * @chowette * @the0ne * @bhgv * @zagaria * @oskarirauta * @jcwren * @ayyaris * @loboris * @Mynogs * @yawor + 6 contributors Languages * C 90.3% * C++ 3.5% * Lua 2.4% * TeX 1.8% * Makefile 0.6% * Shell 0.3% * Other 1.1% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.