# LuOS9p-ESP8266 **Repository Path**: iMaker/LuOS9p-ESP8266 ## Basic Information - **Project Name**: LuOS9p-ESP8266 - **Description**: No description available - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-02-11 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README luOS9p ------ It is an OS for ESP8266 IoT microcontrollers based on Lua-RTOS-ESP8266. But it was significally checked, changed and expanded. https://youtu.be/ojTmyH3cTSQ [schemaic+pcb](pcb/eagle) (Eagle CAD) Features ======== * Lua 5.3.4, * Multithreading using Free-RTOS, * UART (ttl rs232, com port), * I2C, * SPI, * 16 PWMs (hardware), * 16 PIOs, * 5 ADC (3 up to 3v + 1 up to 1v + 1 used internally), * 1 DAC (up to 3v), * OLED screen, * Keyboard with 8 buttons (cursor + 3 special + 1 external), * GUI (menu based. using OLED and keyboard), * Shell by remote (rs232) terminal, * internal Editor of files (remote terminal), * big set of easy to use shell commands (filesystem, ports, devices, network, server, other) * net Ap and Sta modes, * one command WiFi Sta search, * PID regulator module, * Webserver (with compressing): 1. static HTML, 1. CGI, 1. WebSock (up to 5 connections), 1. direct access to devices/ports using WebSock, * 9p2000/Styx (Plan9/Inferno os) distributed network virtual file system + server: 1. list of devices (ex: `ls /n/dev`), 1. list of device's functions (ex: `cat /n/dev/pwm`), 1. call a device's function (ex: `echo ch_val -i 5 -n 0.4 > /n/dev/pwm`), 1. read the result of the function's call (ex: `<> /n/dev/pwm {echo ch_val -i 5 >[1=0]; read}`), 1. read a file/folder list from the fisical filesystem of the device (ex: `ls /n/fs/html/js`), 1. read/write/create files on the device's fisical filesystem (ex: `cat /n/fs/html/js/common.js` or `echo a Text > /n/fs/afile.txt`), 1. create new folders on the device's fisical filesystem (ex: `mkdir /n/fs/new_folder`), 1. remove files or folders from the fisical device's filesystem (ex: `rm /n/fs/html/a_file_or_folder`), 1. RPC channel (synthetic file `/rpc`). it allows to send Lua chunk to the device, run it there and return the result. (ex: `<> /n/rpc {echo 'pwm[5] = 0.2; return "adc_1=", adc[1];' >[1=0]; read}`), 1. user's CGI-like synthetic files. (ex: on the remote device: `styx.addfile("a_file", function(a) return a + 8; end);`, from the inferno-shell: `<> /n/a_file {echo -n 10.9 >[1=0]; read}`). * PC-Studio for easyer upload/download/edit files into/from/on the luOS9p embedded filesystem. also PC-Studio contains remote terminal for luOS9p and other features (in the future). It is written on the Lua and may be edited/expanded easily. It also contains a plugin system for extensions, but it isn't activated for now. How to build ============ ``` ./bld.sh # build ./flash.sh # flash ``` How to build PC-Studio ====================== ``` cd pc-studio ./bld.sh ``` How to run PC-Studio ==================== ``` cd pc-studio/bld ./prg ``` How to run Styx server ====================== In the device's console or from the lua script: ``` thread.start( styx.loop ) ``` Or just select `Styx server` on the device's gui if you are using LuOS9p-PCB (or other with ported GUI driver) In the inferno shell/script/limbo etc: ``` mount -A tcp!!6701 /n ``` Now your IoT device's styx virtual fs is mounted to `/n` folder, including branches for drivers `/dev` and for access to the fisical filesystem of the your IoT device `/fs`. Use it as a regular filesystem. A special board for the luOS9p ============================== For this OS was designed a [special PCB](pcb/eagle/) that included all the necessary hardware/drivers and supports all the features of the OS. ![LuOS9p-PCB](doku/PCB-LuOS9p.jpg) But the OS may be used with the most esp8266-based boards (maybe with changes in the drivers part of the OS according to the target hardware)