Categories
Explainer Internet of Things (IoT)

IoT Basics: How to Install an OS on Raspberry Pi

Due to a lot of requests, we’re introducing the ‘IoT Basics’ to our Explainer series covering all the important things you need to know to get started with a Raspberry Pi, aimed at newbies. We will be covering topics like – using a breadboard, the use of resistors, GPIO pins, among others. Let us look at how to install an OS on Raspberry Pi.

We all start pretty much in the same place; Buy a Raspberry Pi, unpack it, connect it to the power cable, install an Operating System and then may be start brainstorming for things to do with the Rpi, or start playing minecraft. (If you’re curious about the game, check pi store after installing the OS)

So, let’s begin with installing the OS.

First, select the Operating System. You can find the list of supported OS on ‘downloads’ page on the Raspberry pi website. You can download the OS from here.

IMPORTANT: Please note that the ‘dd’ tool can write over pretty much any partition on your machine, including the linux partition. So, please be careful when you specify the device name for writing over.

Preparing the SD card:

Run $ df -h to list all the currently mounted devices. Then insert the SD card and run the same command again. The newly appeared device on the list in the SD card that we are going to be writing the disk image to, so note the device id of the same. The device id on my machine is /dev/sdb

If your device id has a suffix like ‘p1’ or ‘1’ then it is referring to the partition. But remember that we need to write to the whole disk and not just the partition, so wherever we use the device id, drop the partition suffix and write unless specifically mentioned. For example, if the device id is /dev/mmcblk0p1 or /dev/sdb1, drop the last part ‘p1’ or ‘1’ respectively.

Now unmount the SD card, so that files can’t be read in or copied to the card while the image is being copied to the card.

Run $ sudo umount /dev/sdb1 including the partition number. If the list of devices showed up more than one device due to multiple partitions, unmount all of them. The command requires root permissions, so if you are not logged in as root, prefix all commands with sudo.

Now, run $ sudo dd bs=4M if=2016-05-27-raspbian-jessie.img of=/dev/sdb command to write the OS image to the card

Make sure you replace the ’if’ parameter value with the path to the OS image that needs to be written, and the ‘of’ parameter value needs to be replaced with the device id of the SD card. Please make sure to be careful to specify the right name for the device name, as mentioned earlier. The device name should be specified without the partition number.

This will roughly take up to 3 to 4 minutes and the terminal would look like the process is frozen. If you are using an SD card reader, then the LED on it would blink continuously. Otherwise just run $ sudo pkill -USR1 -n -x dd on another terminal, and the progress would be displayed in the original terminal window.

Note: The block size is mentioned as ‘4M’ in the command. If it does not work, then change it to as less as ‘1M’ but remember that this will slow down the process quite a bit.

$ sudo dd bs=4M if=2016-05-27-raspbian-jessie.img of=/dev/sdb
958+1 records in
958+1 records out
4019191808 bytes (4.0 GB) copied, 405.585 s, 9.9 MB/s

Finally, use $ sync to ensure that the write cache is flushed and it is safe to unmount the SD card.

If you are using windows, then check out Win32DiskImager utility.  Okay now that we’re done prepping the memory card, what next?

Booting for the first time:

For this you would require a USB keyboard, USB mouse, 5V USB power supply, HDMI monitor (I just connect the pi to my television), and of course the Raspberry Pi.

Installing OS on the Raspberry Pi3

Connect power and you should see the boot sequence on the TV. After first boot, the Raspberry Pi boots up in setup mode and if not, you can type the following command to get there:

$ sudo raspi-config

First things that need to be done are, resizing the file system to use the entire SD card, in my case it is 32GB. Check the first option on the setup menu. Then change the location and timezone to match yours. By default it is set to United Kingdom.

Now on rebooting the Raspberry Pi, it boots with the new configuration. The setup is now done and ready to use for any projects you’d like. For getting started with your first ever DIY project on the Raspberry Pi, check out this project.

Categories
Internet of Things (IoT)

Why is IoT the Buzzword of the Decade?

As the car was approaching home, her GPS location was sent to the home thermostat. After a long tiring day, she entered her perfectly dim lit, warm home, to her favorite playlist playing in the background. As she sunk into the couch, over a conversation with her virtual assistant on the home speaker, she reviewed how her day went and the virtual assistant ordered pizza for dinner ..” – This isn’t an excerpt out of a movie. This is right now, we are already in the future. Well, almost. Since the term ‘Internet of Things (IoT)’ was coined first, the definition has evolved a lot. In a generic sense though, this is a highly intelligent Machine-to-Machine technology which has potential to revolutionise how we live and work.

From music speakers, to thermostats, to lights and accessories, everything has some sort of intelligence; We are living in tech heaven, to be precise. Having moved from keypads to touch interfaces, we are currently in the no interface era. All the tech giants are focussing on getting maximum done with very little interaction with the device, and that means voice-activated computing powered by artificial intelligence.

When we say IoT, they include things we use on an everyday basis, from wearables to medical parameter sensors, to geographical and environmental sensors, and sensors monitoring the working and the lifecycle of devices.

Think about it, there are so many devices we use everyday, that possibly generate so much data when connected to respective sensors. This data could lead to so many different insights on user behavior and the device lifecycle.

Sensors and Wearables:

Internet-equipped sensors on any device make it possible to tap all the unused data, and analysis of this data lead into inferences about things that are usually considered ‘offline’. This can lead to better productivity, reduce cost, and can bring about a sustainable lifestyle. The thing that makes everyone excited about the future of IoT is the versatility of solutions it provides. This makes IoT the buzzword of the decade because we can expect an explosion of IoT solutions in various sectors.

google glass wearables IoT

Wearable technology enabled clothes are connected to the phone and are recording data about everything from blood pressure to the posture. Also speaking of the Internet of Things (IoT), it is not just the companies building consumer facing products that are a big deal, there are many companies providing wireless power solutions, and cloud based solutions that are more useful to a developer.

Challenges in IoT:

One big issue in the evolution of the Internet of Things is however, the interoperability, inability to connect to all the devices using just one app. There are many companies currently aiming to solve this issue by giving cloud based solutions to connect devices among each other.

Building a successful IoT environment will require massive amounts of cooperation and coordination between firms. But now more platforms like the Google cloud platform is coming up to sync up devices on a data level, and not just with respect to connectivity alone.

Some impressive products have already been around in the market for a while now; Smart pill reminders, that provides a smart and simple solution for patients forgetting to take their daily medicine dosage, or stick to the prescribed amount of medicine. Smart door bells, that combine computer vision, facial recognition and Artificial Intelligence to bring about a revolution in door bell systems.

Just like any other field, there are many skeptics around in tech industry as well. They predict IoT as a whole as a bubble that would burst very soon. But for the rest of us, we are definitely heading towards a better, sustainable future where there’s going to be a lot more evolution happening on the IoT front.

Did you like what you read? check out this article on how to Build your first IoT Application using Raspberry Pi.