diff --git a/Makefile b/Makefile index a4a35a9..75c00d8 100644 --- a/Makefile +++ b/Makefile @@ -63,7 +63,7 @@ ESP_HOSTNAME ?= esp8266 # which modules (subdirectories) of the project to include in compiling #MODULES = driver user lwip/api lwip/app lwip/core lwip/core/ipv4 lwip/netif -MODULES = espfs httpd user +MODULES = espfs httpd user serial EXTRA_INCDIR = include \ . \ lib/heatshrink/ diff --git a/README b/README index 98bcc7f..36afdd1 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ -ESP8266 - Bridge -================ +ESP-LINK +======== This firmware implements a transparent bridge between Wifi and serial using an ESP8266 module. It also provides support for flash-programming Arduino/AVR microcontrollers as well as @@ -36,9 +36,9 @@ Wifi configuration After you have serially flashed the module it will create a wifi access point (AP) with an SSID of the form `ESP_012ABC` where 012ABC is a piece of the module's MAC address. Using a laptop, phone, or tablet connect to this SSID and then open a browser pointed at -http://192.168.0.1, you should them see the esp8266-bridge web site. +http://192.168.0.1, you should them see the esp-link web site. -Now configure the wifi. The typical desired configuration is for the esp-bridge to be a +Now configure the wifi. The typical desired configuration is for the esp-link to be a station on your local wifi network so can communicate with it from all your computers. To make this happen, navigate to the wifi page and hit the "change to STA+AP mode" button. @@ -48,16 +48,16 @@ reconnect to the ESP_123ABC wifi network and refres the wifi settings page. At this point you should see a list of detected networks on the web page and you can select yours. Enter a password if your network is secure (recommended...) and hit the connect button. -You should now see that the esp-bridge has connected to your network and it should show you +You should now see that the esp-link has connected to your network and it should show you its IP address. Write it down and then follow the provided link (you may have to switch your laptop, phone, or tablet back to your network before you can actually connect). -At this point the esp-bridge will have switched to STA mode and be just a station on your +At this point the esp-link will have switched to STA mode and be just a station on your wifi network. These settings are stored in flash and thereby remembered through resets and power cycles. They are also remembered when you flash new firmware. Only flashing `blank.bin` as indicated above will reset the wifi settings. -There is a fail-safe, which is that after a reset (need details) the esp-bridge will revert +There is a fail-safe, which is that after a reset (need details) the esp-link will revert back to AP+STA mode and thus both present its ESP_012ABC-style network and try to connect to the requested network, which will presumably not work or it wouldn't be in fail-safe mode in the first place. You can then connect to the network and reconfigure the station part. @@ -81,7 +81,7 @@ Actual setup of the SDK and toolchain is out of the scope of this document, so I enough to set up your own if you haven't already. If you have that, you can clone out the source code: -git clone http://github.com/jeelabs/esp-bridge +git clone http://github.com/jeelabs/esp-link This project makes use of heatshrink, which is a git submodule. To fetch the code: cd esphttpd @@ -95,7 +95,7 @@ Flashing the firmware --------------------- This firmware supports over-the-air (OTA) flashing, so you do not have to deal with serial flashing again after the initial one! The recommended way to flash is to use `make wiflash`, -which assumes that you set ESP_HOSTNAME to the hostname or IP address of your esp-bridge. +which assumes that you set ESP_HOSTNAME to the hostname or IP address of your esp-link The flashing, restart, and re-associating with your wireless network takes about 15 seconds and is fully automatic. The 512KB flash are divided into two 236KB partitions allowing for new diff --git a/html/cats/cross-eyed-cat.jpg- b/html/cats/cross-eyed-cat.jpg- deleted file mode 100644 index e166e87..0000000 Binary files a/html/cats/cross-eyed-cat.jpg- and /dev/null differ diff --git a/html/cats/junge-katze-iv.jpg- b/html/cats/junge-katze-iv.jpg- deleted file mode 100644 index c3cf70b..0000000 Binary files a/html/cats/junge-katze-iv.jpg- and /dev/null differ diff --git a/html/cats/junge-katze-iv_01.jpg b/html/cats/junge-katze-iv_01.jpg deleted file mode 100644 index 0b2944e..0000000 Binary files a/html/cats/junge-katze-iv_01.jpg and /dev/null differ diff --git a/html/cats/kitten-loves-toy.jpg- b/html/cats/kitten-loves-toy.jpg- deleted file mode 100644 index 569ff56..0000000 Binary files a/html/cats/kitten-loves-toy.jpg- and /dev/null differ diff --git a/html/help.tpl b/html/help.tpl new file mode 100644 index 0000000..b60faa2 --- /dev/null +++ b/html/help.tpl @@ -0,0 +1,72 @@ + +Help - ESP Link + + + +
+

Home | Wifi | + Serial | LED

+ +

ESP Link Help

