Skip to content

Commit

Permalink
add back the changes to the esp8266 class
Browse files Browse the repository at this point in the history
move the time api query back to on start
  • Loading branch information
jcksnvllxr80 committed Dec 4, 2021
1 parent 77c8adb commit b417efc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def connect_wifi():
def get_wifi_conn_status(conn_status):
if conn_status and "WIFI CONNECTED" in conn_status:
wifi_led_green()
query_time_api()
# print("wifi successfully connected --> {}".format(conn_status))
else:
wifi_led_red()
Expand Down Expand Up @@ -189,8 +190,6 @@ def update_oled_display(oled_timer):
def update_conn_status(wifi_timer):
global connection
connection = get_wifi_conn_status(esp01.getConnectionStatus())
if "WIFI CONNECTED" in connection:
query_time_api()


def button_press_isr(irq):
Expand Down
4 changes: 2 additions & 2 deletions wifi/esp8266.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,15 +481,15 @@ def doHttpGet(self, host, path, user_agent="RPi-Pico", port=80):
if(retData != None):
if ">" in retData:
retData = self._sendToESP8266(getHeader, delay=2)
# self._sendToESP8266("AT+CIPCLOSE\r\n")
self._sendToESP8266("AT+CIPCLOSE\r\n")
retData = self.__httpResponse.parseHTTP(retData)
return retData, self.__httpResponse.getHTTPResponse()
else:
return 0, None
else:
return 0, None
else:
# self._sendToESP8266("AT+CIPCLOSE\r\n")
self._sendToESP8266("AT+CIPCLOSE\r\n")
return 0, None

def doHttpPost(self, host, path, user_agent="RPi-Pico", content_type="", content="", port=80):
Expand Down

0 comments on commit b417efc

Please sign in to comment.