to get IP of received UDP packet you should do the following in receive callback function
static void ICACHE_FLASH_ATTR
udpserver_recv(void *arg, char *pusrdata, unsigned short len)
{
struct espconn *udpconn=(struct espconn *)arg;
remot_info *premot = NULL;
sint8 value = ESPCONN_OK;
if (espconn_get_connection_info(udpconn,&premot,0) == ESPCONN_OK){
udpconn->proto.udp->remote_port = premot->remote_port;
udpconn->proto.udp->remote_ip[0] = premot->remote_ip[0];
udpconn->proto.udp->remote_ip[1] = premot->remote_ip[1];
udpconn->proto.udp->remote_ip[2] = premot->remote_ip[2];
udpconn->proto.udp->remote_ip[3] = premot->remote_ip[3];
ets_uart_printf("%d.%d.%d.%d", udpconn->proto.udp->remote_ip[0],
udpconn->proto.udp->remote_ip[1],
udpconn->proto.udp->remote_ip[2],
udpconn->proto.udp->remote_ip[3]);
// send some message back
static const char msg[] = "ANSWER\n";
espconn_sent(udpconn, (uint8 *)msg, sizeof(msg));
}
}