+ +The ESP Link functions in two wifi modes: Station+AccessPoint (STA+AP) and Station (STA). +In the STA+AP mode it presents a network called esp8266 that you can connect to using the +password jeelabs8266. This mode is intended for initial configuration, but it is +fully functional. Typically the easiest way to connect to the esp8266 network is using a phone, +tablet, or laptop.

+

The recommended next step is to configure the ESP Link to connect to your "normal" +Wifi network so you can access it from any of your machines. Once you have connected the ESP Link +to your network and pointed your browser at it successfully, you should +switch the ESP Link to STA mode, which is more secure (no canned password).

+

In STA mode the ESP Link connects to the configured network (the info is saved in flash). +If, after a reset, it cannot connect for one minute, it automatically reverts to STA+AP mode +allowing you to reconnect to the esp8266 network to change configuration.

+

In STA mode the most tricky part usually is the IP address. On most networks, the ESP Link +will get a dynamic IP address assigned via DHCP and you now need to enter that IP address into +your browser to connect. The good news is that after you reset your ESP Link it will continue to +have the same IP address. However, if you leave it off for the week-end it will most likely get a +fresh IP the next time it starts up. On many Wifi routers you can enter a fixed mapping from +the ESP Link's hardware MAC address to a static IP address so it always gets the same IP +address. This is the recommended method of operation.

+ +

Using your ESP Serial Programmer

+The ESP Programmer can used in several distinct ways: + + +

Transparent bridge

+

The ESP accepts TCP connections to port 23 and "connects" through to the serial port. +Up to 5 simultaneous TCP connections are supported and characters coming in on the serial +port get passed through to all connections. Characters coming in on a connection get copied +through to the serial port.

+

When using Linux a simple way to use this is nc esp8266 23

+ +

Programmer using serial-over-TCP

+

By hooking up the ESP's GPIO lines to the reset line of an Arduino (or AVR in general) that is +preloaded with the Optiboot bootloader/flasher it is possible to reprogram these processors over +Wifi. The way is works is that the ESP toggles the reset line each time a connection is established +and the first characters are the flash programming synchronization sequence.

+

When using Linux avrdude can be instructed to program an AVR over TCP by using a special syntax +for the serial port: -Pnet:esp8266:23, where esp8266 is the hostname of the ESP +Serial Programmer (an IP address could have been used instead).

+

NXP's LPC800-serial ARM processors can be programmed similarly by hooking up GPIO pins to the +ARM's reset and ISP lines. The ESP Serial Programmer issues the correct reset/isp pulses to put +the ARM chip into firmware programming mode.

+ +

Web Console

+

The output of an attached Arduino/AVR/ARM can also be monitored via the console web page. +When connecting, it shows the most recent 10KB of characters received on the serial port and +then continues to print everything that comes in on the serial port. Eventually the page refreshes +when it gets very long. (Yes, this could be improved with some javascript...)

+ +

Programmer using HEX upload

+

(Not yet functional) Instead of using the wifi-to-serial bridge to program +microcontrollers it is often faster to upload the HEX file to the ESP Serial Programmer and +have it perform the actual programming protocol.

+ +
+ diff --git a/html/index.tpl b/html/index.tpl index 50c49cc..f789db7 100644 --- a/html/index.tpl +++ b/html/index.tpl @@ -1,25 +1,25 @@ -Esp8266 web server +ESP Link
-

It Works

+

Home | Wifi | + Serial | LED | Help

+ +

ESP Link

-If you see this, it means the tiny li'l website in your ESP8266 does actually work. Fyi, this page has -been loaded %counter% times. +The ESP Link connects the ESP's serial port to Wifi and it can +program microcontrollers over the serial port, in particular Arduinos, AVRs, and +NXP's LPC800-series ARM processors.

+ +

Status

+
  • This page has been loaded %counter% times
  • +
  • Manage wifi
  • +
  • Control the LED
  • -

    And because we're on the Internets now, here are the required pictures of cats:
    - -
    - -

    diff --git a/html/led.tpl b/html/led.tpl index 7a9cf89..2e7ea62 100644 --- a/html/led.tpl +++ b/html/led.tpl @@ -1,9 +1,9 @@ -Test +LED test - ESP Link
    -

    The LED

    +

    ESP Link - LED test

    If there's a LED connected to GPIO2, it's now %ledstate%. You can change that using the buttons below.

    diff --git a/html/style.css b/html/style.css index 2a2f758..7074375 100644 --- a/html/style.css +++ b/html/style.css @@ -2,10 +2,11 @@ body { background-color: #404040; font-family: sans-serif; + font-color: #663300; } #main { - background-color: #d0d0FF; + background-color: #FFFFCC; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; @@ -15,3 +16,10 @@ body { padding: 20px } +.lock-icon { + background-image: url("/wifi/icons.png"); + background-color: transparent; + width: 32px; + height: 32px; + display: inline-block; +} diff --git a/html/wifi/connecting.html b/html/wifi/connecting.html index 12e3a83..47190d6 100644 --- a/html/wifi/connecting.html +++ b/html/wifi/connecting.html @@ -1,4 +1,4 @@ -Connecting... +Connecting... - ESP Link