Setiawan <stwn at unsoed.ac.id> Internet of Things (IoT) • Everyday objects connected to the (inter)network – “Your coffee maker has an IP address” – “You could ping your refrigerator” – “Your bike could talk to your air conditioner” • Many applications – Smart Home – Smart City – Smart anything? +Exchanging data! Device S Device S Device S Device S Global TCP/IP
Setiawan <stwn at unsoed.ac.id> Internet of Things (IoT) • Everyday objects connected to the (inter)network – “Your coffee maker has an IP address” – “You could ping your refrigerator” – “Your bike could talk to your air conditioner” • Many applications – Smart Home – Smart City – Smart anything? Device S Device S Device S Device S Gateway +Exchanging data! Global TCP/IP
Setiawan <stwn at unsoed.ac.id> Internet of Things (IoT) • Everyday objects connected to the (inter)network – “Your coffee maker has an IP address” – “You could ping your refrigerator” – “Your bike could talk to your air conditioner” • Many applications – Smart Home – Smart City – Smart anything? Device S Device S Device S Device S Gateway Network +Exchanging data! Global TCP/IP
Setiawan <stwn at unsoed.ac.id> Internet of Things (IoT) • Everyday objects connected to the (inter)network – “Your coffee maker has an IP address” – “You could ping your refrigerator” – “Your bike could talk to your air conditioner” • Many applications – Smart Home – Smart City – Smart anything? Physical Device S Device S Device S Device S Gateway Network Data Link Physical Data Link Physical Data Link Physical Data Link Data Link Physical Data Link Physical Network +Exchanging data! Global TCP/IP
Setiawan <stwn at unsoed.ac.id> Internet of Things (IoT) • Everyday objects connected to the (inter)network – “Your coffee maker has an IP address” – “You could ping your refrigerator” – “Your bike could talk to your air conditioner” • Many applications – Smart Home – Smart City – Smart anything? Physical Device S Device S Device S Device S Gateway Internet Data Link Physical Data Link Physical Network Network Data Link Network Physical Data Link Network Physical Data Link Network Physical Data Link Network +Exchanging data! Global TCP/IP
Setiawan <stwn at unsoed.ac.id> Internet of Things (IoT) • Everyday objects connected to the (inter)network – “Your coffee maker has an IP address” – “You could ping your refrigerator” – “Your bike could talk to your air conditioner” • Many applications – Smart Home – Smart City – Smart anything? Physical Device S Device S Device S Device S Gateway Internet Data Link Physical Data Link Physical Network Network Data Link Network Physical Data Link Network Physical Data Link Network Physical Data Link Network +Exchanging data! Global TCP/IP Cloud Infra Cloud Infra
Setiawan <stwn at unsoed.ac.id> Objectives • Get to know Raspberry Pi • Learning how to set up Raspberry Pi • Learning how to use Raspberry Pi OS – Graphical user interface (GUI) – Text user interface (TUI)
Setiawan <stwn at unsoed.ac.id> Agenda • Raspberry Pi: Hardware and software • Installing and configuring Raspberry Pi OS • Using Raspberry Pi OS via GUI and TUI – Accessing the Raspberry Pi remotely – Command line interface (CLI)
Setiawan <stwn at unsoed.ac.id> Raspberry Pi: Hardware • A single-board computer or “mini computer” • Low-cost computer, designed to be tinkered • Small size with “unlimited uses” – Phy. computing: coding+interacting with real world – Add-ons in the forms of expansion board or HATs +low-power * https://projects.raspberrypi.org/en/ e.g. Sense HAT Hardware Attached on Top
Setiawan <stwn at unsoed.ac.id> Raspberry Pi: Software • Raspberry Pi OS, an official supported OS – Lite, base system and tools – Desktop, includes desktop env. and basic applications – Desktop and recommended software, or “full” release • Set of applications preinstalled, depends on the release • Development environment – Python 3 – Mu editor formerly, Raspbian
Setiawan <stwn at unsoed.ac.id> Software Download • Raspberry Pi OS “full” • Raspberry Pi Imager • SSH/PuTTY and VNC Viewer * Raspberry Pi OS and Imager: https://raspberrypi.org/software/ * PuTTY: https://putty.org/ * VNC Viewer: https://realvnc.com/en/connect/download/viewer/ * Local mirror site: http://dl.kuliax.net/acnt/iot/
Setiawan <stwn at unsoed.ac.id> Installing Raspberry Pi OS • Run Raspberry Pi Imager • Choose OS-Use custom, select the image • Choose Storage, and click WRITE – Select the correct drive, be careful – While the Imager writes, prepare the Raspberry Pi – Takes ~12 minutes with USB3 connection
Setiawan <stwn at unsoed.ac.id> Enabling “Headless Mode” • Reason: There is no monitor available • Steps needed to run on your computer – Open boot partition on the MicroSD card – Create a file named “ssh” – Configure static IP address by editing dhcpcd.conf in rootfs partition inside “etc” directory. Add these lines in the file interface eth0 static ip_address=192.168.X.1/24
Setiawan <stwn at unsoed.ac.id> Preparing Raspberry Pi • Unplug MicroSD card from the reader • Plug MicroSD card into the Raspberry Pi • Plug in all the needed things – If you have a monitor, MicroHDMI-to-VGA converter to Raspberry Pi, also the VGA cable to the other end, and wireless keyboard+mouse dongle – USB type-C power supply
Setiawan <stwn at unsoed.ac.id> Booting up the Raspberry Pi • When the power supply is plugged in, the Raspberry Pi will turn on and boot • If the booting succeeds – Headless: Raspberry Pi will wait for SSH access – With monitor: a desktop will be shown including a welcoming dialog
Setiawan <stwn at unsoed.ac.id> Connecting to the Raspberry Pi • Configure Ethernet interface on your computer by adding an IP address with the same network as your Raspberry Pi – IP address: 192.168.X.2/24 – Depends on OS on your computer – Check if the Raspberry Pi’s IP address is reachable via ping command: ping 192.168.X.1, or ping raspberry.local • Connect to the Raspberry Pi using SSH, or PuTTY – Linux or MAC: ssh pi@192.168.X.1 – Windows 10: run PowerShell application first
Setiawan <stwn at unsoed.ac.id> Configuring VNC Server • Edit rc.local file $ sudo nano /etc/rc.local sudo -u pi vncserver -randr=[resolution] • Save the file • Reboot your Raspberry Pi
Setiawan <stwn at unsoed.ac.id> Remote Access Using VNC • Run VNC Viewer and use the IP address of the Raspberry Pi to connect into • If succeeded, the desktop will be shown
Setiawan <stwn at unsoed.ac.id> First Configuration (1) • Locale – Country, Language, and Timezone – Check “Use English language” and “Use US keyboard” • Change Password – Default username and password: pi/raspberry – Change the password to “@cnt-X”, e.g. “@cnt-10” for ACNT-10 group • If you have a monitor and there is a black border when the desktop is shown up, please tick the checkbox in “Set Up Screen” dialog • Select WiFi Network and enter the password. Turn off Bluetooth
Setiawan <stwn at unsoed.ac.id> First Configuration (2) • Update software, if necessary – Updating software packages on Raspberry Pi OS – Debian-based systems use Advanced Packaging Tool (APT) for package management • Check if the time is correct, related to Network Time Protocol (NTP) • Reboot
Setiawan <stwn at unsoed.ac.id> Command Line-Fu • Command history: up and down arrows • Command search: Ctrl+R, type the command • Tab completion: Tab and Tab-Tab • File editing: Vim, nano, etc. • System monitoring: top, ps
Setiawan <stwn at unsoed.ac.id> IoT Assignment 1 1. Find the Raspberry Pi 4 Model B specifications – System-on-chip – Instruction set – CPU and GPU 2. Visit these websites and report your findings – pinout.xyz – resistorcolorcodecalc.com – gpiozero.readthedocs.io
Setiawan <stwn at unsoed.ac.id> IoT Assignment 1 3. Observing a pair of traffic lights, physically or virtually – Time needed: 5~10 minutes – Take a picture – Draw the pair of traffic lights either by hand or using computer – Put some notes, e.g. time between red to green, and vice versa +situation Upload your experiment results and assignment 1 to Moodle • Using one PDF file • One group, one document • If you have a demo video (3~5 mins), please attach the URL in the document 05/25 9pm Screenshots, figures, descriptions, notes, video, etc.
Setiawan <stwn at unsoed.ac.id> Resources • Raspberry Pi Foundation, “Getting started with your Raspberry Pi,” 2021. [Online]. Available: https://futurelearn.com/courses/getting-started- with-your-raspberry-pi