Raspberry PI IP

I have a raspberry PI and a Wi-Pi wireless key.

I want to connect PI to a computer using Remote Desktop Connection over a wireless network.

But I'm not sure how to get the IP address of raspberries (without access to the router), that I need to connect to it.

Now I got to the router page and looked what IP address is assigned to pi, and use it to connect

But my goal is to use it in the "field", using the option "Exchange via the Internet", to connect the PI and laptop to it, and then connect to pi from the laptop.

How can I get the IP address that the phone gave PI?

+4
source share
6 answers

You can make your Raspberry Pi your IP address, as described here .

Install the espeak package first:

$ sudo apt-get install espeak 

Then create an init script:

 $ sudo vi /etc/init.d/sayIPbs 

Paste the following content into it:

 #! /bin/sh # /etc/init.d/sayIPbs ## Some things that run always # Carry out specific functions when asked to by the system case "$1" in start) echo "Starting script sayIPbs " sleep 5 public=`curl ifconfig.me` private=`hostname -I` string="public address is $public and private address is $private" echo $string | espeak -s 120 -v en-uk sleep 2 echo $string | espeak -s 120 -v en-uk ;; stop) echo "Stopping script sayIPbs" ;; *) echo "Usage: /etc/init.d/sayIPbs {start|stop}" exit 1 ;;esac exit 0 

Finally, run the following commands:

 $ cd /etc/init.d $ sudo chmod a+x sayIPbs $ sudo update-rc.d -f sayIPbs defaults $ sudo reboot 

Plug in some headphones and listen for the IP address, which will be read at the end of the boot process.

+7
source

You must configure your raspy to always have the same IP address. Try editing the interface.man file using the nano or cat command with your own options, as shown below. Remember to reboot after editing:

 pi@raspberrypi ~ $ cat /etc/network/interfaces.man auto lo iface lo inet loopback iface eth0 inet static address 192.168.1.69 netmask 255.255.255.0 gateway 192.168.1.1 auto wlan0 allow-hotplug wlan0 iface wlan0 inet static address 192.168.1.67 netmask 255.255.255.0 gateway 192.168.1.1 wpa-passphrase password wpa-ssid myssid 
+3
source

I found that I can use nmap to "scan" the network for connected devices, and this will give me a list of devices and their assigned IP.

And since no more than 3 devices are connected, the list is short and easy to read.

 nmap -sP 192.168.1.1/24 
+2
source

Using only the button and the LED, I wrote a script that gets the IP address of raspberry pi, and then the LED blinks several times to show the IP address of the raspberry Pi. I just think that it is blinking, notice them on paper, and then I have an IP address. This seems silly, but only works with two I / O pins.

+2
source

Use static IP on your pi by editing on /etc/network/interfaces . but on the other hand, you can also install network scanner on your phone.

+2
source

Bit late reply, but I had a similar problem inside. Solved my problem as follows:

  • Use Unix terminal commands to identify the IP and MAC address of a wi-fi or Ethernet port (ifconfig)
  • configure your router to always allocate an address for these corresponding network connections. range of use beyond what will be automatically generated using DHCP

Whenever you connect this raspberry Pi to your network, this address will be automatically assigned to it. I also put a sticker on pi with mac and IP address. Especially useful if you use it without a screen and keyboard.

+1
source

Source: https://habr.com/ru/post/1501683/


All Articles