The Day We Tried to Talk to a Raspberry Pi
The job sounded simple.
I had a Raspberry Pi 4.
I had a computer.
I wanted the computer to talk to the Raspberry Pi.
That was it.
People apparently do this every day.
The first suspect was the SD card. Windows could tell there was a 32 GB card in the machine, but wouldn’t give the bloody thing a name or a drive letter. We tried another adapter. And another. A little 4 GB card worked. The 32 GB card didn’t.
Eventually I gave up.
Another day.
Then I bought a decent new Verbatim 32 GB card. Premium. 90 MB/s. 600×. Surely that would put an end to the nonsense.
Windows saw it.
Verbatim SD (G:)
Beauty.
Raspberry Pi Imager started writing. Slowly, because somewhere between the computer, the reader and the card was a speed bump, but it was writing.
Then verifying.
Then:
Verified.
Into the Pi it went.
Red light. Green flashing.
Then the red light started flashing too.
Apparently that was bad.
Out came the power supply. In went a 5 V power bank.
Solid red. Flashing green.
Right. One bastard identified.
Now we had to find the Pi on the network.
raspberrypi.local?
No.
arp -a?
That showed us some numbers.
There was 192.168.0.35.
There was 192.168.0.40.
We pinged .40.
Four replies. Beautiful.
We tried SSH.
Connection refused.
Perhaps SSH wasn’t enabled.
Before doing anything drastic, we put .40 into Firefox.
A printer status page appeared.
We had successfully established communications with the printer.
Fine.
On to .35.
Ping worked.
Firefox found nothing.
That looked promising.
SSH?
Connection refused.
We eventually switched the Raspberry Pi completely off, cleared the network table and discovered .35 was still there.
So .35 wasn’t the Pi either.
Much later the router would reveal that .35 was a Chromecast.
At this point we had attempted to SSH into both a printer and a Chromecast.
The Raspberry Pi remained unmolested.
Perhaps I had entered the Wi-Fi password incorrectly. Perhaps I hadn’t enabled SSH. Perhaps Raspberry Pi Connect was involved. Perhaps the SD card was crook.
Back to Raspberry Pi Imager.
Access denied.
And again.
Access denied.
Now Windows wouldn’t recognise the card.
The built-in card reader looked suspicious. The portable reader looked suspicious. The card looked suspicious. Frankly, everyone in the room looked suspicious.
I went to the laptop in the shed.
The portable reader happily read a 4 GB card.
It happily read another larger card.
The 32 GB card?
No.
Then it did.
And it was empty.
Back at the main PC we started pulling the problem apart instead of merely swearing at it.
Device Manager could see the USB reader.
Disk Management could see the 4 GB card.
Healthy FAT32.
But no drive letter.
We gave it one.
There it was.
Then I worked out another little piece of Windows wisdom: after telling Windows to safely remove the card reader, don’t just pull the SD card out and stick another one in. Pull the whole USB reader, change the card, then reconnect the reader.
Another bastard identified.
The 32 GB Verbatim appeared again.
Disk 8.
29 GB.
Was it write protected?
DiskPart said:
Current Read-only State: No
Read-only: No
Could Windows actually write to it?
We created a file.
Inside it we wrote:
Doonie was here.
Closed it.
Opened it again.
Doonie was still there.
The card was fine.
The reader was fine.
Windows could write to it.
So why couldn’t Raspberry Pi Imager?
Because Imager wasn’t trying to write a little file to G:. It wanted control of the entire physical disk, partitions and all, and Windows wasn’t giving it that control.
So we went back into DiskPart.
Very carefully:
list disk
Disk 8 — 29 GB.
Definitely the Verbatim.
select disk 8
Then the command with teeth:
clean
Done.
The old partition structure disappeared.
Back to Raspberry Pi Imager.
Writing.
There was the bastard.
It wrote.
It verified.
We put the newly written card into the Pi.
Now came the original job, which by this stage seemed to have occurred sometime during the reign of Queen Victoria:
Talk to the Raspberry Pi.
Why, I asked, couldn’t we just plug the bloody thing into the PC?
Fair question.
We found an Ethernet cable. White, with yellow ends. It plugged into the Pi, which seemed sufficient evidence that it was probably an Ethernet cable.
There was no spare Ethernet socket on the PC.
Then another thought:
Why not temporarily unplug the PC from the internet and use that socket?
So we did.
Which also disconnected ChatGPT.
Fortunately I had a phone.
PC directly connected to Pi.
Ethernet light on.
Excellent.
Windows gave itself:
169.254.167.234
The Pi remained elusive.
So we abandoned that particular rabbit hole, restored the PC’s internet connection, and plugged the Pi into a spare LAN socket on the router instead.
Now the router itself could tell us what was connected.
And there it was.
Magnifiser-2
Wired Ethernet.
192.168.0.179
And while we were there, the router finally solved one of the day’s mysteries:
192.168.0.35 — Chromecast.
We had indeed been trying to SSH into the Chromecast.
Back to Command Prompt.
This time:
ssh doonie@192.168.0.179
And instead of:
Connection refused
we got:
The authenticity of host ‘192.168.0.179’ can’t be established.
That was the most beautiful warning message I had seen all day.
I typed:
yes
It asked for the password.
I entered it.
And after a day involving two SD cards, several readers, a dodgy power supply, Windows drive letters, Device Manager, Disk Management, DiskPart, Wi-Fi, SSH, ARP tables, Ethernet cables, a printer, a Chromecast and one strategically deployed file containing the words Doonie was here, the computer finally said:
doonie@Magnifiser:~ $
That little dollar sign was the whole bloody point.
My PC was talking to the Raspberry Pi.
The Raspberry Pi was talking back.
And somewhere on the network, a printer and a Chromecast were probably wondering what the hell had just happened.