You should really ask a single question at a time.
Your steps 1-3 will happen automatically (if the Pi is correctly configured See How to set up networking/WiFi )
If you just want to know the IP Address your Pi is using use hostname -I
.
You COULD go through the process of sending the IP address somewhere - but you need to specify the format and destination to get an answer.
OR you could just connect to your server by name raspberrypi.local
instead of IP address. (NOTE raspberrypi is the default hostname, and can/should be changed).
If you REALLY want to know the IP address you can discover it by many means;
arp raspberrypi.local
on most networks (arp raspberrypi
may work on some)
e.g.
arp archpi.local
archpi.local (10.1.1.20) -- no entry
or
getent hosts archpi.local | awk '{ print $1 }'
10.1.1.20
or
ping -c 1 archpi.local
PING archpi.local (10.1.1.20): 56 data bytes
64 bytes from 10.1.1.20: icmp_seq=0 ttl=64 time=4.607 ms