aboutsummaryrefslogtreecommitdiff
path: root/stm32f091/esp8266.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-10-31 11:34:14 +0100
committerlonkaars <loek@pipeframe.xyz>2022-10-31 11:34:14 +0100
commit2c9c484d60d095a3e1b316ea911772fb0b6b9359 (patch)
treeab55e61e954be9da09adae0ee0c947652b0167d7 /stm32f091/esp8266.c
parenta62fde4b436fd06f66948017ea4b417be6447682 (diff)
add hostname to esp commandsHEADstable-1.1.0masterdev
Diffstat (limited to 'stm32f091/esp8266.c')
-rw-r--r--stm32f091/esp8266.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/stm32f091/esp8266.c b/stm32f091/esp8266.c
index 8ff9547..e92149d 100644
--- a/stm32f091/esp8266.c
+++ b/stm32f091/esp8266.c
@@ -75,9 +75,11 @@ void ws_esp8266_ap_client_mode() {
}
void ws_esp8266_start_tcp_server() {
+ ws_esp8266_send_seq("AT+CIPSTATUS\r\n"); // show ip
ws_esp8266_send_seq("AT+CIPSERVER=0\r\n"); // stop tcp server (if running)
ws_esp8266_send_seq("AT+CIPMUX=1\r\n"); // enable multiplexing (allow multiple connections)
ws_esp8266_send_seq("AT+CIPSERVER=1," WS_SERVER_PORT_STR "\r\n"); // start tcp server
+ ws_esp8266_send_seq("AT+CIPSTA?\r\n");
}
void ws_esp8266_set_mac() {
@@ -87,3 +89,7 @@ void ws_esp8266_set_mac() {
void ws_esp8266_set_ip() {
ws_esp8266_send_seq("AT+CIPSTA=\"" WS_ESP8266_WLAN_IP "\"\r\n");
}
+
+void ws_esp8266_set_hostname() {
+ ws_esp8266_send_seq("AT+CWHOSTNAME=\"" WS_ESP8266_WLAN_HOSTNAME "\"\r\n");
+}