[SOLVED]New router does not work with RTOS sdk

masacate
Posts: 13
Joined: Tue Mar 31, 2015 2:41 am
Location: SPAIN

[SOLVED]New router does not work with RTOS sdk

Postby masacate » Wed Sep 16, 2015 5:12 pm

Hi, I have been using the last Espressif RTOS SDK (august 2015)without problem, I have replace my router (other model) and in theory everything is the same. Since this moment I are not able to connect to the WIFI using the RTOS version, I can connect without problem using AT. Some suggestions please...???

thanks in advance
masacate

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: New router does not work with RTOS sdk

Postby ESP_Faye » Thu Sep 17, 2015 5:25 pm

Hi,

Here is an example of connecting to router http://bbs.espressif.com/viewtopic.php?f=31&t=228

Please notice to set "stationConf.bssid_set = 0;"

If your problem is still unsolved, you could provide your test code and UART logs, we will help debugging it.

masacate
Posts: 13
Joined: Tue Mar 31, 2015 2:41 am
Location: SPAIN

Re: New router does not work with RTOS sdk

Postby masacate » Sat Sep 19, 2015 3:21 am

Hi, I have added "stationConf.bssid_set = 0;" to my RTOS program and the problem continue. I have also used the program you indicated viewtopic.php?f=31&t=228 and there is no problem. It seems to occur only with RTOS programs I use.
It happens even with the simple example program without any special code in the tasks:

/******************************************************************************
* Copyright 2013-2014 Espressif Systems (Wuxi)
*
* FileName: user_main.c
*
* Description: entry file of user application
*
* Modification history:
* 2014/12/1, v1.0 create this file.
*******************************************************************************/
#include "esp_common.h"

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

#include "lwip/sockets.h"
#include "lwip/dns.h"
#include "lwip/netdb.h"


void task2(void *pvParameters)
{
printf("Hello, welcome to task2!\r\n");

while (1) {
}
}

void task3(void *pvParameters)
{
printf("Hello, welcome to task3!\r\n");
while (1) {
}
}

/******************************************************************************
* FunctionName : user_init
* Description : entry of user application, init user function here
* Parameters : none
* Returns : none
*******************************************************************************/
void user_init(void)
{
printf("SDK version:%s\n", system_get_sdk_version());

/* need to set opmode before you set config */
wifi_set_opmode(STATIONAP_MODE);

{
struct station_config *config = (struct station_config *)zalloc(sizeof(struct station_config));
sprintf(config->ssid, "myWIFI");
sprintf(config->password, "myPassword");
//need not mac address
config->bssid_set = 0;


/* need to sure that you are in station mode first,
* otherwise it will be failed. */
wifi_station_set_config(config);
free(config);
}

xTaskCreate(task2, "tsk2", 256, NULL, 2, NULL);
xTaskCreate(task3, "tsk3", 256, NULL, 2, NULL);
}

My debug log says that is continuosly trying to reconnect because of some problem:

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 24728, room 16
tail 8
chksum 0x5c
load 0x3ffe8000, len 1156, room 0
tail 4
chksum 0xa1
load 0x3ffe8490, len 640, room 4
tail 12
chksum 0x4e
csum 0x4e
R ΐ"àŒ!•`1hM"üÚpp_task_hdl : 3ffef748, prio:13, stack:512
pm_task_hdl : 3fff0028, prio:1, stack:176
ApiMsgMutex created
tcpip_task_hdl : 3fff0440, prio:10,stack:512
wdt_task : 3fff0d00, prio:14, stack:176
idle_task_hdl : 3fff1870
tim_task_hdl : 3fff1c68
xPortStartScheduler
frc2_timer_task_hdl:3fff2578, prio:12, stack:512

OS SDK ver: 1.2.0(b900bd2) compiled @ Aug 28 2015 17:18:41
phy ver: 356, pp ver: 9.0

SDK version:1.2.0(b900bd2)
mode : sta(18:fe:34:9c:68:ea) + softAP(1a:fe:34:9c:68:ea)
add if0
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
add if1
bcn 100
Hello, welcome to task2!

Hello, welcome to task3!

scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
cnt
ERRRRRR:256,137,137!!!!state: 5 -> 2 (ea0)
rm 0
reconnect
state: 2 -> 0 (0)
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
cnt
ERRRRRR:256,137,137!!!!state: 5 -> 2 (ea0)
rm 0
reconnect
state: 2 -> 0 (0)
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
cnt
ERRRRRR:256,137,137!!!!state: 5 -> 2 (ea0)
rm 0
reconnect
state: 2 -> 0 (0)
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
cnt
ERRRRRR:256,137,137!!!!state: 5 -> 2 (ea0)
rm 0
reconnect
state: 2 -> 0 (0)
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 4
cnt
ERRRRRR:256,137,137!!!!state: 5 -> 2 (ea0)
rm 0
reconnect
state: 2 -> 0 (0)

please some advice?

eswarams
Posts: 2
Joined: Mon Oct 26, 2015 12:45 pm

Re: New router does not work with RTOS sdk

Postby eswarams » Mon Oct 26, 2015 12:50 pm

Masacate the difference is not your router but the wireless security you used. In older router you would have used WEP and in new one WPA.

With the recent esp_iot_rtos master 1.2.0 the wifi station mode with WPA is broken. I will post a issue on the git now. For now you can set your wireless security to wep and use the chip

masacate
Posts: 13
Joined: Tue Mar 31, 2015 2:41 am
Location: SPAIN

Re: New router does not work with RTOS sdk

Postby masacate » Wed Nov 04, 2015 3:25 pm

Solved with the new release ESP8266 SDK RTOS 1.4
thanks

User avatar
kolban
Posts: 131
Joined: Tue Jun 16, 2015 1:09 pm
Location: Fort Worth, Texas, USA

Re: [SOLVED]New router does not work with RTOS sdk

Postby kolban » Mon Nov 09, 2015 2:10 pm

Looking at your code I am confused by the task implementations. It seems you are performing:

Code: Select all

while(1) {
}


tight loops. Surely if one of those tasks gets control it will never release it since I understand that the FreeRTOS is not preemptive ...?

masacate
Posts: 13
Joined: Tue Mar 31, 2015 2:41 am
Location: SPAIN

Re: [SOLVED]New router does not work with RTOS sdk

Postby masacate » Fri Nov 13, 2015 4:00 pm

This is simply a naked sample to see that the problem was the connection with the router and to avoid any uncertainty about some possible programming bugs.

Who is online

Users browsing this forum: No registered users and 139 guests