├── .gitmodules ├── Arduino IDE └── Relay-Control-MQTT │ └── firmware │ └── relay-mqtt.ino ├── DOCUMENTS ├── MOD-WIFI-ESP8266_jumper_reference_revision_B.odt └── MOD-WIFI-ESP8266_jumper_reference_revision_B.pdf ├── ESP8266-EVB-blinkLED ├── Makefile ├── README.md ├── build │ ├── app.out │ ├── app_app.a │ └── user │ │ └── user_main.o ├── firmware │ ├── 0x00000.bin │ └── 0x40000.bin └── user │ ├── user_config.h │ └── user_main.c ├── HARDWARE ├── ESP8266-EVB-BAT │ ├── ESP8266-EVB-BAT revision A │ │ ├── ESP8266-EVB-BAT_Rev_A.brd │ │ ├── ESP8266-EVB-BAT_Rev_A.pdf │ │ └── ESP8266-EVB-BAT_Rev_A.sch │ ├── ESP8266-EVB-BAT revision B │ │ ├── ESP8266-EVB-BAT_Rev_B-GERBER-files │ │ │ ├── ESP8266-EVB-BAT_Rev_B.bcr │ │ │ ├── ESP8266-EVB-BAT_Rev_B.brd │ │ │ ├── ESP8266-EVB-BAT_Rev_B.cmp │ │ │ ├── ESP8266-EVB-BAT_Rev_B.dim │ │ │ ├── ESP8266-EVB-BAT_Rev_B.drd │ │ │ ├── ESP8266-EVB-BAT_Rev_B.dri │ │ │ ├── ESP8266-EVB-BAT_Rev_B.drl │ │ │ ├── ESP8266-EVB-BAT_Rev_B.gpi │ │ │ ├── ESP8266-EVB-BAT_Rev_B.gtd │ │ │ ├── ESP8266-EVB-BAT_Rev_B.plc │ │ │ ├── ESP8266-EVB-BAT_Rev_B.sch │ │ │ ├── ESP8266-EVB-BAT_Rev_B.sol │ │ │ ├── ESP8266-EVB-BAT_Rev_B.stc │ │ │ ├── ESP8266-EVB-BAT_Rev_B.sts │ │ │ ├── ESP8266-EVB-BAT_Rev_B.tcr │ │ │ ├── ESP8266-EVB-BAT_Rev_B.ypls │ │ │ └── ESP8266-EVB-BAT_Rev_B.zmil │ │ ├── ESP8266-EVB-BAT_Rev_B.bom │ │ ├── ESP8266-EVB-BAT_Rev_B.brd │ │ ├── ESP8266-EVB-BAT_Rev_B.pdf │ │ ├── ESP8266-EVB-BAT_Rev_B.sch │ │ ├── ESP8266-EVB-BAT_Rev_B_bom.ods │ │ └── ESP8266-EVB-BAT_Rev_B_bom.pdf │ └── Hardware_changes.txt ├── ESP8266-EVB │ ├── ESP8266-EVB revision A │ │ ├── ESP8266-EVB_Rev_A.brd │ │ ├── ESP8266-EVB_Rev_A.pdf │ │ └── ESP8266-EVB_Rev_A.sch │ ├── ESP8266-EVB revision A1 │ │ ├── ESP8266-EVB_Rev_A1-GERBER-files │ │ │ ├── ESP8266-EVB_Rev_A1.bcr │ │ │ ├── ESP8266-EVB_Rev_A1.brd │ │ │ ├── ESP8266-EVB_Rev_A1.cmp │ │ │ ├── ESP8266-EVB_Rev_A1.dim │ │ │ ├── ESP8266-EVB_Rev_A1.drd │ │ │ ├── ESP8266-EVB_Rev_A1.dri │ │ │ ├── ESP8266-EVB_Rev_A1.drl │ │ │ ├── ESP8266-EVB_Rev_A1.gpi │ │ │ ├── ESP8266-EVB_Rev_A1.gtd │ │ │ ├── ESP8266-EVB_Rev_A1.plc │ │ │ ├── ESP8266-EVB_Rev_A1.sch │ │ │ ├── ESP8266-EVB_Rev_A1.sol │ │ │ ├── ESP8266-EVB_Rev_A1.stc │ │ │ ├── ESP8266-EVB_Rev_A1.sts │ │ │ ├── ESP8266-EVB_Rev_A1.tcr │ │ │ ├── ESP8266-EVB_Rev_A1.ypls │ │ │ └── ESP8266-EVB_Rev_A1.zmil │ │ ├── ESP8266-EVB_Rev_A1.bom │ │ ├── ESP8266-EVB_Rev_A1.brd │ │ ├── ESP8266-EVB_Rev_A1.pdf │ │ ├── ESP8266-EVB_Rev_A1.sch │ │ ├── ESP8266-EVB_Rev_A1_bom.ods │ │ └── ESP8266-EVB_Rev_A1_bom.pdf │ └── Hardware_changes.txt ├── MOD-WIFI-ESP8266-DEV │ ├── Hardware_changes.txt │ ├── MOD-WiFi-ESP8266-DEV revision A │ │ ├── MOD-WIFI-ESP8266-DEV_Rev_A.pdf │ │ ├── MOD-WIFI-ESP8266-DEV_schematic.pdf │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_A.brd │ │ └── MOD-WiFi-ESP8266-DEV_Rev_A.sch │ ├── MOD-WiFi-ESP8266-DEV revision B │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B.brd │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B.pdf │ │ └── MOD-WiFi-ESP8266-DEV_Rev_B.sch │ ├── MOD-WiFi-ESP8266-DEV revision B1 │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1-GERBER-files │ │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.bcr │ │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.brd │ │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.cmp │ │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.dim │ │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.drd │ │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.dri │ │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.drl │ │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.gpi │ │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.gtd │ │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.plc │ │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.sch │ │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.sol │ │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.stc │ │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.sts │ │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.tcr │ │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.ypls │ │ │ └── MOD-WiFi-ESP8266-DEV_Rev_B1.zmil │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.bom │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.brd │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.pdf │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1.sch │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B1_bom.ods │ │ └── MOD-WiFi-ESP8266-DEV_Rev_B1_bom.pdf │ └── MOD-WiFi-ESP8266-DEV revision B2 │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B2.brd │ │ ├── MOD-WiFi-ESP8266-DEV_Rev_B2.pdf │ │ └── MOD-WiFi-ESP8266-DEV_Rev_B2.sch └── MOD-WIFI-ESP8266 │ ├── Hardware_changes.txt │ ├── MOD-WIFI-ESP8266 revision A │ ├── MOD-WIFI-ESP8266_schematic.pdf │ ├── MOD-WiFi-ESP8266_Rev_A.brd │ └── MOD-WiFi-ESP8266_Rev_A.sch │ ├── MOD-WIFI-ESP8266 revision B │ ├── ESP8266-EVB-BAT_Rev_B.brd │ ├── ESP8266-EVB-BAT_Rev_B.sch │ ├── MOD-WiFi-ESP8266_Rev_B-GERBER-files │ │ ├── MOD-WiFi-ESP8266_Rev_B.bcr │ │ ├── MOD-WiFi-ESP8266_Rev_B.brd │ │ ├── MOD-WiFi-ESP8266_Rev_B.cmp │ │ ├── MOD-WiFi-ESP8266_Rev_B.dim │ │ ├── MOD-WiFi-ESP8266_Rev_B.drd │ │ ├── MOD-WiFi-ESP8266_Rev_B.dri │ │ ├── MOD-WiFi-ESP8266_Rev_B.drl │ │ ├── MOD-WiFi-ESP8266_Rev_B.gpi │ │ ├── MOD-WiFi-ESP8266_Rev_B.gtd │ │ ├── MOD-WiFi-ESP8266_Rev_B.plc │ │ ├── MOD-WiFi-ESP8266_Rev_B.sch │ │ ├── MOD-WiFi-ESP8266_Rev_B.sol │ │ ├── MOD-WiFi-ESP8266_Rev_B.stc │ │ ├── MOD-WiFi-ESP8266_Rev_B.sts │ │ ├── MOD-WiFi-ESP8266_Rev_B.tcr │ │ ├── MOD-WiFi-ESP8266_Rev_B.ypls │ │ └── MOD-WiFi-ESP8266_Rev_B.zmil │ ├── MOD-WiFi-ESP8266_Rev_B.pdf │ ├── MOD-WiFi-ESP8266_Rev_B_Bom.ods │ └── MOD-WiFi-ESP8266_Rev_B_Bom.pdf │ └── MOD-WIFI-ESP8266 revision B1 │ ├── MOD-WiFi-ESP8266_Rev_B1.brd │ ├── MOD-WiFi-ESP8266_Rev_B1.pdf │ └── MOD-WiFi-ESP8266_Rev_B1.sch ├── IoT Demos ├── ESP8266-EVB-Relay │ ├── README.md │ ├── index.js │ └── package.json ├── README.md └── Tweets on MOD-LED8x8RGB │ ├── .gitignore │ ├── License │ ├── README.md │ ├── index.js │ ├── lib │ ├── actions.js │ ├── badges.js │ ├── clock.js │ ├── connections.js │ ├── messages-queue.js │ ├── messages.js │ ├── open-fest-program.js │ ├── param-builder.js │ ├── properties.js │ ├── triggers.js │ └── twitter.js │ ├── main.js │ └── package.json ├── IoT Firmware └── README.md ├── LICENSE ├── README.md ├── arduino_style ├── README.md ├── arduino │ ├── Makefile │ ├── arduino_flash.c │ ├── arduino_flash.h │ ├── arduino_gpio.c │ ├── arduino_gpio.h │ ├── arduino_i2c.c │ ├── arduino_i2c.h │ ├── arduino_serial.c │ ├── arduino_serial.h │ ├── arduino_spi.c │ └── arduino_spi.h └── arduinostyle.h ├── esphttpd ├── Makefile ├── README ├── README.md ├── build │ ├── httpd.out │ ├── httpd_app.a │ └── user │ │ ├── button.o │ │ ├── cgii2c.o │ │ ├── espfs.o │ │ ├── heatshrink_decoder.o │ │ ├── httpd.o │ │ ├── httpdespfs.o │ │ ├── io.o │ │ ├── relay.o │ │ ├── stdout.o │ │ └── user_main.o ├── driver │ ├── i2c │ │ ├── i2c.c │ │ └── i2c.h │ └── spi │ │ ├── spi.c │ │ ├── spi.h │ │ └── spi_register.h ├── espfstest │ ├── Makefile │ ├── espfs.c │ ├── heatshrink_decoder.c │ └── main.c ├── firmware │ ├── 0x00000.bin │ └── 0x40000.bin ├── html │ ├── 140midley.min.js │ ├── ESP8266-EVB.jpg │ ├── button.html │ ├── home.html │ ├── index.html │ ├── logo.png │ ├── relay.html │ └── style.css ├── include │ ├── espmissingincludes.h │ ├── httpdconfig.h │ ├── stdint.h │ ├── uart_hw.h │ └── user_config.h ├── mkespfsimage │ ├── Makefile │ ├── espfsformat.h │ ├── heatshrink_encoder.c │ ├── heatshrink_encoder.o │ ├── main.c │ ├── main.o │ └── mkespfsimage ├── user │ ├── button.c │ ├── button.h │ ├── cgii2c.c │ ├── cgii2c.h │ ├── espfs.c │ ├── espfs.h │ ├── heatshrink_config_httpd.h │ ├── heatshrink_decoder.c │ ├── httpd.c │ ├── httpd.h │ ├── httpdespfs.c │ ├── httpdespfs.h │ ├── io.c │ ├── io.h │ ├── relay.c │ ├── relay.h │ ├── stdout.c │ ├── stdout.h │ └── user_main.c └── webpages.espfs └── pinout_diagram └── ESP8266-DEV_pinout.svg /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/heatshrink"] 2 | path = esphttpd/lib/heatshrink 3 | url = https://github.com/atomicobject/heatshrink.git 4 | -------------------------------------------------------------------------------- /Arduino IDE/Relay-Control-MQTT/firmware/relay-mqtt.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * This code switches a relay connected to port 5 (GPIO5) on an ESP8266. 3 | * 4 | * It will connect to MQTT and listens on topic house/2/attic/cv/thermostat/relay 5 | * for 'on' and 'off' commands. Every 60 seconds, it will publishes te current 6 | * state on house/2/attic/cv/thermostat/relay_state 7 | * 8 | * 9 | * Richard Arends 10 | * richard@unixguru.nl 11 | * 12 | * 21 june 2015 13 | * 14 | * 15 | * 16 | */ 17 | 18 | #include 19 | #include 20 | 21 | int RelayPin = 5; // RELAY connected to digital pin 5 22 | 23 | const char* ssid = "YOUR_OWN_SSID"; 24 | const char* password = "YOUR_OWN_PASSWORD"; 25 | 26 | IPAddress server(10, 0, 0, 1); // Change this to the ip address of the MQTT server 27 | PubSubClient client(server); 28 | 29 | void callback(const MQTT::Publish& pub) { 30 | Serial.print(pub.topic()); 31 | Serial.print(" => "); 32 | Serial.println(pub.payload_string()); 33 | 34 | if ( pub.topic() == "house/2/attic/cv/thermostat/relay" ) { 35 | if (pub.payload_string() == "on" ) { 36 | digitalWrite(RelayPin, HIGH); // turn the RELAY on 37 | client.publish("house/2/attic/cv/thermostat/relay_state","on"); 38 | } else if ( pub.payload_string() == "off" ) { 39 | digitalWrite(RelayPin, LOW); // turn the RELAY off 40 | client.publish("house/2/attic/cv/thermostat/relay_state","off"); 41 | } else { 42 | Serial.print("I do not know what to do with "); 43 | Serial.print(pub.payload_string()); 44 | Serial.print(" on topic "); 45 | Serial.println(pub.topic()); 46 | } 47 | } 48 | } 49 | 50 | void connect_to_MQTT() { 51 | client.set_callback(callback); 52 | 53 | if (client.connect("thermostat_relay")) { 54 | Serial.println("(re)-connected to MQTT"); 55 | client.subscribe("house/2/attic/cv/thermostat/relay"); 56 | } else { 57 | Serial.println("Could not connect to MQTT"); 58 | } 59 | } 60 | 61 | void setup() { 62 | Serial.begin(115200); 63 | delay(10); 64 | 65 | // Connecting to our WiFi network 66 | Serial.println(); 67 | Serial.println(); 68 | Serial.print("Connecting to "); 69 | Serial.println(ssid); 70 | 71 | WiFi.mode(WIFI_STA); 72 | WiFi.begin(ssid, password); 73 | 74 | while (WiFi.status() != WL_CONNECTED) { 75 | delay(500); 76 | Serial.print("."); 77 | } 78 | 79 | Serial.println(""); 80 | Serial.println("WiFi connected"); 81 | Serial.println("IP address: "); 82 | Serial.println(WiFi.localIP()); 83 | 84 | connect_to_MQTT(); 85 | 86 | // initialize pin 5, where the relay is connected to. 87 | pinMode(RelayPin, OUTPUT); 88 | } 89 | 90 | int tellstate = 0; 91 | 92 | void loop() { 93 | client.loop(); 94 | 95 | if (! client.connected()) { 96 | Serial.println("Not connected to MQTT...."); 97 | connect_to_MQTT(); 98 | delay(5000); 99 | } 100 | 101 | // Tell the current state every 60 seconds 102 | if ( (millis() - tellstate) > 60000 ) { 103 | if ( digitalRead(RelayPin) ) { 104 | client.publish("house/2/attic/cv/thermostat/relay_state","on"); 105 | } else { 106 | client.publish("house/2/attic/cv/thermostat/relay_state","off"); 107 | } 108 | tellstate = millis(); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /DOCUMENTS/MOD-WIFI-ESP8266_jumper_reference_revision_B.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/DOCUMENTS/MOD-WIFI-ESP8266_jumper_reference_revision_B.odt -------------------------------------------------------------------------------- /DOCUMENTS/MOD-WIFI-ESP8266_jumper_reference_revision_B.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/DOCUMENTS/MOD-WIFI-ESP8266_jumper_reference_revision_B.pdf -------------------------------------------------------------------------------- /ESP8266-EVB-blinkLED/Makefile: -------------------------------------------------------------------------------- 1 | # tnx to mamalala 2 | # Changelog 3 | # Changed the variables to include the header file directory 4 | # Added global var for the XTENSA tool root 5 | # 6 | # This make file still needs some work. 7 | # 8 | # 9 | # Output directors to store intermediate compiled files 10 | # relative to the project directory 11 | BUILD_BASE = build 12 | FW_BASE = firmware 13 | 14 | # Base directory for the compiler 15 | XTENSA_TOOLS_ROOT ?= /opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin 16 | 17 | # base directory of the ESP8266 SDK package, absolute 18 | SDK_BASE ?= /opt/Espressif/ESP8266_SDK/esp_iot_sdk_v0.9.3 19 | 20 | #Esptool.py path and port 21 | ESPTOOL ?= /opt/Espressif/esptool-py/esptool.py 22 | ESPPORT ?= /dev/ttyUSB0 23 | 24 | # name for the target project 25 | TARGET = app 26 | 27 | # which modules (subdirectories) of the project to include in compiling 28 | MODULES = driver user 29 | EXTRA_INCDIR = include /opt/Espressif/ESP8266_SDK/esp_iot_sdk_v0.9.3/include 30 | 31 | # libraries used in this project, mainly provided by the SDK 32 | LIBS = c gcc hal pp phy net80211 lwip wpa main 33 | 34 | # compiler flags using during compilation of source files 35 | CFLAGS = -Os -g -O2 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -D__ets__ -DICACHE_FLASH 36 | 37 | # linker flags used to generate the main object file 38 | LDFLAGS = -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static 39 | 40 | # linker script used for the above linkier step 41 | LD_SCRIPT = eagle.app.v6.ld 42 | 43 | # various paths from the SDK used in this project 44 | SDK_LIBDIR = lib 45 | SDK_LDDIR = ld 46 | SDK_INCDIR = include include/json 47 | 48 | # we create two different files for uploading into the flash 49 | # these are the names and options to generate them 50 | FW_FILE_1 = 0x00000 51 | FW_FILE_1_ARGS = -bo $@ -bs .text -bs .data -bs .rodata -bc -ec 52 | FW_FILE_2 = 0x40000 53 | FW_FILE_2_ARGS = -es .irom0.text $@ -ec 54 | 55 | # select which tools to use as compiler, librarian and linker 56 | CC := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-gcc 57 | AR := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-ar 58 | LD := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-gcc 59 | 60 | 61 | 62 | #### 63 | #### no user configurable options below here 64 | #### 65 | FW_TOOL ?= /usr/bin/esptool 66 | SRC_DIR := $(MODULES) 67 | BUILD_DIR := $(addprefix $(BUILD_BASE)/,$(MODULES)) 68 | 69 | SDK_LIBDIR := $(addprefix $(SDK_BASE)/,$(SDK_LIBDIR)) 70 | SDK_INCDIR := $(addprefix -I$(SDK_BASE)/,$(SDK_INCDIR)) 71 | 72 | SRC := $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.c)) 73 | OBJ := $(patsubst %.c,$(BUILD_BASE)/%.o,$(SRC)) 74 | LIBS := $(addprefix -l,$(LIBS)) 75 | APP_AR := $(addprefix $(BUILD_BASE)/,$(TARGET)_app.a) 76 | TARGET_OUT := $(addprefix $(BUILD_BASE)/,$(TARGET).out) 77 | 78 | LD_SCRIPT := $(addprefix -T$(SDK_BASE)/$(SDK_LDDIR)/,$(LD_SCRIPT)) 79 | 80 | INCDIR := $(addprefix -I,$(SRC_DIR)) 81 | EXTRA_INCDIR := $(addprefix -I,$(EXTRA_INCDIR)) 82 | MODULE_INCDIR := $(addsuffix /include,$(INCDIR)) 83 | 84 | FW_FILE_1 := $(addprefix $(FW_BASE)/,$(FW_FILE_1).bin) 85 | FW_FILE_2 := $(addprefix $(FW_BASE)/,$(FW_FILE_2).bin) 86 | 87 | V ?= $(VERBOSE) 88 | ifeq ("$(V)","1") 89 | Q := 90 | vecho := @true 91 | else 92 | Q := @ 93 | vecho := @echo 94 | endif 95 | 96 | vpath %.c $(SRC_DIR) 97 | 98 | define compile-objects 99 | $1/%.o: %.c 100 | $(vecho) "CC $$<" 101 | $(Q) $(CC) $(INCDIR) $(MODULE_INCDIR) $(EXTRA_INCDIR) $(SDK_INCDIR) $(CFLAGS) -c $$< -o $$@ 102 | endef 103 | 104 | .PHONY: all checkdirs flash clean 105 | 106 | all: checkdirs $(TARGET_OUT) $(FW_FILE_1) $(FW_FILE_2) 107 | 108 | $(FW_FILE_1): $(TARGET_OUT) 109 | $(vecho) "FW $@" 110 | $(Q) $(FW_TOOL) -eo $(TARGET_OUT) $(FW_FILE_1_ARGS) 111 | 112 | $(FW_FILE_2): $(TARGET_OUT) 113 | $(vecho) "FW $@" 114 | $(Q) $(FW_TOOL) -eo $(TARGET_OUT) $(FW_FILE_2_ARGS) 115 | 116 | $(TARGET_OUT): $(APP_AR) 117 | $(vecho) "LD $@" 118 | $(Q) $(LD) -L$(SDK_LIBDIR) $(LD_SCRIPT) $(LDFLAGS) -Wl,--start-group $(LIBS) $(APP_AR) -Wl,--end-group -o $@ 119 | 120 | $(APP_AR): $(OBJ) 121 | $(vecho) "AR $@" 122 | $(Q) $(AR) cru $@ $^ 123 | 124 | checkdirs: $(BUILD_DIR) $(FW_BASE) 125 | 126 | $(BUILD_DIR): 127 | $(Q) mkdir -p $@ 128 | 129 | firmware: 130 | $(Q) mkdir -p $@ 131 | 132 | flash: firmware/0x00000.bin firmware/0x40000.bin 133 | -$(ESPTOOL) --port $(ESPPORT) write_flash 0x00000 firmware/0x00000.bin 0x40000 firmware/0x40000.bin 134 | 135 | clean: 136 | $(Q) rm -f $(APP_AR) 137 | $(Q) rm -f $(TARGET_OUT) 138 | $(Q) rm -rf $(BUILD_DIR) 139 | $(Q) rm -rf $(BUILD_BASE) 140 | 141 | 142 | $(Q) rm -f $(FW_FILE_1) 143 | $(Q) rm -f $(FW_FILE_2) 144 | $(Q) rm -rf $(FW_BASE) 145 | 146 | $(foreach bdir,$(BUILD_DIR),$(eval $(call compile-objects,$(bdir)))) 147 | -------------------------------------------------------------------------------- /ESP8266-EVB-blinkLED/README.md: -------------------------------------------------------------------------------- 1 | ESP8266-EVB Hello World Blinking LED code 2 | ========================================= 3 | 4 | Will blink TX Green LED on the MOD-WIFI-ESP8266-DEV module with 1Hz. 5 | 6 | How to build project and upload: 7 | 8 | * Install toolchain 9 | * Build the project 10 | * Connect the board to pc 11 | * Upload the project 12 | 13 | ### Install the toolchain 14 | Follow the instructions on this site: 15 | https://github.com/esp8266/esp8266-wiki/wiki 16 | 17 | ### Build the project 18 | 19 | ```shell 20 | $ make 21 | ``` 22 | 23 | ### Connect the board to pc 24 | 25 | You will need 3.3V cable like [USB-SERIAL-CABLE-F](https://www.olimex.com/Products/Components/Cables/USB-Serial-Cable/USB-Serial-Cable-F/ "USB-Serial-Cable-F"). 26 | 27 | Connect cable as follows: 28 | * blue --> uext pin-2 29 | * green --> uext pin-3 30 | * red --> ext pin-4 31 | 32 | Connect the cable to USB port. You should see the new device in /dev/tty*, for example /dev/ttyUSB0 if you see other update makefile properly. 33 | 34 | ### Upload the project 35 | 36 | If you have build the project without errors you can upload the code to ESP8266 with these commands: 37 | 38 | ```shell 39 | make flash 40 | ``` 41 | The upload takes 2 cycles. 42 | 43 | Now everything is complete and you will see the board GREEN LED to flash slowly. 44 | -------------------------------------------------------------------------------- /ESP8266-EVB-blinkLED/build/app.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/ESP8266-EVB-blinkLED/build/app.out -------------------------------------------------------------------------------- /ESP8266-EVB-blinkLED/build/app_app.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/ESP8266-EVB-blinkLED/build/app_app.a -------------------------------------------------------------------------------- /ESP8266-EVB-blinkLED/build/user/user_main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/ESP8266-EVB-blinkLED/build/user/user_main.o -------------------------------------------------------------------------------- /ESP8266-EVB-blinkLED/firmware/0x00000.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/ESP8266-EVB-blinkLED/firmware/0x00000.bin -------------------------------------------------------------------------------- /ESP8266-EVB-blinkLED/firmware/0x40000.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/ESP8266-EVB-blinkLED/firmware/0x40000.bin -------------------------------------------------------------------------------- /ESP8266-EVB-blinkLED/user/user_config.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/ESP8266-EVB-blinkLED/user/user_config.h -------------------------------------------------------------------------------- /ESP8266-EVB-blinkLED/user/user_main.c: -------------------------------------------------------------------------------- 1 | #include "ets_sys.h" 2 | #include "osapi.h" 3 | #include "gpio.h" 4 | #include "os_type.h" 5 | #include "user_config.h" 6 | 7 | #define user_procTaskPrio 0 8 | #define user_procTaskQueueLen 1 9 | os_event_t user_procTaskQueue[user_procTaskQueueLen]; 10 | static void user_procTask(os_event_t *events); 11 | 12 | static volatile os_timer_t some_timer; 13 | 14 | 15 | void some_timerfunc(void *arg) 16 | { 17 | //Do blinky stuff 18 | if (GPIO_REG_READ(GPIO_OUT_ADDRESS) & BIT1) 19 | { 20 | //Set GPIO1 to LOW 21 | gpio_output_set(0, BIT1, BIT1, 0); 22 | } 23 | else 24 | { 25 | //Set GPIO1 to HIGH 26 | gpio_output_set(BIT1, 0, BIT1, 0); 27 | } 28 | } 29 | 30 | //Do nothing function 31 | static void ICACHE_FLASH_ATTR 32 | user_procTask(os_event_t *events) 33 | { 34 | os_delay_us(10); 35 | } 36 | 37 | //Init function 38 | void ICACHE_FLASH_ATTR 39 | user_init() 40 | { 41 | // Initialize the GPIO subsystem. 42 | gpio_init(); 43 | 44 | //Set GPIO1 to output mode 45 | PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0TXD_U, FUNC_GPIO1); 46 | 47 | //Set GPIO1 low 48 | gpio_output_set(0, BIT1, BIT1, 0); 49 | 50 | //Disarm timer 51 | os_timer_disarm(&some_timer); 52 | 53 | //Setup timer 54 | os_timer_setfn(&some_timer, (os_timer_func_t *)some_timerfunc, NULL); 55 | 56 | //Arm the timer 57 | //&some_timer is the pointer 58 | //1000 is the fire time in ms 59 | //0 for once and 1 for repeating 60 | os_timer_arm(&some_timer, 1000, 1); 61 | 62 | //Start os task 63 | system_os_task(user_procTask, user_procTaskPrio,user_procTaskQueue, user_procTaskQueueLen); 64 | } 65 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision A/ESP8266-EVB-BAT_Rev_A.brd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision A/ESP8266-EVB-BAT_Rev_A.brd -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision A/ESP8266-EVB-BAT_Rev_A.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision A/ESP8266-EVB-BAT_Rev_A.pdf -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision A/ESP8266-EVB-BAT_Rev_A.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision A/ESP8266-EVB-BAT_Rev_A.sch -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B-GERBER-files/ESP8266-EVB-BAT_Rev_B.bcr: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | %ADD10R,0.1450X0.0650*% 11 | %ADD11R,0.1420X0.0650*% 12 | D10* 13 | X007017Y006893D03* 14 | X007017Y007893D03* 15 | X007017Y008893D03* 16 | X007017Y009893D03* 17 | X007017Y010893D03* 18 | D11* 19 | X007017Y014893D03* 20 | X007017Y015893D03* 21 | X007017Y016893D03* 22 | X007017Y017893D03* 23 | X007017Y018893D03* 24 | X007017Y019893D03* 25 | X007017Y020893D03* 26 | X007017Y021893D03* 27 | X007017Y022893D03* 28 | X007017Y023893D03* 29 | M02* 30 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B-GERBER-files/ESP8266-EVB-BAT_Rev_B.brd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B-GERBER-files/ESP8266-EVB-BAT_Rev_B.brd -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B-GERBER-files/ESP8266-EVB-BAT_Rev_B.drd: -------------------------------------------------------------------------------- 1 | % 2 | M48 3 | M72 4 | T01C0.0236 5 | T02C0.0276 6 | T03C0.0340 7 | T04C0.0354 8 | T05C0.0394 9 | T06C0.0400 10 | T07C0.0510 11 | T08C0.0590 12 | T09C0.0630 13 | T10C0.0710 14 | T11C0.1299 15 | T12C0.2598 16 | % 17 | T01 18 | X80771Y68931 19 | X86554Y62649 20 | X93271Y65431 21 | X99988Y62649 22 | X102771Y55931 23 | X99988Y49214 24 | X93271Y46431 25 | X86554Y49214 26 | X83771Y55931 27 | X80271Y82431 28 | X80271Y88931 29 | X105771Y87931 30 | X117771Y100931 31 | X124771Y93931 32 | X143271Y102931 33 | X134771Y116931 34 | X124271Y112931 35 | X117771Y116931 36 | X121771Y128931 37 | X124771Y132431 38 | X120271Y137431 39 | X120771Y142431 40 | X112271Y147431 41 | X101271Y132431 42 | X89771Y128431 43 | X89771Y122431 44 | X82771Y116431 45 | X74271Y116431 46 | X78771Y125431 47 | X73771Y130431 48 | X72271Y135931 49 | X72771Y142431 50 | X65271Y128931 51 | X80271Y158931 52 | X80271Y168931 53 | X80271Y178931 54 | X80271Y188931 55 | X80271Y198931 56 | X80271Y208931 57 | X83771Y223431 58 | X117771Y192931 59 | X112271Y186931 60 | X121271Y175931 61 | X127771Y173431 62 | X131771Y184431 63 | X126771Y201931 64 | X145271Y212431 65 | X157271Y212431 66 | X167271Y212431 67 | X160771Y201681 68 | X160771Y191931 69 | X163771Y168431 70 | X157271Y141931 71 | X171771Y135431 72 | X176771Y143431 73 | X185271Y141431 74 | X196771Y141431 75 | X190771Y130431 76 | X170271Y112431 77 | X155271Y123931 78 | X146271Y128431 79 | X132771Y142431 80 | X105271Y111931 81 | X144271Y74931 82 | X136771Y46431 83 | X224271Y121931 84 | X235771Y121931 85 | X227771Y152431 86 | X221271Y164931 87 | X216771Y178431 88 | X205271Y171431 89 | X198271Y171431 90 | X201771Y185431 91 | X215271Y196431 92 | X229771Y214931 93 | X220271Y236431 94 | X213271Y236431 95 | X214271Y249431 96 | X205771Y247431 97 | X206771Y257431 98 | X217771Y261431 99 | X226271Y258931 100 | X195271Y247431 101 | X195271Y241431 102 | X195771Y232931 103 | X185771Y232931 104 | X175771Y232931 105 | X181771Y217431 106 | X189771Y206431 107 | X192271Y201431 108 | X146371Y242331 109 | X139654Y245114 110 | X136871Y251831 111 | X139654Y258549 112 | X146371Y261331 113 | X153088Y258549 114 | X155871Y251831 115 | X153088Y245114 116 | X110771Y172431 117 | X255271Y177431 118 | T02 119 | X93771Y80475 120 | X93771Y73388 121 | T03 122 | X185271Y125431 123 | X185271Y135431 124 | X234271Y221931 125 | X234271Y231931 126 | X226771Y242431 127 | T04 128 | X245771Y243994 129 | X245771Y251869 130 | T05 131 | X236169Y158750 132 | X234200Y158750 133 | X232231Y158750 134 | X230263Y158750 135 | X228294Y158750 136 | X226326Y158750 137 | X224357Y158750 138 | X217271Y147136 139 | X217271Y145168 140 | X217271Y143199 141 | X217271Y141231 142 | X217271Y139262 143 | X217271Y137294 144 | X217271Y135325 145 | X242861Y135325 146 | X242861Y137294 147 | X242861Y139262 148 | X242861Y141231 149 | X242861Y143199 150 | X242861Y145168 151 | X242861Y147136 152 | T06 153 | X68771Y48431 154 | X110771Y157931 155 | X120771Y157931 156 | X130771Y157931 157 | X140771Y157931 158 | X150771Y157931 159 | X160771Y157931 160 | X170771Y157931 161 | X180771Y157931 162 | X190771Y157931 163 | X200771Y157931 164 | X210771Y157931 165 | X252671Y188531 166 | X252671Y206331 167 | X210771Y227931 168 | X200771Y227931 169 | X190771Y227931 170 | X180771Y227931 171 | X170771Y227931 172 | X160771Y227931 173 | X150771Y227931 174 | X140771Y227931 175 | X130771Y227931 176 | X120771Y227931 177 | X110771Y227931 178 | T07 179 | X170771Y101431 180 | X218771Y101431 181 | X218771Y54431 182 | X170771Y54431 183 | T08 184 | X242871Y183631 185 | X242871Y211231 186 | T09 187 | X243791Y97931 188 | X243791Y77931 189 | X243791Y57931 190 | T10 191 | X162771Y77931 192 | T11 193 | X93657Y98770 194 | X93271Y55931 195 | X93657Y209006 196 | X146371Y251831 197 | X203893Y209006 198 | T12 199 | X119917Y252274 200 | X119917Y55424 201 | M30 202 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B-GERBER-files/ESP8266-EVB-BAT_Rev_B.dri: -------------------------------------------------------------------------------- 1 | Drill Station Info File: C:/maria/ESP8266-EVB-BAT_Rev_B---2-LayersPCB-za-luibcho/ESP8266-EVB-BAT_Rev_B.dri 2 | 3 | Date : 9/11/2018 11:42:09a 4 | Drills : generated 5 | Device : Excellon drill station 6 | 7 | Parameter settings: 8 | 9 | Tolerance Drill + : 2.50 % 10 | Tolerance Drill - : 2.50 % 11 | Rotate : no 12 | Mirror : no 13 | Optimize : yes 14 | Auto fit : yes 15 | OffsetX : 0inch 16 | OffsetY : 0inch 17 | Layers : Drills Holes 18 | 19 | Drill File Info: 20 | 21 | Data Mode : Absolute 22 | Units : 1/1000 Inch 23 | 24 | Drills used: 25 | 26 | Code Size used 27 | 28 | T01 0.0236inch 100 29 | T02 0.0276inch 2 30 | T03 0.0340inch 5 31 | T04 0.0354inch 2 32 | T05 0.0394inch 21 33 | T06 0.0400inch 25 34 | T07 0.0510inch 4 35 | T08 0.0590inch 2 36 | T09 0.0630inch 3 37 | T10 0.0710inch 1 38 | T11 0.1299inch 5 39 | T12 0.2598inch 2 40 | 41 | Total number of drills: 172 42 | 43 | Plotfiles: 44 | 45 | C:/maria/ESP8266-EVB-BAT_Rev_B---2-LayersPCB-za-luibcho/ESP8266-EVB-BAT_Rev_B.drd 46 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B-GERBER-files/ESP8266-EVB-BAT_Rev_B.drl: -------------------------------------------------------------------------------- 1 | T01 0.60mm 2 | T02 0.70mm 3 | T03 0.86mm 4 | T04 0.90mm 5 | T05 1.00mm 6 | T06 1.02mm 7 | T07 1.30mm 8 | T08 1.50mm 9 | T09 1.60mm 10 | T10 1.80mm 11 | T11 3.30mm 12 | T12 6.60mm 13 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B-GERBER-files/ESP8266-EVB-BAT_Rev_B.gpi: -------------------------------------------------------------------------------- 1 | Photoplotter Info File: C:/maria/ESP8266-EVB-BAT_Rev_B---2-LayersPCB-za-luibcho/ESP8266-EVB-BAT_Rev_B.gpi 2 | 3 | Date : 9/11/2018 11:42:23a 4 | Plotfile : C:/maria/ESP8266-EVB-BAT_Rev_B---2-LayersPCB-za-luibcho/ESP8266-EVB-BAT_Rev_B.zmil 5 | Apertures : generated: 6 | Device : Gerber photoplotter with RS-274-X aperture generation 7 | 8 | Parameter settings: 9 | 10 | Emulate Apertures : no 11 | Emulate Thermal : no 12 | Emulate Annulus : no 13 | Tolerance Draw + : 0.00 % 14 | Tolerance Draw - : 0.00 % 15 | Tolerance Flash + : 0.00 % 16 | Tolerance Flash - : 0.00 % 17 | Rotate : no 18 | Mirror : no 19 | Optimize : yes 20 | Auto fit : yes 21 | OffsetX : 0inch 22 | OffsetY : 0inch 23 | 24 | Plotfile Info: 25 | 26 | Coordinate Format : 2.4 27 | Coordinate Units : Inch 28 | Data Mode : Absolute 29 | Zero Suppression : None 30 | End Of Block : * 31 | 32 | Apertures used: 33 | 34 | Code Shape Size used 35 | 36 | 37 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B-GERBER-files/ESP8266-EVB-BAT_Rev_B.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B-GERBER-files/ESP8266-EVB-BAT_Rev_B.sch -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B-GERBER-files/ESP8266-EVB-BAT_Rev_B.sts: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | %ADD10C,0.1290*% 11 | %ADD11C,0.1040*% 12 | %ADD12O,0.1930X0.0985*% 13 | %ADD13R,0.1490X0.0690*% 14 | %ADD14C,0.0631*% 15 | %ADD15R,0.0740X0.0740*% 16 | %ADD16R,0.0640X0.0640*% 17 | %ADD17C,0.0640*% 18 | %ADD18R,0.0700X0.0700*% 19 | %ADD19C,0.0700*% 20 | %ADD20R,0.0571X0.0571*% 21 | %ADD21C,0.0571*% 22 | %ADD22R,0.0240X0.0340*% 23 | %ADD23R,0.0340X0.0240*% 24 | %ADD24R,0.1460X0.0690*% 25 | %ADD25C,0.0640*% 26 | %ADD26C,0.0925*% 27 | %ADD27C,0.1339*% 28 | %ADD28C,0.2638*% 29 | %ADD29C,0.0316*% 30 | %ADD30C,0.2520*% 31 | D10* 32 | X016277Y007793D03* 33 | D11* 34 | X017077Y010143D03* 35 | X021877Y010143D03* 36 | X021877Y005443D03* 37 | X017077Y005443D03* 38 | D12* 39 | X024379Y005793D03* 40 | X024379Y007793D03* 41 | X024379Y009793D03* 42 | D13* 43 | X007017Y009893D03* 44 | X007017Y010893D03* 45 | X007017Y008893D03* 46 | X007017Y007893D03* 47 | X007017Y006893D03* 48 | D14* 49 | X021727Y013533D03* 50 | X021727Y013729D03* 51 | X021727Y013926D03* 52 | X021727Y014123D03* 53 | X021727Y014320D03* 54 | X021727Y014517D03* 55 | X021727Y014714D03* 56 | X022436Y015875D03* 57 | X022633Y015875D03* 58 | X022829Y015875D03* 59 | X023026Y015875D03* 60 | X023223Y015875D03* 61 | X023420Y015875D03* 62 | X023617Y015875D03* 63 | X024286Y014714D03* 64 | X024286Y014517D03* 65 | X024286Y014320D03* 66 | X024286Y014123D03* 67 | X024286Y013926D03* 68 | X024286Y013729D03* 69 | X024286Y013533D03* 70 | D15* 71 | X006877Y004843D03* 72 | D16* 73 | X018527Y013543D03* 74 | X023427Y022193D03* 75 | D17* 76 | X023427Y023193D03* 77 | X022677Y024243D03* 78 | X018527Y012543D03* 79 | D18* 80 | X021077Y022793D03* 81 | D19* 82 | X020077Y022793D03* 83 | X019077Y022793D03* 84 | X018077Y022793D03* 85 | X017077Y022793D03* 86 | X016077Y022793D03* 87 | X015077Y022793D03* 88 | X014077Y022793D03* 89 | X013077Y022793D03* 90 | X012077Y022793D03* 91 | X011077Y022793D03* 92 | X011077Y015793D03* 93 | X012077Y015793D03* 94 | X013077Y015793D03* 95 | X014077Y015793D03* 96 | X015077Y015793D03* 97 | X016077Y015793D03* 98 | X017077Y015793D03* 99 | X018077Y015793D03* 100 | X019077Y015793D03* 101 | X020077Y015793D03* 102 | X021077Y015793D03* 103 | D20* 104 | X024577Y024399D03* 105 | D21* 106 | X024577Y025187D03* 107 | D22* 108 | X021827Y024143D03* 109 | X021527Y024143D03* 110 | D23* 111 | X020177Y019143D03* 112 | X020177Y018843D03* 113 | D24* 114 | X007017Y018893D03* 115 | X007017Y017893D03* 116 | X007017Y016893D03* 117 | X007017Y015893D03* 118 | X007017Y014893D03* 119 | X007017Y019893D03* 120 | X007017Y020893D03* 121 | X007017Y021893D03* 122 | X007017Y022893D03* 123 | X007017Y023893D03* 124 | D25* 125 | X025267Y020633D03* 126 | X025267Y018853D03* 127 | D26* 128 | X024287Y018363D03* 129 | X024287Y021123D03* 130 | D27* 131 | X020389Y020901D03* 132 | X009366Y020901D03* 133 | X009366Y009877D03* 134 | D28* 135 | X011992Y005542D03* 136 | X011992Y025227D03* 137 | D29* 138 | X009377Y008047D03* 139 | X009377Y007339D03* 140 | D30* 141 | X009327Y005593D03* 142 | X014637Y025183D03* 143 | M02* 144 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B-GERBER-files/ESP8266-EVB-BAT_Rev_B.tcr: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | %ADD10R,0.0709X0.0571*% 11 | %ADD11R,0.0551X0.0394*% 12 | %ADD12R,0.0400X0.0400*% 13 | %ADD13R,0.1450X0.0650*% 14 | %ADD14R,0.0700X0.0900*% 15 | %ADD15R,0.0472X0.0217*% 16 | %ADD16R,0.0630X0.1378*% 17 | %ADD17R,0.0571X0.0709*% 18 | %ADD18R,0.0400X0.0100*% 19 | %ADD19R,0.1420X0.0650*% 20 | %ADD20R,0.0610X0.0591*% 21 | D10* 22 | X014427Y006831D03* 23 | X014427Y008756D03* 24 | D11* 25 | X014460Y009743D03* 26 | X013594Y009369D03* 27 | X013594Y010117D03* 28 | X014494Y017319D03* 29 | X014494Y018067D03* 30 | X015360Y017693D03* 31 | D12* 32 | X007627Y005343D03* 33 | X007627Y006043D03* 34 | X011077Y008093D03* 35 | X011777Y008093D03* 36 | X012677Y007543D03* 37 | X013377Y007543D03* 38 | X012927Y009393D03* 39 | X012927Y010093D03* 40 | X012927Y010693D03* 41 | X012927Y011393D03* 42 | X011777Y011293D03* 43 | X011077Y011293D03* 44 | X010127Y011643D03* 45 | X010127Y012243D03* 46 | X010127Y012843D03* 47 | X011077Y012893D03* 48 | X011777Y012893D03* 49 | X014277Y014243D03* 50 | X014977Y014243D03* 51 | X016027Y013243D03* 52 | X016627Y013243D03* 53 | X016627Y012543D03* 54 | X016027Y012543D03* 55 | X016027Y011943D03* 56 | X016627Y011943D03* 57 | X016627Y011243D03* 58 | X016027Y011243D03* 59 | X015127Y012393D03* 60 | X014427Y012393D03* 61 | X011777Y009693D03* 62 | X011077Y009693D03* 63 | X009427Y011643D03* 64 | X009427Y012243D03* 65 | X009427Y012843D03* 66 | X013177Y017343D03* 67 | X013777Y017343D03* 68 | X013777Y018043D03* 69 | X013177Y018043D03* 70 | X013527Y018793D03* 71 | X014127Y018793D03* 72 | X014127Y019493D03* 73 | X013527Y019493D03* 74 | X014127Y020093D03* 75 | X014827Y020093D03* 76 | X016077Y018143D03* 77 | X016777Y018143D03* 78 | X016777Y017543D03* 79 | X016777Y016843D03* 80 | X019227Y017143D03* 81 | X019227Y017843D03* 82 | X019827Y017843D03* 83 | X020527Y017843D03* 84 | X021127Y017843D03* 85 | X021127Y017143D03* 86 | X023877Y019393D03* 87 | X023877Y020093D03* 88 | X022027Y024143D03* 89 | X021327Y024143D03* 90 | X020727Y024143D03* 91 | X020027Y024143D03* 92 | X019127Y024143D03* 93 | X019127Y024743D03* 94 | X019127Y025343D03* 95 | X018427Y025343D03* 96 | X018427Y024743D03* 97 | X018427Y024143D03* 98 | X020677Y026143D03* 99 | X021377Y026143D03* 100 | X022627Y025493D03* 101 | X022627Y024893D03* 102 | X023327Y024893D03* 103 | X023327Y025493D03* 104 | X023927Y025543D03* 105 | X023927Y024843D03* 106 | D13* 107 | X007017Y010893D03* 108 | X007017Y009893D03* 109 | X007017Y008893D03* 110 | X007017Y007893D03* 111 | X007017Y006893D03* 112 | D14* 113 | X023970Y017043D03* 114 | X025684Y017043D03* 115 | D15* 116 | X018539Y016919D03* 117 | X018539Y017293D03* 118 | X018539Y017667D03* 119 | X017515Y017667D03* 120 | X017515Y017293D03* 121 | X017515Y016919D03* 122 | X015139Y013717D03* 123 | X015139Y012969D03* 124 | X014115Y012969D03* 125 | X014115Y013343D03* 126 | X014115Y013717D03* 127 | D16* 128 | X014155Y011343D03* 129 | X015100Y011343D03* 130 | X017555Y018693D03* 131 | X018500Y018693D03* 132 | D17* 133 | X019214Y018993D03* 134 | X021140Y018993D03* 135 | X016840Y018993D03* 136 | X014914Y018993D03* 137 | D18* 138 | X020161Y024749D03* 139 | X020161Y024946D03* 140 | X020161Y025143D03* 141 | X020161Y025340D03* 142 | X020161Y025537D03* 143 | X021893Y025537D03* 144 | X021893Y025340D03* 145 | X021893Y025143D03* 146 | X021893Y024946D03* 147 | X021893Y024749D03* 148 | D19* 149 | X007017Y023893D03* 150 | X007017Y022893D03* 151 | X007017Y021893D03* 152 | X007017Y020893D03* 153 | X007017Y019893D03* 154 | X007017Y018893D03* 155 | X007017Y017893D03* 156 | X007017Y016893D03* 157 | X007017Y015893D03* 158 | X007017Y014893D03* 159 | D20* 160 | X008491Y007693D03* 161 | X010263Y007693D03* 162 | M02* 163 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B-GERBER-files/ESP8266-EVB-BAT_Rev_B.zmil: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | M02* 11 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B.bom: -------------------------------------------------------------------------------- 1 | Partlist exported from J:/SVN/OLIMEX_OTHER/ESP8266_EVB-BAT/Hardware/trunk/BRD/ESP8266-EVB-BAT_Rev_B.sch at 14/07/2015 16:39:08 2 | 3 | Qty Value Device Parts 4 | 4 1.1k/1% R-EU_R0603_5MIL_DWS R5, R9, R13, R21 5 | 1 1.5k R-EU_R0603_5MIL_DWS R17 6 | 3 1N5822/SS34/SMA SCHOTKKY7.62SS2 D1, D2, D4 7 | 6 2.2k R-EU_R0603_5MIL_DWS R1, R4, R14, R15, R16, R22 8 | 2 2.2uH/1.5A/DCR<0.1R/CD32 L-CD32 L1, L2 9 | 4 4.99k/1% R-EU_R0603_5MIL_DWS R8, R10, R11, R19 10 | 1 8.2k/1% R-EU_R0603_5MIL_DWS R12 11 | 2 10k R-EU_R0603_5MIL_DWS R6, R18 12 | 1 10n C-EUC0603_DWS C9 13 | 1 22k/1% R-EU_R0603_5MIL_DWS R20 14 | 1 22pF C-EUC0603_DWS C3 15 | 7 22uF/6.3V C-EUC0603_DWS C2, C4, C5, C6, C7, C8, C10 16 | 1 47k R-EU_R0603_5MIL_DWS R3 17 | 2 220 R-EU_R0603_5MIL_DWS R7, R24 18 | 2 470uF/10V/105C CPOL-EUE2.5-6.3 C1, C11 19 | 1 0603/GREEN LED0603DWS_L CH_CMPL 20 | 1 0603/RED LED0603DWS_L PG 21 | 1 0603/YELLOW LED0603DWS_L CH_PRGR 22 | 1 BC817-40(SMD) NPN-TRANSISTOR_SOT23 T1 23 | 1 BH10S ML10SMD UEXT 24 | 1 BH20S ML20CHANGED CON1 25 | 1 CON3HD-515R8_3P+HD-515H8_3P CON3HD-515R8_3P+HD-515H8_3P CON2 26 | 1 DW02R CON2DW02R BAT 27 | 3 FIDUCIAL FIDUCIAL U$1, U$2, U$8 28 | 1 IRLML6402 IRLML6402 FET1 29 | 1 MCP73833-AMI/UN MCP73833 U3 30 | 1 NA R-EU_R0603_5MIL_DWS R23 31 | 1 NA(2.2k) R-EU_R0603_5MIL_DWS R2 32 | 1 PWRJ-2mm PWR-JAKPWR_JACK_UNI_MILLING PWR 33 | 1 RAS-05-15 RELAYH200F RELAY 34 | 1 SMBJ6.0A SMBJ16A D3 35 | 1 SW-TAKTIT1185AU2 SW-TAKTIT1185AU2 RST 36 | 1 SY7208(SOT23-6) SY7208 U2 37 | 1 SY8009AAAC(SOT23-5) SY8008 U1 38 | 1 TESTPAD TESTPAD THERM 39 | 1 TESTPAD3 TESTPAD3 GND 40 | 1 TESTPAD40/60/SQUARE TESTPAD40/60/SQUARE 1 41 | 21 TESTPAD40/66 TESTPAD40/66 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 42 | 1 TV-06B 31-XX BUT 43 | 1 close SJSJ_1_SMALLER_CLOSE_10MILS 400MA_E 44 | 1 green/0603 LED0603DWS_L REL 45 | 1 open SJSJ_SMALLER +5V_E 46 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B.brd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B.brd -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B.pdf -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B.sch -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B_bom.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B_bom.ods -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B_bom.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB-BAT/ESP8266-EVB-BAT revision B/ESP8266-EVB-BAT_Rev_B_bom.pdf -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB-BAT/Hardware_changes.txt: -------------------------------------------------------------------------------- 1 | ESP8266-EVB-BAT 2 | 3 | Designed with Eagle CAD 4 | 5 | --- 6 | 7 | ESP8266-EVB-BAT hardware revision B - latest hardware revision - notable changes: 8 | 9 | 1. Added a reset button and resistor for easier access to bootloader mode 10 | 11 | --- 12 | 13 | ESP8266-EVB-BAT hardware revision A - initial release -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A/ESP8266-EVB_Rev_A.brd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB/ESP8266-EVB revision A/ESP8266-EVB_Rev_A.brd -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A/ESP8266-EVB_Rev_A.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB/ESP8266-EVB revision A/ESP8266-EVB_Rev_A.pdf -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A/ESP8266-EVB_Rev_A.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB/ESP8266-EVB revision A/ESP8266-EVB_Rev_A.sch -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1-GERBER-files/ESP8266-EVB_Rev_A1.bcr: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | M02* 11 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1-GERBER-files/ESP8266-EVB_Rev_A1.brd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1-GERBER-files/ESP8266-EVB_Rev_A1.brd -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1-GERBER-files/ESP8266-EVB_Rev_A1.dim: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | %ADD10C,0.0100*% 11 | D10* 12 | X002157Y004243D02* 13 | X002157Y023743D01* 14 | X024657Y023743D01* 15 | X024657Y004243D01* 16 | X002157Y004243D01* 17 | M02* 18 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1-GERBER-files/ESP8266-EVB_Rev_A1.drd: -------------------------------------------------------------------------------- 1 | % 2 | M48 3 | M72 4 | T01C0.0236 5 | T02C0.0340 6 | T03C0.0394 7 | T04C0.0400 8 | T05C0.0433 9 | T06C0.0500 10 | T07C0.0510 11 | T08C0.0512 12 | T09C0.0710 13 | T10C0.1299 14 | % 15 | T01 16 | X36569Y47931 17 | X29851Y50714 18 | X27069Y57431 19 | X29851Y64149 20 | X36569Y66931 21 | X43286Y64149 22 | X46069Y57431 23 | X43286Y50714 24 | X64069Y66431 25 | X111069Y106931 26 | X115569Y118431 27 | X121569Y118431 28 | X127069Y100931 29 | X134569Y96431 30 | X145569Y90431 31 | X142569Y81931 32 | X149069Y98931 33 | X159069Y98931 34 | X169069Y98931 35 | X179069Y98931 36 | X189069Y98931 37 | X199069Y98931 38 | X231569Y66931 39 | X224851Y64149 40 | X222069Y57431 41 | X224851Y50714 42 | X231569Y47931 43 | X238286Y50714 44 | X241069Y57431 45 | X238286Y64149 46 | X220069Y138931 47 | X220069Y158931 48 | X220069Y178931 49 | X220069Y198931 50 | X231569Y212931 51 | X224851Y215714 52 | X222069Y222431 53 | X224851Y229149 54 | X231569Y231931 55 | X238286Y229149 56 | X241069Y222431 57 | X238286Y215714 58 | X178569Y202431 59 | X162069Y208931 60 | X166569Y187431 61 | X175569Y174431 62 | X169069Y167431 63 | X174069Y154931 64 | X169569Y150431 65 | X164069Y148931 66 | X154069Y145431 67 | X181569Y143931 68 | X189069Y143931 69 | X148069Y181431 70 | X46069Y222431 71 | X43286Y215714 72 | X36569Y212931 73 | X29851Y215714 74 | X27069Y222431 75 | X29851Y229149 76 | X36569Y231931 77 | X43286Y229149 78 | T02 79 | X90069Y96931 80 | X90069Y86931 81 | T03 82 | X74569Y87695 83 | X74569Y85727 84 | X74569Y89664 85 | X74569Y91632 86 | X74569Y93601 87 | X74569Y95569 88 | X74569Y97538 89 | X67482Y74113 90 | X65513Y74113 91 | X63545Y74113 92 | X61576Y74113 93 | X59608Y74113 94 | X57639Y74113 95 | X55671Y74113 96 | X48978Y85727 97 | X48978Y87695 98 | X48978Y89664 99 | X48978Y91632 100 | X48978Y93601 101 | X48978Y95569 102 | X48978Y97538 103 | X45069Y119431 104 | T04 105 | X109069Y134931 106 | X119069Y134931 107 | X129069Y134931 108 | X139069Y134931 109 | X149069Y134931 110 | X159069Y134931 111 | X169069Y134931 112 | X179069Y134931 113 | X189069Y134931 114 | X199069Y134931 115 | X209069Y134931 116 | X209069Y64931 117 | X199069Y64931 118 | X189069Y64931 119 | X179069Y64931 120 | X169069Y64931 121 | X159069Y64931 122 | X149069Y64931 123 | X139069Y64931 124 | X129069Y64931 125 | X119069Y64931 126 | X109069Y64931 127 | X109069Y47431 128 | X99069Y47431 129 | X89069Y47431 130 | X79069Y47431 131 | X69069Y47431 132 | X59069Y47431 133 | X119069Y47431 134 | X129069Y47431 135 | X139069Y47431 136 | X149069Y47431 137 | X159069Y47431 138 | X169069Y47431 139 | X179069Y47431 140 | X189069Y47431 141 | X199069Y47431 142 | X209069Y47431 143 | X104569Y224931 144 | T05 145 | X157069Y224931 146 | X157069Y214931 147 | X167069Y214931 148 | X177069Y214931 149 | X187069Y214931 150 | X197069Y214931 151 | X197069Y224931 152 | X187069Y224931 153 | X177069Y224931 154 | X167069Y224931 155 | T06 156 | X190069Y188431 157 | X190069Y168431 158 | X240069Y168431 159 | X240069Y188431 160 | T07 161 | X121569Y201931 162 | X73569Y201931 163 | X73569Y154931 164 | X121569Y154931 165 | T08 166 | X38069Y158746 167 | X38069Y178431 168 | X38069Y198117 169 | X38069Y101774 170 | X38069Y82089 171 | T09 172 | X129569Y178431 173 | T10 174 | X36569Y222431 175 | X36569Y57431 176 | X231569Y57431 177 | X231569Y222431 178 | M30 179 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1-GERBER-files/ESP8266-EVB_Rev_A1.dri: -------------------------------------------------------------------------------- 1 | Drill Station Info File: C:/maria/ESP8266-EVB_Rev_A1---2-layersPCB-za-Lub/ESP8266-EVB_Rev_A1.dri 2 | 3 | Date : 9/11/2018 11:39:06a 4 | Drills : generated 5 | Device : Excellon drill station 6 | 7 | Parameter settings: 8 | 9 | Tolerance Drill + : 2.50 % 10 | Tolerance Drill - : 2.50 % 11 | Rotate : no 12 | Mirror : no 13 | Optimize : yes 14 | Auto fit : yes 15 | OffsetX : 0inch 16 | OffsetY : 0inch 17 | Layers : Drills Holes 18 | 19 | Drill File Info: 20 | 21 | Data Mode : Absolute 22 | Units : 1/1000 Inch 23 | 24 | Drills used: 25 | 26 | Code Size used 27 | 28 | T01 0.0236inch 62 29 | T02 0.0340inch 2 30 | T03 0.0394inch 22 31 | T04 0.0400inch 39 32 | T05 0.0433inch 10 33 | T06 0.0500inch 4 34 | T07 0.0510inch 4 35 | T08 0.0512inch 5 36 | T09 0.0710inch 1 37 | T10 0.1299inch 4 38 | 39 | Total number of drills: 153 40 | 41 | Plotfiles: 42 | 43 | C:/maria/ESP8266-EVB_Rev_A1---2-layersPCB-za-Lub/ESP8266-EVB_Rev_A1.drd 44 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1-GERBER-files/ESP8266-EVB_Rev_A1.drl: -------------------------------------------------------------------------------- 1 | T01 0.60mm 2 | T02 0.86mm 3 | T03 1.00mm 4 | T04 1.02mm 5 | T05 1.10mm 6 | T06 1.27mm 7 | T07 1.30mm 8 | T08 1.80mm 9 | T09 3.30mm 10 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1-GERBER-files/ESP8266-EVB_Rev_A1.gpi: -------------------------------------------------------------------------------- 1 | Photoplotter Info File: C:/maria/ESP8266-EVB_Rev_A1---2-layersPCB-za-Lub/ESP8266-EVB_Rev_A1.gpi 2 | 3 | Date : 9/11/2018 11:39:21a 4 | Plotfile : C:/maria/ESP8266-EVB_Rev_A1---2-layersPCB-za-Lub/ESP8266-EVB_Rev_A1.zmil 5 | Apertures : generated: 6 | Device : Gerber photoplotter with RS-274-X aperture generation 7 | 8 | Parameter settings: 9 | 10 | Emulate Apertures : no 11 | Emulate Thermal : no 12 | Emulate Annulus : no 13 | Tolerance Draw + : 0.00 % 14 | Tolerance Draw - : 0.00 % 15 | Tolerance Flash + : 0.00 % 16 | Tolerance Flash - : 0.00 % 17 | Rotate : no 18 | Mirror : no 19 | Optimize : yes 20 | Auto fit : yes 21 | OffsetX : 0inch 22 | OffsetY : 0inch 23 | 24 | Plotfile Info: 25 | 26 | Coordinate Format : 2.4 27 | Coordinate Units : Inch 28 | Data Mode : Absolute 29 | Zero Suppression : None 30 | End Of Block : * 31 | 32 | Apertures used: 33 | 34 | Code Shape Size used 35 | 36 | 37 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1-GERBER-files/ESP8266-EVB_Rev_A1.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1-GERBER-files/ESP8266-EVB_Rev_A1.sch -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1-GERBER-files/ESP8266-EVB_Rev_A1.sts: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | %ADD10C,0.1290*% 11 | %ADD11C,0.1040*% 12 | %ADD12R,0.1240X0.1240*% 13 | %ADD13C,0.1240*% 14 | %ADD14R,0.0700X0.0700*% 15 | %ADD15C,0.0700*% 16 | %ADD16C,0.0631*% 17 | %ADD17R,0.0740X0.0740*% 18 | %ADD18R,0.0640X0.0640*% 19 | %ADD19C,0.0640*% 20 | %ADD20C,0.2520*% 21 | D10* 22 | X012957Y017843D03* 23 | D11* 24 | X012157Y015493D03* 25 | X007357Y015493D03* 26 | X007357Y020193D03* 27 | X012157Y020193D03* 28 | X019007Y018843D03* 29 | X019007Y016843D03* 30 | X024007Y016843D03* 31 | X024007Y018843D03* 32 | D12* 33 | X003807Y019812D03* 34 | X003807Y010177D03* 35 | D13* 36 | X003807Y008209D03* 37 | X003807Y015875D03* 38 | X003807Y017843D03* 39 | D14* 40 | X005907Y004743D03* 41 | X010907Y006493D03* 42 | X015707Y021493D03* 43 | D15* 44 | X016707Y021493D03* 45 | X017707Y021493D03* 46 | X018707Y021493D03* 47 | X019707Y021493D03* 48 | X019707Y022493D03* 49 | X018707Y022493D03* 50 | X017707Y022493D03* 51 | X016707Y022493D03* 52 | X015707Y022493D03* 53 | X015907Y013493D03* 54 | X016907Y013493D03* 55 | X017907Y013493D03* 56 | X018907Y013493D03* 57 | X019907Y013493D03* 58 | X020907Y013493D03* 59 | X014907Y013493D03* 60 | X013907Y013493D03* 61 | X012907Y013493D03* 62 | X011907Y013493D03* 63 | X010907Y013493D03* 64 | X011907Y006493D03* 65 | X012907Y006493D03* 66 | X013907Y006493D03* 67 | X014907Y006493D03* 68 | X015907Y006493D03* 69 | X016907Y006493D03* 70 | X017907Y006493D03* 71 | X018907Y006493D03* 72 | X019907Y006493D03* 73 | X020907Y006493D03* 74 | X020907Y004743D03* 75 | X019907Y004743D03* 76 | X018907Y004743D03* 77 | X017907Y004743D03* 78 | X016907Y004743D03* 79 | X015907Y004743D03* 80 | X014907Y004743D03* 81 | X013907Y004743D03* 82 | X012907Y004743D03* 83 | X011907Y004743D03* 84 | X010907Y004743D03* 85 | X009907Y004743D03* 86 | X008907Y004743D03* 87 | X007907Y004743D03* 88 | X006907Y004743D03* 89 | D16* 90 | X006748Y007411D03* 91 | X006551Y007411D03* 92 | X006354Y007411D03* 93 | X006158Y007411D03* 94 | X005961Y007411D03* 95 | X005764Y007411D03* 96 | X005567Y007411D03* 97 | X004898Y008573D03* 98 | X004898Y008770D03* 99 | X004898Y008966D03* 100 | X004898Y009163D03* 101 | X004898Y009360D03* 102 | X004898Y009557D03* 103 | X004898Y009754D03* 104 | X004507Y011943D03* 105 | X007457Y009754D03* 106 | X007457Y009557D03* 107 | X007457Y009360D03* 108 | X007457Y009163D03* 109 | X007457Y008966D03* 110 | X007457Y008770D03* 111 | X007457Y008573D03* 112 | D17* 113 | X010457Y022493D03* 114 | D18* 115 | X009007Y008693D03* 116 | D19* 117 | X009007Y009693D03* 118 | D20* 119 | X003657Y005743D03* 120 | X003657Y022243D03* 121 | X023157Y022243D03* 122 | X023157Y005743D03* 123 | M02* 124 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1-GERBER-files/ESP8266-EVB_Rev_A1.tcr: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | %ADD10R,0.0551X0.0394*% 11 | %ADD11R,0.0400X0.0400*% 12 | %ADD12R,0.0700X0.0900*% 13 | %ADD13R,0.0472X0.0217*% 14 | %ADD14R,0.0630X0.1378*% 15 | D10* 16 | X015640Y015519D03* 17 | X015640Y016267D03* 18 | X014774Y015893D03* 19 | X014807Y017095D03* 20 | X014807Y018591D03* 21 | D11* 22 | X011557Y009393D03* 23 | X012157Y009393D03* 24 | X012157Y010093D03* 25 | X011557Y010093D03* 26 | X011557Y010693D03* 27 | X012157Y010693D03* 28 | X012157Y011393D03* 29 | X011557Y011393D03* 30 | X013107Y010093D03* 31 | X013807Y010093D03* 32 | X013807Y008193D03* 33 | X013107Y008193D03* 34 | X016307Y015543D03* 35 | X016907Y015543D03* 36 | X016907Y016243D03* 37 | X016307Y016243D03* 38 | X015657Y017493D03* 39 | X015657Y018193D03* 40 | X015657Y018993D03* 41 | X015657Y019693D03* 42 | X016657Y019843D03* 43 | X017257Y019843D03* 44 | X017857Y019843D03* 45 | X017857Y019143D03* 46 | X017257Y019143D03* 47 | X016657Y019143D03* 48 | X018257Y018193D03* 49 | X018257Y017493D03* 50 | D12* 51 | X006964Y011943D03* 52 | X005250Y011943D03* 53 | D13* 54 | X012945Y009517D03* 55 | X012945Y008769D03* 56 | X013969Y008769D03* 57 | X013969Y009143D03* 58 | X013969Y009517D03* 59 | D14* 60 | X013929Y011193D03* 61 | X012984Y011193D03* 62 | M02* 63 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1-GERBER-files/ESP8266-EVB_Rev_A1.zmil: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | M02* 11 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1.bom: -------------------------------------------------------------------------------- 1 | Partlist exported from J:/SVN/OLIMEX_OTHER/ESP8266-EVB/Hardware/trunk/BRD/ESP8266-EVB_Rev_A1.sch at 28/01/2015 11:49:35 2 | 3 | Qty Value Device Parts 4 | 2 1.1k/1% R-EU_R0603_5MIL_DWS R5, R9 5 | 1 1N5819(S4SOD-123) SCHOTKKY7.62SS-1N5819(S4SOD-123) D1 6 | 2 2.2k R-EU_R0603_5MIL_DWS R1, R4 7 | 1 2.2uH/1.5A/DCR<0.1R/CD32 L-CD32 L1 8 | 1 4.99k/1% R-EU_R0603_5MIL_DWS R8 9 | 1 10k R-EU_R0603_5MIL_DWS R6 10 | 1 22pF C-EUC0603_DWS C3 11 | 3 22uF/6.3V C-EUC0603_DWS C2, C4, C5 12 | 1 47k R-EU_R0603_5MIL_DWS R3 13 | 1 220 R-EU_R0603_5MIL_DWS R7 14 | 1 470uF/10V/105C CPOL-EUE2.5-6.3 C1 15 | 1 BC817-40(SMD) NPN-TRANSISTOR_SOT23 T1 16 | 1 BH10S ML10 UEXT 17 | 1 CON3-DG306-5.0_3P(TB3-5MM) CON3-DG306-5.0_3P(TB3-5MM) CON4 18 | 1 DTSM24R(12x12x10) SW-TAKTSS BUT 19 | 3 FIDUCIAL FIDUCIAL U$1, U$2, U$8 20 | 1 HN1X16 CON16-HN1X16 CON3 21 | 1 NA(2.2k) R-EU_R0603_5MIL_DWS R2 22 | 1 NA(TB2/3.5mm) CON2-DG306-5.0_2P(TB2-5MM) PWR. 23 | 1 RAS-05-15 RELAYH200F REL 24 | 1 SMBJ6.0A SMBJ16A D2 25 | 1 SY8009AAAC(SOT23-5) SY8008 U1 26 | 1 TESTPAD3 TESTPAD3 GND_PIN 27 | 1 TESTPAD40/60/SQUARE TESTPAD40/60/SQUARE 1 28 | 21 TESTPAD40/66 TESTPAD40/66 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22 29 | 1 YDJ-1136 PWR-JAKPWR_JACK_UNI_MILLING PWR 30 | 1 green/0603 LED0603DWS_L LED 31 | -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1.brd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1.brd -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1.pdf -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1.sch -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1_bom.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1_bom.ods -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1_bom.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/ESP8266-EVB/ESP8266-EVB revision A1/ESP8266-EVB_Rev_A1_bom.pdf -------------------------------------------------------------------------------- /HARDWARE/ESP8266-EVB/Hardware_changes.txt: -------------------------------------------------------------------------------- 1 | ESP8266-EVB 2 | 3 | Designed with Eagle CAD 4 | 5 | --- 6 | 7 | ESP8266-EVB hardware revision A1 - latest hardware revision - notable changes: 8 | 9 | 1. R1 now populated in order to have a properly working I2C. Value changed from NA to 2.2K. 10 | 11 | --- 12 | 13 | ESP8266-EVB hardware revision A - initial release -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/Hardware_changes.txt: -------------------------------------------------------------------------------- 1 | MOD-WIFI-ESP8266-DEV 2 | 3 | Designed with Eagle CAD 4 | 5 | --- 6 | 7 | MOD-WIFI-ESP8266-DEV hardware revision B1 - latest hardware revision - notable changes: 8 | 9 | 1. Changed C1 and C2 from 10pF to 3.9pF, because of different quartz. 10 | 11 | --- 12 | 13 | MOD-WIFI-ESP8266-DEV hardware revision B - notable changes: 14 | 15 | 1. Removed cream layer from UEXT connector, decreased the width of ESP8266's pads 16 | 2. Added a button and R11 = 200R 17 | 3. Added NA(2K) pads for pull up resistor over GPIO4 - this is done to be capable to use the I2C-to (if you use the board with ESP8266-EVB, since it is part of EVB board then such a resistor is already placed on the EVB part). However, you can still use it without EVB if you solder the resistor. 18 | 4. Changed jumper names for better consistency with other ESP8266 products 19 | 5. Added a test pad for the RTC pin 20 | 21 | --- 22 | 23 | MOD-WIFI-ESP8266 hardware revision A - initial release -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision A/MOD-WIFI-ESP8266-DEV_Rev_A.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision A/MOD-WIFI-ESP8266-DEV_Rev_A.pdf -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision A/MOD-WIFI-ESP8266-DEV_schematic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision A/MOD-WIFI-ESP8266-DEV_schematic.pdf -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B/MOD-WiFi-ESP8266-DEV_Rev_B.brd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B/MOD-WiFi-ESP8266-DEV_Rev_B.brd -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B/MOD-WiFi-ESP8266-DEV_Rev_B.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B/MOD-WiFi-ESP8266-DEV_Rev_B.pdf -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B/MOD-WiFi-ESP8266-DEV_Rev_B.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B/MOD-WiFi-ESP8266-DEV_Rev_B.sch -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1-GERBER-files/MOD-WiFi-ESP8266-DEV_Rev_B1.bcr: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | M02* 11 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1-GERBER-files/MOD-WiFi-ESP8266-DEV_Rev_B1.brd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1-GERBER-files/MOD-WiFi-ESP8266-DEV_Rev_B1.brd -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1-GERBER-files/MOD-WiFi-ESP8266-DEV_Rev_B1.dim: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | %ADD10C,0.0100*% 11 | %ADD11C,0.0000*% 12 | D10* 13 | X007962Y003989D02* 14 | X007962Y012989D01* 15 | X020962Y012989D01* 16 | X020962Y003989D01* 17 | X007962Y003989D01* 18 | D11* 19 | X010924Y005685D02* 20 | X010926Y005709D01* 21 | X010932Y005732D01* 22 | X010942Y005754D01* 23 | X010956Y005774D01* 24 | X010973Y005791D01* 25 | X010993Y005805D01* 26 | X011015Y005815D01* 27 | X011038Y005821D01* 28 | X011062Y005823D01* 29 | X011086Y005821D01* 30 | X011109Y005815D01* 31 | X011131Y005805D01* 32 | X011151Y005791D01* 33 | X011168Y005774D01* 34 | X011182Y005754D01* 35 | X011192Y005732D01* 36 | X011198Y005709D01* 37 | X011200Y005685D01* 38 | X011198Y005661D01* 39 | X011192Y005638D01* 40 | X011182Y005616D01* 41 | X011168Y005596D01* 42 | X011151Y005579D01* 43 | X011131Y005565D01* 44 | X011109Y005555D01* 45 | X011086Y005549D01* 46 | X011062Y005547D01* 47 | X011038Y005549D01* 48 | X011015Y005555D01* 49 | X010993Y005565D01* 50 | X010973Y005579D01* 51 | X010956Y005596D01* 52 | X010942Y005616D01* 53 | X010932Y005638D01* 54 | X010926Y005661D01* 55 | X010924Y005685D01* 56 | X010924Y006394D02* 57 | X010926Y006418D01* 58 | X010932Y006441D01* 59 | X010942Y006463D01* 60 | X010956Y006483D01* 61 | X010973Y006500D01* 62 | X010993Y006514D01* 63 | X011015Y006524D01* 64 | X011038Y006530D01* 65 | X011062Y006532D01* 66 | X011086Y006530D01* 67 | X011109Y006524D01* 68 | X011131Y006514D01* 69 | X011151Y006500D01* 70 | X011168Y006483D01* 71 | X011182Y006463D01* 72 | X011192Y006441D01* 73 | X011198Y006418D01* 74 | X011200Y006394D01* 75 | X011198Y006370D01* 76 | X011192Y006347D01* 77 | X011182Y006325D01* 78 | X011168Y006305D01* 79 | X011151Y006288D01* 80 | X011131Y006274D01* 81 | X011109Y006264D01* 82 | X011086Y006258D01* 83 | X011062Y006256D01* 84 | X011038Y006258D01* 85 | X011015Y006264D01* 86 | X010993Y006274D01* 87 | X010973Y006288D01* 88 | X010956Y006305D01* 89 | X010942Y006325D01* 90 | X010932Y006347D01* 91 | X010926Y006370D01* 92 | X010924Y006394D01* 93 | M02* 94 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1-GERBER-files/MOD-WiFi-ESP8266-DEV_Rev_B1.drd: -------------------------------------------------------------------------------- 1 | % 2 | M48 3 | M72 4 | T01C0.0118 5 | T02C0.0157 6 | T03C0.0236 7 | T04C0.0276 8 | T05C0.0400 9 | T06C0.0472 10 | T07C0.0500 11 | % 12 | T01 13 | X98622Y93892 14 | X104122Y97892 15 | X104622Y102892 16 | X103622Y105892 17 | X115122Y100392 18 | X116622Y97892 19 | X114622Y93392 20 | X108622Y87892 21 | X105622Y84392 22 | X105622Y79592 23 | X108622Y76392 24 | X111622Y79592 25 | X106622Y91892 26 | X127122Y87892 27 | X127622Y84892 28 | X127122Y81392 29 | X128622Y75892 30 | X126122Y70392 31 | X142622Y79392 32 | X145122Y77392 33 | X145122Y81392 34 | X152122Y77392 35 | X157122Y77392 36 | X157622Y81392 37 | X161122Y77642 38 | X156122Y71892 39 | X159122Y68392 40 | X151122Y68392 41 | X151122Y63642 42 | X147122Y71892 43 | X149154Y89774 44 | X146004Y92924 45 | X146004Y96861 46 | X149154Y100010 47 | X153091Y100010 48 | X156240Y96861 49 | X156240Y92924 50 | X153091Y89774 51 | X163122Y103392 52 | X173622Y101892 53 | X149622Y107892 54 | X145622Y108892 55 | X142622Y111392 56 | X137122Y102892 57 | X137622Y99892 58 | X129622Y95892 59 | X127622Y93392 60 | X129622Y90392 61 | X129122Y98892 62 | T02 63 | X129122Y112392 64 | X118122Y111892 65 | X98622Y111892 66 | X82622Y110892 67 | X152122Y110142 68 | X160122Y104392 69 | X164122Y96892 70 | X182622Y80892 71 | X175622Y70892 72 | X177122Y56892 73 | X151122Y58392 74 | X206122Y118392 75 | T03 76 | X190122Y124392 77 | X177122Y101892 78 | X165122Y83392 79 | X140122Y106892 80 | X133622Y98142 81 | X133622Y83892 82 | X118122Y76892 83 | X114622Y65892 84 | X128872Y55892 85 | X132122Y63892 86 | X94122Y111892 87 | T04 88 | X124622Y109892 89 | X110622Y63935 90 | X110622Y56849 91 | T05 92 | X114622Y49892 93 | X104622Y49892 94 | X94622Y49892 95 | X84622Y49892 96 | X124622Y49892 97 | X134622Y49892 98 | X144622Y49892 99 | X154622Y49892 100 | X164622Y49892 101 | X174622Y49892 102 | X184622Y49892 103 | X184622Y119892 104 | X174622Y119892 105 | X164622Y119892 106 | X154622Y119892 107 | X144622Y119892 108 | X134622Y119892 109 | X124622Y119892 110 | X114622Y119892 111 | X104622Y119892 112 | X94622Y119892 113 | X84622Y119892 114 | T06 115 | X151122Y94892 116 | T07 117 | X84622Y39892 118 | X94622Y39892 119 | X104622Y39892 120 | X114622Y39892 121 | X124622Y39892 122 | X134622Y39892 123 | X144622Y39892 124 | X154622Y39892 125 | X164622Y39892 126 | X174622Y39892 127 | X184622Y39892 128 | X184622Y129892 129 | X174622Y129892 130 | X164622Y129892 131 | X154622Y129892 132 | X144622Y129892 133 | X134622Y129892 134 | X124622Y129892 135 | X114622Y129892 136 | X104622Y129892 137 | X94622Y129892 138 | X84622Y129892 139 | M30 140 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1-GERBER-files/MOD-WiFi-ESP8266-DEV_Rev_B1.dri: -------------------------------------------------------------------------------- 1 | Drill Station Info File: C:/maria/MOD-WiFi-ESP8266-DEV_Rev_B1---2-LayerPCB-za-Lub/MOD-WiFi-ESP8266-DEV_Rev_B1.dri 2 | 3 | Date : 9/11/2018 11:48:50a 4 | Drills : generated 5 | Device : Excellon drill station 6 | 7 | Parameter settings: 8 | 9 | Tolerance Drill + : 2.50 % 10 | Tolerance Drill - : 2.50 % 11 | Rotate : no 12 | Mirror : no 13 | Optimize : yes 14 | Auto fit : yes 15 | OffsetX : 0inch 16 | OffsetY : 0inch 17 | Layers : Drills Holes 18 | 19 | Drill File Info: 20 | 21 | Data Mode : Absolute 22 | Units : 1/1000 Inch 23 | 24 | Drills used: 25 | 26 | Code Size used 27 | 28 | T01 0.0118inch 49 29 | T02 0.0157inch 12 30 | T03 0.0236inch 11 31 | T04 0.0276inch 3 32 | T05 0.0400inch 22 33 | T06 0.0472inch 1 34 | T07 0.0500inch 22 35 | 36 | Total number of drills: 120 37 | 38 | Plotfiles: 39 | 40 | C:/maria/MOD-WiFi-ESP8266-DEV_Rev_B1---2-LayerPCB-za-Lub/MOD-WiFi-ESP8266-DEV_Rev_B1.drd 41 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1-GERBER-files/MOD-WiFi-ESP8266-DEV_Rev_B1.drl: -------------------------------------------------------------------------------- 1 | T01 0.30mm 2 | T02 0.40mm 3 | T03 0.60mm 4 | T04 0.70mm 5 | T05 1.02mm 6 | T06 1.20mm 7 | T07 1.27mm 8 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1-GERBER-files/MOD-WiFi-ESP8266-DEV_Rev_B1.gpi: -------------------------------------------------------------------------------- 1 | Photoplotter Info File: C:/maria/MOD-WiFi-ESP8266-DEV_Rev_B1---2-LayerPCB-za-Lub/MOD-WiFi-ESP8266-DEV_Rev_B1.gpi 2 | 3 | Date : 9/11/2018 11:49:02a 4 | Plotfile : C:/maria/MOD-WiFi-ESP8266-DEV_Rev_B1---2-LayerPCB-za-Lub/MOD-WiFi-ESP8266-DEV_Rev_B1.zmil 5 | Apertures : generated: 6 | Device : Gerber photoplotter with RS-274-X aperture generation 7 | 8 | Parameter settings: 9 | 10 | Emulate Apertures : no 11 | Emulate Thermal : no 12 | Emulate Annulus : no 13 | Tolerance Draw + : 0.00 % 14 | Tolerance Draw - : 0.00 % 15 | Tolerance Flash + : 0.00 % 16 | Tolerance Flash - : 0.00 % 17 | Rotate : no 18 | Mirror : no 19 | Optimize : yes 20 | Auto fit : yes 21 | OffsetX : 0inch 22 | OffsetY : 0inch 23 | 24 | Plotfile Info: 25 | 26 | Coordinate Format : 2.4 27 | Coordinate Units : Inch 28 | Data Mode : Absolute 29 | Zero Suppression : None 30 | End Of Block : * 31 | 32 | Apertures used: 33 | 34 | Code Shape Size used 35 | 36 | 37 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1-GERBER-files/MOD-WiFi-ESP8266-DEV_Rev_B1.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1-GERBER-files/MOD-WiFi-ESP8266-DEV_Rev_B1.sch -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1-GERBER-files/MOD-WiFi-ESP8266-DEV_Rev_B1.sts: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | %ADD10R,0.1490X0.0690*% 11 | %ADD11R,0.0749X0.0749*% 12 | %ADD12R,0.0278X0.0278*% 13 | %ADD13C,0.0317*% 14 | %ADD14C,0.0700*% 15 | %ADD15C,0.0900*% 16 | %ADD16C,0.0316*% 17 | %ADD17C,0.0453*% 18 | D10* 19 | X008912Y006489D03* 20 | X008912Y007489D03* 21 | X008912Y008489D03* 22 | X008912Y009489D03* 23 | X008912Y010489D03* 24 | D11* 25 | X015112Y009489D03* 26 | D12* 27 | X014915Y008977D03* 28 | X014600Y009292D03* 29 | X014600Y009686D03* 30 | X014915Y010001D03* 31 | X015309Y010001D03* 32 | X015624Y009686D03* 33 | X015624Y009292D03* 34 | X015309Y008977D03* 35 | D13* 36 | X018262Y008089D03* 37 | D14* 38 | X018462Y004989D03* 39 | X017462Y004989D03* 40 | X016462Y004989D03* 41 | X015462Y004989D03* 42 | X014462Y004989D03* 43 | X013462Y004989D03* 44 | X012462Y004989D03* 45 | X011462Y004989D03* 46 | X010462Y004989D03* 47 | X009462Y004989D03* 48 | X008462Y004989D03* 49 | X008462Y011989D03* 50 | X009462Y011989D03* 51 | X010462Y011989D03* 52 | X011462Y011989D03* 53 | X012462Y011989D03* 54 | X013462Y011989D03* 55 | X014462Y011989D03* 56 | X015462Y011989D03* 57 | X016462Y011989D03* 58 | X017462Y011989D03* 59 | X018462Y011989D03* 60 | D15* 61 | X008462Y003989D03* 62 | X009462Y003989D03* 63 | X010462Y003989D03* 64 | X011462Y003989D03* 65 | X012462Y003989D03* 66 | X013462Y003989D03* 67 | X014462Y003989D03* 68 | X015462Y003989D03* 69 | X016462Y003989D03* 70 | X017462Y003989D03* 71 | X018462Y003989D03* 72 | X018462Y012989D03* 73 | X017462Y012989D03* 74 | X016462Y012989D03* 75 | X015462Y012989D03* 76 | X014462Y012989D03* 77 | X013462Y012989D03* 78 | X012462Y012989D03* 79 | X011462Y012989D03* 80 | X010462Y012989D03* 81 | X009462Y012989D03* 82 | X008462Y012989D03* 83 | D16* 84 | X011062Y006394D03* 85 | X011062Y005685D03* 86 | D17* 87 | X012462Y010989D03* 88 | M02* 89 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1-GERBER-files/MOD-WiFi-ESP8266-DEV_Rev_B1.tcr: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | %ADD10R,0.0230X0.0240*% 11 | %ADD11R,0.0091X0.0315*% 12 | %ADD12R,0.0315X0.0091*% 13 | %ADD13R,0.0354X0.0354*% 14 | %ADD14R,0.0236X0.0354*% 15 | %ADD15R,0.0354X0.0236*% 16 | %ADD16R,0.0240X0.0230*% 17 | %ADD17R,0.0400X0.0400*% 18 | %ADD18R,0.1000X0.0300*% 19 | %ADD19R,0.0472X0.0551*% 20 | %ADD20R,0.0551X0.0394*% 21 | %ADD21R,0.0610X0.0591*% 22 | D10* 23 | X010112Y009389D03* 24 | X010112Y009789D03* 25 | X010112Y010189D03* 26 | X010112Y010589D03* 27 | X013012Y008589D03* 28 | X013012Y008189D03* 29 | X013212Y007289D03* 30 | X013212Y006889D03* 31 | X013212Y006039D03* 32 | X013212Y005639D03* 33 | X016612Y010439D03* 34 | X016612Y010839D03* 35 | X013762Y011039D03* 36 | X013762Y011439D03* 37 | D11* 38 | X014423Y010454D03* 39 | X014620Y010454D03* 40 | X014817Y010454D03* 41 | X015014Y010454D03* 42 | X015211Y010454D03* 43 | X015407Y010454D03* 44 | X015604Y010454D03* 45 | X015801Y010454D03* 46 | X015801Y008525D03* 47 | X015604Y008525D03* 48 | X015407Y008525D03* 49 | X015211Y008525D03* 50 | X015014Y008525D03* 51 | X014817Y008525D03* 52 | X014620Y008525D03* 53 | X014423Y008525D03* 54 | D12* 55 | X014148Y008800D03* 56 | X014148Y008997D03* 57 | X014148Y009194D03* 58 | X014148Y009391D03* 59 | X014148Y009588D03* 60 | X014148Y009784D03* 61 | X014148Y009981D03* 62 | X014148Y010178D03* 63 | X016077Y010178D03* 64 | X016077Y009981D03* 65 | X016077Y009784D03* 66 | X016077Y009588D03* 67 | X016077Y009391D03* 68 | X016077Y009194D03* 69 | X016077Y008997D03* 70 | X016077Y008800D03* 71 | D13* 72 | X015565Y009036D03* 73 | X014659Y009036D03* 74 | X014659Y009942D03* 75 | X015565Y009942D03* 76 | D14* 77 | X015112Y009942D03* 78 | X015112Y009036D03* 79 | D15* 80 | X014659Y009489D03* 81 | X015565Y009489D03* 82 | D16* 83 | X016612Y010064D03* 84 | X017012Y010064D03* 85 | X017387Y009864D03* 86 | X017787Y009864D03* 87 | X017412Y010489D03* 88 | X017412Y010839D03* 89 | X017012Y010839D03* 90 | X017012Y010489D03* 91 | X015362Y011439D03* 92 | X014962Y011439D03* 93 | X014962Y011089D03* 94 | X014562Y011089D03* 95 | X014562Y011439D03* 96 | X014162Y011439D03* 97 | X013262Y010139D03* 98 | X012862Y010139D03* 99 | X012462Y010139D03* 100 | X012062Y010139D03* 101 | X012062Y009789D03* 102 | X012062Y009439D03* 103 | X012462Y009439D03* 104 | X012462Y009789D03* 105 | X012462Y009089D03* 106 | X012462Y008739D03* 107 | X012062Y008739D03* 108 | X012062Y009089D03* 109 | X013512Y008039D03* 110 | X013912Y008039D03* 111 | X017387Y007914D03* 112 | X017787Y007914D03* 113 | X010462Y007589D03* 114 | X010462Y007239D03* 115 | X010462Y006889D03* 116 | X010062Y006889D03* 117 | X010062Y007239D03* 118 | X010062Y007589D03* 119 | D17* 120 | X008362Y005689D03* 121 | X009062Y005689D03* 122 | X010112Y008139D03* 123 | X010112Y008839D03* 124 | X013262Y010639D03* 125 | X013262Y011339D03* 126 | D18* 127 | X014062Y007339D03* 128 | X014062Y006839D03* 129 | X014062Y006339D03* 130 | X014062Y005839D03* 131 | X016562Y005839D03* 132 | X016562Y006339D03* 133 | X016562Y006839D03* 134 | X016562Y007339D03* 135 | D19* 136 | X017047Y008456D03* 137 | X017677Y008456D03* 138 | X017677Y009322D03* 139 | X017047Y009322D03* 140 | D20* 141 | X012262Y008137D03* 142 | X012262Y006641D03* 143 | D21* 144 | X011948Y006039D03* 145 | X010176Y006039D03* 146 | M02* 147 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1-GERBER-files/MOD-WiFi-ESP8266-DEV_Rev_B1.zmil: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | M02* 11 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1.brd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1.brd -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1.pdf -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1.sch -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1_bom.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1_bom.ods -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1_bom.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B1/MOD-WiFi-ESP8266-DEV_Rev_B1_bom.pdf -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B2/MOD-WiFi-ESP8266-DEV_Rev_B2.brd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B2/MOD-WiFi-ESP8266-DEV_Rev_B2.brd -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B2/MOD-WiFi-ESP8266-DEV_Rev_B2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B2/MOD-WiFi-ESP8266-DEV_Rev_B2.pdf -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B2/MOD-WiFi-ESP8266-DEV_Rev_B2.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WiFi-ESP8266-DEV revision B2/MOD-WiFi-ESP8266-DEV_Rev_B2.sch -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/Hardware_changes.txt: -------------------------------------------------------------------------------- 1 | MOD-WIFI-ESP8266 2 | 3 | Designed with Eagle CAD 4 | 5 | --- 6 | 7 | MOD-WIFI-ESP8266 hardware revision B1 - latest hardware revision - notable changes: 8 | 9 | 1. Due to memory shortages and unavailability, SPI flash memory chip changed from W25Q16J16JVSSIG to EN25Q16B-104HIP. This might cause programming issues in esptool so make to write_flash parameters to add "-fm qout". 10 | 11 | MOD-WIFI-ESP8266 hardware revision B - notable changes: 12 | 13 | 1. R7, R8, R9 changed to 2k (up from 200R) 14 | 2. Added pads R10(NA) and R11(NA) for connecting I2C to UEXT. Note that the I2C pins are like ESP8266-EVB's, and not like MOD-WIFI-ESP8266-DEV's - SCL is multiplexed with hardware SPI CS 15 | 3. Added pad R12 - 2k(NA) for SCL pull-up 16 | 4. Added R13 and SW button for easier boot mode enter 17 | 5. Added 4 pads in the bottom (SP1-4) for back soldering 18 | 19 | --- 20 | 21 | MOD-WIFI-ESP8266 hardware revision A - initial release -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision A/MOD-WIFI-ESP8266_schematic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision A/MOD-WIFI-ESP8266_schematic.pdf -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/ESP8266-EVB-BAT_Rev_B.brd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/ESP8266-EVB-BAT_Rev_B.brd -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/ESP8266-EVB-BAT_Rev_B.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/ESP8266-EVB-BAT_Rev_B.sch -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B-GERBER-files/MOD-WiFi-ESP8266_Rev_B.bcr: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | M02* 11 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B-GERBER-files/MOD-WiFi-ESP8266_Rev_B.brd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B-GERBER-files/MOD-WiFi-ESP8266_Rev_B.brd -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B-GERBER-files/MOD-WiFi-ESP8266_Rev_B.dim: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | %ADD10C,0.0100*% 11 | %ADD11C,0.0000*% 12 | D10* 13 | X013485Y006229D02* 14 | X013485Y013129D01* 15 | X023985Y013129D01* 16 | X023985Y006229D01* 17 | X013485Y006229D01* 18 | D11* 19 | X018297Y012074D02* 20 | X018299Y012098D01* 21 | X018305Y012121D01* 22 | X018315Y012143D01* 23 | X018329Y012163D01* 24 | X018346Y012180D01* 25 | X018366Y012194D01* 26 | X018388Y012204D01* 27 | X018411Y012210D01* 28 | X018435Y012212D01* 29 | X018459Y012210D01* 30 | X018482Y012204D01* 31 | X018504Y012194D01* 32 | X018524Y012180D01* 33 | X018541Y012163D01* 34 | X018555Y012143D01* 35 | X018565Y012121D01* 36 | X018571Y012098D01* 37 | X018573Y012074D01* 38 | X018571Y012050D01* 39 | X018565Y012027D01* 40 | X018555Y012005D01* 41 | X018541Y011985D01* 42 | X018524Y011968D01* 43 | X018504Y011954D01* 44 | X018482Y011944D01* 45 | X018459Y011938D01* 46 | X018435Y011936D01* 47 | X018411Y011938D01* 48 | X018388Y011944D01* 49 | X018366Y011954D01* 50 | X018346Y011968D01* 51 | X018329Y011985D01* 52 | X018315Y012005D01* 53 | X018305Y012027D01* 54 | X018299Y012050D01* 55 | X018297Y012074D01* 56 | X018297Y012783D02* 57 | X018299Y012807D01* 58 | X018305Y012830D01* 59 | X018315Y012852D01* 60 | X018329Y012872D01* 61 | X018346Y012889D01* 62 | X018366Y012903D01* 63 | X018388Y012913D01* 64 | X018411Y012919D01* 65 | X018435Y012921D01* 66 | X018459Y012919D01* 67 | X018482Y012913D01* 68 | X018504Y012903D01* 69 | X018524Y012889D01* 70 | X018541Y012872D01* 71 | X018555Y012852D01* 72 | X018565Y012830D01* 73 | X018571Y012807D01* 74 | X018573Y012783D01* 75 | X018571Y012759D01* 76 | X018565Y012736D01* 77 | X018555Y012714D01* 78 | X018541Y012694D01* 79 | X018524Y012677D01* 80 | X018504Y012663D01* 81 | X018482Y012653D01* 82 | X018459Y012647D01* 83 | X018435Y012645D01* 84 | X018411Y012647D01* 85 | X018388Y012653D01* 86 | X018366Y012663D01* 87 | X018346Y012677D01* 88 | X018329Y012694D01* 89 | X018315Y012714D01* 90 | X018305Y012736D01* 91 | X018299Y012759D01* 92 | X018297Y012783D01* 93 | M02* 94 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B-GERBER-files/MOD-WiFi-ESP8266_Rev_B.drd: -------------------------------------------------------------------------------- 1 | % 2 | M48 3 | M72 4 | T01C0.0118 5 | T02C0.0157 6 | T03C0.0236 7 | T04C0.0276 8 | T05C0.0320 9 | T06C0.0472 10 | % 11 | T01 12 | X153354Y70287 13 | X158354Y74287 14 | X176854Y87787 15 | X179854Y86787 16 | X174354Y89787 17 | X172354Y92787 18 | X170354Y95787 19 | X167354Y101287 20 | X159854Y98287 21 | X158354Y102287 22 | X160854Y106287 23 | X164854Y108287 24 | X160354Y113287 25 | X158854Y120287 26 | X160354Y123287 27 | X179854Y121787 28 | X179854Y118287 29 | X179385Y109405 30 | X183322Y109405 31 | X186472Y106255 32 | X186472Y102318 33 | X183322Y99169 34 | X179385Y99169 35 | X176235Y102318 36 | X176235Y106255 37 | X193354Y93787 38 | X193354Y90287 39 | X193854Y86787 40 | X191854Y83787 41 | X193854Y78787 42 | X187354Y78787 43 | X182354Y81287 44 | X186854Y86787 45 | X207854Y85287 46 | X207854Y79287 47 | X207854Y73287 48 | X164854Y91287 49 | X201854Y111287 50 | X197854Y122287 51 | X188354Y128787 52 | X180854Y128787 53 | T02 54 | X183354Y117287 55 | X190354Y113287 56 | X194354Y106287 57 | X212854Y90287 58 | T03 59 | X197354Y89787 60 | X187354Y71787 61 | X191354Y65787 62 | X183354Y65787 63 | X167354Y72787 64 | X207354Y112287 65 | X186354Y124287 66 | X170854Y115287 67 | X160854Y127787 68 | T04 69 | X184354Y127830 70 | X184354Y120743 71 | T05 72 | X161354Y86287 73 | X161354Y78287 74 | X161354Y70287 75 | T06 76 | X181354Y104287 77 | M30 78 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B-GERBER-files/MOD-WiFi-ESP8266_Rev_B.dri: -------------------------------------------------------------------------------- 1 | Drill Station Info File: C:/maria/MOD-WiFi-ESP8266_Rev_B---2-LayerPCB-za-Lub/MOD-WiFi-ESP8266_Rev_B.dri 2 | 3 | Date : 9/11/2018 11:45:55a 4 | Drills : generated 5 | Device : Excellon drill station 6 | 7 | Parameter settings: 8 | 9 | Tolerance Drill + : 2.50 % 10 | Tolerance Drill - : 2.50 % 11 | Rotate : no 12 | Mirror : no 13 | Optimize : yes 14 | Auto fit : yes 15 | OffsetX : 0inch 16 | OffsetY : 0inch 17 | Layers : Drills Holes 18 | 19 | Drill File Info: 20 | 21 | Data Mode : Absolute 22 | Units : 1/1000 Inch 23 | 24 | Drills used: 25 | 26 | Code Size used 27 | 28 | T01 0.0118inch 41 29 | T02 0.0157inch 4 30 | T03 0.0236inch 9 31 | T04 0.0276inch 2 32 | T05 0.0320inch 3 33 | T06 0.0472inch 1 34 | 35 | Total number of drills: 60 36 | 37 | Plotfiles: 38 | 39 | C:/maria/MOD-WiFi-ESP8266_Rev_B---2-LayerPCB-za-Lub/MOD-WiFi-ESP8266_Rev_B.drd 40 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B-GERBER-files/MOD-WiFi-ESP8266_Rev_B.drl: -------------------------------------------------------------------------------- 1 | T01 0.30mm 2 | T02 0.40mm 3 | T03 0.60mm 4 | T04 0.70mm 5 | T05 0.81mm 6 | T06 1.20mm 7 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B-GERBER-files/MOD-WiFi-ESP8266_Rev_B.gpi: -------------------------------------------------------------------------------- 1 | Photoplotter Info File: C:/maria/MOD-WiFi-ESP8266_Rev_B---2-LayerPCB-za-Lub/MOD-WiFi-ESP8266_Rev_B.gpi 2 | 3 | Date : 9/11/2018 11:46:06a 4 | Plotfile : C:/maria/MOD-WiFi-ESP8266_Rev_B---2-LayerPCB-za-Lub/MOD-WiFi-ESP8266_Rev_B.zmil 5 | Apertures : generated: 6 | Device : Gerber photoplotter with RS-274-X aperture generation 7 | 8 | Parameter settings: 9 | 10 | Emulate Apertures : no 11 | Emulate Thermal : no 12 | Emulate Annulus : no 13 | Tolerance Draw + : 0.00 % 14 | Tolerance Draw - : 0.00 % 15 | Tolerance Flash + : 0.00 % 16 | Tolerance Flash - : 0.00 % 17 | Rotate : no 18 | Mirror : no 19 | Optimize : yes 20 | Auto fit : yes 21 | OffsetX : 0inch 22 | OffsetY : 0inch 23 | 24 | Plotfile Info: 25 | 26 | Coordinate Format : 2.4 27 | Coordinate Units : Inch 28 | Data Mode : Absolute 29 | Zero Suppression : None 30 | End Of Block : * 31 | 32 | Apertures used: 33 | 34 | Code Shape Size used 35 | 36 | 37 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B-GERBER-files/MOD-WiFi-ESP8266_Rev_B.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B-GERBER-files/MOD-WiFi-ESP8266_Rev_B.sch -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B-GERBER-files/MOD-WiFi-ESP8266_Rev_B.sts: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | %ADD10R,0.1490X0.0690*% 11 | %ADD11R,0.0749X0.0749*% 12 | %ADD12R,0.0278X0.0278*% 13 | %ADD13C,0.0317*% 14 | %ADD14R,0.0240X0.0340*% 15 | %ADD15C,0.0060*% 16 | %ADD16R,0.0340X0.0240*% 17 | %ADD17C,0.0600*% 18 | %ADD18C,0.0316*% 19 | %ADD19R,0.1240X0.0440*% 20 | D10* 21 | X014435Y007679D03* 22 | X014435Y008679D03* 23 | X014435Y009679D03* 24 | X014435Y010679D03* 25 | X014435Y011679D03* 26 | D11* 27 | X018135Y010429D03* 28 | D12* 29 | X017624Y010626D03* 30 | X017624Y010232D03* 31 | X017939Y009917D03* 32 | X018332Y009917D03* 33 | X018647Y010232D03* 34 | X018647Y010626D03* 35 | X018332Y010940D03* 36 | X017939Y010940D03* 37 | D13* 38 | X021285Y009029D03* 39 | D14* 40 | X016135Y009479D03* 41 | X015835Y009479D03* 42 | X015535Y009479D03* 43 | X015535Y010979D03* 44 | X015835Y010979D03* 45 | X016135Y010979D03* 46 | D15* 47 | X015985Y010819D02* 48 | X015985Y011139D01* 49 | X015685Y011139D02* 50 | X015685Y010819D01* 51 | X015745Y010379D02* 52 | X015426Y010379D01* 53 | X015426Y010079D02* 54 | X015745Y010079D01* 55 | X015685Y009639D02* 56 | X015685Y009319D01* 57 | X015985Y009319D02* 58 | X015985Y009639D01* 59 | D16* 60 | X015585Y009929D03* 61 | X015585Y010229D03* 62 | X015585Y010529D03* 63 | D17* 64 | X016135Y008629D03* 65 | X016135Y007829D03* 66 | X016135Y007029D03* 67 | D18* 68 | X018435Y012074D03* 69 | X018435Y012783D03* 70 | D19* 71 | X017135Y012779D03* 72 | X020285Y012779D03* 73 | X020285Y006579D03* 74 | X017135Y006579D03* 75 | M02* 76 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B-GERBER-files/MOD-WiFi-ESP8266_Rev_B.tcr: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | %ADD10R,0.0230X0.0240*% 11 | %ADD11R,0.0091X0.0315*% 12 | %ADD12R,0.0315X0.0091*% 13 | %ADD13R,0.0354X0.0354*% 14 | %ADD14R,0.0236X0.0354*% 15 | %ADD15R,0.0354X0.0236*% 16 | %ADD16R,0.0240X0.0230*% 17 | %ADD17R,0.0400X0.0400*% 18 | %ADD18R,0.1000X0.0300*% 19 | %ADD19R,0.0472X0.0551*% 20 | %ADD20R,0.0315X0.0315*% 21 | %ADD21R,0.0610X0.0591*% 22 | D10* 23 | X015585Y007079D03* 24 | X015585Y007479D03* 25 | X015535Y007879D03* 26 | X015535Y008279D03* 27 | X015535Y008679D03* 28 | X015535Y009079D03* 29 | X016735Y008279D03* 30 | X016735Y007879D03* 31 | X016735Y006929D03* 32 | X016735Y006529D03* 33 | X015535Y010979D03* 34 | X015535Y011379D03* 35 | X015535Y011779D03* 36 | X015535Y012179D03* 37 | X016935Y012279D03* 38 | X016935Y011879D03* 39 | X019535Y011779D03* 40 | X019535Y011379D03* 41 | D11* 42 | X018824Y011393D03* 43 | X018627Y011393D03* 44 | X018431Y011393D03* 45 | X018234Y011393D03* 46 | X018037Y011393D03* 47 | X017840Y011393D03* 48 | X017643Y011393D03* 49 | X017446Y011393D03* 50 | X017446Y009464D03* 51 | X017643Y009464D03* 52 | X017840Y009464D03* 53 | X018037Y009464D03* 54 | X018234Y009464D03* 55 | X018431Y009464D03* 56 | X018627Y009464D03* 57 | X018824Y009464D03* 58 | D12* 59 | X019100Y009740D03* 60 | X019100Y009937D03* 61 | X019100Y010133D03* 62 | X019100Y010330D03* 63 | X019100Y010527D03* 64 | X019100Y010724D03* 65 | X019100Y010921D03* 66 | X019100Y011118D03* 67 | X017171Y011118D03* 68 | X017171Y010921D03* 69 | X017171Y010724D03* 70 | X017171Y010527D03* 71 | X017171Y010330D03* 72 | X017171Y010133D03* 73 | X017171Y009937D03* 74 | X017171Y009740D03* 75 | D13* 76 | X017683Y009976D03* 77 | X018588Y009976D03* 78 | X018588Y010881D03* 79 | X017683Y010881D03* 80 | D14* 81 | X018135Y010881D03* 82 | X018135Y009976D03* 83 | D15* 84 | X017683Y010429D03* 85 | X018588Y010429D03* 86 | D16* 87 | X019535Y011004D03* 88 | X019935Y011004D03* 89 | X020335Y010804D03* 90 | X020735Y010804D03* 91 | X020335Y011429D03* 92 | X019935Y011429D03* 93 | X019935Y011779D03* 94 | X020335Y011779D03* 95 | X016985Y012829D03* 96 | X016585Y012829D03* 97 | X015585Y012829D03* 98 | X015185Y012829D03* 99 | X016285Y010479D03* 100 | X016685Y010479D03* 101 | X016485Y010129D03* 102 | X016085Y010129D03* 103 | X016285Y009779D03* 104 | X016685Y009779D03* 105 | X016685Y009429D03* 106 | X016285Y009429D03* 107 | X020235Y008879D03* 108 | X020635Y008879D03* 109 | X015635Y006529D03* 110 | X015235Y006529D03* 111 | D17* 112 | X016435Y011629D03* 113 | X016435Y012329D03* 114 | D18* 115 | X017535Y008329D03* 116 | X017535Y007829D03* 117 | X017535Y007329D03* 118 | X017535Y006829D03* 119 | X020035Y006829D03* 120 | X020035Y007329D03* 121 | X020035Y007829D03* 122 | X020035Y008329D03* 123 | D19* 124 | X019870Y009446D03* 125 | X020500Y009446D03* 126 | X020500Y010312D03* 127 | X019870Y010312D03* 128 | D20* 129 | X013935Y006629D03* 130 | X014535Y006629D03* 131 | X014535Y012729D03* 132 | X013935Y012729D03* 133 | D21* 134 | X017550Y012429D03* 135 | X019321Y012429D03* 136 | M02* 137 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B-GERBER-files/MOD-WiFi-ESP8266_Rev_B.zmil: -------------------------------------------------------------------------------- 1 | G75* 2 | G70* 3 | %OFA0B0*% 4 | %FSLAX24Y24*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | M02* 11 | -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B.pdf -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B_Bom.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B_Bom.ods -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B_Bom.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B/MOD-WiFi-ESP8266_Rev_B_Bom.pdf -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B1/MOD-WiFi-ESP8266_Rev_B1.brd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B1/MOD-WiFi-ESP8266_Rev_B1.brd -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B1/MOD-WiFi-ESP8266_Rev_B1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B1/MOD-WiFi-ESP8266_Rev_B1.pdf -------------------------------------------------------------------------------- /HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B1/MOD-WiFi-ESP8266_Rev_B1.sch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/HARDWARE/MOD-WIFI-ESP8266/MOD-WIFI-ESP8266 revision B1/MOD-WiFi-ESP8266_Rev_B1.sch -------------------------------------------------------------------------------- /IoT Demos/ESP8266-EVB-Relay/README.md: -------------------------------------------------------------------------------- 1 | ## node.js demo for using esp8266-iotjs npm package to control ESP266-EVB board 2 | 3 | #### The esp8266-iotjs npm package is in Beta version and is in process of development 4 | 5 | [Npm package link](https://www.npmjs.com/package/esp8266-iotjs) 6 | 7 | #### Use at your own risk, it is Beta 0.0.1 8 | 9 | 10 | #### Work properly with only one board connected to host at the time 11 | only work with 12 | * Relay 13 | * Button 14 | * more comming soon ++ 15 | 16 | 17 | ### Requirements 18 | 19 | To use this demo you have to 20 | 21 | 1. Use Olimex IoT Firmware on your ESP8266-EVB 22 | 2. Configure your computer as IoT Server using ESP-Sample-Application.html 23 | * Select IoT tab 24 | * Check WebSocket 25 | * Uncheck SSL 26 | * Set Server to your computer IP address 27 | * Leave everything else blank 28 | 29 | ### Installation 30 | 31 | First install node.js and NPM on your computer. 32 | 33 | Then type the following command in command prompt: 34 | 35 | cd ESP8266-EVB-Relay 36 | npm install 37 | 38 | ### Usage 39 | To start the demo use the following command 40 | 41 | [sudo] node index.js 42 | 43 | 44 | 45 | ## Events 46 | - ready (when is web socket is open for requests) 47 | - relayStateIsChange (Is triggered when relay state is change) 48 | - push (Is triggered when button is pressed) 49 | 50 | 51 | ## Methods 52 | - setRelayState(param) - Change relay state with giving param, accept (1 or 0) 53 | - relayOn() - TurnOn the relay 54 | - relayOff() - TurnOff the relay 55 | - relayToggle() - Toggle relay state 56 | -------------------------------------------------------------------------------- /IoT Demos/ESP8266-EVB-Relay/index.js: -------------------------------------------------------------------------------- 1 | var ESP8266 = require('esp8266-iotjs'); 2 | var board = new ESP8266(true); //pass True for debug mode ON 3 | 4 | board.on('push',function() { 5 | this.relayToggle(); 6 | }); -------------------------------------------------------------------------------- /IoT Demos/ESP8266-EVB-Relay/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "esp8266-evb-relay", 3 | "version": "1.0.0", 4 | "description": "Simple Demo of using esp8266-iotjs package", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/OLIMEX/ESP8266/tree/master/IoT%20Demos" 12 | }, 13 | "author": "Dimitar Manovski", 14 | "license": "ISC", 15 | "dependencies": { 16 | "esp8266-iotjs": "0.0.1" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /IoT Demos/README.md: -------------------------------------------------------------------------------- 1 | # Demos for IoT Firmware usage 2 | * Tweets on MOD-LED8x8RGB 3 | * Relay Switch with Button on ESP8266-EVB 4 | * More to come... 5 | -------------------------------------------------------------------------------- /IoT Demos/Tweets on MOD-LED8x8RGB/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /IoT Demos/Tweets on MOD-LED8x8RGB/License: -------------------------------------------------------------------------------- 1 | Copyright 2015 Olimex Ltd 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /IoT Demos/Tweets on MOD-LED8x8RGB/README.md: -------------------------------------------------------------------------------- 1 | # node.js demo for displaying tweets with #olimex or @olimex on MOD-LED8x8RGB 2 | 3 | ## Requirements 4 | 5 | To use this demo you have to 6 | 7 | 1. Use Olimex IoT Firmware on your ESP8266-EVB 8 | 2. Configure your computer as IoT Server using ESP-Sample-Application.html 9 | * Select IoT tab 10 | * Check WebSocket 11 | * Uncheck SSL 12 | * Set Server to your computer IP address 13 | * Leave everything else blank 14 | 15 | ## Installation 16 | 17 | First install node.js on your computer. 18 | 19 | Then use the following command in command prompt: 20 | 21 | npm install olimex-iot-demo 22 | 23 | ## Usage 24 | 25 | You should have the following environment variables set to be able to use Twitter API: 26 | 27 | TWITTER_CONSUMER_KEY 28 | TWITTER_CONSUMER_SECRET 29 | TWITTER_TOKEN 30 | TWITTER_TOKEN_SECRET 31 | 32 | These are unique for every twitter account and they are obtained from https://apps.twitter.com 33 | 34 | To start the demo use the following command 35 | 36 | [sudo] node node_modules\olimex-iot-demo\index.js 37 | 38 | -------------------------------------------------------------------------------- /IoT Demos/Tweets on MOD-LED8x8RGB/lib/actions.js: -------------------------------------------------------------------------------- 1 | 2 | /**************************************************************************** 3 | * Action 4 | ****************************************************************************/ 5 | function Action(name, callback) { 6 | this._name = name; 7 | 8 | if (typeof callback != 'function') { 9 | console.log('ACTIONS: [' + this._name + '] callback must be a function'); 10 | this._callback = null; 11 | } else { 12 | this._callback = callback; 13 | } 14 | 15 | this._parameters = {}; 16 | } 17 | 18 | Action.prototype.parameter = function (parameter, type, required) { 19 | this._parameters[parameter] = { 20 | type: type, 21 | required: required 22 | }; 23 | 24 | return this; 25 | }; 26 | 27 | Action.prototype.execute = function (parameters) { 28 | for (var index in this._parameters) { 29 | var current = this._parameters[index]; 30 | var type = typeof parameters[index]; 31 | if (current.required && type == 'undefined') { 32 | console.log('ACTIONS: [' + this._name + '] missing [' + index + '] parameter'); 33 | return; 34 | } 35 | 36 | if (current.type != type && type != 'undefined') { 37 | console.log( 38 | 'ACTIONS: [' + this._name + '] wrong [' + index + '] type! '+ 39 | 'Expected ['+current.type+'] got ['+type+']' 40 | ); 41 | return; 42 | } 43 | } 44 | 45 | if (typeof this._callback != 'function') { 46 | console.log('ACTIONS: [' + this._name + '] wrong callback type'); 47 | } else { 48 | this._callback(parameters); 49 | } 50 | }; 51 | 52 | /**************************************************************************** 53 | * Actions 54 | ****************************************************************************/ 55 | module.exports = { 56 | _poll: [], 57 | 58 | register: function (name, callback) { 59 | if (typeof this._poll[name] != 'undefined') { 60 | console.log('ACTIONS: Action ['+name+'] is already registered'); 61 | } else { 62 | this._poll[name] = new Action(name, callback); 63 | } 64 | 65 | return this._poll[name]; 66 | }, 67 | 68 | get: function (name) { 69 | if (typeof this._poll[name] == 'undefined') { 70 | console.log('ACTIONS: Unknown action ['+name+']'); 71 | return null; 72 | } 73 | return this._poll[name]; 74 | }, 75 | 76 | execute: function (name, parameters) { 77 | var action = this.get(name); 78 | if (action === null) { 79 | return; 80 | } 81 | 82 | action.execute(parameters); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /IoT Demos/Tweets on MOD-LED8x8RGB/lib/badges.js: -------------------------------------------------------------------------------- 1 | var Actions = require('./actions'); 2 | var Triggers = require('./triggers'); 3 | var ParamBuilder = require('./param-builder'); 4 | var Messages = require('./messages'); 5 | 6 | try { 7 | var Twitter = require('./twitter'); 8 | } catch (err) { 9 | console.log(err.message); 10 | } 11 | 12 | /**************************************************************************** 13 | * Badges 14 | ****************************************************************************/ 15 | module.exports = Badges = { 16 | add: function (params) { 17 | console.log('Badges.add('+JSON.stringify(params)+')'); 18 | var messageQueue = Messages.init(params.node, 'ESP-BADGE', '/badge', 1, 1, 40); 19 | if (typeof Twitter == 'object') { 20 | messageQueue.defaultMsg( 21 | { 22 | text: 'Tweet with '+Twitter.tracking().join(' or ')+' to see your message here ;-)', 23 | r: 1, g: 1, b: 0 24 | } 25 | ); 26 | } 27 | } 28 | }; 29 | 30 | Actions. 31 | register( 32 | 'Badges.add', 33 | function (params) { 34 | Badges.add(params); 35 | } 36 | ). 37 | parameter('node', 'string', true) 38 | ; 39 | 40 | Triggers. 41 | onRegisterDevice( 42 | null, '/badge', 43 | 'Badges.add', 44 | ParamBuilder(). 45 | parameter('node', '[NodeToken]') 46 | ) 47 | ; 48 | -------------------------------------------------------------------------------- /IoT Demos/Tweets on MOD-LED8x8RGB/lib/clock.js: -------------------------------------------------------------------------------- 1 | var Messages = require('./messages'); 2 | 3 | const CLOCK_INTERVAL = 1000 * 60 * 1; // 1 minutes 4 | 5 | function dateTimePad(n) { 6 | if (n < 10) { 7 | return '0'+n; 8 | } 9 | return n; 10 | } 11 | 12 | setInterval( 13 | function () { 14 | var now = new Date(); 15 | Messages.display( 16 | { 17 | node: '*', 18 | text: 19 | // dateTimePad(now.getDate() )+'.'+dateTimePad(now.getMonth())+'.'+now.getFullYear()+' '+ 20 | dateTimePad(now.getHours())+':'+dateTimePad(now.getMinutes()), 21 | r: 1, g: 1, b: 1 22 | } 23 | ); 24 | }, 25 | CLOCK_INTERVAL 26 | ); 27 | -------------------------------------------------------------------------------- /IoT Demos/Tweets on MOD-LED8x8RGB/lib/connections.js: -------------------------------------------------------------------------------- 1 | // Connections 2 | module.exports = { 3 | _poll: [], 4 | 5 | add: function (connection) { 6 | connection.node = { 7 | Name: "", 8 | Token: "", 9 | Devices: [] 10 | }; 11 | 12 | this._poll.push(connection); 13 | }, 14 | 15 | setName: function (connection, name) { 16 | connection.node.Name = name; 17 | }, 18 | 19 | setToken: function (connection, token) { 20 | var old = this.get(token); 21 | if (old !== null) { 22 | this.remove(old); 23 | } 24 | 25 | connection.node.Token = token; 26 | }, 27 | 28 | remove: function (connection) { 29 | if (connection.connected) { 30 | connection.close(); 31 | return; 32 | } 33 | 34 | var i = this._poll.indexOf(connection); 35 | if (i >= 0) { 36 | this._poll.splice(i, 1); 37 | } 38 | }, 39 | 40 | get: function (node) { 41 | if (typeof node == 'object') { 42 | if (node.connected) { 43 | return node; 44 | } 45 | node = node.node.Token; 46 | } 47 | 48 | var connection = null; 49 | for (var index in this._poll) { 50 | var current = this._poll[index]; 51 | if ( 52 | current.node.Name == node || 53 | current.node.Token == node 54 | ) { 55 | connection = current; 56 | break; 57 | } 58 | } 59 | 60 | return connection; 61 | }, 62 | 63 | getNodes: function () { 64 | var data = []; 65 | this._poll.forEach( 66 | function (current, index, array) { 67 | data.push( 68 | { 69 | IP: current.remoteAddress, 70 | Name: current.node.Name, 71 | Token: current.node.Token, 72 | Devices: current.node.Devices 73 | } 74 | ); 75 | } 76 | ); 77 | return data; 78 | } 79 | }; 80 | -------------------------------------------------------------------------------- /IoT Demos/Tweets on MOD-LED8x8RGB/lib/messages-queue.js: -------------------------------------------------------------------------------- 1 | var Connections = require('./connections'); 2 | var Triggers = require('./triggers'); 3 | 4 | const MESSAGES_TIMEOUT = 60000; // 1 minute 5 | const MESSAGES_DEF_TIMEOUT = 5000; // 5 seconds 6 | 7 | /**************************************************************************** 8 | * Message Queue 9 | ****************************************************************************/ 10 | function MessagesQueue(node, url, rows, cols, speed) { 11 | this._token = node; 12 | this._connection = null; 13 | 14 | this._queue = []; 15 | this._timeout = null; 16 | 17 | this._url = url; 18 | 19 | this._rows = rows; 20 | this._cols = cols; 21 | this._speed = speed; 22 | 23 | this._default = null; 24 | this._default_timeout = null; 25 | 26 | this._current = null; 27 | this._triggers = []; 28 | 29 | this.connect(); 30 | } 31 | 32 | MessagesQueue.prototype.addTrigger = function (trigger) { 33 | this._triggers.push(trigger); 34 | return this; 35 | } 36 | 37 | MessagesQueue.prototype.removeTriggers = function () { 38 | // remove global registered triggers 39 | this._triggers.forEach( 40 | function (trigger) { 41 | Triggers.remove(trigger); 42 | } 43 | ); 44 | 45 | // clear local references 46 | this._triggers = []; 47 | return this; 48 | } 49 | 50 | MessagesQueue.prototype.connect = function () { 51 | if (this._connection === null) { 52 | var connection = Connections.get(this._token); 53 | if (connection !== null) { 54 | this._connection = connection; 55 | this._token = connection.node.Token; 56 | } 57 | } 58 | 59 | return this; 60 | }; 61 | 62 | MessagesQueue.prototype.url = function () { 63 | return this._url; 64 | } 65 | 66 | MessagesQueue.prototype.token = function () { 67 | return this._token; 68 | }; 69 | 70 | MessagesQueue.prototype.rows = function (rows) { 71 | this._rows = rows; 72 | return this; 73 | }; 74 | 75 | MessagesQueue.prototype.cols = function (cols) { 76 | this._cols = cols; 77 | return this; 78 | }; 79 | 80 | MessagesQueue.prototype.speed = function (speed) { 81 | this._speed = speed; 82 | return this; 83 | }; 84 | 85 | MessagesQueue.prototype.defaultMsg = function (msg) { 86 | this._default = msg; 87 | this.next(); 88 | }; 89 | 90 | MessagesQueue.prototype.display = function (message) { 91 | this._queue.push(message); 92 | console.log('MessagesQueue.length@'+this.token()+'['+this._queue.length+']'); 93 | this.next(); 94 | return this; 95 | }; 96 | 97 | MessagesQueue.prototype.next = function() { 98 | if (this._timeout !== null) { 99 | return; 100 | } 101 | 102 | var self = this; 103 | if (this._queue.length == 0) { 104 | if (this._default === null) { 105 | return; 106 | } 107 | // display default message after timeout 108 | this._default_timeout = setTimeout( 109 | function () { 110 | console.log('MessagesQueue.displayDefault()'); 111 | self.display(self._default); 112 | }, 113 | MESSAGES_DEF_TIMEOUT 114 | ); 115 | return; 116 | } 117 | 118 | this.connect(); 119 | if (typeof this._connection != 'object' || !this._connection.connected) { 120 | // retry after timeout 121 | setTimeout( 122 | function () { 123 | self.next(); 124 | }, 125 | MESSAGES_TIMEOUT 126 | ); 127 | return; 128 | } 129 | 130 | this.setTimeout(); 131 | 132 | this._current = this._queue.shift(); 133 | console.log('MessagesQueue.display@'+this.token()+'['+this._current.text+']'); 134 | console.log('MessagesQueue.length@'+this.token()+'['+this._queue.length+']'); 135 | 136 | this._connection.sendUTF( 137 | JSON.stringify( 138 | { 139 | URL: this._url, 140 | Method: 'POST', 141 | Data: { 142 | Text: this._current.text, 143 | R: typeof this._current.r == 'undefined' ? 144 | 1 145 | : 146 | this._current.r 147 | , 148 | G: typeof this._current.g == 'undefined' ? 149 | 1 150 | : 151 | this._current.g 152 | , 153 | B: typeof this._current.b == 'undefined' ? 154 | 1 155 | : 156 | this._current.b 157 | , 158 | Speed: typeof this._current.speed == 'undefined' ? 159 | this._speed 160 | : 161 | this._current.speed 162 | , 163 | cols: typeof this._current.cols == 'undefined' ? 164 | this._cols 165 | : 166 | this._current.cols 167 | , 168 | rows: typeof this._current.rows == 'undefined' ? 169 | this._rows 170 | : 171 | this._current.rows 172 | } 173 | } 174 | ) 175 | ); 176 | 177 | }; 178 | 179 | MessagesQueue.prototype.setTimeout = function () { 180 | var self = this; 181 | 182 | if (this._default_timeout !== null) { 183 | // reset default message timout 184 | clearTimeout(this._default_timeout); 185 | this._default_timeout = null; 186 | } 187 | 188 | if (this._timeout !== null) { 189 | clearTimeout(this._timeout); 190 | } 191 | 192 | this._timeout = setTimeout( 193 | // done after timeout 194 | function () { 195 | self.done(); 196 | }, 197 | MESSAGES_TIMEOUT 198 | ); 199 | }; 200 | 201 | MessagesQueue.prototype.done = function () { 202 | if (this._timeout !== null) { 203 | clearTimeout(this._timeout); 204 | } 205 | this._timeout = null; 206 | this.next(); 207 | }; 208 | 209 | MessagesQueue.prototype.busy = function () { 210 | if (this._current !== null) { 211 | if (this._current.text != this._default.text) { 212 | this._queue.unshift(this._current); 213 | console.log('MessagesQueue.busy("'+this._current.text+'")'); 214 | console.log('MessagesQueue.length@'+this.token()+'['+this._queue.length+']'); 215 | } 216 | this._current = null; 217 | } 218 | this.setTimeout(); 219 | }; 220 | 221 | module.exports = MessagesQueue; -------------------------------------------------------------------------------- /IoT Demos/Tweets on MOD-LED8x8RGB/lib/messages.js: -------------------------------------------------------------------------------- 1 | var Connections = require('./connections'); 2 | var Triggers = require('./triggers'); 3 | var Actions = require('./actions'); 4 | var ParamBuilder = require('./param-builder'); 5 | var MessagesQueue = require('./messages-queue'); 6 | 7 | /**************************************************************************** 8 | * Messages 9 | ****************************************************************************/ 10 | module.exports = Messages = { 11 | _queues: [], 12 | 13 | init: function (node, device, url, rows, cols, speed) { 14 | this.remove(node, url); 15 | 16 | var queue = new MessagesQueue(node, url, rows, cols, speed); 17 | 18 | queue. 19 | addTrigger( 20 | Triggers.onPropertyChange( 21 | node, device, 'Error', null, 'Busy', 22 | 'Messages.busy', 23 | ParamBuilder(). 24 | parameter('node', '[NodeToken]') 25 | ) 26 | ). 27 | 28 | addTrigger( 29 | Triggers.onPropertyChange( 30 | node, device, 'Status', null, 'OK', 31 | 'Messages.setTimeout', 32 | ParamBuilder(). 33 | parameter('node', '[NodeToken]') 34 | ) 35 | ). 36 | 37 | addTrigger( 38 | Triggers.onPropertyChange( 39 | node, device, 'Status', null, 'Done', 40 | 'Messages.done', 41 | ParamBuilder(). 42 | parameter('node', '[NodeToken]') 43 | ) 44 | ). 45 | 46 | addTrigger( 47 | Triggers.onConnectionClose( 48 | node, 49 | 'Messages.remove', 50 | ParamBuilder(). 51 | parameter('node', '[NodeToken]') 52 | ) 53 | ) 54 | ; 55 | 56 | this._queues.push(queue); 57 | return queue; 58 | }, 59 | 60 | remove: function (node, url) { 61 | if (typeof url == 'undefined') { 62 | url = null; 63 | } 64 | 65 | var connection = Connections.get(node); 66 | var token = connection === null ? 67 | node 68 | : 69 | connection.node.Token 70 | ; 71 | 72 | console.log('Messages.remove("'+token+'", "'+url+'").totalBefore('+this._queues.length+')'); 73 | 74 | var removed = 0; 75 | var index = 0; 76 | while (this._queues.length > index) { 77 | var current = this._queues[index]; 78 | if ( 79 | current.token() === token && 80 | (url === null || current.url() === url) 81 | ) { 82 | current.removeTriggers(); 83 | this._queues.splice(index, 1); 84 | removed++; 85 | } else { 86 | index++; 87 | } 88 | } 89 | 90 | console.log('Messages.removed('+removed+').remainingAfter('+this._queues.length+')'); 91 | return removed; 92 | }, 93 | 94 | findQueue: function (params) { 95 | var connection = Connections.get(params.node); 96 | var token = connection === null ? 97 | params.node 98 | : 99 | connection.node.Token 100 | ; 101 | 102 | var result = []; 103 | for (var index in this._queues) { 104 | var current = this._queues[index]; 105 | if (current.token() === token || token === '*' || token === null) { 106 | result.push(this._queues[index]); 107 | } 108 | } 109 | 110 | return result; 111 | }, 112 | 113 | display: function (params) { 114 | console.log('Messages.display('+JSON.stringify(params)+')'); 115 | var queues = this.findQueue(params); 116 | queues.forEach( 117 | function (queue) { 118 | queue.display(params); 119 | } 120 | ); 121 | }, 122 | 123 | setTimeout: function (params) { 124 | console.log('Messages.setTimeout('+JSON.stringify(params)+')'); 125 | var queues = this.findQueue(params); 126 | queues.forEach( 127 | function (queue) { 128 | queue.setTimeout(); 129 | } 130 | ); 131 | }, 132 | 133 | done: function (params) { 134 | console.log('Messages.done('+JSON.stringify(params)+')'); 135 | var queues = this.findQueue(params); 136 | queues.forEach( 137 | function (queue) { 138 | queue.done(); 139 | } 140 | ); 141 | }, 142 | 143 | busy: function (params) { 144 | console.log('Messages.busy('+JSON.stringify(params)+')'); 145 | var queues = this.findQueue(params); 146 | queues.forEach( 147 | function (queue) { 148 | queue.busy(); 149 | } 150 | ); 151 | } 152 | 153 | }; 154 | 155 | /**************************************************************************** 156 | * Initialization 157 | ****************************************************************************/ 158 | Actions. 159 | register( 160 | 'Messages.display', 161 | function (params) { 162 | Messages.display(params); 163 | } 164 | ). 165 | parameter('node', 'string', true). 166 | parameter('text', 'string', true). 167 | parameter('r', 'number', false). 168 | parameter('g', 'number', false). 169 | parameter('b', 'number', false). 170 | parameter('rows', 'number', false). 171 | parameter('cols', 'number', false). 172 | parameter('speed', 'number', false) 173 | ; 174 | 175 | Actions. 176 | register( 177 | 'Messages.setTimeout', 178 | function (params) { 179 | Messages.setTimeout(params); 180 | } 181 | ). 182 | parameter('node', 'string', true) 183 | ; 184 | 185 | Actions. 186 | register( 187 | 'Messages.done', 188 | function (params) { 189 | Messages.done(params); 190 | } 191 | ). 192 | parameter('node', 'string', true) 193 | ; 194 | 195 | Actions. 196 | register( 197 | 'Messages.busy', 198 | function (params) { 199 | Messages.busy(params); 200 | } 201 | ). 202 | parameter('node', 'string', true) 203 | ; 204 | 205 | Actions. 206 | register( 207 | 'Messages.remove', 208 | function (params) { 209 | Messages.remove(params.node); 210 | } 211 | ). 212 | parameter('node', 'string', true) 213 | ; 214 | -------------------------------------------------------------------------------- /IoT Demos/Tweets on MOD-LED8x8RGB/lib/param-builder.js: -------------------------------------------------------------------------------- 1 | var Properties = require('./properties'); 2 | 3 | /**************************************************************************** 4 | * ParamBuilder 5 | ****************************************************************************/ 6 | function ParamBuilder() { 7 | this._parameters = {}; 8 | } 9 | 10 | ParamBuilder.prototype.parameter = function (name, expression) { 11 | this._parameters[name] = expression; 12 | return this; 13 | }; 14 | 15 | ParamBuilder.prototype.eval = function (expression, context) { 16 | if (typeof expression != 'string') { 17 | return expression; 18 | } 19 | 20 | var split = expression.split(/\[([^\[\]]+)\]/); 21 | for (var i in split) { 22 | if ((i % 2) == 1) { 23 | split[i] = Properties.value(split[i], context); 24 | } 25 | } 26 | 27 | var i = 0; 28 | while (i < split.length) { 29 | if (split[i] === '') { 30 | split.splice(i, 1); 31 | } else { 32 | i++; 33 | } 34 | } 35 | 36 | return split.length == 1 ? 37 | split[0] 38 | : 39 | split.join('') 40 | ; 41 | }; 42 | 43 | ParamBuilder.prototype.execute = function (context) { 44 | var data = {}; 45 | for (index in this._parameters) { 46 | var current = this._parameters[index]; 47 | data[index] = this.eval(current, context); 48 | } 49 | 50 | return data; 51 | }; 52 | 53 | module.exports = function () { 54 | return new ParamBuilder(); 55 | }; -------------------------------------------------------------------------------- /IoT Demos/Tweets on MOD-LED8x8RGB/lib/properties.js: -------------------------------------------------------------------------------- 1 | var JSONPath = require('advanced-json-path'); 2 | 3 | /**************************************************************************** 4 | * Properties 5 | ****************************************************************************/ 6 | module.exports = Properties = { 7 | _poll: [], 8 | 9 | register: function (device, property, path) { 10 | if (typeof device != 'string') { 11 | device = '*'; 12 | } 13 | 14 | if (typeof this._poll[device] == 'undefined') { 15 | this._poll[device] = []; 16 | } 17 | 18 | this._poll[device][property] = path; 19 | 20 | return this; 21 | }, 22 | 23 | get: function (device, property) { 24 | if (typeof device != 'string') { 25 | device = '*'; 26 | } 27 | 28 | var path = JSONPath(this._poll, '$["'+device+'"]["'+property+'"]'); 29 | if (path) { 30 | return path; 31 | } 32 | 33 | return JSONPath(this._poll, '$["*"]["'+property+'"]'); 34 | }, 35 | 36 | value: function (property, data) { 37 | var device = JSONPath( 38 | data, 39 | Properties.get(null, 'Device') 40 | ); 41 | 42 | var path = Properties.get(device, property); 43 | if (path === false) { 44 | return null; 45 | } 46 | 47 | return JSONPath(data, path); 48 | } 49 | }; 50 | 51 | /**************************************************************************** 52 | * Register some properties 53 | ****************************************************************************/ 54 | Properties. 55 | register(null, 'Device', '$.EventData.Device'). 56 | register(null, 'Status', '$.EventData.Status'). 57 | register(null, 'Error', '$.EventData.Error'). 58 | register(null, 'I2C_Address', '$.EventData.I2C_Address'). 59 | register(null, 'NodeIP', '$.EventNode.IP'). 60 | register(null, 'NodeName', '$.EventNode.Name'). 61 | register(null, 'NodeToken', '$.EventNode.Token'). 62 | 63 | register('ESP8266', 'Relay', '$.EventData.Data.Relay'). 64 | register('ESP8266', 'Button', '$.EventData.Data.Button'). 65 | register('ESP8266', 'ADCValue', '$.EventData.Data.ADC.Value'). 66 | register('ESP8266', 'BatteryState', '$.EventData.Data.Battery.State'). 67 | register('ESP8266', 'BatteryPercent', '$.EventData.Data.Battery.Percent'). 68 | 69 | register('MOD-TC-MK2', 'Temperature', '$.EventData.Data.Temperature'). 70 | 71 | register('MOD-FINGER', 'FingerID', '$.EventData.Match.ID'). 72 | register('MOD-FINGER', 'FingerScore', '$.EventData.Match.Score') 73 | ; 74 | -------------------------------------------------------------------------------- /IoT Demos/Tweets on MOD-LED8x8RGB/lib/triggers.js: -------------------------------------------------------------------------------- 1 | var JSONPath = require('advanced-json-path'); 2 | var Properties = require('./properties'); 3 | var Actions = require('./actions'); 4 | 5 | /**************************************************************************** 6 | * Triggers 7 | ****************************************************************************/ 8 | module.exports = { 9 | _poll: [], 10 | 11 | register: function (path, action, paramBuilder) { 12 | var actionName = ''; 13 | if (typeof action == 'string') { 14 | actionName = action; 15 | action = Actions.get(actionName); 16 | } else { 17 | action = null; 18 | } 19 | 20 | if (action === null) { 21 | console.log('TRIGGERS: Action not found ['+actionName+']'); 22 | } 23 | 24 | // console.log('TRIGGERS: Register '+path+' ['+actionName+']'); 25 | var trigger = { 26 | path: path, 27 | actionName: actionName, 28 | action: action, 29 | paramBuilder: paramBuilder 30 | }; 31 | 32 | this._poll.push(trigger); 33 | return trigger; 34 | }, 35 | 36 | remove: function (trigger) { 37 | var i = this._poll.indexOf(trigger); 38 | if (i >= 0) { 39 | this._poll.splice(i, 1); 40 | } 41 | }, 42 | 43 | onRegisterDevice: function (node, deviceURL, action, paramBuilder) { 44 | var nodePath = node ? 45 | '[?($.EventNode.Name == "'+node+'" || $.EventNode.Token == "'+node+'")]' 46 | : 47 | '' 48 | ; 49 | 50 | var devicePath = deviceURL ? 51 | '.EventData.Data.Devices[?(@.URL == "'+deviceURL+'" && @.Found == 1)]' 52 | : 53 | '' 54 | ; 55 | 56 | return this.register('$[?($.EventURL == "/devices")]' + nodePath + devicePath, action, paramBuilder); 57 | }, 58 | 59 | onPropertyChange: function (node, device, property, cmp_opearor, value, action, paramBuilder) { 60 | var nodePath = node ? 61 | '[?($.EventNode.Name == "'+node+'" || $.EventNode.Token == "'+node+'")]' 62 | : 63 | '' 64 | ; 65 | 66 | var devicePath = device ? 67 | '[?('+Properties.get(null, 'Device')+' == "'+device+'")]' 68 | : 69 | '' 70 | ; 71 | 72 | cmp_opearor = typeof cmp_opearor == 'string' ? 73 | cmp_opearor 74 | : 75 | ' === ' 76 | ; 77 | 78 | var propertyPath = Properties.get(device, property); 79 | propertyPath = propertyPath ? 80 | '[?({'+propertyPath+'}'+(value ? cmp_opearor+JSON.stringify(value) : ' !== false')+')]' 81 | : 82 | '' 83 | ; 84 | 85 | return this.register('$' + nodePath + devicePath + propertyPath, action, paramBuilder); 86 | }, 87 | 88 | onConnectionClose: function (node, action, paramBuilder) { 89 | var nodePath = node ? 90 | '[?($.EventNode.Name == "'+node+'" || $.EventNode.Token == "'+node+'")]' 91 | : 92 | '' 93 | ; 94 | 95 | return this.register('$' + nodePath + '.EventData[?(@.Status == "Connection close")]', action, paramBuilder); 96 | }, 97 | 98 | fire: function (data) { 99 | console.log('DATA: ' + JSON.stringify(data)); 100 | this._poll.forEach( 101 | function (current, index, array) { 102 | if (JSONPath(data, current.path) && current.action != null) { 103 | console.log('TRIGGERS: fire(' + current.action._name + ')'); 104 | current.action.execute( 105 | current.paramBuilder ? 106 | current.paramBuilder.execute(data) 107 | : 108 | {} 109 | ); 110 | } 111 | } 112 | ); 113 | console.log(); 114 | } 115 | }; 116 | -------------------------------------------------------------------------------- /IoT Demos/Tweets on MOD-LED8x8RGB/lib/twitter.js: -------------------------------------------------------------------------------- 1 | var TwitterStream = require('node-tweet-stream'); 2 | var Triggers = require('./triggers'); 3 | var Properties = require('./properties'); 4 | 5 | var TRACK = [ 6 | '#OpenFest15' 7 | ]; 8 | 9 | if (typeof process.env.TWITTER_CONSUMER_KEY == 'undefined') { 10 | throw new Error('TWITTER ERROR: Missing TWITTER_CONSUMER_KEY environment variable'); 11 | } 12 | 13 | if (typeof process.env.TWITTER_CONSUMER_SECRET == 'undefined') { 14 | throw new Error('TWITTER ERROR: Missing TWITTER_CONSUMER_SECRET environment variable'); 15 | } 16 | 17 | if (typeof process.env.TWITTER_TOKEN == 'undefined') { 18 | throw new Error('TWITTER ERROR: Missing TWITTER_TOKEN environment variable'); 19 | } 20 | 21 | if (typeof process.env.TWITTER_TOKEN_SECRET == 'undefined') { 22 | throw new Error('TWITTER ERROR: Missing TWITTER_TOKEN_SECRET environment variable'); 23 | } 24 | 25 | // Init Twitter Stream 26 | var Twitter = new TwitterStream( 27 | { 28 | consumer_key : process.env.TWITTER_CONSUMER_KEY, 29 | consumer_secret : process.env.TWITTER_CONSUMER_SECRET, 30 | token : process.env.TWITTER_TOKEN, 31 | token_secret : process.env.TWITTER_TOKEN_SECRET 32 | } 33 | ); 34 | 35 | // Handle tweets 36 | Twitter.on( 37 | 'tweet', 38 | function (tweet) { 39 | console.log('TWEET: ['+tweet.user.name+'] '+tweet.text+' \n'); 40 | Triggers.fire({ 41 | TwitterEvent: 'Tweet', 42 | EventData: { 43 | user: tweet.user.name, 44 | text: tweet.text 45 | } 46 | }); 47 | } 48 | ); 49 | 50 | // Handle Twitter errors 51 | Twitter.on( 52 | 'error', 53 | function (err) { 54 | console.log('TWEET ERROR: '+err+'\n'); 55 | } 56 | ); 57 | 58 | // Init tracks 59 | for (i in TRACK) { 60 | Twitter.track(TRACK[i]); 61 | } 62 | 63 | Properties. 64 | register(null, 'TweetUser', '$[?($.TwitterEvent == "Tweet")].EventData.user'). 65 | register(null, 'TweetText', '$[?($.TwitterEvent == "Tweet")].EventData.text') 66 | ; 67 | 68 | module.exports = Twitter; 69 | -------------------------------------------------------------------------------- /IoT Demos/Tweets on MOD-LED8x8RGB/main.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var app = express(); 3 | 4 | var jsonParser = require('body-parser').json(); 5 | 6 | var http = require('http').Server(app); 7 | var ws = require('websocket').server; 8 | var websocket = new ws({ 9 | httpServer: http, 10 | autoAcceptConnections: false 11 | }); 12 | 13 | var JSONPath = require('advanced-json-path'); 14 | var Connections = require('./lib/connections'); 15 | var Triggers = require('./lib/triggers'); 16 | 17 | const HTTP_PORT = 80; 18 | 19 | function responseHeaders(response) { 20 | response.setHeader('Access-Control-Allow-Origin', '*'); 21 | response.setHeader('Access-Control-Allow-Headers', 'Authorization, Content-Type'); 22 | } 23 | 24 | app.options('*', 25 | function(request, response) { 26 | console.log('OPTIONS ['+request.url+']'); 27 | responseHeaders(response); 28 | response.send(); 29 | } 30 | ); 31 | 32 | app.get('/nodes', 33 | function(request, response) { 34 | console.log('GET ['+request.url+'] ['+request.ip+']'); 35 | responseHeaders(response); 36 | response.send(Connections.getNodes()); 37 | } 38 | ); 39 | 40 | app.get('*', 41 | function(request, response) { 42 | console.log('GET ['+request.url+'] ['+request.ip+']'); 43 | responseHeaders(response); 44 | response.send('{"Status" : "OK"}'); 45 | } 46 | ); 47 | 48 | app.post('*', jsonParser, 49 | function(request, response) { 50 | console.log('POST ['+request.url+'] ['+request.ip+']'); 51 | if (!request.body) { 52 | return response.sendStatus(400); 53 | } 54 | 55 | Triggers.fire(request.body); 56 | 57 | responseHeaders(response); 58 | response.send('{"Status" : "OK"}'); 59 | } 60 | ); 61 | 62 | http.listen(HTTP_PORT, 63 | function() { 64 | console.log('NodeJS listening on *:'+HTTP_PORT); 65 | } 66 | ); 67 | 68 | function originIsAllowed(origin) { 69 | // FIX THIS TO USE IN PRODUCTION ENVIRONMENT 70 | return true; 71 | } 72 | 73 | websocket.on( 74 | 'request', 75 | function(request) { 76 | console.log('WEBSOCKET: Connection request ['+request.resource+'] ['+request.remoteAddress+']'); 77 | 78 | if (!originIsAllowed(request.origin)) { 79 | // Make sure we only accept requests from an allowed origin 80 | request.reject(); 81 | console.log('WEBSOCKET: Connection from origin [' + request.origin + '] rejected.'); 82 | return; 83 | } 84 | 85 | var connection = request.accept(); 86 | Connections.add(connection); 87 | console.log('WEBSOCKET: Connection accepted'); 88 | 89 | var time = new Date().getTime(); 90 | 91 | connection.on( 92 | 'message', 93 | function(message) { 94 | if (message.type === 'utf8') { 95 | var data = null; 96 | try { 97 | data = JSON.parse(message.utf8Data); 98 | 99 | if (JSONPath(data, '$[?($.Name)][?($.Token)]')) { 100 | // Node identification 101 | Connections.setName(connection, data.Name); 102 | Connections.setToken(connection, data.Token); 103 | 104 | connection.sendUTF( 105 | JSON.stringify( 106 | { 107 | URL: '/devices', 108 | Method: 'GET' 109 | } 110 | ) 111 | ); 112 | } 113 | 114 | data.EventNode = { 115 | IP: connection.remoteAddress, 116 | Name: connection.node.Name, 117 | Token: connection.node.Token 118 | } 119 | 120 | var devices = JSONPath(data, '$[?($.EventURL == "/devices")].EventData.Data.Devices[?(@.Found == 1)]'); 121 | if (devices !== false) { 122 | console.log('REGISTER DEVICES:'); 123 | connection.node.Devices = connection.node.Devices.concat(devices); 124 | } 125 | } catch (err) { 126 | console.log('ERROR@'+connection.node.Token+' ['+err+']'); 127 | console.log('Data: '+message.utf8Data); 128 | return; 129 | } 130 | 131 | // TODO Log data 132 | Triggers.fire(data); 133 | } else if (message.type === 'binary') { 134 | console.log('WEBSOCKET: ['+ connection.node.Token + '] Received Binary Message of ' + message.binaryData.length + ' bytes'); 135 | } 136 | } 137 | ); 138 | 139 | connection.on( 140 | 'close', 141 | function(reasonCode, description) { 142 | Triggers.fire( 143 | { 144 | EventURL: null, 145 | 146 | EventData: { 147 | Status: 'Connection close' 148 | }, 149 | 150 | EventNode: { 151 | IP: connection.remoteAddress, 152 | Name: connection.node.Name, 153 | Token: connection.node.Token 154 | } 155 | } 156 | ); 157 | 158 | Connections.remove(connection); 159 | console.log('WEBSOCKET: ['+ connection.node.Token + '] CLOSE [' + connection.remoteAddress + '] ['+reasonCode+': '+description+']'); 160 | } 161 | ); 162 | } 163 | ); 164 | -------------------------------------------------------------------------------- /IoT Demos/Tweets on MOD-LED8x8RGB/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "olimex-iot-demo", 3 | "version": "2.0.2", 4 | "description": "WebSocket ESP8266 Olimex IoT Demo", 5 | "dependencies": { 6 | "advanced-json-path": "~1.0.4", 7 | "express": "~4.13.1", 8 | "body-parser": "~1.13.2", 9 | "websocket": "~1.0.19", 10 | "node-tweet-stream": "~1.8.2" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/OLIMEX/ESP8266/tree/master/IoT Demos/Tweets on MOD-LED8x8RGB" 15 | }, 16 | "license" : "Apache-2.0", 17 | "private": false 18 | } 19 | -------------------------------------------------------------------------------- /IoT Firmware/README.md: -------------------------------------------------------------------------------- 1 | This project has moved to [olimex-iot-firmware-esp8266 repository](https://github.com/OLIMEX/olimex-iot-firmware-esp8266). 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | README 2 | ====== 3 | 4 | These apps accomplish the following: 5 | 6 | -- ESP8266-EVB-blinkLED : Blink by green LED on ESP8266-EVB 7 | 8 | -- arduino_style : 9 | 10 | -- esphttpd : Advanced web-server for ESP8266-EVB (Config, Rele, Button). 11 | 12 | ## Build toolchain 13 | 14 | https://github.com/pfalcon/esp-open-sdk is easy to use, it basically does all on its own. 15 | 16 | - Clone the repository to ```/opt/Espressif``` (or somewhere else, this path seems to be preferred by some people) 17 | - Install dependencies: ```sudo apt-get install make unrar autoconf automake libtool gcc g++ gperf flex bison texinfo gawk ncurses-dev libexpat-dev python sed``` 18 | - ```make```, wait a few minutes, done. 19 | - Add ```export PATH="${PATH}:/opt/Espressif/xtensa-lx106-elf/bin``` to your .bashrc, .profile, .zshrc, whatever. Or just run it every time you want to use the toolchain. 20 | 21 | In some versions of the SDK there seems to be a problem with some type definitions. If you have problems compiling with errors that some types are not defined try opening ```xtensa-lx106-elf/xtensa-lx106-elf/sysroot/usr/include/c_types.h``` and replace ```#if 0``` near the top with ```#if 1```. 22 | 23 | ## Get esptool 24 | 25 | Some projects use ```esptool```, which is something completely different as ```esptool.py``` and which is not installed by ```esp-open-sdk```. You can get ```esptool``` here: 26 | * https://github.com/tommie/esptool-ck 27 | 28 | or here: 29 | * https://github.com/themadinventor/esptool 30 | -------------------------------------------------------------------------------- /arduino_style/arduino/Makefile: -------------------------------------------------------------------------------- 1 | 2 | ############################################################# 3 | # Required variables for each makefile 4 | # Discard this section from all parent makefiles 5 | # Expected variables (with automatic defaults): 6 | # CSRCS (all "C" files in the dir) 7 | # SUBDIRS (all subdirs with a Makefile) 8 | # GEN_LIBS - list of libs to be generated () 9 | # GEN_IMAGES - list of images to be generated () 10 | # COMPONENTS_xxx - a list of libs/objs in the form 11 | # subdir/lib to be extracted and rolled up into 12 | # a generated lib/image xxx.a () 13 | # 14 | ifndef PDIR 15 | GEN_LIBS = libarduino.a 16 | endif 17 | 18 | 19 | ############################################################# 20 | # Configuration i.e. compile options etc. 21 | # Target specific stuff (defines etc.) goes in here! 22 | # Generally values applying to a tree are captured in the 23 | # makefile at its root level - these are then overridden 24 | # for a subtree within the makefile rooted therein 25 | # 26 | #DEFINES += 27 | 28 | ############################################################# 29 | # Recursion Magic - Don't touch this!! 30 | # 31 | # Each subtree potentially has an include directory 32 | # corresponding to the common APIs applicable to modules 33 | # rooted at that subtree. Accordingly, the INCLUDE PATH 34 | # of a module can only contain the include directories up 35 | # its parent path, and not its siblings 36 | # 37 | # Required for each makefile to inherit from the parent 38 | # 39 | 40 | INCLUDES := $(INCLUDES) -I $(PDIR)include 41 | INCLUDES += -I ./ 42 | INCLUDES += -I ../../include/ets 43 | PDIR := ../$(PDIR) 44 | sinclude $(PDIR)Makefile 45 | 46 | -------------------------------------------------------------------------------- /arduino_style/arduino/arduino_flash.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * arduino_flash.c is part of esp_arduino_style. 4 | * 5 | * esp_arduino_style is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * esp_arduino_style is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with esp_arduino_style. If not, see . 17 | * 18 | * Created on: Mar 3, 2015 19 | * Author: Stefan Mavrodiev 20 | * Company: Olimex LTD. 21 | * Contact: support@olimex.com 22 | */ 23 | 24 | #include "osapi.h" //TODO: remove me after debug 25 | #include "arduino_flash.h" 26 | #include "spi_flash.h" 27 | 28 | flash_t flash = 29 | { .erase = flash_erase, .read = flash_read, .write = flash_write, }; 30 | 31 | /** 32 | * Erase sectors in given range. 33 | * 34 | * @param startAddress Start address. 35 | * @param endAddress End address. 36 | * @return None. 37 | */ 38 | void flash_erase(uint32 startAddress, uint32 endAddress) 39 | { 40 | 41 | uint32 currentAddress = startAddress & ~(0x00000FFF); 42 | 43 | do 44 | { 45 | if (spi_flash_erase_sector(currentAddress / 0x1000) 46 | != SPI_FLASH_RESULT_OK) 47 | { 48 | return; 49 | } 50 | 51 | currentAddress += 0x1000; 52 | } while (currentAddress <= endAddress); 53 | } 54 | 55 | /** 56 | * Write data at address. 57 | * 58 | * @param address Address in the memory. 59 | * @param data Data to be written. 60 | * @return None 61 | */ 62 | void flash_write(uint32 address, uint32 data) 63 | { 64 | 65 | uint32 buffer[] = 66 | { data }; 67 | 68 | if (spi_flash_write(address, (uint32 *) buffer, sizeof(buffer)) 69 | != SPI_FLASH_RESULT_OK) 70 | return; 71 | } 72 | 73 | /** 74 | * Read data at address. 75 | * @param address Address in the memory. 76 | * @return Value in the memory cell. 77 | */ 78 | uint32 flash_read(uint32 address) 79 | { 80 | uint32 buffer[1]; 81 | 82 | spi_flash_read(address, (uint32 *) buffer, sizeof(buffer)); 83 | return buffer[0]; 84 | } 85 | -------------------------------------------------------------------------------- /arduino_style/arduino/arduino_flash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * arduino_flash.h is part of esp_arduino_style. 4 | * 5 | * esp_arduino_style is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * esp_arduino_style is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with esp_arduino_style. If not, see . 17 | * 18 | * Created on: Mar 3, 2015 19 | * Author: Stefan Mavrodiev 20 | * Company: Olimex LTD. 21 | * Contact: support@olimex.com 22 | */ 23 | 24 | #ifndef USER_ARDUINO_ARDUINO_FLASH_H_ 25 | #define USER_ARDUINO_ARDUINO_FLASH_H_ 26 | 27 | #include "c_types.h" 28 | 29 | typedef struct 30 | { 31 | void (*erase)(uint32 startAddress, uint32 endAddress); 32 | void (*write)(uint32 address, uint32 data); 33 | uint32 (*read)(uint32 address); 34 | } flash_t; 35 | 36 | void flash_erase(uint32 startAddress, uint32 endAddress); 37 | uint32 flash_read(uint32 address); 38 | void flash_write(uint32 address, uint32 data); 39 | 40 | extern flash_t flash; 41 | #endif /* USER_ARDUINO_ARDUINO_FLASH_H_ */ 42 | -------------------------------------------------------------------------------- /arduino_style/arduino/arduino_gpio.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * arduino_gpio.c is part of esp_arduino_style. 4 | * 5 | * esp_arduino_style is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * esp_arduino_style is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with esp_arduino_style. If not, see . 17 | * 18 | * Created on: Mar 2, 2015 19 | * Author: Stefan Mavrodiev 20 | * Company: Olimex LTD. 21 | * Contact: support@olimex.com 22 | */ 23 | 24 | #include "ets_sys.h" 25 | #include "arduino_gpio.h" 26 | 27 | gpio_reg_t gpio[] = 28 | { 29 | { PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0 }, //gpio0 30 | { PERIPHS_IO_MUX_U0TXD_U, FUNC_GPIO1 }, //gpio1 31 | { PERIPHS_IO_MUX_GPIO2_U, FUNC_GPIO2 }, //gpio2 32 | { PERIPHS_IO_MUX_U0RXD_U, FUNC_GPIO3 }, //gpio3 33 | { PERIPHS_IO_MUX_GPIO4_U, FUNC_GPIO4 }, //gpio4 34 | { PERIPHS_IO_MUX_GPIO5_U, FUNC_GPIO5 }, //gpio5 35 | { 0, 0 }, 36 | { 0, 0 }, 37 | { 0, 0 }, 38 | { 0, 0 }, 39 | { 0, 0 }, 40 | { 0, 0 }, 41 | { PERIPHS_IO_MUX_MTDI_U, FUNC_GPIO12 }, //gpio12 42 | { PERIPHS_IO_MUX_MTCK_U, FUNC_GPIO13 }, //gpio13 43 | { PERIPHS_IO_MUX_MTMS_U, FUNC_GPIO14 }, //gpio14 44 | { PERIPHS_IO_MUX_MTDO_U, FUNC_GPIO15 }, //gpio15 45 | }; 46 | 47 | /** 48 | * Return if gpio is available. 49 | * 50 | * @param pin The gpio to be used 51 | * @return 0 if gpio is valid, 1 for invalid. 52 | */ 53 | uint8_t pin_is_valid(uint8 pin) 54 | { 55 | /* Check if pin number is valid */ 56 | if ((pin > 5 && pin < 12) || pin > 15) 57 | { 58 | return 0; 59 | } 60 | return 1; 61 | } 62 | 63 | /** 64 | * Set data direction of GPIO. 65 | * 66 | * @param pin GPIO to be configured. 67 | * @param mode The data direction 68 | * @see pinmode_t 69 | * @return None 70 | */ 71 | void pinMode(uint8 pin, pinmode_t mode) 72 | { 73 | /* Check if pin number is valid */ 74 | if (!pin_is_valid(pin)) 75 | { 76 | return; 77 | } 78 | 79 | /* Mux to gpio */ 80 | PIN_FUNC_SELECT(gpio[pin].reg, gpio[pin].gpio_func); 81 | PIN_PULLUP_DIS(gpio[pin].reg); 82 | PIN_PULLDWN_DIS(gpio[pin].reg); 83 | 84 | /* Set direction */ 85 | switch (mode) 86 | { 87 | 88 | case INPUT: 89 | WRITE_PERI_REG(GPIO_ENABLE_W1TC, 0x1 << pin); 90 | break; 91 | 92 | case OUTPUT: 93 | WRITE_PERI_REG(GPIO_ENABLE_W1TS, 0x1 << pin); 94 | break; 95 | 96 | case INPUT_PULLUP: 97 | WRITE_PERI_REG(GPIO_ENABLE_W1TC, 0x1 << pin); 98 | PIN_PULLUP_EN(gpio[pin].reg); 99 | break; 100 | 101 | default: 102 | return; 103 | break; 104 | } 105 | 106 | return; 107 | } 108 | 109 | /** 110 | * Set output value of GPIO. 111 | * 112 | * @param pin GPIO to be configured. 113 | * @param value The output value. If configured 114 | * as input 1 enables pull-up. 115 | * @see pinvalue_t 116 | * @return None 117 | */ 118 | void digitalWrite(uint8 pin, pinvalue_t value) 119 | { 120 | /* Check if pin number is valid */ 121 | if (!pin_is_valid(pin)) 122 | { 123 | return; 124 | } 125 | 126 | /* Read current confgiguration */ 127 | if (READ_PERI_REG(GPIO_ENABLE) & ((uint32) 0x1 << pin)) 128 | { 129 | /* Pin is output */ 130 | WRITE_PERI_REG(GPIO_OUT, 131 | (READ_PERI_REG(GPIO_OUT) & (uint32) (~(0x01 << pin))) 132 | | (value << pin)); 133 | } 134 | else 135 | { 136 | /* Pin is input */ 137 | if (value) 138 | { 139 | PIN_PULLUP_EN(gpio[pin].reg); 140 | } 141 | else 142 | { 143 | PIN_PULLUP_DIS(gpio[pin].reg); 144 | } 145 | } 146 | } 147 | 148 | /** 149 | * Read current value of GPIO. 150 | * 151 | * @param pin GPIO to be read. 152 | * @return If configured as input return value at GPIO. 153 | * Otherwise return the output value. 154 | */ 155 | uint8 digitalRead(uint8 pin) 156 | { 157 | /* Check if pin number is valid */ 158 | if (!pin_is_valid(pin)) 159 | { 160 | return 0; 161 | } 162 | 163 | if (READ_PERI_REG(GPIO_ENABLE) & ((uint32) 0x1 << pin)) 164 | { 165 | return !!((READ_PERI_REG(GPIO_OUT) & ((uint32) 0x1 << pin))); 166 | } 167 | else 168 | { 169 | return !!((READ_PERI_REG(GPIO_IN) & ((uint32) 0x1 << pin))); 170 | } 171 | 172 | } 173 | -------------------------------------------------------------------------------- /arduino_style/arduino/arduino_gpio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * arduino_gpio.h is part of esp_arduino_style. 4 | * 5 | * esp_arduino_style is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * esp_arduino_style is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with esp_arduino_style. If not, see . 17 | * 18 | * Created on: Mar 2, 2015 19 | * Author: Stefan Mavrodiev 20 | * Company: Olimex LTD. 21 | * Contact: support@olimex.com 22 | */ 23 | 24 | #ifndef USER_ARDUINO_ARDUINO_GPIO_H_ 25 | #define USER_ARDUINO_ARDUINO_GPIO_H_ 26 | 27 | #include "c_types.h" 28 | 29 | /* 30 | * Define GPIO related registers. 31 | */ 32 | #define PERIPHS_GPIO_BASEADDR 0x60000300 33 | 34 | #define GPIO_OUT (PERIPHS_GPIO_BASEADDR + 0x00) 35 | #define GPIO_OUT_W1TS (PERIPHS_GPIO_BASEADDR + 0x04) 36 | #define GPIO_OUT_W1TC (PERIPHS_GPIO_BASEADDR + 0x08) 37 | 38 | #define GPIO_ENABLE (PERIPHS_GPIO_BASEADDR + 0x0C) 39 | #define GPIO_ENABLE_W1TS (PERIPHS_GPIO_BASEADDR + 0x10) 40 | #define GPIO_ENABLE_W1TC (PERIPHS_GPIO_BASEADDR + 0x14) 41 | 42 | #define GPIO_IN (PERIPHS_GPIO_BASEADDR + 0x18) 43 | 44 | /* 45 | * Define structure that describes register -> function 46 | * relation. 47 | */ 48 | typedef struct { 49 | uint32 reg; 50 | uint8 gpio_func; 51 | } gpio_reg_t; 52 | 53 | /* 54 | * Define possible pin modes. 55 | */ 56 | typedef enum { 57 | INPUT, 58 | OUTPUT, 59 | INPUT_PULLUP 60 | } pinmode_t; 61 | 62 | /* 63 | * Define output levels. 64 | */ 65 | typedef enum { 66 | LOW, 67 | HIGH 68 | } pinvalue_t; 69 | 70 | extern void pinMode(uint8 pin, pinmode_t mode); 71 | extern void digitalWrite(uint8 pin, pinvalue_t value); 72 | extern uint8 digitalRead(uint8 pin); 73 | 74 | #endif /* USER_ARDUINO_ARDUINO_GPIO_H_ */ 75 | -------------------------------------------------------------------------------- /arduino_style/arduino/arduino_i2c.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * arduino_i2c.h is part of esp_arduino_style. 4 | * 5 | * esp_arduino_style is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * esp_arduino_style is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with esp_arduino_style. If not, see . 17 | * 18 | * Created on: Mar 2, 2015 19 | * Author: Stefan Mavrodiev 20 | * Company: Olimex LTD. 21 | * Contact: support@olimex.com 22 | */ 23 | 24 | #ifndef USER_ARDUINO_ARDUINO_I2C_H_ 25 | #define USER_ARDUINO_ARDUINO_I2C_H_ 26 | 27 | #define I2C_MASTER_SDA_MUX PERIPHS_IO_MUX_GPIO2_U 28 | #define I2C_MASTER_SCL_MUX PERIPHS_IO_MUX_GPIO4_U 29 | #define I2C_MASTER_SDA_GPIO 2 30 | #define I2C_MASTER_SCL_GPIO 4 31 | #define I2C_MASTER_SDA_FUNC FUNC_GPIO2 32 | #define I2C_MASTER_SCL_FUNC FUNC_GPIO4 33 | 34 | #define I2C_MASTER_SDA_HIGH_SCL_HIGH() \ 35 | gpio_output_set(1<. 17 | * 18 | * Created on: Mar 3, 2015 19 | * Author: Stefan Mavrodiev 20 | * Company: Olimex LTD. 21 | * Contact: support@olimex.com 22 | */ 23 | 24 | #ifndef USER_ARDUINO_ARDUINO_SERIAL_H_ 25 | #define USER_ARDUINO_ARDUINO_SERIAL_H_ 26 | 27 | #include "driver/uart.h" 28 | 29 | typedef struct 30 | { 31 | void (*begin)(UartBautRate baud); 32 | void (*println)(char *buffer); 33 | void (*print)(char *buffer); 34 | void (*write)(char c); 35 | int (*read)(void); 36 | int (*available)(void); 37 | } serial_t; 38 | 39 | 40 | void uart0_init(UartBautRate baud); 41 | void uart_print(char *buffer); 42 | void uart_println(char *buffer); 43 | void uart_write(char c); 44 | int uart_available(void); 45 | int uart_read(void); 46 | 47 | extern serial_t Serial; 48 | 49 | 50 | #endif /* USER_ARDUINO_ARDUINO_SERIAL_H_ */ 51 | -------------------------------------------------------------------------------- /arduino_style/arduino/arduino_spi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * arduino_spi.h is part of esp_arduino_style. 4 | * 5 | * esp_arduino_style is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * esp_arduino_style is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with esp_arduino_style. If not, see . 17 | * 18 | * Created on: Mar 3, 2015 19 | * Author: Stefan Mavrodiev 20 | * Company: Olimex LTD. 21 | * Contact: support@olimex.com 22 | */ 23 | 24 | #ifndef USER_ARDUINO_ARDUINO_SPI_H_ 25 | #define USER_ARDUINO_ARDUINO_SPI_H_ 26 | 27 | /* SPI */ 28 | typedef enum 29 | { 30 | SPI_MODE0, SPI_MODE1, SPI_MODE2, SPI_MODE3 31 | } spiMode_t; 32 | 33 | typedef enum 34 | { 35 | MSBFIRST = 0, LSBFIRST 36 | } spiOrder_t; 37 | 38 | typedef enum 39 | { 40 | SPI_CONTINUE, SPI_LAST 41 | } spiTransferMode_t; 42 | 43 | typedef struct 44 | { 45 | spiOrder_t order; 46 | spiMode_t mode; 47 | uint16 delay; 48 | 49 | } spi_config_t; 50 | 51 | typedef struct 52 | { 53 | void (*begin)(uint8 pin); 54 | void (*setClockDivider)(uint16 predivider, uint8 divider); 55 | void (*setDataMode)(spiMode_t mode); 56 | void (*setBitOrder)(spiOrder_t order); 57 | uint8 (*transfer)(uint8 pin, uint8 val, spiTransferMode_t transferMode); 58 | } spi_t; 59 | 60 | void spi_begin(uint8 pin); 61 | void spi_set_clock_divider(uint16 predivider, uint8 divider); 62 | void spi_set_data_mode(spiMode_t mode); 63 | void spi_set_bit_order(spiOrder_t order); 64 | uint8 spi_transfer(uint8 pin, uint8 val, spiTransferMode_t transferMode); 65 | 66 | extern spi_t spi; 67 | 68 | #endif /* USER_ARDUINO_ARDUINO_SPI_H_ */ 69 | -------------------------------------------------------------------------------- /arduino_style/arduinostyle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * arduinostyle.h 3 | * 4 | * Created on: Jan 30, 2015 5 | * Author: stefan 6 | */ 7 | 8 | #ifndef USER_ARDUINOSTYLE_H_ 9 | #define USER_ARDUINOSTYLE_H_ 10 | 11 | #include "arduino/arduino_gpio.h" 12 | #include "arduino/arduino_serial.h" 13 | #include "arduino/arduino_flash.h" 14 | #include "arduino/arduino_i2c.h" 15 | #include "arduino/arduino_spi.h" 16 | 17 | 18 | #endif /* USER_ARDUINOSTYLE_H_ */ 19 | -------------------------------------------------------------------------------- /esphttpd/Makefile: -------------------------------------------------------------------------------- 1 | # tnx to mamalala 2 | # Changelog 3 | # Changed the variables to include the header file directory 4 | # Added global var for the XTENSA tool root 5 | # 6 | # This make file still needs some work. 7 | # 8 | # 9 | # Output directors to store intermediate compiled files 10 | # relative to the project directory 11 | BUILD_BASE = build 12 | FW_BASE = firmware 13 | 14 | # Base directory for the compiler 15 | XTENSA_TOOLS_ROOT ?=/opt/Espressif/crosstool-NG/builds/xtensa-lx106-elf/bin 16 | 17 | #Extra Tensilica includes from the ESS VM 18 | SDK_EXTRA_INCLUDES ?= /opt/Espressif/include 19 | 20 | # base directory of the ESP8266 SDK package, absolute 21 | SDK_BASE ?= /opt/Espressif/ESP8266_SDK/esp_iot_sdk_v0.9.3 22 | 23 | #Esptool.py path and port 24 | ESPTOOL ?= /opt/Espressif/esptool-py/esptool.py 25 | ESPPORT ?= /dev/ttyUSB0 26 | 27 | # name for the target project 28 | TARGET = httpd 29 | 30 | # which modules (subdirectories) of the project to include in compiling 31 | MODULES = driver user #driver/i2c driver/spi 32 | EXTRA_INCDIR = include \ 33 | . \ 34 | lib/heatshrink/ \ 35 | $(SDK_EXTRA_INCLUDES) 36 | 37 | # libraries used in this project, mainly provided by the SDK 38 | LIBS = c gcc hal phy net80211 lwip wpa main pp 39 | 40 | # compiler flags using during compilation of source files 41 | CFLAGS = -Os -ggdb -std=c99 -Werror -Wpointer-arith -Wundef -Wall -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -D__ets__ -DICACHE_FLASH 42 | 43 | # linker flags used to generate the main object file 44 | LDFLAGS = -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static 45 | 46 | # linker script used for the above linkier step 47 | LD_SCRIPT = eagle.app.v6.ld 48 | 49 | # various paths from the SDK used in this project 50 | SDK_LIBDIR = lib 51 | SDK_LDDIR = ld 52 | SDK_INCDIR = include include/json 53 | 54 | # we create two different files for uploading into the flash 55 | # these are the names and options to generate them 56 | FW_FILE_1 = 0x00000 57 | FW_FILE_1_ARGS = -bo $@ -bs .text -bs .data -bs .rodata -bc -ec 58 | FW_FILE_2 = 0x40000 59 | FW_FILE_2_ARGS = -es .irom0.text $@ -ec 60 | 61 | # select which tools to use as compiler, librarian and linker 62 | CC := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-gcc 63 | AR := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-ar 64 | LD := $(XTENSA_TOOLS_ROOT)/xtensa-lx106-elf-gcc 65 | 66 | 67 | 68 | #### 69 | #### no user configurable options below here 70 | #### 71 | FW_TOOL ?= /usr/bin/esptool 72 | SRC_DIR := $(MODULES) 73 | BUILD_DIR := $(addprefix $(BUILD_BASE)/,$(MODULES)) 74 | 75 | SDK_LIBDIR := $(addprefix $(SDK_BASE)/,$(SDK_LIBDIR)) 76 | SDK_INCDIR := $(addprefix -I$(SDK_BASE)/,$(SDK_INCDIR)) 77 | 78 | SRC := $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.c)) 79 | OBJ := $(patsubst %.c,$(BUILD_BASE)/%.o,$(SRC)) 80 | LIBS := $(addprefix -l,$(LIBS)) 81 | APP_AR := $(addprefix $(BUILD_BASE)/,$(TARGET)_app.a) 82 | TARGET_OUT := $(addprefix $(BUILD_BASE)/,$(TARGET).out) 83 | 84 | LD_SCRIPT := $(addprefix -T$(SDK_BASE)/$(SDK_LDDIR)/,$(LD_SCRIPT)) 85 | 86 | INCDIR := $(addprefix -I,$(SRC_DIR)) 87 | EXTRA_INCDIR := $(addprefix -I,$(EXTRA_INCDIR)) 88 | MODULE_INCDIR := $(addsuffix /include,$(INCDIR)) 89 | 90 | FW_FILE_1 := $(addprefix $(FW_BASE)/,$(FW_FILE_1).bin) 91 | FW_FILE_2 := $(addprefix $(FW_BASE)/,$(FW_FILE_2).bin) 92 | 93 | V ?= $(VERBOSE) 94 | ifeq ("$(V)","1") 95 | Q := 96 | vecho := @true 97 | else 98 | Q := @ 99 | vecho := @echo 100 | endif 101 | 102 | vpath %.c $(SRC_DIR) 103 | 104 | define compile-objects 105 | $1/%.o: %.c 106 | $(vecho) "CC $$<" 107 | $(Q) $(CC) $(INCDIR) $(MODULE_INCDIR) $(EXTRA_INCDIR) $(SDK_INCDIR) $(CFLAGS) -c $$< -o $$@ 108 | endef 109 | 110 | .PHONY: all checkdirs clean 111 | 112 | all: checkdirs $(TARGET_OUT) $(FW_FILE_1) $(FW_FILE_2) 113 | 114 | $(FW_FILE_1): $(TARGET_OUT) firmware 115 | $(vecho) "FW $@" 116 | $(Q) $(FW_TOOL) -eo $(TARGET_OUT) $(FW_FILE_1_ARGS) 117 | 118 | $(FW_FILE_2): $(TARGET_OUT) firmware 119 | $(vecho) "FW $@" 120 | $(Q) $(FW_TOOL) -eo $(TARGET_OUT) $(FW_FILE_2_ARGS) 121 | 122 | $(TARGET_OUT): $(APP_AR) 123 | $(vecho) "LD $@" 124 | $(Q) $(LD) -L$(SDK_LIBDIR) $(LD_SCRIPT) $(LDFLAGS) -Wl,--start-group $(LIBS) $(APP_AR) -Wl,--end-group -o $@ 125 | 126 | $(APP_AR): $(OBJ) 127 | $(vecho) "AR $@" 128 | $(Q) $(AR) cru $@ $^ 129 | 130 | checkdirs: $(BUILD_DIR) $(FW_BASE) 131 | 132 | $(BUILD_DIR): 133 | $(Q) mkdir -p $@ 134 | 135 | firmware: 136 | $(Q) mkdir -p $@ 137 | 138 | flash: firmware/0x00000.bin firmware/0x40000.bin 139 | -$(ESPTOOL) --port $(ESPPORT) write_flash 0x00000 firmware/0x00000.bin 0x40000 firmware/0x40000.bin 140 | 141 | webpages.espfs: html/ mkespfsimage/mkespfsimage 142 | cd html; find | sudo ../mkespfsimage/mkespfsimage > ../webpages.espfs; cd .. 143 | 144 | mkespfsimage/mkespfsimage: mkespfsimage/ 145 | make -C mkespfsimage 146 | 147 | htmlflash: webpages.espfs 148 | if [ $$(stat -c '%s' webpages.espfs) -gt $$(( 0x2E000 )) ]; then echo "webpages.espfs too big!"; false; fi 149 | -$(ESPTOOL) --port $(ESPPORT) write_flash 0x12000 webpages.espfs 150 | 151 | clean: 152 | $(Q) rm -f $(APP_AR) 153 | $(Q) rm -f $(TARGET_OUT) 154 | $(Q) find $(BUILD_BASE) -type f | xargs rm -f 155 | 156 | 157 | $(Q) rm -f $(FW_FILE_1) 158 | $(Q) rm -f $(FW_FILE_2) 159 | $(Q) rm -rf $(FW_BASE) 160 | 161 | $(foreach bdir,$(BUILD_DIR),$(eval $(call compile-objects,$(bdir)))) 162 | -------------------------------------------------------------------------------- /esphttpd/README: -------------------------------------------------------------------------------- 1 | esp-httpd README 2 | 3 | This is a small but powerful webserver for ESP8266(EX) chips. Included is an example of how 4 | to make a module that can have the AP it connects to configured over a webbrowser. 5 | 6 | ABOUT THE WEBSERVER 7 | 8 | The Good (aka: what's awesome) 9 | - Supports multiple connections, for eg simultaneous html/css/js/images downloading 10 | - Static files stored in flash, in an (optionally compressed) RO filesystem 11 | - Pluggable using external cgi routines 12 | - Simple template engine for mixed c and html things 13 | 14 | The Bad (aka: what can be improved) 15 | - Not built for speediness, although it's reasonable fast. 16 | - Built according to what I remember of the HTTP protocol, not according to the 17 | RFCs. Should work with most modern browsers, though. 18 | - No support for authentication or https. 19 | 20 | The Ugly (aka: bugs, misbehaviour) 21 | - Possible buffer overflows (usually not remotely exploitable) due to no os_snprintf 22 | This can be theoretically remedied by either Espressif including an os_snprintf in 23 | their libs or by using some alternate printf lib, like elm-chans xprintf 24 | 25 | ABOUT THE EXAMPLE 26 | 27 | When you flash the example into an ESP8266(EX) module, you get a small webserver with a few example 28 | pages. If you've already connected your module to your WLAN before, it'll keep those settings. When 29 | you haven't or the settings are wrong, keep GPIO0 for >5 seconds. The module will reboot into 30 | its STA+AP mode. Connect a computer to the newly formed access point and browse to 31 | http://192.168.4.1/wifi in order to connect the module to your WiFi network. The example also 32 | allows you to control a LED that's connected to GPIO2. 33 | 34 | BUILDING EVERYTHING 35 | 36 | For this, you need an environment that can compile ESP8266 firmware. Environments for this still 37 | are in flux at the moment, but I'm using a crosstool-ng gcc setup combined with the libs & includes 38 | from the ESP SDK and ESP VM. You probably also need an UNIX-slike system; I'm working on 39 | Debian Linux myself. 40 | 41 | To manage the paths to all this, you can source a small shell fragment into your current session. For 42 | example, I source a file with these contents: 43 | export PATH=${PWD}/crosstool-NG/builds/xtensa-lx106-elf/bin:$PATH 44 | export XTENSA_TOOLS_ROOT=${PWD}/crosstool-NG/builds/xtensa-lx106-elf/bin 45 | export SDK_BASE=${PWD}/esp_iot_sdk_v0.9.2/ 46 | export SDK_EXTRA_INCLUDES=${PWD}/esp_iot_sdk_novm_unpacked/usr/xtensa/XtDevTools/install/builds/RC-2010.1-win32/lx106/xtensa-elf/include/ 47 | export ESPTOOL=${PWD}/esptool/esptool.py 48 | export ESPPORT=/dev/ttyUSB0 49 | Actual setup of the SDK and toolchain is out of the scope of this document, so I hope this helps you 50 | enough to set up your own if you haven't already. 51 | 52 | If you have that, you can clone out the source code: 53 | git clone http://git.spritesserver.nl/esphttpd.git/ 54 | 55 | This project makes use of heatshrink, which is a git submodule. To fetch the code: 56 | cd esphttpd 57 | git submodule init 58 | git submodule update 59 | 60 | 61 | Now, build the code: 62 | make 63 | 64 | Flash the code happens in 2 steps. First the code itself gets flashed. Reset the module into bootloader 65 | mode and enter 'make flash'. You may want to reset and re-enter the bootloader halfway (at 'sleep 3') for 66 | the 2nd part of this flash to work. 67 | 68 | The 2nd step is to pack the static files the webserver will serve and flash that. Reset the module into 69 | bootloader mode again and enter 'make htmlflash'. 70 | 71 | You should have a working webserver now. 72 | 73 | WRITING CODE FOR THE WEBSERVER 74 | 75 | ...errm... to be done. For now, look at the examples. Hey, you probably managed to find out how 76 | the SDK works, this shouldn't be too hard :P 77 | 78 | 79 | -------------------------------------------------------------------------------- /esphttpd/README.md: -------------------------------------------------------------------------------- 1 | esphttpd 2 | ======== 3 | 4 | ESP8266 webserver + Olimex DEMO page 5 | 6 | 7 | How to build project and upload: 8 | 9 | * Install toolchain 10 | * Build the project 11 | * Connect the board to pc 12 | * Upload the project 13 | 14 | ### Install the toolchain 15 | Follow the instructions on this site: 16 | https://github.com/esp8266/esp8266-wiki/wiki 17 | 18 | ### Build the project 19 | Clone this repository into Espressif install directory 20 | 21 | ```shell 22 | cd /opt/Espressif 23 | git clone https://github.com/OLIMEX/ESP8266.git 24 | cd ESP8266/esphttpd 25 | git submodule init 26 | git submodule update 27 | make 28 | ``` 29 | Once you make the project the next step is to upload it to [ESP8266-EVB](https://www.olimex.com/Products/IoT/ESP8266-EVB/open-source-hardware/ "ESP8266-EVB") board. 30 | 31 | ### Connect the board to pc 32 | 33 | You will need 3.3V cable like [USB-SERIAL-CABLE-F](https://www.olimex.com/Products/Components/Cables/USB-Serial-Cable/USB-Serial-Cable-F/ "USB-Serial-Cable-F"). 34 | 35 | Connect cable as follows: 36 | * blue --> uext pin-2 37 | * green --> uext pin-3 38 | * red --> ext pin-4 39 | 40 | Connect the cable to USB port. You should see the new device in /dev/tty*, for example /dev/ttyUSB0 if you see other update makefile properly. 41 | 42 | To go into bootloader mode, simply hold the big white button on the board, apply power and release the button. 43 | 44 | ### Upload the project 45 | 46 | If you have build the project without errors you can upload the code to ESP8266 with these commands: 47 | 48 | ```shell 49 | make flash 50 | ``` 51 | The upload takes 2 cycles. 52 | 53 | To upload demo webpages go again into bootloader mode and run: 54 | 55 | ```shell 56 | make htmlflash 57 | ``` 58 | 59 | Now everything is complete. 60 | 61 | Use computer with WIFI and scan for WIFI networks the name of ESP8266-EVB WIFI will be ESP_xxxxx where xxxxx is the ESP MAC address. 62 | Then launch browser and type http://192.168.4.1 63 | You will see this home page: 64 | 65 | ![Home page](https://www.olimex.com/Products/IoT/ESP8266-EVB/resources/HOME.png) 66 | 67 | if you click on the RELAY button you will be re-directed to the page: 68 | 69 | ![Home page](https://www.olimex.com/Products/IoT/ESP8266-EVB/resources/RELAY.png) 70 | 71 | on this page you can change on-board RELAY to ON and OFF 72 | 73 | if you click on the BUTTON button you will be re-directed to the page: 74 | 75 | ![Home page](https://www.olimex.com/Products/IoT/ESP8266-EVB/resources/RELAY.png) 76 | 77 | where you can scan the button status. 78 | 79 | This is very basic demo code which can be used as template for your own projects! 80 | 81 | -------------------------------------------------------------------------------- /esphttpd/build/httpd.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/build/httpd.out -------------------------------------------------------------------------------- /esphttpd/build/httpd_app.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/build/httpd_app.a -------------------------------------------------------------------------------- /esphttpd/build/user/button.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/build/user/button.o -------------------------------------------------------------------------------- /esphttpd/build/user/cgii2c.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/build/user/cgii2c.o -------------------------------------------------------------------------------- /esphttpd/build/user/espfs.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/build/user/espfs.o -------------------------------------------------------------------------------- /esphttpd/build/user/heatshrink_decoder.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/build/user/heatshrink_decoder.o -------------------------------------------------------------------------------- /esphttpd/build/user/httpd.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/build/user/httpd.o -------------------------------------------------------------------------------- /esphttpd/build/user/httpdespfs.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/build/user/httpdespfs.o -------------------------------------------------------------------------------- /esphttpd/build/user/io.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/build/user/io.o -------------------------------------------------------------------------------- /esphttpd/build/user/relay.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/build/user/relay.o -------------------------------------------------------------------------------- /esphttpd/build/user/stdout.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/build/user/stdout.o -------------------------------------------------------------------------------- /esphttpd/build/user/user_main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/build/user/user_main.o -------------------------------------------------------------------------------- /esphttpd/driver/i2c/i2c.c: -------------------------------------------------------------------------------- 1 | /* 2 | I2C driver for the ESP8266 3 | Copyright (C) 2014 Rudy Hardeman (zarya) 4 | 5 | This program is free software; you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License along 16 | with this program; if not, write to the Free Software Foundation, Inc., 17 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | #include "ets_sys.h" 20 | #include "osapi.h" 21 | #include "gpio.h" 22 | #include "i2c/i2c.h" 23 | 24 | /** 25 | * Set SDA to state 26 | */ 27 | LOCAL void ICACHE_FLASH_ATTR 28 | i2c_sda(uint8 state) 29 | { 30 | state &= 0x01; 31 | //Set SDA line to state 32 | if (state) 33 | gpio_output_set(1 << I2C_SDA_PIN, 0, 1 << I2C_SDA_PIN, 0); 34 | else 35 | gpio_output_set(0, 1 << I2C_SDA_PIN, 1 << I2C_SDA_PIN, 0); 36 | } 37 | 38 | /** 39 | * Set SCK to state 40 | */ 41 | LOCAL void ICACHE_FLASH_ATTR 42 | i2c_sck(uint8 state) 43 | { 44 | //Set SCK line to state 45 | if (state) 46 | gpio_output_set(1 << I2C_SCK_PIN, 0, 1 << I2C_SCK_PIN, 0); 47 | else 48 | gpio_output_set(0, 1 << I2C_SCK_PIN, 1 << I2C_SCK_PIN, 0); 49 | } 50 | 51 | /** 52 | * I2C init function 53 | * This sets up the GPIO io 54 | */ 55 | void ICACHE_FLASH_ATTR 56 | i2c_init(void) 57 | { 58 | //Disable interrupts 59 | ETS_GPIO_INTR_DISABLE(); 60 | 61 | //Set pin functions 62 | PIN_FUNC_SELECT(I2C_SDA_MUX, I2C_SDA_FUNC); 63 | PIN_FUNC_SELECT(I2C_SCK_MUX, I2C_SCK_FUNC); 64 | 65 | //Set SDA as open drain 66 | GPIO_REG_WRITE( 67 | GPIO_PIN_ADDR(GPIO_ID_PIN(I2C_SDA_PIN)), 68 | GPIO_REG_READ(GPIO_PIN_ADDR(GPIO_ID_PIN(I2C_SDA_PIN))) | 69 | GPIO_PIN_PAD_DRIVER_SET(GPIO_PAD_DRIVER_ENABLE) 70 | ); 71 | 72 | GPIO_REG_WRITE(GPIO_ENABLE_ADDRESS, GPIO_REG_READ(GPIO_ENABLE_ADDRESS) | (1 << I2C_SDA_PIN)); 73 | 74 | //Set SCK as open drain 75 | GPIO_REG_WRITE( 76 | GPIO_PIN_ADDR(GPIO_ID_PIN(I2C_SCK_PIN)), 77 | GPIO_REG_READ(GPIO_PIN_ADDR(GPIO_ID_PIN(I2C_SCK_PIN))) | 78 | GPIO_PIN_PAD_DRIVER_SET(GPIO_PAD_DRIVER_ENABLE) 79 | ); 80 | 81 | GPIO_REG_WRITE(GPIO_ENABLE_ADDRESS, GPIO_REG_READ(GPIO_ENABLE_ADDRESS) | (1 << I2C_SCK_PIN)); 82 | 83 | //Turn interrupt back on 84 | ETS_GPIO_INTR_ENABLE(); 85 | 86 | i2c_sda(1); 87 | i2c_sck(1); 88 | return; 89 | } 90 | 91 | /** 92 | * I2C Start signal 93 | */ 94 | void ICACHE_FLASH_ATTR 95 | i2c_start(void) 96 | { 97 | i2c_sda(1); 98 | i2c_sck(1); 99 | os_delay_us(I2C_SLEEP_TIME); 100 | i2c_sda(0); 101 | os_delay_us(I2C_SLEEP_TIME); 102 | i2c_sck(0); 103 | os_delay_us(I2C_SLEEP_TIME); 104 | } 105 | 106 | /** 107 | * I2C Stop signal 108 | */ 109 | void ICACHE_FLASH_ATTR 110 | i2c_stop(void) 111 | { 112 | os_delay_us(I2C_SLEEP_TIME); 113 | i2c_sck(1); 114 | os_delay_us(I2C_SLEEP_TIME); 115 | i2c_sda(1); 116 | os_delay_us(I2C_SLEEP_TIME); 117 | } 118 | 119 | /** 120 | * Send I2C ACK to the bus 121 | * uint8 state 1 or 0 122 | * 1 for ACK 123 | * 0 for NACK 124 | */ 125 | void ICACHE_FLASH_ATTR 126 | i2c_send_ack(uint8 state) 127 | { 128 | i2c_sck(0); 129 | os_delay_us(I2C_SLEEP_TIME); 130 | //Set SDA 131 | // HIGH for NACK 132 | // LOW for ACK 133 | i2c_sda((state?0:1)); 134 | 135 | //Pulse the SCK 136 | i2c_sck(0); 137 | os_delay_us(I2C_SLEEP_TIME); 138 | i2c_sck(1); 139 | os_delay_us(I2C_SLEEP_TIME); 140 | i2c_sck(0); 141 | os_delay_us(I2C_SLEEP_TIME); 142 | 143 | i2c_sda(1); 144 | os_delay_us(I2C_SLEEP_TIME); 145 | } 146 | 147 | /** 148 | * Receive I2C ACK from the bus 149 | * returns 1 or 0 150 | * 1 for ACK 151 | * 0 for NACK 152 | */ 153 | uint8 ICACHE_FLASH_ATTR 154 | i2c_check_ack(void) 155 | { 156 | uint8 ack; 157 | i2c_sda(1); 158 | os_delay_us(I2C_SLEEP_TIME); 159 | i2c_sck(0); 160 | os_delay_us(I2C_SLEEP_TIME); 161 | i2c_sck(1); 162 | os_delay_us(I2C_SLEEP_TIME); 163 | 164 | //Get SDA pin status 165 | ack = i2c_read(); 166 | 167 | os_delay_us(I2C_SLEEP_TIME); 168 | i2c_sck(0); 169 | os_delay_us(I2C_SLEEP_TIME); 170 | i2c_sda(0); 171 | os_delay_us(I2C_SLEEP_TIME); 172 | 173 | return (ack?0:1); 174 | } 175 | 176 | /** 177 | * Receive byte from the I2C bus 178 | * returns the byte 179 | */ 180 | uint8 ICACHE_FLASH_ATTR 181 | i2c_readByte(void) 182 | { 183 | uint8 data = 0; 184 | uint8 data_bit; 185 | uint8 i; 186 | 187 | i2c_sda(1); 188 | 189 | for (i = 0; i < 8; i++) 190 | { 191 | os_delay_us(I2C_SLEEP_TIME); 192 | i2c_sck(0); 193 | os_delay_us(I2C_SLEEP_TIME); 194 | 195 | i2c_sck(1); 196 | os_delay_us(I2C_SLEEP_TIME); 197 | 198 | data_bit = i2c_read(); 199 | os_delay_us(I2C_SLEEP_TIME); 200 | 201 | data_bit <<= (7 - i); 202 | data |= data_bit; 203 | } 204 | i2c_sck(0); 205 | os_delay_us(I2C_SLEEP_TIME); 206 | 207 | return data; 208 | } 209 | 210 | /** 211 | * Write byte to I2C bus 212 | * uint8 data: to byte to be writen 213 | */ 214 | void ICACHE_FLASH_ATTR 215 | i2c_writeByte(uint8 data) 216 | { 217 | uint8 data_bit; 218 | sint8 i; 219 | 220 | os_delay_us(I2C_SLEEP_TIME); 221 | 222 | for (i = 7; i >= 0; i--) { 223 | data_bit = data >> i; 224 | i2c_sda(data_bit); 225 | os_delay_us(I2C_SLEEP_TIME); 226 | i2c_sck(1); 227 | os_delay_us(I2C_SLEEP_TIME); 228 | i2c_sck(0); 229 | os_delay_us(I2C_SLEEP_TIME); 230 | } 231 | } 232 | -------------------------------------------------------------------------------- /esphttpd/driver/i2c/i2c.h: -------------------------------------------------------------------------------- 1 | #ifndef __I2C_H__ 2 | #define __I2C_H__ 3 | #endif 4 | 5 | /* 6 | I2C driver for the ESP8266 7 | Copyright (C) 2014 Rudy Hardeman (zarya) 8 | 9 | This program is free software; you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation; either version 2 of the License, or 12 | (at your option) any later version. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License along 20 | with this program; if not, write to the Free Software Foundation, Inc., 21 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 22 | */ 23 | 24 | #include "espmissingincludes.h" 25 | #include "ets_sys.h" 26 | #include "osapi.h" 27 | #include "gpio.h" 28 | 29 | #define I2C_SLEEP_TIME 10 30 | 31 | #define I2C_SDA_MUX PERIPHS_IO_MUX_GPIO2_U 32 | #define I2C_SDA_FUNC FUNC_GPIO2 33 | #define I2C_SDA_PIN 2 34 | 35 | #define I2C_SCK_MUX PERIPHS_IO_MUX_GPIO4_U 36 | #define I2C_SCK_FUNC FUNC_GPIO4 37 | #define I2C_SCK_PIN 4 38 | 39 | //SCK on GPIO0 (untested) 40 | //#define I2C_SCK_MUX PERIPHS_IO_MUX_GPIO0_U 41 | //#define I2C_SCK_PIN 0 42 | //#define I2C_SCK_FUNC FUNC_GPIO0 43 | 44 | #define i2c_read() GPIO_INPUT_GET(GPIO_ID_PIN(I2C_SDA_PIN)); 45 | 46 | void i2c_init(void); 47 | void i2c_start(void); 48 | void i2c_stop(void); 49 | void i2c_send_ack(uint8 state); 50 | uint8 i2c_check_ack(void); 51 | uint8 i2c_readByte(void); 52 | void i2c_writeByte(uint8 data); 53 | -------------------------------------------------------------------------------- /esphttpd/driver/spi/spi.h: -------------------------------------------------------------------------------- 1 | #ifndef SPI_APP_H 2 | #define SPI_APP_H 3 | 4 | #include "spi_register.h" 5 | #include "ets_sys.h" 6 | #include "osapi.h" 7 | #include "os_type.h" 8 | 9 | /*SPI number define*/ 10 | #define SPI 0 11 | #define HSPI 1 12 | 13 | 14 | 15 | //lcd drive function 16 | void spi_lcd_mode_init(uint8 spi_no); 17 | void spi_lcd_9bit_write(uint8 spi_no,uint8 high_bit,uint8 low_8bit); 18 | 19 | //spi master init funtion 20 | void spi_master_init(uint8 spi_no); 21 | //use spi send 8bit data 22 | void spi_mast_byte_write(uint8 spi_no,uint8 reg, uint8 value); 23 | 24 | //transmit data to esp8266 slave buffer,which needs 16bit transmission , 25 | //first byte is master command 0x04, second byte is master data 26 | void spi_byte_write_espslave(uint8 spi_no,uint8 data); 27 | //read data from esp8266 slave buffer,which needs 16bit transmission , 28 | //first byte is master command 0x06, second byte is to read slave data 29 | void spi_byte_read_espslave(uint8 spi_no,uint8 *data); 30 | 31 | //esp8266 slave mode initial 32 | void spi_slave_init(uint8 spi_no); 33 | //esp8266 slave isr handle funtion,tiggered when any transmission is finished. 34 | //the function is registered in spi_slave_init. 35 | void spi_slave_isr_handler(void *para); 36 | 37 | 38 | //hspi test function, used to test esp8266 spi slave 39 | void hspi_master_readwrite_repeat(void); 40 | 41 | 42 | void ICACHE_FLASH_ATTR 43 | spi_test_init(void); 44 | 45 | 46 | #endif 47 | 48 | -------------------------------------------------------------------------------- /esphttpd/espfstest/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS=-I../lib/heatshrink -I../user -I../include -std=gnu99 2 | 3 | espfstest: main.o espfs.o heatshrink_decoder.o 4 | $(CC) -o $@ $^ 5 | 6 | espfs.o: espfs.c ../user/espfs.c 7 | 8 | 9 | clean: 10 | rm -f *.o espfstest 11 | -------------------------------------------------------------------------------- /esphttpd/espfstest/espfs.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "../user/espfs.c" 4 | -------------------------------------------------------------------------------- /esphttpd/espfstest/heatshrink_decoder.c: -------------------------------------------------------------------------------- 1 | #include "httpdconfig.h" 2 | #ifdef EFS_HEATSHRINK 3 | //Stupid wrapper so we don't have to move c-files around 4 | //Also loads httpd-specific config. 5 | 6 | #include "../lib/heatshrink/heatshrink_decoder.c" 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /esphttpd/espfstest/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Simple and stupid file decompressor for an espfs image. Mostly used as a testbed for espfs.c and 3 | the decompressors: code compiled natively is way easier to debug using gdb et all :) 4 | */ 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | 15 | #include "espfs.h" 16 | 17 | char *espFsData; 18 | 19 | int main(int argc, char **argv) { 20 | int f, out; 21 | int len; 22 | char buff[128]; 23 | EspFsFile *ef; 24 | off_t size; 25 | 26 | if (argc!=3) { 27 | printf("Usage: %s espfs-image file\nExpands file from the espfs-image archive.\n", argv[0]); 28 | exit(0); 29 | } 30 | 31 | f=open(argv[1], O_RDONLY); 32 | if (f<=0) { 33 | perror(argv[1]); 34 | exit(1); 35 | } 36 | size=lseek(f, 0, SEEK_END); 37 | espFsData=mmap(NULL, size, PROT_READ, MAP_SHARED, f, 0); 38 | if (espFsData==MAP_FAILED) { 39 | perror("mmap"); 40 | exit(1); 41 | } 42 | 43 | ef=espFsOpen(argv[2]); 44 | if (ef==NULL) { 45 | printf("Couldn't find %s in image.\n", argv[2]); 46 | exit(1); 47 | } 48 | 49 | out=open(argv[2], O_WRONLY|O_CREAT|O_TRUNC, 0644); 50 | if (out<=0) { 51 | perror(argv[2]); 52 | exit(1); 53 | } 54 | 55 | while ((len=espFsRead(ef, buff, 128))!=0) { 56 | write(out, buff, len); 57 | } 58 | espFsClose(ef); 59 | //munmap, close, ... I can't be bothered. 60 | } 61 | -------------------------------------------------------------------------------- /esphttpd/firmware/0x00000.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/firmware/0x00000.bin -------------------------------------------------------------------------------- /esphttpd/firmware/0x40000.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/firmware/0x40000.bin -------------------------------------------------------------------------------- /esphttpd/html/ESP8266-EVB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/html/ESP8266-EVB.jpg -------------------------------------------------------------------------------- /esphttpd/html/button.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 41 | 42 | 43 |

Read button state

44 |

ESP8266-EVB has one push button. It can be used as general purpose button as long GPIO0 is 45 | set as input.

46 |

If you hold the button during power-up, then the board will go into loader mode and new firmware can 47 | be uploaded. This could be done using USB-Serial-Cable-F (or MOD-USB-RS232) 48 | connected to UEXT connector.

49 |

What this demo does is constantly to ask the board for the state of the button. If it's not pressed, the 50 | level at the input is logical "1", and if it's pressed - logical "0". This is done with the help of cgi module.

51 |

Go ahead and try it!

52 |
53 |
54 | Button state: 55 | 56 |
57 |
58 | 59 | 60 |
61 | 62 | -------------------------------------------------------------------------------- /esphttpd/html/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |

About ESP8266-DEV

9 |
10 | ESP8266-EVB 11 |
12 |

13 | ESP8266 is very highly integrated SOC which includes Xtensa LX106 core processor, RAM, RF front end and allow WIFI TCP-IP stack to be implemented on board with just few components beside ESP8266. It's very new but promising IC and it attracted lot of attantion and community with it's launch. 14 |

15 | 16 | -------------------------------------------------------------------------------- /esphttpd/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | Esp8266 web server 3 | 4 | 5 | 6 | 16 | 17 | 18 | 19 |
20 |
21 |

22 | www.olimex.com 23 | ESP8266-EVB DEMO PAGE 24 |

25 |
26 | 27 |
28 | 33 |
34 | 35 | -------------------------------------------------------------------------------- /esphttpd/html/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/html/logo.png -------------------------------------------------------------------------------- /esphttpd/html/relay.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 49 | 50 | 51 |

Toggle relay

52 |

ESP8266-EVB has a relay output. It can be used to switch loads, running at 220VAC, up to 10A.

53 |

This could be done by switching GPIO5 on MOD-ESP8266-DEV.

54 |

Go ahead and try it!

55 |
56 |
57 | 58 | 59 |
60 | 61 | -------------------------------------------------------------------------------- /esphttpd/html/style.css: -------------------------------------------------------------------------------- 1 | 2 | * { 3 | font-family: Arial, Helvetica, sans-serif; 4 | font-size: 12px; 5 | line-height: 20px; 6 | overflow: hidden; 7 | } 8 | 9 | .container { 10 | width: 800px; 11 | margin: 0 auto; 12 | border: 1px solid #000000; 13 | overflow: hidden; 14 | } 15 | 16 | .header { 17 | margin: 0; 18 | padding: 10px; 19 | border-bottom: 1px solid #000000; 20 | } 21 | 22 | .logo { 23 | float: left; 24 | } 25 | 26 | .logo img { 27 | vertical-align: middle; 28 | } 29 | 30 | .title { 31 | float: left; 32 | display: table-cell; 33 | vertical-align: middle; 34 | } 35 | 36 | .text { 37 | float: left; 38 | width: 600px; 39 | height: 80%; 40 | margin: 10px; 41 | } 42 | 43 | .menu { 44 | float: left; 45 | margin: 10px; 46 | padding: 0; 47 | width: 150px; 48 | } 49 | 50 | .menu li { 51 | margin: 0; 52 | padding: 0; 53 | list-style-type: none; 54 | margin: 5px 0; 55 | } 56 | 57 | .menu a { 58 | display: block; 59 | width: auto; 60 | padding: 3px 12px 3px 8px; 61 | text-decoration: none; 62 | border: 1px solid #000000; 63 | color: #000000; 64 | } 65 | 66 | .menu a:hover { 67 | background-color: #369; 68 | color: #FFF; 69 | } 70 | 71 | 72 | 73 | span { 74 | display: inline-block; 75 | vertical-align: middle; 76 | font-size: 32; 77 | font-family: Impact,Charcoal,sans-serif; 78 | } 79 | 80 | h1 { 81 | font-size: 18px; 82 | } 83 | 84 | h2 { 85 | font-size: 14px; 86 | } 87 | 88 | p { 89 | text-align: justify; 90 | } 91 | 92 | iframe { 93 | border-style: none; 94 | height: 100%; 95 | width: 100%; 96 | } 97 | 98 | .btn { 99 | font-family: Arial; 100 | color: #000000; 101 | padding: 10px 20px 10px 20px; 102 | border: solid #000000 1px; 103 | text-decoration: none; 104 | background: #ffffff; 105 | margin: 20px; 106 | } 107 | 108 | .btn:hover { 109 | background: beige; 110 | text-decoration: none; 111 | } 112 | 113 | .btn_container { 114 | width: 100%; 115 | display:inline-block; 116 | overflow: auto; 117 | white-space: nowrap; 118 | margin: 0px auto; 119 | text-align: center; 120 | } 121 | 122 | #button-state span { 123 | font-size: 24px; 124 | } -------------------------------------------------------------------------------- /esphttpd/include/espmissingincludes.h: -------------------------------------------------------------------------------- 1 | #ifndef ESPMISSINGINCLUIDES_H 2 | #define ESPMISSINGINCLUIDES_H 3 | 4 | #include 5 | 6 | //Missing function prototypes in include folders. Gcc will warn on these if we don't define 'em anywhere. 7 | //MOST OF THESE ARE GUESSED! but they seem to swork and shut up the compiler. 8 | 9 | int atoi(const char *nptr); 10 | void ets_install_putc1(void *routine); 11 | void ets_isr_attach(int intr, void *handler, void *arg); 12 | void ets_isr_mask(unsigned intr); 13 | void ets_isr_unmask(unsigned intr); 14 | void ets_delay_us(unsigned delay); //SAM 15 | int ets_memcmp(const void *s1, const void *s2, size_t n); 16 | void *ets_memcpy(void *dest, const void *src, size_t n); 17 | void *ets_memset(void *s, int c, size_t n); 18 | int ets_sprintf(char *str, const char *format, ...) __attribute__ ((format (printf, 2, 3))); 19 | int ets_str2macaddr(void *, void *); 20 | int ets_strcmp(const char *s1, const char *s2); 21 | char *ets_strcpy(char *dest, const char *src); 22 | size_t ets_strlen(const char *s); 23 | int ets_strncmp(const char *s1, const char *s2, int len); 24 | char *ets_strncpy(char *dest, const char *src, size_t n); 25 | char *ets_strstr(const char *haystack, const char *needle); 26 | void ets_timer_arm_new(ETSTimer *a, int b, int c, int isMstimer); 27 | void ets_timer_disarm(ETSTimer *a); 28 | void ets_timer_setfn(ETSTimer *t, ETSTimerFunc *fn, void *parg); 29 | int os_printf(const char *format, ...) __attribute__ ((format (printf, 1, 2))); 30 | int os_snprintf(char *str, size_t size, const char *format, ...) __attribute__ ((format (printf, 3, 4))); 31 | void pvPortFree(void *ptr); 32 | void *pvPortMalloc(size_t xWantedSize); 33 | void *pvPortZalloc(size_t); 34 | void uart_div_modify(int no, unsigned int freq); 35 | void vPortFree(void *ptr); 36 | void *vPortMalloc(size_t xWantedSize); 37 | #endif 38 | -------------------------------------------------------------------------------- /esphttpd/include/httpdconfig.h: -------------------------------------------------------------------------------- 1 | 2 | //Define this if you want to be able to use Heatshrink-compressed espfs images. 3 | #define EFS_HEATSHRINK 4 | 5 | //Pos of esp fs in flash 6 | #define ESPFS_POS 0x12000 7 | -------------------------------------------------------------------------------- /esphttpd/include/stdint.h: -------------------------------------------------------------------------------- 1 | 2 | //Including the system-wide stdint.h messes stuff up... but I don't want to change heatshrink 3 | //not to do it. Including this dummy file fixes it too, tho'. 4 | 5 | #ifndef __ets__ 6 | //Do include stdint for testing builds. 7 | #include_next 8 | #endif -------------------------------------------------------------------------------- /esphttpd/include/user_config.h: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /esphttpd/mkespfsimage/Makefile: -------------------------------------------------------------------------------- 1 | 2 | CFLAGS=-I../lib/heatshrink -std=gnu99 3 | OBJS=main.o heatshrink_encoder.o 4 | TARGET=mkespfsimage 5 | 6 | $(TARGET): $(OBJS) 7 | $(CC) -o $@ $^ 8 | 9 | clean: 10 | rm -f $(TARGET) $(OBJS) -------------------------------------------------------------------------------- /esphttpd/mkespfsimage/espfsformat.h: -------------------------------------------------------------------------------- 1 | #ifndef ESPROFSFORMAT_H 2 | #define ESPROFSFORMAT_H 3 | 4 | /* 5 | Stupid cpio-like tool to make read-only 'filesystems' that live on the flash SPI chip of the module. 6 | Can (will) use lzf compression (when I come around to it) to make shit quicker. Aligns names, files, 7 | headers on 4-byte boundaries so the SPI abstraction hardware in the ESP8266 doesn't crap on itself 8 | when trying to do a <4byte or unaligned read. 9 | */ 10 | 11 | /* 12 | The idea 'borrows' from cpio: it's basically a concatenation of {header, filename, file} data. 13 | Header, filename and file data is 32-bit aligned. The last file is indicated by data-less header 14 | with the FLAG_LASTFILE flag set. 15 | */ 16 | 17 | 18 | #define FLAG_LASTFILE (1<<0) 19 | #define COMPRESS_NONE 0 20 | #define COMPRESS_HEATSHRINK 1 21 | 22 | typedef struct { 23 | int32_t magic; 24 | int8_t flags; 25 | int8_t compression; 26 | int16_t nameLen; 27 | int32_t fileLenComp; 28 | int32_t fileLenDecomp; 29 | } __attribute__((packed)) EspFsHeader; 30 | 31 | #endif -------------------------------------------------------------------------------- /esphttpd/mkespfsimage/heatshrink_encoder.c: -------------------------------------------------------------------------------- 1 | //Stupid wraparound include to make sure object file doesn't end up in heatshrink dir 2 | 3 | #include "../lib/heatshrink/heatshrink_encoder.c" 4 | -------------------------------------------------------------------------------- /esphttpd/mkespfsimage/heatshrink_encoder.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/mkespfsimage/heatshrink_encoder.o -------------------------------------------------------------------------------- /esphttpd/mkespfsimage/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "espfsformat.h" 12 | 13 | //Heatshrink 14 | #include "heatshrink_common.h" 15 | #include "heatshrink_config.h" 16 | #include "heatshrink_encoder.h" 17 | 18 | 19 | //Routines to convert host format to the endianness used in the xtensa 20 | short htoxs(short in) { 21 | char r[2]; 22 | r[0]=in; 23 | r[1]=in>>8; 24 | return *((short *)r); 25 | } 26 | 27 | int htoxl(int in) { 28 | unsigned char r[4]; 29 | r[0]=in; 30 | r[1]=in>>8; 31 | r[2]=in>>16; 32 | r[3]=in>>24; 33 | return *((int *)r); 34 | } 35 | 36 | size_t compressHeatshrink(char *in, int insize, char *out, int outsize, int level) { 37 | char *inp=in; 38 | char *outp=out; 39 | int len; 40 | int ws[]={5, 6, 8, 11, 13}; 41 | int ls[]={3, 3, 4, 4, 4}; 42 | HSE_poll_res pres; 43 | HSE_sink_res sres; 44 | size_t r; 45 | if (level==-1) level=8; 46 | level=(level-1)/2; //level is now 0, 1, 2, 3, 4 47 | heatshrink_encoder *enc=heatshrink_encoder_alloc(ws[level], ls[level]); 48 | if (enc==NULL) { 49 | perror("allocating mem for heatshrink"); 50 | exit(1); 51 | } 52 | //Save encoder parms as first byte 53 | *outp=(ws[level]<<4)|ls[level]; 54 | outp++; outsize--; 55 | 56 | r=1; 57 | do { 58 | if (insize>0) { 59 | sres=heatshrink_encoder_sink(enc, inp, insize, &len); 60 | if (sres!=HSER_SINK_OK) break; 61 | inp+=len; insize-=len; 62 | if (insize==0) heatshrink_encoder_finish(enc); 63 | } 64 | do { 65 | pres=heatshrink_encoder_poll(enc, outp, outsize, &len); 66 | if (pres!=HSER_POLL_MORE && pres!=HSER_POLL_EMPTY) break; 67 | outp+=len; outsize-=len; 68 | r+=len; 69 | } while (pres==HSER_POLL_MORE); 70 | } while (insize!=0); 71 | 72 | if (insize!=0) { 73 | fprintf(stderr, "Heatshrink: Bug? insize is still %d. sres=%d pres=%d\n", insize, sres, pres); 74 | exit(1); 75 | } 76 | 77 | heatshrink_encoder_free(enc); 78 | return r; 79 | } 80 | 81 | int handleFile(int f, char *name, int compression, int level) { 82 | char *fdat, *cdat; 83 | off_t size, csize; 84 | EspFsHeader h; 85 | int nameLen; 86 | size=lseek(f, 0, SEEK_END); 87 | fdat=mmap(NULL, size, PROT_READ, MAP_SHARED, f, 0); 88 | if (fdat==MAP_FAILED) { 89 | perror("mmap"); 90 | return 0; 91 | } 92 | 93 | if (compression==COMPRESS_NONE) { 94 | csize=size; 95 | cdat=fdat; 96 | } else if (compression==COMPRESS_HEATSHRINK) { 97 | cdat=malloc(size*2); 98 | csize=compressHeatshrink(fdat, size, cdat, size*2, level); 99 | } else { 100 | fprintf(stderr, "Unknown compression - %d\n", compression); 101 | exit(1); 102 | } 103 | 104 | if (csize>size) { 105 | //Compressing enbiggened this file. Revert to uncompressed store. 106 | compression=COMPRESS_NONE; 107 | csize=size; 108 | cdat=fdat; 109 | } 110 | 111 | //Fill header data 112 | h.magic=('E'<<0)+('S'<<8)+('f'<<16)+('s'<<24); 113 | h.flags=0; 114 | h.compression=compression; 115 | nameLen=strlen(name)+1; 116 | if (nameLen&3) nameLen+=4-(nameLen&3); //Round to next 32bit boundary 117 | h.nameLen=htoxs(nameLen); 118 | h.fileLenComp=htoxl(csize); 119 | h.fileLenDecomp=htoxl(size); 120 | 121 | write(1, &h, sizeof(EspFsHeader)); 122 | write(1, name, nameLen); //ToDo: this can eat up a few bytes after the buffer. 123 | write(1, cdat, csize); 124 | //Pad out to 32bit boundary 125 | while (csize&3) { 126 | write(1, "\000", 1); 127 | csize++; 128 | } 129 | munmap(fdat, size); 130 | return (csize*100)/size; 131 | } 132 | 133 | //Write final dummy header with FLAG_LASTFILE set. 134 | void finishArchive() { 135 | EspFsHeader h; 136 | h.magic=('E'<<0)+('S'<<8)+('f'<<16)+('s'<<24); 137 | h.flags=FLAG_LASTFILE; 138 | h.compression=COMPRESS_NONE; 139 | h.nameLen=htoxs(0); 140 | h.fileLenComp=htoxl(0); 141 | h.fileLenDecomp=htoxl(0); 142 | write(1, &h, sizeof(EspFsHeader)); 143 | } 144 | 145 | 146 | int main(int argc, char **argv) { 147 | int f, x; 148 | char fileName[1024]; 149 | char *realName; 150 | struct stat statBuf; 151 | int serr; 152 | int rate; 153 | int err=0; 154 | int compType=1; //default compression type - heatshrink 155 | int compLvl=-1; 156 | 157 | for (x=1; x=x-2) { 159 | compType=atoi(argv[x=1]); 160 | x++; 161 | } else if (strcmp(argv[x], "-l")==0 && argc>=x-2) { 162 | compLvl=atoi(argv[x=1]); 163 | if (compLvl<1 || compLvl>9) err=1; 164 | x++; 165 | } else { 166 | err=1; 167 | } 168 | } 169 | 170 | if (err) { 171 | fprintf(stderr, "%s - Program to create espfs images\n", argv[0]); 172 | fprintf(stderr, "Usage: \nfind | %s [-c compressor] [-l compression_level] > out.espfs\n", argv[0]); 173 | fprintf(stderr, "Compressors:\n0 - None\n1 - Heatshrink(defautl\n"); 174 | fprintf(stderr, "Compression level: 1 is worst but low RAM usage, higher is better compression \nbut uses more ram on decompression. -1 = compressors default.\n"); 175 | exit(0); 176 | } 177 | 178 | while(fgets(fileName, sizeof(fileName), stdin)) { 179 | //Kill off '\n' at the end 180 | fileName[strlen(fileName)-1]=0; 181 | //Only include files 182 | serr=stat(fileName, &statBuf); 183 | if ((serr==0) && S_ISREG(statBuf.st_mode)) { 184 | //Strip off './' or '/' madness. 185 | realName=fileName; 186 | if (fileName[0]=='.') realName++; 187 | if (realName[0]=='/') realName++; 188 | f=open(fileName, O_RDONLY); 189 | if (f>0) { 190 | rate=handleFile(f, realName, compType, compLvl); 191 | fprintf(stderr, "%s (%d%%)\n", realName, rate); 192 | close(f); 193 | } else { 194 | perror(fileName); 195 | } 196 | } else { 197 | if (serr!=0) { 198 | perror(fileName); 199 | } 200 | } 201 | } 202 | finishArchive(); 203 | return 0; 204 | } 205 | 206 | -------------------------------------------------------------------------------- /esphttpd/mkespfsimage/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/mkespfsimage/main.o -------------------------------------------------------------------------------- /esphttpd/mkespfsimage/mkespfsimage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/mkespfsimage/mkespfsimage -------------------------------------------------------------------------------- /esphttpd/user/button.c: -------------------------------------------------------------------------------- 1 | /* 2 | Some random cgi routines. 3 | */ 4 | 5 | /* 6 | * ---------------------------------------------------------------------------- 7 | * "THE BEER-WARE LICENSE" (Revision 42): 8 | * Jeroen Domburg wrote this file. As long as you retain 9 | * this notice you can do whatever you want with this stuff. If we meet some day, 10 | * and you think this stuff is worth it, you can buy me a beer in return. 11 | * ---------------------------------------------------------------------------- 12 | */ 13 | 14 | 15 | #include 16 | #include 17 | #include "user_interface.h" 18 | #include "mem.h" 19 | #include "httpd.h" 20 | #include "io.h" 21 | #include "gpio.h" 22 | #include "espmissingincludes.h" 23 | 24 | //Cgi that turns the LED on or off according to the 'led' param in the POST data 25 | int ICACHE_FLASH_ATTR cgiButton(HttpdConnData *connData) { 26 | int len; 27 | char buff[1024]; 28 | 29 | if (connData->conn==NULL) { 30 | //Connection aborted. Clean up. 31 | return HTTPD_CGI_DONE; 32 | } 33 | 34 | httpdStartResponse(connData, 200); 35 | httpdHeader(connData, "Content-Type", "application/json"); 36 | httpdEndHeaders(connData); 37 | 38 | /* This will return JSON: 39 | * {"button": 40 | * {"status":"on"} 41 | * } 42 | */ 43 | len = os_sprintf(buff, "{\n \"button\": { \n\"status\":\"%s\"\n}\n}\n", (GPIO_INPUT_GET(0)) ? "off" : "on"); 44 | espconn_sent(connData->conn, (uint8 *)buff, len); 45 | 46 | return HTTPD_CGI_DONE; 47 | } 48 | -------------------------------------------------------------------------------- /esphttpd/user/button.h: -------------------------------------------------------------------------------- 1 | #ifndef BUTTON_H 2 | #define BUTTON_H 3 | 4 | #include "httpd.h" 5 | 6 | int cgiButton(HttpdConnData *connData); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /esphttpd/user/cgii2c.c: -------------------------------------------------------------------------------- 1 | /* 2 | Some random cgi routines. 3 | */ 4 | 5 | /* 6 | * ---------------------------------------------------------------------------- 7 | * "THE BEER-WARE LICENSE" (Revision 42): 8 | * Jeroen Domburg wrote this file. As long as you retain 9 | * this notice you can do whatever you want with this stuff. If we meet some day, 10 | * and you think this stuff is worth it, you can buy me a beer in return. 11 | * ---------------------------------------------------------------------------- 12 | */ 13 | 14 | 15 | #include 16 | #include 17 | #include "user_interface.h" 18 | #include "mem.h" 19 | #include "httpd.h" 20 | #include "io.h" 21 | #include "gpio.h" 22 | #include "i2c/i2c.h" 23 | #include "espmissingincludes.h" 24 | 25 | //Cgi that turns the LED on or off according to the 'led' param in the POST data 26 | int ICACHE_FLASH_ATTR cgiI2C(HttpdConnData *connData) { 27 | 28 | if (connData->conn==NULL) { 29 | //Connection aborted. Clean up. 30 | return HTTPD_CGI_DONE; 31 | } 32 | 33 | return HTTPD_CGI_DONE; 34 | } 35 | -------------------------------------------------------------------------------- /esphttpd/user/cgii2c.h: -------------------------------------------------------------------------------- 1 | #ifndef I2C_H 2 | #define I2C_H 3 | 4 | #include "httpd.h" 5 | 6 | int cgiI2C(HttpdConnData *connData); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /esphttpd/user/espfs.h: -------------------------------------------------------------------------------- 1 | #ifndef ESPFS_H 2 | #define ESPFS_H 3 | 4 | 5 | 6 | typedef struct EspFsFile EspFsFile; 7 | 8 | EspFsFile *espFsOpen(char *fileName); 9 | int espFsRead(EspFsFile *fh, char *buff, int len); 10 | void espFsClose(EspFsFile *fh); 11 | 12 | 13 | #endif -------------------------------------------------------------------------------- /esphttpd/user/heatshrink_config_httpd.h: -------------------------------------------------------------------------------- 1 | //Heatshrink config for the decompressor. 2 | #ifndef HEATSHRINK_CONFIG_H 3 | #define HEATSHRINK_CONFIG_H 4 | 5 | /* Should functionality assuming dynamic allocation be used? */ 6 | #define HEATSHRINK_DYNAMIC_ALLOC 1 7 | 8 | #if HEATSHRINK_DYNAMIC_ALLOC 9 | /* Optional replacement of malloc/free */ 10 | #define HEATSHRINK_MALLOC(SZ) os_malloc(SZ) 11 | #define HEATSHRINK_FREE(P, SZ) os_free(P) 12 | #else 13 | /* Required parameters for static configuration */ 14 | #define HEATSHRINK_STATIC_INPUT_BUFFER_SIZE 32 15 | #define HEATSHRINK_STATIC_WINDOW_BITS 8 16 | #define HEATSHRINK_STATIC_LOOKAHEAD_BITS 4 17 | #endif 18 | 19 | /* Turn on logging for debugging. */ 20 | #define HEATSHRINK_DEBUGGING_LOGS 0 21 | 22 | /* Use indexing for faster compression. (This requires additional space.) */ 23 | #define HEATSHRINK_USE_INDEX 1 24 | 25 | #endif 26 | 27 | -------------------------------------------------------------------------------- /esphttpd/user/heatshrink_decoder.c: -------------------------------------------------------------------------------- 1 | #include "httpdconfig.h" 2 | #ifdef EFS_HEATSHRINK 3 | //Stupid wrapper so we don't have to move c-files around 4 | //Also loads httpd-specific config. 5 | 6 | #define _STDLIB_H_ 7 | #define _STRING_H_ 8 | #define _STDDEF_H 9 | #define _STDINT_H 10 | 11 | #include "espmissingincludes.h" 12 | #include "c_types.h" 13 | #include "mem.h" 14 | #include "osapi.h" 15 | #include "heatshrink_config_httpd.h" 16 | #define malloc(x) os_malloc(x) 17 | #define memset(x,y,z) os_memset(x,y,z) 18 | #define memcpy(x,y,z) os_memcpy(x,y,z) 19 | #include "../lib/heatshrink/heatshrink_decoder.c" 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /esphttpd/user/httpd.h: -------------------------------------------------------------------------------- 1 | #ifndef HTTPD_H 2 | #define HTTPD_H 3 | #include 4 | #include 5 | #include 6 | 7 | #define HTTPD_CGI_MORE 0 8 | #define HTTPD_CGI_DONE 1 9 | #define HTTPD_CGI_NOTFOUND 2 10 | 11 | typedef struct HttpdPriv HttpdPriv; 12 | typedef struct HttpdConnData HttpdConnData; 13 | 14 | typedef int (* cgiSendCallback)(HttpdConnData *connData); 15 | 16 | //A struct describing a http connection. This gets passed to cgi functions. 17 | struct HttpdConnData { 18 | struct espconn *conn; 19 | char *url; 20 | char *getArgs; 21 | const void *cgiArg; 22 | void *cgiData; 23 | HttpdPriv *priv; 24 | cgiSendCallback cgi; 25 | int postLen; 26 | char *postBuff; 27 | }; 28 | 29 | //A struct describing an url. This is the main struct that's used to send different URL requests to 30 | //different routines. 31 | typedef struct { 32 | const char *url; 33 | cgiSendCallback cgiCb; 34 | const void *cgiArg; 35 | } HttpdBuiltInUrl; 36 | 37 | int ICACHE_FLASH_ATTR cgiRedirect(HttpdConnData *connData); 38 | void ICACHE_FLASH_ATTR httpdRedirect(HttpdConnData *conn, char *newUrl); 39 | int httpdUrlDecode(char *val, int valLen, char *ret, int retLen); 40 | int ICACHE_FLASH_ATTR httpdFindArg(char *line, char *arg, char *buff, int buffLen); 41 | void ICACHE_FLASH_ATTR httpdInit(HttpdBuiltInUrl *fixedUrls, int port); 42 | const char *httpdGetMimetype(char *url); 43 | void ICACHE_FLASH_ATTR httpdStartResponse(HttpdConnData *conn, int code); 44 | void ICACHE_FLASH_ATTR httpdHeader(HttpdConnData *conn, const char *field, const char *val); 45 | void ICACHE_FLASH_ATTR httpdEndHeaders(HttpdConnData *conn); 46 | 47 | #endif -------------------------------------------------------------------------------- /esphttpd/user/httpdespfs.c: -------------------------------------------------------------------------------- 1 | /* 2 | Connector to let httpd use the espfs filesystem to serve the files in that. 3 | */ 4 | 5 | /* 6 | * ---------------------------------------------------------------------------- 7 | * "THE BEER-WARE LICENSE" (Revision 42): 8 | * Jeroen Domburg wrote this file. As long as you retain 9 | * this notice you can do whatever you want with this stuff. If we meet some day, 10 | * and you think this stuff is worth it, you can buy me a beer in return. 11 | * ---------------------------------------------------------------------------- 12 | */ 13 | 14 | #include "espmissingincludes.h" 15 | #include 16 | #include 17 | #include "c_types.h" 18 | #include "user_interface.h" 19 | #include "espconn.h" 20 | #include "mem.h" 21 | 22 | #include "httpd.h" 23 | #include "espfs.h" 24 | #include "httpdespfs.h" 25 | 26 | 27 | //This is a catch-all cgi function. It takes the url passed to it, looks up the corresponding 28 | //path in the filesystem and if it exists, passes the file through. This simulates what a normal 29 | //webserver would do with static files. 30 | int ICACHE_FLASH_ATTR cgiEspFsHook(HttpdConnData *connData) { 31 | EspFsFile *file=connData->cgiData; 32 | int len; 33 | char buff[1024]; 34 | 35 | if (connData->conn==NULL) { 36 | //Connection aborted. Clean up. 37 | espFsClose(file); 38 | return HTTPD_CGI_DONE; 39 | } 40 | 41 | if (file==NULL) { 42 | //First call to this cgi. Open the file so we can read it. 43 | file=espFsOpen(connData->url); 44 | if (file==NULL) { 45 | return HTTPD_CGI_NOTFOUND; 46 | } 47 | connData->cgiData=file; 48 | httpdStartResponse(connData, 200); 49 | httpdHeader(connData, "Content-Type", httpdGetMimetype(connData->url)); 50 | httpdEndHeaders(connData); 51 | return HTTPD_CGI_MORE; 52 | } 53 | 54 | len=espFsRead(file, buff, 1024); 55 | if (len>0) espconn_sent(connData->conn, (uint8 *)buff, len); 56 | if (len!=1024) { 57 | //We're done. 58 | espFsClose(file); 59 | return HTTPD_CGI_DONE; 60 | } else { 61 | //Ok, till next time. 62 | return HTTPD_CGI_MORE; 63 | } 64 | } 65 | 66 | 67 | //cgiEspFsTemplate can be used as a template. 68 | 69 | typedef struct { 70 | EspFsFile *file; 71 | void *tplArg; 72 | char token[64]; 73 | int tokenPos; 74 | } TplData; 75 | 76 | typedef void (* TplCallback)(HttpdConnData *connData, char *token, void **arg); 77 | 78 | int ICACHE_FLASH_ATTR cgiEspFsTemplate(HttpdConnData *connData) { 79 | TplData *tpd=connData->cgiData; 80 | int len; 81 | int x, sp=0; 82 | char *e=NULL; 83 | char buff[1025]; 84 | 85 | if (connData->conn==NULL) { 86 | //Connection aborted. Clean up. 87 | ((TplCallback)(connData->cgiArg))(connData, NULL, &tpd->tplArg); 88 | espFsClose(tpd->file); 89 | os_free(tpd); 90 | return HTTPD_CGI_DONE; 91 | } 92 | 93 | if (tpd==NULL) { 94 | //First call to this cgi. Open the file so we can read it. 95 | tpd=(TplData *)os_malloc(sizeof(TplData)); 96 | tpd->file=espFsOpen(connData->url); 97 | tpd->tplArg=NULL; 98 | tpd->tokenPos=-1; 99 | if (tpd->file==NULL) { 100 | return HTTPD_CGI_NOTFOUND; 101 | } 102 | connData->cgiData=tpd; 103 | httpdStartResponse(connData, 200); 104 | httpdHeader(connData, "Content-Type", httpdGetMimetype(connData->url)); 105 | httpdEndHeaders(connData); 106 | return HTTPD_CGI_MORE; 107 | } 108 | 109 | len=espFsRead(tpd->file, buff, 1024); 110 | if (len>0) { 111 | sp=0; 112 | e=buff; 113 | for (x=0; xtokenPos==-1) { 115 | //Inside ordinary text. 116 | if (buff[x]=='%') { 117 | //Send raw data up to now 118 | if (sp!=0) espconn_sent(connData->conn, (uint8 *)e, sp); 119 | sp=0; 120 | //Go collect token chars. 121 | tpd->tokenPos=0; 122 | } else { 123 | sp++; 124 | } 125 | } else { 126 | if (buff[x]=='%') { 127 | tpd->token[tpd->tokenPos++]=0; //zero-terminate token 128 | ((TplCallback)(connData->cgiArg))(connData, tpd->token, &tpd->tplArg); 129 | //Go collect normal chars again. 130 | e=&buff[x+1]; 131 | tpd->tokenPos=-1; 132 | } else { 133 | if (tpd->tokenPos<(sizeof(tpd->token)-1)) tpd->token[tpd->tokenPos++]=buff[x]; 134 | } 135 | } 136 | } 137 | } 138 | //Send remaining bit. 139 | if (sp!=0) espconn_sent(connData->conn, (uint8 *)e, sp); 140 | if (len!=1024) { 141 | //We're done. 142 | ((TplCallback)(connData->cgiArg))(connData, NULL, &tpd->tplArg); 143 | espFsClose(tpd->file); 144 | return HTTPD_CGI_DONE; 145 | } else { 146 | //Ok, till next time. 147 | return HTTPD_CGI_MORE; 148 | } 149 | } 150 | 151 | -------------------------------------------------------------------------------- /esphttpd/user/httpdespfs.h: -------------------------------------------------------------------------------- 1 | #ifndef HTTPDESPFS_H 2 | #define HTTPDESPFS_H 3 | 4 | #include "httpd.h" 5 | #include "espfs.h" 6 | 7 | int cgiEspFsHook(HttpdConnData *connData); 8 | int ICACHE_FLASH_ATTR cgiEspFsTemplate(HttpdConnData *connData); 9 | 10 | #endif -------------------------------------------------------------------------------- /esphttpd/user/io.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * ---------------------------------------------------------------------------- 4 | * "THE BEER-WARE LICENSE" (Revision 42): 5 | * Jeroen Domburg wrote this file. As long as you retain 6 | * this notice you can do whatever you want with this stuff. If we meet some day, 7 | * and you think this stuff is worth it, you can buy me a beer in return. 8 | * ---------------------------------------------------------------------------- 9 | */ 10 | 11 | 12 | #include "espmissingincludes.h" 13 | #include "c_types.h" 14 | #include "user_interface.h" 15 | #include "espconn.h" 16 | #include "mem.h" 17 | #include "osapi.h" 18 | #include "gpio.h" 19 | 20 | 21 | #define BTNGPIO 0 22 | 23 | 24 | void ioInit() { 25 | PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0); 26 | gpio_output_set(0, 0, 0, (1< wrote this file. As long as you retain 9 | * this notice you can do whatever you want with this stuff. If we meet some day, 10 | * and you think this stuff is worth it, you can buy me a beer in return. 11 | * ---------------------------------------------------------------------------- 12 | */ 13 | 14 | 15 | #include 16 | #include 17 | #include "user_interface.h" 18 | #include "mem.h" 19 | #include "httpd.h" 20 | #include "io.h" 21 | #include "gpio.h" 22 | #include "espmissingincludes.h" 23 | 24 | void ICACHE_FLASH_ATTR ioRelay(int value) { 25 | if(value) { 26 | gpio_output_set((1<<5), 0, (1<<5), 0); 27 | } else { 28 | gpio_output_set(0, (1<<5), (1<<5), 0); 29 | } 30 | } 31 | 32 | int ICACHE_FLASH_ATTR cgiRelay(HttpdConnData *connData) { 33 | int len; 34 | char buff[1024]; 35 | 36 | if (connData->conn==NULL) { 37 | //Connection aborted. Clean up. 38 | return HTTPD_CGI_DONE; 39 | } 40 | 41 | os_printf("POST_DATA: %s\n", connData->postBuff); 42 | 43 | len=httpdFindArg(connData->postBuff, "relay", buff, sizeof(buff)); 44 | if (len != 0) { 45 | ioRelay(atoi(buff)); 46 | } 47 | 48 | httpdStartResponse(connData, 200); 49 | httpdHeader(connData, "Content-Type", "application/json"); 50 | httpdEndHeaders(connData); 51 | 52 | /* This will return JSON: 53 | * {"relay": 54 | * {"status":"ok"} 55 | * } 56 | */ 57 | len = os_sprintf(buff, "{\n \"relay\": { \n\"status\":\"ok\"\n}\n}\n"); 58 | espconn_sent(connData->conn, (uint8 *)buff, len); 59 | 60 | return HTTPD_CGI_DONE; 61 | } 62 | -------------------------------------------------------------------------------- /esphttpd/user/relay.h: -------------------------------------------------------------------------------- 1 | #ifndef RELAY_H 2 | #define RELAY_H 3 | 4 | #include "httpd.h" 5 | 6 | int cgiRelay(HttpdConnData *connData); 7 | void ICACHE_FLASH_ATTR ioRelay(int value); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /esphttpd/user/stdout.c: -------------------------------------------------------------------------------- 1 | //Stupid bit of code that does the bare minimum to make os_printf work. 2 | 3 | /* 4 | * ---------------------------------------------------------------------------- 5 | * "THE BEER-WARE LICENSE" (Revision 42): 6 | * Jeroen Domburg wrote this file. As long as you retain 7 | * this notice you can do whatever you want with this stuff. If we meet some day, 8 | * and you think this stuff is worth it, you can buy me a beer in return. 9 | * ---------------------------------------------------------------------------- 10 | */ 11 | 12 | 13 | #include "espmissingincludes.h" 14 | #include "ets_sys.h" 15 | #include "osapi.h" 16 | #include "uart_hw.h" 17 | 18 | static void ICACHE_FLASH_ATTR stdoutUartTxd(char c) { 19 | //Wait until there is room in the FIFO 20 | while (((READ_PERI_REG(UART_STATUS(0))>>UART_TXFIFO_CNT_S)&UART_TXFIFO_CNT)>=126) ; 21 | //Send the character 22 | WRITE_PERI_REG(UART_FIFO(0), c); 23 | } 24 | 25 | static void ICACHE_FLASH_ATTR stdoutPutchar(char c) { 26 | //convert \n -> \r\n 27 | if (c=='\n') stdoutUartTxd('\r'); 28 | stdoutUartTxd(c); 29 | } 30 | 31 | 32 | void stdoutInit() { 33 | //Enable TxD pin 34 | PIN_PULLUP_DIS(PERIPHS_IO_MUX_U0TXD_U); 35 | PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0TXD_U, FUNC_U0TXD); 36 | 37 | //Set baud rate and other serial parameters to 115200,n,8,1 38 | uart_div_modify(0, UART_CLK_FREQ/BIT_RATE_115200); 39 | WRITE_PERI_REG(UART_CONF0(0), (STICK_PARITY_DIS)|(ONE_STOP_BIT << UART_STOP_BIT_NUM_S)| \ 40 | (EIGHT_BITS << UART_BIT_NUM_S)); 41 | 42 | //Reset tx & rx fifo 43 | SET_PERI_REG_MASK(UART_CONF0(0), UART_RXFIFO_RST|UART_TXFIFO_RST); 44 | CLEAR_PERI_REG_MASK(UART_CONF0(0), UART_RXFIFO_RST|UART_TXFIFO_RST); 45 | //Clear pending interrupts 46 | WRITE_PERI_REG(UART_INT_CLR(0), 0xffff); 47 | 48 | //Install our own putchar handler 49 | os_install_putc1((void *)stdoutPutchar); 50 | } -------------------------------------------------------------------------------- /esphttpd/user/stdout.h: -------------------------------------------------------------------------------- 1 | void stdoutInit(); 2 | -------------------------------------------------------------------------------- /esphttpd/user/user_main.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* 4 | * ---------------------------------------------------------------------------- 5 | * "THE BEER-WARE LICENSE" (Revision 42): 6 | * Jeroen Domburg wrote this file. As long as you retain 7 | * this notice you can do whatever you want with this stuff. If we meet some day, 8 | * and you think this stuff is worth it, you can buy me a beer in return. 9 | * ---------------------------------------------------------------------------- 10 | */ 11 | 12 | 13 | #include "espmissingincludes.h" 14 | #include "ets_sys.h" 15 | #include "i2c/i2c.h" 16 | #include "osapi.h" 17 | #include "httpd.h" 18 | #include "io.h" 19 | #include "httpdespfs.h" 20 | #include "button.h" 21 | #include "relay.h" 22 | #include "stdout.h" 23 | //#include "cgii2c.h" 24 | // 25 | //#include "i2c/i2c.h" 26 | //#include "spi/spi.h" 27 | 28 | HttpdBuiltInUrl builtInUrls[]={ 29 | {"/", cgiRedirect, "/index.html"}, 30 | {"/button.cgi", cgiButton, NULL}, 31 | {"/relay.cgi", cgiRelay, NULL}, 32 | {"*", cgiEspFsHook, NULL}, //Catch-all cgi function for the filesystem 33 | {NULL, NULL, NULL} 34 | }; 35 | 36 | 37 | 38 | void user_init(void) { 39 | stdoutInit(); 40 | ioInit(); 41 | httpdInit(builtInUrls, 80); 42 | os_printf("Ready!\n"); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /esphttpd/webpages.espfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OLIMEX/ESP8266/c8eb5c073649f70807d593dbbd02f881bbaf5235/esphttpd/webpages.espfs --------------------------------------------------------------------------------