ESPTerm - ESP8266 terminal emulator. Branches: [master] patches, [work] next release
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
espterm-firmware/README.md

100 lines
4.7 KiB

# ESPTerm
7 years ago
ESP8266 Wireless Terminal Emulator project
7 years ago
This project is based on SpriteTM's esphttpd and libesphttpd, forked by MightyPork to
[MightyPork/esphttpd](https://github.com/MightyPork/esphttpd) and
[MightyPork/libesphttpd](https://github.com/MightyPork/libesphttpd) respectively.
Those forks include improvements not available upstream.
7 years ago
7 years ago
## Goals
The project aims to be a wireless terminal emulator that'll work with the likes of
7 years ago
Arduino, AVR, PIC, STM8, STM32, mbed etc, anything with UART, even your USB-serial dongle will work.
7 years ago
7 years ago
Connect it to the master device via UART and use the terminal on the built-in web page for debug logging,
7 years ago
remote control etc. It works like a simple LCD screen, in a way.
7 years ago
It lets you make simple UI (manipulating the screen with ANSI sequences) and receive input from buttons on
the webpage (and keyboard on PC). There is some rudimentary touch input as well.
7 years ago
7 years ago
The screen size is adjustable up to 25x80 (via a special control sequence) and uses 16 standard colors
(8 dark and 8 bright). Both default size and colors can be configured in the settings.
7 years ago
## Project status
*A little buggy, but mostly okay! There are many features and fixes planned, but it should be fairly usable already.*
7 years ago
- We have a working **2-way terminal** (UART->ESP->Browser and vice versa) with real-time update via websocket.
7 years ago
This means that what you type in the browser is sent to UART0 and what's received on UART0 is processed by the
7 years ago
ANSI parser and applied to the internal screen buffer. You'll also immediately see the changes in your browser.
There's a filter in the way that discards garbage characters (like unicode and most ASCII outside 32-126).
7 years ago
For a quick test, try connecting the UART0 Rx and Tx with a piece of wire to make a loopback interface.
*NOTE: Use the bare module, not something like LoLin or NodeMCU with a FTDI, it'll interfere*.
You should then directly see what you type & can even try some ANSI sequences, right from the browser.
- All ANSI sequences that make sense, as well as control codes like Backspace and CR / LF are implemented.
7 years ago
Set colors with your usual `\e[31;1m` etc (see Wikipedia). `\e` is the ASCII code 27 (ESC).
Arrow keys generate ANSI sequences, ESC sends literal ASCII code 27 etc. Almost everything can be input
straight from the browser.
7 years ago
7 years ago
- Buttons pressed in the browser UI send ASCII codes 1..5. Mouse clicks are sent as `\e[<row>;<col>M`.
7 years ago
- There's a built-in WiFi config page and a Help page with a list of all supported ANSI sequences and other details.
7 years ago
7 years ago
## Development
### Installation for development
- Clone this project with `--recursive`, or afterwards run `git submodule init` and `git submodule update`.
7 years ago
- Install [esp-open-sdk](https://github.com/pfalcon/esp-open-sdk/) and build it with
7 years ago
`make toolchain esptool libhal STANDALONE=n`.
Make sure the `xtensa-lx106-elf/bin` folder is on $PATH.
- Install [esptool](https://github.com/espressif/esptool) (it's in the Arch community repo and on AUR, too)
7 years ago
- Set up udev rules so you have access to ttyUSB0 without root, eg:
```
KERNEL=="tty[A-Z]*[0-9]*", GROUP="uucp", MODE="0666"
```
- Install Ragel if you wish to make modifications to the ANSI sequence parser.
If not, comment out its call in `build_parser.sh`. The `.rl` file is the actual source, the `.c` is generated.
7 years ago
- Install Ruby and then the `sass` package with `gem install sass` (or try some other implementation, such as
`sassc`)
- Make sure your `esphttpdconfig.mk` is set up properly - link to the SDK etc.
7 years ago
The IoT SDK is now included in the project due to problems with obtaining the correct version and patching it.
It works with version 1.5.2, any newer seems to be incompatible. If you get it working with a newer SDK, a PR is more
than welcome!
7 years ago
### Web resources
7 years ago
7 years ago
The web resources are in `html_orig`. To prepare for a build, run `build_web.sh`, which packs them and
copies over to `html`. The compression and minification is handled by scripts in libesphttpd, specifically
it runs yuicompressor on js and css and gzip or heatshrink on the other files. The `html` folder is
then embedded in the firmware image.
7 years ago
7 years ago
It's kind of tricky to develop the web resources locally; you might want to try the "split image"
Makefile option, then you can flash just the html portion with `make htmlflash`. I haven't tried this.
7 years ago
For local development, use the `server.sh` script in `html_orig`. It's possible to talk to API of a running
ESP8266 from here, if you configure `_env.php` with its IP.
7 years ago
### Flashing
7 years ago
7 years ago
The Makefile should automatically build the parser and web resources for you when you run `make`.
Sometimes it does not, particularly with `make -B`. Try just plain `make`. You can always run those
build scripts manually, too.
7 years ago
7 years ago
To flash, just run `make flash`.