This method was mentioned in my first blog of Raspberry Pie. Here is a brief introduction.
Connect GND, txd and rxd of GPIO serial ports of Raspberry Pie and Raspberry Pie to GND, rxd and txd of the adapter respectively. I don't care what adapter module I use. Anyway, it will eventually become a USB interface to connect to the computer. You can find it in the port option of computer device manager and log in with serial port.
You can log in with PUTTY, and I use the new version of secureCRT.
2.ssh login
In my first blog about raspberry pie, I asked you to create a new document file without suffix, which came in handy.
Read my other blog directly, set the static ID of the raspberry pie, connect the raspberry pie with the LAN port of the router with a network cable, and then we can operate our raspberry pie remotely.
But be careful, we have to be on the same wifi band as raspberry pie. In other words, our computer must be connected to the wifi of the router connected to Raspberry Pi, otherwise it cannot be connected.
3. Direct connection of network cable
Because raspberry pie 3B has only one working serial port, and the other serial port is still virtual, which is very worrying.
You can log in through ssh and then use its serial port.
Here is another login. Raspberry Pie and computer can be connected by network cable.
This picture is also copied from other web pages. First, complete the above operations and allow other users to connect something:
Entering arp -a in dos interface will add192.168.137.1strangely, which is the same for every computer. This is the IP address of the local connection, so you can think of your computer as an address of192.5438+015383636.
Because the wlan0 and eth0 I opened on the raspberry pie didn't open automatically, I opened one directly by violence.
Input: sudo ifconfig eth0192.168 438+037.438+00.
Then you open secureCRT or PUTTY, log in through SSH2, and find that you can log in, and the ping network is still open.
I have a fatal problem in this way, that is, every time I want to log in this way, I have to log in in the above two ways first and then force my eth0 to open.
In fact, I don't connect my computer to the Internet through a network cable, but I connect directly to wifi, but I want Raspberry Pie to access the Internet through a network cable.
Then how can I surf the Internet through only one network cable?
In other words, we don't set the address of eth0 forcibly, but let Raspberry Pie get its own IP as soon as it starts, and then SSH in. After that, the raspberry pie has been surfing the Internet through the static network, that is, the network cable.
Let's comment out all the previous settings about wifi and open a useful eth0:
Enter sudovim/etc/resolv.conf.
Here we set up DNS, which plays an important role in resolving domain names.
The first name server was routed by me, and we added a second name server, which was filled by computers. As I said just now, when we regard the computer as a router, it becomes192.168.438+037.1,and it will start to assign addresses instead.
After setting, enter sudo reboot to restart, and then log in directly with SSH, and the connection is perfect.
Now we surf the Internet through eth0 instead of wifi.
4. Direct connection of network cable (revised version)
I reread my blog today and found it a bit messy. For your convenience, I'll edit it here. New buyers of raspberry pie can directly read this part on the premise of only one network cable.
First, complete the following operations. I surf the internet wirelessly, and then I connect the raspberry pie through the internet port.
If you encounter such a problem as the following figure, please quickly win+R and then enter services.msc to enter the service option and open the Windows firewall service.
When you type arp -a in the cmd window, if your Raspberry Pie address (0-254) is not displayed, you can try to insert it again.
If you still can't find it, enter this under cmd, and ping all ip addresses under ping 137 to get the IP and mac addresses.
For/L% I in (1, 1, 255) is doped with-n1-w 60192.168.137. % I | find "reply" > & gtpingall.txt
This 192 is the address obtained by our raspberry pie. Just log in with CRT or putty.