Raspberry Pi’s are cheap, and I really like the Raspbian operating system, I can work in just about any programming language I want, and I can configure it from my laptop with standard networking gear. No extra keyboards, monitors or serial adapters needed.
Jack a cable from the Pi’s ethernet port straight into your network router, insert a SD card prepared with Raspbian and power up the Raspberry Pi. 98% of the time, your network will automatically assign the Pi with an ip address (the other 2% being cases where you have explicitly configured your network otherwise).
Next, fire up a network analysis tool and find the address that was automatically assigned to the Pi. For me, I use the excellent Angry IP scanner (open source) to scan my network and get an address list of all the devices that are currently connected.
Now that you know the address of your Pi, you can crank open a terminal and SSH into it with the default credentials that comes with Raspbian:
laptop$ ssh email@example.com
(The default password is raspberry)
Now that we are in, the Raspberry Pi can be customised for your project. I upload and run a little script that installs the tools I use (OpenCV, vim and Go), it also ensures that the operating system is set to handle regular USB webcams and finally configures the timezone.
#!/usr/bin/env bash # Update aptitude sudo apt-get update sudo apt-get upgrade -y # Install opencv & vim. sudo apt-get install -y libopencv-dev sudo apt-get install -y vim # Ensure webcam module is loaded with necessary settings. sudo rmmod uvcvideo sudo modprobe uvcvideo nodrop=1 timeout=5000 quirks=0x80 # Download golang if [ ! -f go1.2.2.linux-arm~multiarch-armv6-1.tar.gz ]; then wget https://dave.cheney.net/paste/go1.2.2.linux-arm~multiarch-armv6-1.tar.gz fi # Install golang sudo tar -C /usr/local -xzf go1.2.2.linux-arm~multiarch-armv6-1.tar.gz echo "export PATH=$PATH:/usr/local/go/bin" >> /home/pi/.bashrc source /home/pi/.bashrc # Configure the local timezone. sudo bash -c 'echo "Australia/Brisbane" > /etc/timezone' sudo dpkg-reconfigure -f noninteractive tzdata
Often I will tweak this base configuration with some project specific changes, which will customise the networking setup and tweak /etc/rc.local to run a custom application when the Raspberry Pi is booted.
Uploading the bootstrapping script from your laptop is pretty straight forward with scp:
laptop$ scp bootstrap.sh firstname.lastname@example.org:.
Running the script on the Pi is simply a case of:
Become a Patreon to get early and behind-the-scenes access along with email notifications for each new post.
Hi! Subconsciously you already know this, but let's make it obvious. Hopefully this article was helpful. You might also find yourself following a link to Amazon to learn more about parts or equipment. If you end up placing an order, I make a couple of dollarydoos. We aren't talking a rapper lifestyle of supercars and yachts, but it does help pay for the stuff you see here. So to everyone that supports this place - thank you.