How to find the IP address of Raspberry Pi when it is connected to the wireless network without a screen

How to find the IP address of Raspberry Pi when it is connected to the wireless network without a screen

Assuming you are a linuxer , we don't want to assume you are windowser , because Windows users usually buy a monitor, because they will not be used to the command line interface at all. After all, Windows is a dead star system without a monitor.

OK, let's assume you are a Linux user, then

First case:

I don't have money to buy a monitor for the Raspberry Pi, and I only have an Internet cable left from my home broadband connection and a wireless router for Internet access. How can I know the IP address of the Raspberry Pi?

At this time, you only need to connect the Raspberry Pi to the wireless router LAN interface with an Ethernet cable and log in to the wireless router user management interface.

192.168.0.1

or

192.168.1.1

Then you can see an IP that is not your PC, that is the IP of your Raspberry Pi

Some people may say, using ifconfig, isn’t that nonsense? If you can't log in, where can you run ifconfig? My suggestion:

1. View from the router (troublesome)

2. Just write a program to loop through 192.168.1.1---192.168.1.255. This is what I did. The timeout for each connect detection is 100ms. I can quickly find the Raspberry Pi IP address, as follows:

Done.

Second case

I am a poor college student. I want to learn embedded system for the first time. I saved money to buy a Raspberry Pi. Then I just connected an Ethernet cable. How can I know the IP address of the Raspberry Pi?

There is a protocol in the TCP/IP protocol called ARP which is used to map IP addresses in a local area network to MAC addresses.

At this point, those who know the tricks will know how to do it. It’s okay if you don’t know. Let’s continue.

The ARP protocol is for the first communication service within the LAN. Each host will poll the IP address. The host with this IP address must send its MAC address to the host that initiated the ARP poll according to the ARP protocol.

Then we use this

I am a Debian user here, other Red Hat users can change the command by themselves

enter

sudo apt-get install arp-scan

Then install a small software like this

Then here, pay attention

Use arp-scan in root mode

so

sudo arp-scan -interface eth0 --localnet

-interface option specifies the network port to use. In our case, it is the wired network port eth0, which is short for Ethernet.

--localnet indicates that we want to use the ARP protocol within the LAN segment

Isn't the IP address divided into four segments, ABCD? We only use ARP within the LAN segment, for example:

Your PC LAN IP address is 192.168.1.9 and the subnet mask is 255.255.255.0

Then arp-scan will only send ARP packets to IP addresses in the network segment 192.168.1.0/24, that is, 192.168.1.2-192.168.1.254

Then wait for a while, the IP of the Raspberry Pi will come out, and then you can ssh using this IP

ssh -l pi xxxx

Then enter your password

raspberry

OK, login to Raspberry Pi is successful

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links

You may also be interested in:
  • How to install Docker on Raspberry Pi
  • Python Raspberry Pi Infrared Reflection Sensor
  • Ubuntu16.04/Raspberry Pi Python3+opencv configuration tutorial (sharing)
  • Python+Raspberry Pi+YOLO builds an artificial intelligence camera
  • Raspberry Pi.GPRS.SMS Receiver
  • How to install NodeJS on Debian (Raspberry Pi)
  • Python implements the example code of automatic reconnection of Raspberry Pi WiFi disconnection
  • Use Python to simply implement Raspberry Pi WEB control
  • Tutorial on installing Python and OpenCV on a Raspberry Pi 2 or Raspberry Pi B+
  • Example of getting GY-85 nine-axis module information using Python in Raspberry Pi

<<:  MySQL database table and database partitioning strategy

>>:  Four ways to switch tab pages in VUE

Recommend

Solution for Baidu site search not supporting https (tested)

Recently, https has been enabled on the mobile ph...

Summary of javascript date tools

let Utils = { /** * Is it the year of death? * @r...

How to increase HTML page loading speed

(1) Reduce HTTP requests. (Merge resource files a...

MySQL 8.0 New Features: Hash Join

The MySQL development team officially released th...

Detailed explanation of Vue project packaging

Table of contents 1. Related configuration Case 1...

Detailed explanation of the implementation of MySQL auto-increment primary key

Table of contents 1. Where is the self-incremente...

Summary of MySQL usage specifications

1. InnoDB storage engine must be used It has bett...

Docker installation and configuration command code examples

Docker installation Install dependency packages s...

Detailed explanation of Mysql transaction processing

1. MySQL transaction concept MySQL transactions a...

Introduction to several ways to introduce CSS in HTML

Table of contents 1. Embed CSS styles directly in...

The best 9 foreign free picture material websites

It is difficult to find good image material websi...

How to open port 8080 on Alibaba Cloud ECS server

For security reasons, Alibaba Cloud Server ECS co...