Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How disable automatic connect Wi-Fi network? #154

Open
augustocadini opened this issue May 23, 2018 · 1 comment
Open

How disable automatic connect Wi-Fi network? #154

augustocadini opened this issue May 23, 2018 · 1 comment

Comments

@augustocadini
Copy link

I've commented all user_main.c code, but ESP8266 keeping trying to connect to Wi-Fi. Where are I disable this?

void ICACHE_FLASH_ATTR user_init(void)
{
	user_rf_pre_init();
	uart_init(BIT_RATE_115200, BIT_RATE_115200);
//	os_delay_us(65535);

//	CFG_Load();
//

	INFO("\r\nHello World - ESP-012\r\n");
	GPIO_OUTPUT_SET(4,1);
	GPIO_OUTPUT_SET(5,1);
//	MQTT_InitConnection(&mqttClient, MQTTServer,MQTTPort, 0);
//	//MQTT_InitConnection(&mqttClient, "192.168.11.122", 1880, 0);
//
//	MQTT_InitClient(&mqttClient, MQTTUser, MQTTUser, MQTTPassword, 60, 1);
//	//MQTT_InitClient(&mqttClient, "client_id", "user", "pass", 120, 1);
//
//	MQTT_InitLWT(&mqttClient, "/lwt", "offline", 0, 0);
//	MQTT_OnConnected(&mqttClient, mqttConnectedCb);
//	MQTT_OnDisconnected(&mqttClient, mqttDisconnectedCb);
//	MQTT_OnPublished(&mqttClient, mqttPublishedCb);
//	MQTT_OnData(&mqttClient, mqttDataCb);
//
//	WIFI_Connect(SSID,password, wifiConnectCb);

	INFO("\r\nSystem started ...\r\n");
}

Serial OUTPUT:


             Hello World - ESP-012

System started ...
mode : sta(60:01:94:2d:b6:7a)
add if0
scandone
no iPhone de Augusto found, reconnect after 1s
reconnect
scandone
no iPhone de Augusto found, reconnect after 1s
reconnect
scandone
no iPhone de Augusto found, reconnect after 1s

... follow forever...
@Cicero-MF
Copy link

At the beginning, you need to use:
wifi_station_set_auto_connect(FALSE);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants