Connection to PiZeroW with Raspbian Stretch Lite, without additional adapters and monitor

In general, the other day I fell into the hands of Raspberry Pi Zero W. But the difficulty was that it only has micro ports for connection, and I did not have any adapters for them.
 
Connection to PiZeroW with Raspbian Stretch Lite, without additional adapters and monitor
 
And this made it difficult to configure it, in contrast to the same Raspbery Pi 3+
 
If you do not resort to soldering iron, and expansion cards, then on the raspberries there are two microUSB and one microHDMI. If you have two adapters (microHDMI (M) -HDMI (F) and microUSB (M) -USB (F)), you could connect it to the monitor and keyboard, well, then in console mode, everything is set up. But as I already said, I did not have such adapters, the nearest store with such was quite far away, and waiting for delivery simply did not have the patience.
 
Of course, some adapters we still need, but they just get it. In particular, the microUSB cord can be taken from the phone a SD adapter on the microSD card from the camera.
 
In order to connect, I found two ways. The first one is over WiFi. All you need is to configure it on WiFi and SSH. But you only need to do this using an SD card. And since I had only a MacBook from computers, I did not have access to the linux partition (I did not consider the ext3f3173 version of ext4fuse
). There was only section
/boot
which was in FAT32 and worked wonderfully with MacOS. Therefore, all that we will do will occur in this section.
 
So the first thing we need is to enable SSH access to the malink.
 
To do this, create a
file. ssh
without any content and expansion
 
touch /Volumes /boot /ssh
 
Secondly, we need to somehow configure the WiFi connection when launching
 
To do this, you must first obtain a password hash for WiFi. And then I ran into a new problem, how to do it in MacOS. Since before it was necessary to configure the connection for the presence of a Linux machine. There it is done so
 
wpa_passphrase ACCEPT_NAME PASSWORD PASSWORD
 
The result of the command, it looked like
 
network = {
ssid = "ACCEPT_NAME"
psk = 656c4700f528aced39b853b3c51b3fdcfc55409faa83a6402e936842237ac6f3
}

 
Well, for MacOs, generate
psk
I did not find it. Therefore we had
temporarily
specify the password in clear. Or configure WiFi later (about this at the end of the article)
 
network = {
ssid = "ACCEPT_NAME"
psk = "PASSWORD"
}

 
In this way, we configure all WiFi networks and save the result to file
wpa_supplicant.conf
 
ctrl_interface = DIR = /var /run /wpa_supplicant GROUP = netdev
update_config = 1
country = UK
## The first three lines are required for Raspbian versions> = Stretch
network = {
ssid = "ACCEPT_NAME"
psk = 656c4700f528aced39b853b3c51b3fdcfc55409faa83a6402e936842237ac6f3
}
network = {
ssid = "ACCEPT_NAME2"
psk = "PASSWORD"
}

 
Well, that's all. It remains to insert the card into RaspberryPi, plug in the power and wait an average of 90 seconds while it boots up and lifts the WiFi connection.
 
To find IP malinki in the local network, you can use the command
 
arp -na | grep -i b8: 27: eb
 
or watch the connected clients from the WiFi router.
 
Next, it only remains to connect via SSH to the IP found. (By default, if someone suddenly did not know that for raspbian login and password
.pi: raspberry
)
 
But there is another way to connect to Raspberry. As many noticed on the motherboard there is one more USB connector besides the power supply, so we'll need it. The only thing I'll pay attention to is that the USB cable should be completely decoupled (and not like I had, only the last two power contacts, why I first resorted to WiFi connection).
 
The essence of the second method is to connect the USB cable to another connector (on the board they are subscribed to
? USB
and
? PWR_IN
), By the way, in this case the board will be powered from it.
 
But first you need to add several parameters to two files in the same
/boot
section
 
The first one is in
cmdline.txt
add after
rootwait
connection of Ethernet modules
 
modules-load = dwc? g_ether
 
And the second in
config.txt
add
to the end of the file.
 
dtoverlay = dwc2
 
All. We insert the card, wait for the download and connect via SSH to the malink at
raspberrypi.local
+ 0 -

Add comment