ESP8266 Developer Zone The Official ESP8266 Forum 2015-04-20T14:34:11+08:00 https://bbs.espressif.com:443/feed.php?f=66&t=372 2015-04-20T14:34:11+08:00 2015-04-20T14:34:11+08:00 https://bbs.espressif.com:443/viewtopic.php?t=372&p=1435#p1435 <![CDATA[Re: udp listen on the sta+softap mode.]]> Statistics: Posted by nice72 — Mon Apr 20, 2015 2:34 pm


]]>
2015-04-20T14:29:05+08:00 2015-04-20T14:29:05+08:00 https://bbs.espressif.com:443/viewtopic.php?t=372&p=1434#p1434 <![CDATA[Re: udp listen on the sta+softap mode.]]>
Thanks for your valuable advice.

We will optimize this issue in next SDK which is going to released at the end of April.

Statistics: Posted by ESP_Faye — Mon Apr 20, 2015 2:29 pm


]]>
2015-04-20T08:54:26+08:00 2015-04-20T08:54:26+08:00 https://bbs.espressif.com:443/viewtopic.php?t=372&p=1420#p1420 <![CDATA[Re: udp listen on the sta+softap mode.]]>
I have already used the method which you have supposed. But..
If someone performs a portscan, I shall always reset the connection.
It seems too absurd way.
For a more substantial issue, you please distribute me a new sdk.

Thanks,
Peter

Statistics: Posted by nice72 — Mon Apr 20, 2015 8:54 am


]]>
2015-04-17T18:19:18+08:00 2015-04-17T18:19:18+08:00 https://bbs.espressif.com:443/viewtopic.php?t=372&p=1400#p1400 <![CDATA[Re: udp listen on the sta+softap mode.]]>
Thanks for your interest in ESP8266.

In this case , you need to create two UDP with two port,one for station , one for softAP.

Statistics: Posted by ESP_Faye — Fri Apr 17, 2015 6:19 pm


]]>
2015-04-17T11:05:27+08:00 2015-04-17T11:05:27+08:00 https://bbs.espressif.com:443/viewtopic.php?t=372&p=1384#p1384 <![CDATA[udp listen on the sta+softap mode.]]>

In order to recevie a udp packet from station side and softAp side, I made simple source code.

SDK version the latest version (esp_iot_sdk_v1.0.1_b2_15_04_10)
wifi mode station and softAp mode

Code:

static void ICACHE_FLASH_ATTR mng_udp_init( void )
{
    g_mng_udp_esp_conn.type = ESPCONN_UDP;
    g_mng_udp_esp_conn.state = ESPCONN_NONE;
    g_mng_udp_esp_conn.proto.udp = &g_mng_udp_espudp;
    g_mng_udp_esp_conn.proto.udp->local_port = MNG_UDP_PORT; 
    espconn_regist_recvcb(&g_mng_udp_esp_conn, mng_udp_recv);
    espconn_create(&g_mng_udp_esp_conn); 
}

static void ICACHE_FLASH_ATTR mng_udp_recv(void *arg, char *rxmsg, unsigned short len)
{
    struct espconn *pesp_conn = arg;

    os_printf("\nmng udp recv  %d.%d.%d.%d %d -> %d.%d.%d.%d %d state(%d)\n",
            pesp_conn->proto.udp->remote_ip[0],
            pesp_conn->proto.udp->remote_ip[1],
            pesp_conn->proto.udp->remote_ip[2],
            pesp_conn->proto.udp->remote_ip[3],
            pesp_conn->proto.udp->remote_port,
            pesp_conn->proto.udp->local_ip[0],
            pesp_conn->proto.udp->local_ip[1],
            pesp_conn->proto.udp->local_ip[2],
            pesp_conn->proto.udp->local_ip[3],
            pesp_conn->proto.udp->local_port, pesp_conn->state
            );
}


ESP8266 can receive the 1st packet from any direction.
Thereafter, ESP8266 can receive the packet is received in only one direction.

[Testing Procedure 1]

SmartPhone1 --(1)--> ESP8266 <--(3)-- CISCO AP <--(3)-- SmartPhone2

1. SmartPhone1 send a udp packet to the ESP8266
2. ESP8266 can receive that one.
3. Using the same destination udp port, SmartPhone2 send a udp packet to the ESP8266
4. ESP8266 can't receive udp packet.

[Testing Procedure 2]

0. Restart the esp8266 (power reset)

SmartPhone1 --(3)--> ESP8266 <--(1)-- CISCO AP <--(1)-- SmartPhone2

1. SmartPhone2 send a udp packet to the ESP8266
2. ESP8266 can receive that one.
3. Using the same destination udp port, SmartPhone1 send a udp packet to the ESP8266
4. ESP8266 can't receive udp packet.

[Testing Procedure 3]

0. Without system restart

SmartPhone1 <--(1)-- ESP8266 --(3)--> CISCO AP --(3)--> SmartPhone2

1. ESP8266 send a udp packet to the SmartPhone1
2. SmartPhone1 can receive the packet.
3. ESP8266 send a udp packet to the SmartPhone2
2. SmartPhone2 can receive the packet.

In order to solve this problem, I need your help. :roll:

Thanks,
Peter

Statistics: Posted by nice72 — Fri Apr 17, 2015 11:05 am


]]>