From fe4f565fe83f05e402cc8d8ca3ceefbc39692a1f Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Wed, 3 Jan 2018 16:45:29 -0800 Subject: [PATCH 01/14] Mention how to use Ivan Grokhotkov's esptool (#337) The native esptool available with a simple `apt-get install esptool` on Debian/Ubuntu and probably other distros can be used as well. Document the flags here. --- FLASHING.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/FLASHING.md b/FLASHING.md index 1380ccf7..c8d3c7ef 100644 --- a/FLASHING.md +++ b/FLASHING.md @@ -100,6 +100,16 @@ flash modules. Note the different address for esp_init_data_default.bin and blan For __8Mbit / 1MByte__ modules the addresses are 0xFC000 and 0xFE000. +Debian, and probably other Linux distributions, come with a different esptool. It is similar, +but all the flags are different. Here is an example of flashing an **ESP-01S** which has 1M of flash using +``` +esptool -cp /dev/ttyUSB0 -cb 460800 -cd none -bz 1M\ + -ca 0x00000 -cf boot_v1.7.bin\ + -ca 0x01000 -cf user1.bin\ + -ca 0xFC000 -cf esp_init_data_default.bin\ + -ca 0xFE000 -cf blank.bin +``` + __Warning__: there is a bug in boot_v1.5.bin which causes it to only boot into user1 once. If that fails it gets stuck trying to boot into user2. If this happens (can be seen in the boot output on uart2 at 76600 baud) reflash just blank.bin at 0x7E000 (4Mbit module). (Sigh) From d189a1b3fa07d1299739842e4e5692df99234c12 Mon Sep 17 00:00:00 2001 From: Fabio Date: Fri, 2 Aug 2019 08:15:37 +0200 Subject: [PATCH 02/14] Cross compatibility script to upload ATmega2560 (#457) -> Issue #456 -> Works with python 2 & 3 -> Works on Linux & Windows --- flash2560.py | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 flash2560.py diff --git a/flash2560.py b/flash2560.py new file mode 100644 index 00000000..f47eb82f --- /dev/null +++ b/flash2560.py @@ -0,0 +1,105 @@ +#!/usr/bin/python3 +# Created by Fabio Manz (30.7.2019) + +import sys +import re +import requests +import platform # For getting the operating system name +import subprocess # For executing a shell command +import os +import time + +ip_regex = "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$" + + +def main(argv): + print("--- flash2560 - Created by Fabio Manz ---") + + hostname = "192.168.4.1" + input_file = "none" + + # Handle the command line arguments + for index, arg in enumerate(argv): + if arg == "-h" or arg == "--help": + print_help() + sys.exit(0) + elif arg == "-H" or arg == "--hostname": + if index + 1 < len(argv) and re.search(ip_regex, argv[index + 1]): + hostname = argv[index + 1] + if not ping(hostname): + print("IP is not reachable:") + sys.exit(2) + else: + print("IP address is not right") + print_help() + sys.exit(1) + elif arg == "-f" or arg == "--file": + if index + 1 < len(argv) and os.path.isfile(argv[index + 1]): + input_file = argv[index + 1] + else: + print("Can't open file") + print_help() + sys.exit(3) + + if input_file == "none": + print("No input file") + print_help() + sys.exit(4) + + response = requests.post('http://' + hostname + '/pgmmega/sync') + + # ------------ GET AVR in SYNC ---------------------------------------- + + if response.status_code != 204: + print("Failed to reset the AVR (HTML ERROR: " + response.status_code + ")") + sys.exit(5) + + while True: + response = requests.get('http://' + hostname + '/pgmmega/sync') + + if "SYNC" in response.content.decode('ASCII'): + print(response.content) + break + elif "NOT READY" not in response.content.decode('ASCII'): + print("Could not get in Sync with AVR") + sys.exit(7) + + time.sleep(0.1) + + # -------------- Upload HEX file ----------------------------------------- + + hex_file = open(input_file).read() + + response = requests.post('http://' + hostname + '/pgmmega/upload', data=hex_file, timeout=20.0) + + if "Success" in response.content.decode('ASCII'): + print("+++++ Success :) ++++++") + else: + print("Failed :(") + sys.exit(8) + + # Reset the avr to solve a bug in the bootloader that the program dows not start immediately + time.sleep(0.1) + requests.post('http://' + hostname + '/console/reset') + + sys.exit(0) + + +def print_help(): + print('\n') + print("Usage: ") + print("flash2560.py -H -f ") + print("\nExample:") + print("flash2560.py -H 192.168.4.1 -f Sketch.hex") + + +def ping(host): + param = '-n' if platform.system().lower() == 'windows' else '-c' + + command = ['ping', param, '1', host] + output = open(os.devnull, 'w') + return subprocess.call(command, stdout=output) == 0 + + +if __name__ == "__main__": + main(sys.argv[1:]) From 03bea3dd2dcaa194973d6b9b7957f976c7b31fcd Mon Sep 17 00:00:00 2001 From: Bartlomiej Zimon Date: Sat, 29 Jul 2017 19:21:17 +0200 Subject: [PATCH 03/14] fix version [me@here esp-link]$ git describe --tags --match 'v*.0' --long --dirty | sed -re 's/(\.0)?-/./' v3.1.47-g9c6530d-dirty [me@here esp-link]$ git describe --tags --match 'v*.*.*' --long --dirty | sed -re 's/(\.0)?-/./' v3.2.47.alpha.0-g9c6530d-dirty --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 365749bf..aa496d85 100644 --- a/Makefile +++ b/Makefile @@ -191,7 +191,7 @@ TRAVIS_BRANCH?=$(shell git symbolic-ref --short HEAD --quiet) # Use git describe to get the latest version tag, commits since then, sha and dirty flag, this # results is something like "v1.2.0-13-ab6cedf-dirty" NO_TAG ?= "no-tag" -VERSION := $(shell (git describe --tags --match 'v*.0' --long --dirty || echo $(NO_TAG)) | sed -re 's/(\.0)?-/./') +VERSION := $(shell (git describe --tags --match 'v*.*.*' --long --dirty || echo $(NO_TAG)) | sed -re 's/(\.0)?-/./') # If not on master then insert the branch name ifneq ($(TRAVIS_BRANCH),master) ifneq ($(findstring V%,$(TRAVIS_BRANCH)),) From 9d5bfffc145cd6a023a8fcd41451f5532673bce5 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zimon Date: Wed, 3 Jan 2018 09:59:26 +0100 Subject: [PATCH 04/14] - add ajax /console/clear - fix #348 --- esp-link/main.c | 1 + html/console.html | 5 ++++- serial/console.c | 9 +++++++++ serial/console.h | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/esp-link/main.c b/esp-link/main.c index d2a316e9..31bcf6e1 100644 --- a/esp-link/main.c +++ b/esp-link/main.c @@ -88,6 +88,7 @@ HttpdBuiltInUrl builtInUrls[] = { { "/log/reset", cgiReset, NULL }, { "/console/reset", ajaxConsoleReset, NULL }, { "/console/baud", ajaxConsoleBaud, NULL }, + { "/console/clear", ajaxConsoleClear, NULL }, { "/console/fmt", ajaxConsoleFormat, NULL }, { "/console/text", ajaxConsole, NULL }, { "/console/send", ajaxConsoleSend, NULL }, diff --git a/html/console.html b/html/console.html index e621f05b..6cb74af7 100644 --- a/html/console.html +++ b/html/console.html @@ -91,7 +91,10 @@

Microcontroller Console

$("#clear-button").addEventListener("click", function(e) { e.preventDefault(); var co = $("#console"); - co.innerHTML = ""; + ajaxSpin('POST', "/console/clear", + function(resp) { showNotification("uC buffer cleared"); co.innerHTML = ""; co.textEnd = 0;}, + function(s, st) { showWarning("Error clearing buffer in uC"); } + ); }); ajaxJson('GET', "/console/baud", diff --git a/serial/console.c b/serial/console.c index d0820364..473bcf6b 100644 --- a/serial/console.c +++ b/serial/console.c @@ -59,6 +59,15 @@ ajaxConsoleReset(HttpdConnData *connData) { return HTTPD_CGI_DONE; } +int ICACHE_FLASH_ATTR +ajaxConsoleClear(HttpdConnData *connData) { + if (connData->conn==NULL) return HTTPD_CGI_DONE; // Connection aborted. Clean up. + jsonHeader(connData, 200); + //reset buffer + console_rd = console_wr = console_pos = 0; + return HTTPD_CGI_DONE; +} + int ICACHE_FLASH_ATTR ajaxConsoleBaud(HttpdConnData *connData) { if (connData->conn==NULL) return HTTPD_CGI_DONE; // Connection aborted. Clean up. diff --git a/serial/console.h b/serial/console.h index 30209035..f1d22618 100644 --- a/serial/console.h +++ b/serial/console.h @@ -7,6 +7,7 @@ void consoleInit(void); void ICACHE_FLASH_ATTR console_write_char(char c); int ajaxConsole(HttpdConnData *connData); int ajaxConsoleReset(HttpdConnData *connData); +int ajaxConsoleClear(HttpdConnData *connData); int ajaxConsoleBaud(HttpdConnData *connData); int ajaxConsoleFormat(HttpdConnData *connData); int ajaxConsoleSend(HttpdConnData *connData); From 84fd0a3a5857751ffe647e751f4035fa12edde27 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zimon Date: Tue, 23 Jan 2018 22:26:54 +0100 Subject: [PATCH 05/14] Change MQTT password to 64 chars, fixes #356 --- esp-link/config.c | 9 ++++++++- esp-link/config.h | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/esp-link/config.c b/esp-link/config.c index 224f0470..7693e7f9 100644 --- a/esp-link/config.c +++ b/esp-link/config.c @@ -23,7 +23,7 @@ FlashConfig flashDefault = { .slip_enable = 0, .mqtt_enable = 0, .mqtt_status_enable = 0, .mqtt_timeout = 2, .mqtt_clean_session = 1, .mqtt_port = 1883, .mqtt_keepalive = 60, - .mqtt_old_host = "\0", .mqtt_clientid = "\0", + .mqtt_old_host = "\0", .mqtt_old_password = "\0", .mqtt_clientid = "\0", .mqtt_username = "\0", .mqtt_password = "\0", .mqtt_status_topic = "\0", .mqtt_host = "\0", .sys_descr = "\0", @@ -154,6 +154,13 @@ bool ICACHE_FLASH_ATTR configRestore(void) { os_memset(flashConfig.mqtt_old_host, 0, 32); } else os_printf("mqtt_host is '%s'\n", flashConfig.mqtt_host); + if (flashConfig.mqtt_password[0] == 0 && flashConfig.mqtt_old_password[0] != 0) { + // the mqtt_password got changed from 32 chars to 64 in a new location + os_printf("Converting old mqtt_password\n"); + os_memcpy(flashConfig.mqtt_password, flashConfig.mqtt_old_password, 32); + os_memset(flashConfig.mqtt_old_password, 0, 32); + } + if (flashConfig.data_bits == 0) { // restore to default 8N1 flashConfig.data_bits = flashDefault.data_bits; diff --git a/esp-link/config.h b/esp-link/config.h index 65195d29..b495dc3d 100644 --- a/esp-link/config.h +++ b/esp-link/config.h @@ -24,7 +24,7 @@ typedef struct { char mqtt_old_host[32], // replaced by 64-char mqtt_host below mqtt_clientid[48], mqtt_username[32], - mqtt_password[32], + mqtt_old_password[32], // replaced by 64-char mqtt_password below mqtt_status_topic[32]; char sys_descr[129]; // system description int8_t rx_pullup; // internal pull-up on RX pin @@ -41,6 +41,7 @@ typedef struct { int8_t data_bits; int8_t parity; int8_t stop_bits; + char mqtt_password[64]; // MQTT password, was 32-char mqtt_old_password } FlashConfig; extern FlashConfig flashConfig; From 5995df787d0c99d016d2f81471308ab2e6bac2d3 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zimon Date: Thu, 11 Jul 2019 17:40:31 +0000 Subject: [PATCH 06/14] add soft-ap channel option fix for #345 and #453 Signed-off-by: Bartlomiej Zimon --- esp-link/cgiwifi.c | 13 +++++++++++++ html/wifi/wifiAp.html | 6 ++++++ html/wifi/wifiAp.js | 1 + 3 files changed, 20 insertions(+) diff --git a/esp-link/cgiwifi.c b/esp-link/cgiwifi.c index 8ae7e3a5..9a0ea62a 100644 --- a/esp-link/cgiwifi.c +++ b/esp-link/cgiwifi.c @@ -640,6 +640,17 @@ int ICACHE_FLASH_ATTR cgiApSettingsChange(HttpdConnData *connData) { apconf.ssid_hidden = 0; } } + // Set channel to be hidden or not + len=httpdFindArg(connData->getArgs, "ap_channel", buff, sizeof(buff)); + if(len>0){ + int value = atoi(buff); + if(value >= 1 || value <= 13){ + apconf.channel = value; + }else{ + // If out of range, set by default + apconf.channel = 1; + } + } // Store new configuration wifi_softap_set_config(&apconf); @@ -659,6 +670,7 @@ int ICACHE_FLASH_ATTR cgiApSettingsInfo(HttpdConnData *connData) { "\"ap_authmode\": %d, " "\"ap_maxconn\": %d, " "\"ap_beacon\": %d, " + "\"ap_channel\": %d, " "\"ap_hidden\": \"%s\" " " }", apconf.ssid, @@ -666,6 +678,7 @@ int ICACHE_FLASH_ATTR cgiApSettingsInfo(HttpdConnData *connData) { apconf.authmode, apconf.max_connection, apconf.beacon_interval, + apconf.channel, apconf.ssid_hidden ? "enabled" : "disabled" ); diff --git a/html/wifi/wifiAp.html b/html/wifi/wifiAp.html index 41b36973..e61c3412 100644 --- a/html/wifi/wifiAp.html +++ b/html/wifi/wifiAp.html @@ -69,6 +69,12 @@

Soft-AP Settings

+
+ + + +
+
diff --git a/html/wifi/wifiAp.js b/html/wifi/wifiAp.js index 59dd6ce0..50b2c24d 100644 --- a/html/wifi/wifiAp.js +++ b/html/wifi/wifiAp.js @@ -3,6 +3,7 @@ specials["ap_ssid"] = "SSID name"; specials["ap_password"] = "PASSWORD"; specials["ap_maxconn"] = "Max Connections number"; specials["ap_beacon"] = "Beacon Interval"; +specials["ap_channel"] = "Channel"; function changeWifiMode(m) { blockScan = 1; From ef3d68d8f04342cd593ef6d9c887bbf5cb77dbf5 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zimon Date: Thu, 11 Jul 2019 17:44:27 +0000 Subject: [PATCH 07/14] change length for mqtt username and password fix for #450 Signed-off-by: Bartlomiej Zimon --- esp-link/config.c | 9 ++++++++- esp-link/config.h | 7 ++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/esp-link/config.c b/esp-link/config.c index 7693e7f9..e9ad4530 100644 --- a/esp-link/config.c +++ b/esp-link/config.c @@ -23,7 +23,7 @@ FlashConfig flashDefault = { .slip_enable = 0, .mqtt_enable = 0, .mqtt_status_enable = 0, .mqtt_timeout = 2, .mqtt_clean_session = 1, .mqtt_port = 1883, .mqtt_keepalive = 60, - .mqtt_old_host = "\0", .mqtt_old_password = "\0", .mqtt_clientid = "\0", + .mqtt_old_host = "\0", .mqtt_old_password = "\0", .mqtt_old_username = "\0", .mqtt_clientid = "\0", .mqtt_username = "\0", .mqtt_password = "\0", .mqtt_status_topic = "\0", .mqtt_host = "\0", .sys_descr = "\0", @@ -161,6 +161,13 @@ bool ICACHE_FLASH_ATTR configRestore(void) { os_memset(flashConfig.mqtt_old_password, 0, 32); } + if (flashConfig.mqtt_username[0] == 0 && flashConfig.mqtt_old_username[0] != 0) { + // the mqtt_username got changed from 32 chars to 64 in a new location + os_printf("Converting old mqtt_username\n"); + os_memcpy(flashConfig.mqtt_password, flashConfig.mqtt_old_username, 32); + os_memset(flashConfig.mqtt_old_username, 0, 32); + } + if (flashConfig.data_bits == 0) { // restore to default 8N1 flashConfig.data_bits = flashDefault.data_bits; diff --git a/esp-link/config.h b/esp-link/config.h index b495dc3d..c6a4058e 100644 --- a/esp-link/config.h +++ b/esp-link/config.h @@ -23,8 +23,8 @@ typedef struct { uint16_t mqtt_port, mqtt_keepalive; // MQTT Host port, MQTT Keepalive timer char mqtt_old_host[32], // replaced by 64-char mqtt_host below mqtt_clientid[48], - mqtt_username[32], - mqtt_old_password[32], // replaced by 64-char mqtt_password below + mqtt_old_username[32], + mqtt_old_password[32], // replaced by 70-char mqtt_password below mqtt_status_topic[32]; char sys_descr[129]; // system description int8_t rx_pullup; // internal pull-up on RX pin @@ -41,7 +41,8 @@ typedef struct { int8_t data_bits; int8_t parity; int8_t stop_bits; - char mqtt_password[64]; // MQTT password, was 32-char mqtt_old_password + char mqtt_password[70]; // MQTT password, was 32-char mqtt_old_password + char mqtt_username[70]; // MQTT username, was 32-char mqtt_old_username } FlashConfig; extern FlashConfig flashConfig; From cba426021d419cef6fb45c79849237841dd239c7 Mon Sep 17 00:00:00 2001 From: Tyler Anderson Date: Wed, 13 Dec 2017 12:08:17 -0800 Subject: [PATCH 08/14] Ensure MDNS broadcasts go out on whatever interfaces we are using --- esp-link/cgiwifi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/esp-link/cgiwifi.c b/esp-link/cgiwifi.c index 9a0ea62a..01d35320 100644 --- a/esp-link/cgiwifi.c +++ b/esp-link/cgiwifi.c @@ -128,6 +128,7 @@ static char* mdns_txt = "ssh_upload=no"; void ICACHE_FLASH_ATTR wifiStartMDNS(struct ip_addr ip) { if (flashConfig.mdns_enable) { + wifi_set_broadcast_if(wifi_get_opmode()); if (mdns_info == NULL) mdns_info = (struct mdns_info *)os_zalloc(sizeof(struct mdns_info)); From 3036a1f4cc41aaf4d6c1501c873a9dbd451bd9d2 Mon Sep 17 00:00:00 2001 From: Florian Beier Date: Fri, 13 Apr 2018 14:45:50 +0200 Subject: [PATCH 09/14] Add note on flash mode Some modules require the flash mode to be `dio`, otherwise the module won't boot. I didn't know that at first and was wondering why my new ESP-12F module wouldn't boot. Maybe that is one reason why people are reporting none booting modules recently? --- FLASHING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FLASHING.md b/FLASHING.md index c8d3c7ef..318308e6 100644 --- a/FLASHING.md +++ b/FLASHING.md @@ -83,7 +83,7 @@ esptool.py --port /dev/ttyUSB0 --baud 230400 write_flash -fs 32m -ff 80m \ 0x00000 boot_v1.5.bin 0x1000 user1.bin \ 0x3FC000 esp_init_data_default.bin 0x3FE000 blank.bin ``` -I use a high baud rate as shown above because I'm impatient, but that's not required. +I use a high baud rate as shown above because I'm impatient, but that's not required. Attention: For some modules you have to set the flash mode to `dio` by adding `--fm dio` to the command line above, otherwise they won't boot. ### 4Mbit / 512Kbyte module ``` From 697e6b5c228c2076e034bc45bdc11835f54fdcd1 Mon Sep 17 00:00:00 2001 From: mr-sven Date: Wed, 25 Apr 2018 21:00:40 +0200 Subject: [PATCH 10/14] Changed argument getter with sizeof --- mqtt/mqtt_cmd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mqtt/mqtt_cmd.c b/mqtt/mqtt_cmd.c index b6bb909e..a1b944cd 100644 --- a/mqtt/mqtt_cmd.c +++ b/mqtt/mqtt_cmd.c @@ -93,10 +93,10 @@ MQTTCMD_Lwt(CmdPacket *cmd) { client->connect_info.will_message[len] = 0; // get qos - cmdPopArg(&req, (uint8_t*)&client->connect_info.will_qos, 4); + cmdPopArg(&req, (uint8_t*)&client->connect_info.will_qos, sizeof(client->connect_info.will_qos)); // get retain - cmdPopArg(&req, (uint8_t*)&client->connect_info.will_retain, 4); + cmdPopArg(&req, (uint8_t*)&client->connect_info.will_retain, sizeof(client->connect_info.will_retain)); DBG("MQTT: MQTTCMD_Lwt topic=%s, message=%s, qos=%d, retain=%d\n", client->connect_info.will_topic, @@ -177,7 +177,7 @@ MQTTCMD_Subscribe(CmdPacket *cmd) { // get qos uint32_t qos = 0; - cmdPopArg(&req, (uint8_t*)&qos, 4); + cmdPopArg(&req, (uint8_t*)&qos, sizeof(qos)); DBG("MQTT: MQTTCMD_Subscribe topic=%s, qos=%u\n", topic, qos); From 1cfbc513173e8bfe12a0a867fb2820b2ff75bd74 Mon Sep 17 00:00:00 2001 From: Fabio Date: Fri, 2 Aug 2019 23:38:35 +0200 Subject: [PATCH 11/14] Changed compatibility for Python 2, added license --- flash2560.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/flash2560.py b/flash2560.py index f47eb82f..4c85a74a 100644 --- a/flash2560.py +++ b/flash2560.py @@ -1,5 +1,11 @@ -#!/usr/bin/python3 -# Created by Fabio Manz (30.7.2019) +#!/usr/bin/python + +# ---------------------------------------------------------------------------- +# "THE BEER-WARE LICENSE" (Revision 42): +# Fabio Manz wrote this file. As long as you retain +# this notice you can do whatever you want with this stuff. If we meet some day, +# and you think this stuff is worth it, you can buy me a beer in return. +# ---------------------------------------------------------------------------- import sys import re From 09474e6734137daddc92538beb8e7f460f2cbdbc Mon Sep 17 00:00:00 2001 From: Fabio Date: Fri, 2 Aug 2019 23:44:01 +0200 Subject: [PATCH 12/14] Changed to shebang Shebang is now compatible with Python 2.x and Python 3.x --- flash2560.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flash2560.py b/flash2560.py index 4c85a74a..5f89b14c 100644 --- a/flash2560.py +++ b/flash2560.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): From 75448fdeb93a8e91a3b05e2bfb4d9d1fab672c9b Mon Sep 17 00:00:00 2001 From: Yukai Li Date: Tue, 24 Dec 2019 15:30:15 -0700 Subject: [PATCH 13/14] Change reset line high output to no output --- serial/serbridge.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/serial/serbridge.c b/serial/serbridge.c index 7ba8e8ea..88de652b 100644 --- a/serial/serbridge.c +++ b/serial/serbridge.c @@ -143,7 +143,7 @@ telnetUnwrap(serbridgeConnData *conn, uint8_t *inBuf, int len) break; case DTR_OFF: if (mcu_reset_pin >= 0) { - GPIO_OUTPUT_SET(mcu_reset_pin, 1); + GPIO_DIS_OUTPUT(mcu_reset_pin); os_delay_us(100L); } break; @@ -267,7 +267,7 @@ serbridgeReset() #endif GPIO_OUTPUT_SET(mcu_reset_pin, 0); os_delay_us(2000L); // esp8266 needs at least 1ms reset pulse, it seems... - GPIO_OUTPUT_SET(mcu_reset_pin, 1); + GPIO_DIS_OUTPUT(mcu_reset_pin); } #ifdef SERBR_DBG else { os_printf("MCU reset: no pin\n"); } @@ -332,7 +332,7 @@ serbridgeRecvCb(void *arg, char *data, unsigned short len) os_delay_us(100L); if (mcu_isp_pin >= 0) GPIO_OUTPUT_SET(mcu_isp_pin, 0); os_delay_us(2000L); - if (mcu_reset_pin >= 0) GPIO_OUTPUT_SET(mcu_reset_pin, 1); + if (mcu_reset_pin >= 0) GPIO_DIS_OUTPUT(mcu_reset_pin); //os_delay_us(100L); //if (mcu_isp_pin >= 0) GPIO_OUTPUT_SET(mcu_isp_pin, 1); os_delay_us(1000L); // wait a millisecond before writing to the UART below @@ -498,7 +498,7 @@ serbridgeDisconCb(void *arg) os_delay_us(100L); GPIO_OUTPUT_SET(mcu_reset_pin, 0); os_delay_us(100L); - GPIO_OUTPUT_SET(mcu_reset_pin, 1); + GPIO_DIS_OUTPUT(mcu_reset_pin); } conn->conn = NULL; } @@ -580,7 +580,7 @@ serbridgeInitPins() // set both pins to 1 before turning them on so we don't cause a reset if (mcu_isp_pin >= 0) GPIO_OUTPUT_SET(mcu_isp_pin, 1); - if (mcu_reset_pin >= 0) GPIO_OUTPUT_SET(mcu_reset_pin, 1); + if (mcu_reset_pin >= 0) GPIO_DIS_OUTPUT(mcu_reset_pin); // switch pin mux to make these pins GPIO pins if (mcu_reset_pin >= 0) makeGpio(mcu_reset_pin); if (mcu_isp_pin >= 0) makeGpio(mcu_isp_pin); From cf329e8b84a55a05afa04df971d9abd9793c9130 Mon Sep 17 00:00:00 2001 From: Brian Clemens Date: Thu, 20 Feb 2020 21:21:29 +0900 Subject: [PATCH 14/14] Vim --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index aa496d85..0a8d314e 100644 --- a/Makefile +++ b/Makefile @@ -163,7 +163,6 @@ else ifeq ("$(FLASH_SIZE)","2MB") ESP_SPI_SIZE ?= 4 # 6->4MB (1MB+1MB) or 4->4MB (512KB+512KB) ESP_FLASH_MODE ?= 0 # 0->QIO, 2->DIO ESP_FLASH_FREQ_DIV ?= 15 # 15->80Mhz -:q ET_FS ?= 16m # 16Mbit flash size in esptool flash command ET_FF ?= 80m # 80Mhz flash speed in esptool flash command ET_BLANK ?= 0x1FE000 # where to flash blank.bin to erase wireless settings