Raspberry Pi with all needed things for GUI is no way cheap, indeed it is quite costly including all actually needed hardwares for general purpose use and increasing longevity of it. Case of Arduino is different as it is just a developmental board based on microcontroller. Raspberry Pi is a single board computer. Here is cheapest way to setup Raspberry Pi as headless like server to SSH & work. This way is good if you are used with both SSH and some electronics DIY works. Still you need these things with latest Raspberry Pi (which has WiFi) :
- Raspberry Pi board : $36
- A Micro SD card for that Raspberry Pi (minimum 16 GB is practical) : $5 to $10
- A Micro SD card reader or someway to connect as storage device with your computer’s card reader. There is Micro SD card adapter for Mac : $10
Total about $50 is not cheap but cheapest as we are not including the power. Raspberry Pi board needed 5V supply via micro USB, we have breadboard power supply from old desktop computer’s PSU and method to cut USB cable. You either a dedicated power supply or build in DIY way with a Micro USB cable. Usually many tablets have Micro USB power supply which can support Raspberry Pi. There is Micro SD card which are preloaded with Raspberry Pi operating system. Perform market research before buying. That card has to do with performance.
Cheapest Way to Setup Raspberry Pi Like Server
After you have arranged the hardwares, if you’re using MacBook, you will put that Micro SD card in MacBook’s card slot. May be that slot is virgin, at least my one MacBook was. Such unused slot in few years old MacBook needs a bout of cleaning the dust inside. That can be an episode which is not funny – card can fail to read. Open Disk Utility. To open Disk Utility you can navigate to Applications > Utilities > Disk Utility
. You’ll need to click on the “Apple SDXC Reader” in the left column of Disk Utility. Then format the SD card to MS-DOS (FAT). Give a name to that card. Run df -h
to get the mounting point which will be like /dev/disk2
. You’ll get this kind of output :
---
1 2 3 4 5 6 7 | Filesystem Size Used Avail Capacity iused ifree %iused Mounted on /dev/disk0s2 465Gi 199Gi 265Gi 43% 52299389 69587353 43% / devfs 192Ki 192Ki 0Bi 100% 664 0 100% /dev map -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net map auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home /dev/disk1s2 303Mi 280Mi 23Mi 93% 71633 5944 92% /Volumes/NI-DAQmx_Base_3.3.0 /dev/disk2s1 56Mi 19Mi 37Mi 34% 512 0 100% /Volumes/NONAME |
If you visit this link you’ll get Raspbian as download zip file :
1 | http://downloads.raspberrypi.org/raspbian_latest |
You’ll find all possible downloads here :
1 | http://downloads.raspberrypi.org |
If the download’s unzipped file’s name is 2017-07-07-wheezy-raspbian.img
and X is number of /dev/rdiskX
then run :
1 2 3 4 | sudo diskutil unmount /dev/diskXs1 sudo dd bs=1m if=./2017-07-07-wheezy-raspbian.img of=/dev/rdiskX sudo diskutil eject /dev/rdiskX arp -a |
Last command will find IP address. If IP is 192.168.1.8
, then with WiFi connection, try SSH once :
1 | ssh pi@192.168.1.8 |
You probably need few steps for WiFi. First cd
to /Volumes/boot
and run touch ssh
to create an empty file.
Create wpa_supplicant.conf
:
1 | nano wpa_supplicant.conf |
Copy paste the below content after your judgement.
For Raspbian Jessie:
1 2 3 4 5 | network={ ssid="YOUR_NETWORK_NAME" psk="YOUR_PASSWORD" key_mgmt=WPA-PSK } |
For Raspbian Stretch:
1 2 3 4 5 6 | ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev network={ ssid="YOUR_NETWORK_NAME" psk="YOUR_PASSWORD" key_mgmt=WPA-PSK } |
Now safely eject that card, insert inside Raspberry Pi, power it and SSH. If you face trouble, visit this Github’s page :
1 | https://github.com/raspberrypi/documentation/blob/master/configuration/wireless/wireless-cli.md |
First time you’ll log in, the Raspberry Pi will run raspi-config so you can set configuration parameters.
Tagged With raspberry pi dip switch config