Raspberry PI, headless, RSA, Camera Setup

Hello,

In this post i sill show step by step how to install system and prepare RaspberryPi Zero W, to match our needs, so in few steps i will show how to:

And all of this without connecting mouse,keyboard or display to our RaspberryPi

 

OK we need to have system image so we can deploy it on RPi, I chose “Raspbian Stretch with Desktop” ( because it already have thinks that we will need) we download it from :

https://www.raspberrypi.org/downloads/raspbian/

lets unpack zip (using 7zip program, windows archive is not so good for this kind of files  }

And lets write image into our SD card

I’ve used “Win32 Disk Imager

At the left Image file we choose what was unpacked at previous step, at the right we choose SD card itself ( If you don’t have anything in devices combobox turn off program and insert SD card again then turn on Win32 Disk Imager)

Click Write, after couple minutes we have our SD card almost ready

Firstly we need to turn on ‘ssh’ so we can connect our Rpi from console

Open SD card directory ( in my case H: ) and place the ssh file here (without any extensions I’ve used for this total commander, You can do the same in Windows explorer but then you have to remove file extension)

 

and we have:

As you see there is no extension there is just single name “ssh”

Ok, now we have to configure network so Rpi will know where and how to connect. We need to create and edit “wpa_supplicant.conf” file, we placed in at the same place as previous ssh file so in main SD card dir

wpa_supplicant.conf content:

I’ve assume that your WiFi has WPA-PSK encryption (most popular option)

Ofcourse you have to change networkName and networkPassword ( but you can leave there question marks)

SD card is ready lets connect power source to our RPi (remember to connect power cable with USB labeled as PWR IN)

Green diode will blink for a while then it will be solid green indicating successful boot.

Now lets connect our RaspberryPi I’ve used putty

https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

Lets fill fields in order to mark at printscreen, in Saved Session You can provide any name You want I’ve put raspberry pi 2 because its my second RPi

 

Click saved so we will have it next time we turn on putty, and click open 

We should see something like that

[spoiler title=’There is an error’ style=’default’ collapse_link=’true’]

lets ping our raspberry pi with cmd  (How to run CMD) using address “raspberrypi.local”

 

if no answer lets try another address

if there is still nothing lets check at WIFI router itself if RasbperryPi is connected and lets take its IP address

proper pings looks like :

 

[/spoiler]

lets write default password  :

and we got something like:

[spoiler title=’Change password’ style=’default’ collapse_link=’true’]

command

 

[/spoiler]

lets also install mcedit text editor its much simpler then vim or nano

 

 

I recommend to make RSA keys so you don’t have to provide password each time you connect to RPi

[spoiler title=’Create RSA keys ‘ style=’default’ collapse_link=’true’]

didn’t translate yet in comment ping me up 😉

potrzebujemy puttygen

https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

klikamy Generate i na szarym tle poruszamy myszka az progress bar sie wypelni. Klikamy nastepnie

Save public key zapisujemy pod nazwa “cokolwiek.pub”

Save private key “cokolwiek.ppk”

dla utrzymania porządku “cokolwiek” w dwóch plikach powinno być takie samo. Pliki zapisujemy w folderze

w moim przypadku

NIE zamykamy na razie okna puttyGen.

wracamy do podłączonego putty:

tworzymy folder .ssh:

i tworzymy plik authorized_keys

kopiujemy publiczny klucz z puttygen:

a w oknie putty wciskajac [Shift+ insert] wklajamy:

dodajemy enter na koncu linii. i wciskamy [F2] na klawiaturze

[Enter] i [F10] zeby wyjsc

sprawdzmy czy sie dobrze wgralo:

restarujemy puttego

 

w nowym oknie :

wskazuemy plik ktory zapisalismy PuttyGen

 

wracamy do zapisanych sesji

klikamy save i open

tym razem system nie poprosi nas o hasło 🙂

wygenerowane klucze RSA (pub, ppk) możemy użyć do kolejnych raspberryPi do łączenia z tego komputera. Do kolejnych komputerów generujemy pliki RSA jeszcze raz a w RaspberryPi w authorized_keys wklejamy kolejne publiczne klucze – każdy w nowej linii

[/spoiler]

Lets configure camera I2c

in putty:

Interfacing options:

then Camera and change to “Yes”

[Enter][Enter]

the same for Serial and I2C

then “finish” and restart:

lets check our camera

plug in camera (best if RPI is turn off):

putty:

camera diode wil be red for a while then “kotek.jpg” will be created

lets download foto and check if we have nice photo I’ve used WinSCP  https://winscp.net/eng/download.php

and configure WinSCP to connect my RPi

I’ve assumt that You configure RSA keys if no jsut provide password and skip steps 4 5 6 7

download to disk

and check it

Thats all,

we have our RPI installed, configured Wifi, connected I2C, serial, and working camera, And we know how to connect putty into our RPi

 

Leave a Reply

avatar
  Subscribe  
Notify of