Iot Application (Raspberry quick start and internet connection setup)

Getting the web application hardware up and running takes a few steps regarding some internal setup , internet connectivity and SSH.  Since raspberry is so popular , we can find many guides, forums, tutorials etc.

First of all, download and flash Raspbian:

  • download Raspberrypi official site raspbian from the official raspberry site
  • flashing operating system on  the card with etcher

I choose raspbian lite since i do not need a graphical interface and other extra features.

Initial start of the Raspberry:

While Raspbian does not get installed per say , it is simply loaded and runned from the card. On the first run your user is pi and the password is raspberry.

You are now restricted to use a screen, and no internet via wireless connection just yet.

Internal config:

Access Raspberry configuration tool via:

I usually tend to do the following setup:

  • change password
    raspi-config-screen
  • expand file system (found under main screen/advanced options)
    expand-file-system
  • enable ssh (found under main screen/interfacing options)
    enable-ssh

More elaborate description of these configuration options are found on the official page.

Connect to the internet:

Given the fact that i am using a Raspberry 3 which has a 2.4GHz 802.11n wireless, i am going to setup a wireless connection with a static address. Going with a static address and not a dhcp , is a good approach since most of the time i will interface with the Raspberry via ssh. Another thing to have in mind is that this setup also requires to do a bind in the router aswell. The static ip address you assign to the Raspberry needs to get binded with the its mac address. With a simple search over the internet by your router model that becomes trivial. You can find the mac address by typing in the raspberry`s terminal:

As a result you will get something like this, where wlan0 stands for wireless lan , and HWaddr is the mac address.

ifconfig

In addition ,since we are here (router config), you also need to open port 22, which is the default SSH port, for the ip address you want to assign to your raspberry. Again due to the broad diversity of routers is better to search how to do that over the internet ,  by your router model.

After you dealt with the router part, it’s time to add the connection details in the Raspberry like so:

  • first of all ,open the interface configuration file in a text editor
Where in that line, nano is the text editor we use , followed by the location of the file.

  • then edit the file similarly
  • hence the extra comments , you need to delete them in order to work properly
  • hit ctrl+x to save
  • and reboot your raspberry to get the interface restarted via:

Connect remotely:

Almost done, by now you should be online and rockin’. Just check again with ifconfig to make sure that you get inbound and outbound traffic (RX an TX  in the wlan0 section should indicate a byte counter).

Finally to enjoy the flexibility gained through ssh , and get rid of the extra keyboard and screen that you need for running the pi, just download PUTTY ssh client and:

putty

or use a linux terminal , this is my option since i am running linux on my laptop.


Some footnote:

This setup seems a bit tricky for starters , but with basic knowledge regarding routers and a linux terminal becomes trivial.

Do you feel like you have missed something, try getting your bearings in the intro post for this project , since it also contains a so called glossary where you can access what part is especially relevant to you.

Recommended Posts

Leave a Comment

Start typing and press Enter to search

application for internet of things