kopia lustrzana https://github.com/martin-ger/esp_mqtt
change method save wifi infomation to flash
rodzic
55937fb701
commit
2786b6f68b
2
Makefile
2
Makefile
|
@ -65,7 +65,7 @@ else
|
|||
# We are under other system, may be Linux. Assume using gcc.
|
||||
# Can we use -fdata-sections?
|
||||
ESPPORT ?= /dev/ttyUSB0
|
||||
SDK_BASE ?= /esptools/esp-open-sdk/sdk
|
||||
SDK_BASE ?= /esptools/esp_iot_sdk_v1.3.0
|
||||
|
||||
CCFLAGS += -Os -ffunction-sections -fno-jump-tables
|
||||
AR = xtensa-lx106-elf-ar
|
||||
|
|
|
@ -10,8 +10,9 @@ This is MQTT client library for ESP8266, port from: [MQTT client library for Con
|
|||
|
||||
* Support subscribing, publishing, authentication, will messages, keep alive pings and all 3 QoS levels (it should be a fully functional client).
|
||||
* Support multiple connection (to multiple hosts).
|
||||
* Support SSL connection (max 1024 bit key size)
|
||||
* Support SSL connection (sdk 1.3 with path)
|
||||
* Easy to setup and use
|
||||
* Update support SDK 1.3
|
||||
|
||||
**Compile:**
|
||||
|
||||
|
@ -20,7 +21,7 @@ Make sure to add PYTHON PATH and compile PATH to Eclipse environment variable if
|
|||
for Windows:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/tuanpmt/esp_mqtt
|
||||
git clone --recursive https://github.com/tuanpmt/esp_mqtt
|
||||
cd esp_mqtt
|
||||
#clean
|
||||
mingw32-make clean
|
||||
|
@ -255,10 +256,6 @@ SDK esp_iot_sdk_v0.9.4_14_12_19 or higher
|
|||
**Authors:**
|
||||
[Tuan PM](https://twitter.com/TuanPMT)
|
||||
|
||||
**Donations**
|
||||
|
||||
Invite me to a coffee
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JR9RVLFC4GE6J)
|
||||
|
||||
|
||||
**LICENSE - "MIT License"**
|
||||
|
|
|
@ -78,8 +78,9 @@ void ICACHE_FLASH_ATTR WIFI_Connect(uint8_t* ssid, uint8_t* pass, WifiCallback c
|
|||
struct station_config stationConf;
|
||||
|
||||
INFO("WIFI_INIT\r\n");
|
||||
wifi_set_opmode(STATION_MODE);
|
||||
wifi_station_set_auto_connect(FALSE);
|
||||
wifi_set_opmode_current(STATION_MODE);
|
||||
|
||||
//wifi_station_set_auto_connect(FALSE);
|
||||
wifiCb = cb;
|
||||
|
||||
os_memset(&stationConf, 0, sizeof(struct station_config));
|
||||
|
@ -87,13 +88,13 @@ void ICACHE_FLASH_ATTR WIFI_Connect(uint8_t* ssid, uint8_t* pass, WifiCallback c
|
|||
os_sprintf(stationConf.ssid, "%s", ssid);
|
||||
os_sprintf(stationConf.password, "%s", pass);
|
||||
|
||||
wifi_station_set_config(&stationConf);
|
||||
wifi_station_set_config_current(&stationConf);
|
||||
|
||||
os_timer_disarm(&WiFiLinker);
|
||||
os_timer_setfn(&WiFiLinker, (os_timer_func_t *)wifi_check_ip, NULL);
|
||||
os_timer_arm(&WiFiLinker, 1000, 0);
|
||||
|
||||
wifi_station_set_auto_connect(TRUE);
|
||||
//wifi_station_set_auto_connect(TRUE);
|
||||
wifi_station_connect();
|
||||
}
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue