IP Problem: 2 ESP8266-01's togther.

Hi. I've got an ESP8266-01 set as an AP (and STA to, AT+CWMODE=3).
When I connect my phone to it, the ESP gives my phone an IP..

+STA_CONNECTED:"ea:aa:9aa:aa:aa:a" (I'm not writing my phones real MAC)+DIST_STA_IP:"ec:8c:9a:b5:47:ef","192.168.4.2"

I want this to happen when I connect a second ESP to the ESP Server,
I.e. I want the ESP server to give an IP to a different ESP.

I a second ESP to the AP. I get this...
WIFI CONNECTED
+CWJAP:1
FAIL
WIFI DISCONNECT

After WIFI CONNECTED, I can see my ESP server noting the MAC address of the connecting ESP.
But I don't unlike for my phone, the ESP server doesn't allocate an IP to the new ESP
and I get disconnected shortly after connecting.

Now sure why I'm getting the +CWJAP:1 message either.

Can any kind soul help me to get the ESP server give an IP to the new/connecting ESP.

Tq.

is this what you want to do?