Set Static IP untuk WiFi | Rasp Pi

Raspberry Pi akan gunakan default auto IP dengan Ipv4 Address:
192.168.1.xxx.

Kebanyakan HotSpot dari Smart Phone mempunyai struktur lain:
192.168.43.xxx atau 169.235.1.xxx

Dengan ini, Rasp Pi memang tidak dapat untuk connect pada WiFi network, bila IP Address nya salah, walaupun dalam status mengatakan “Connected”.

SETUP STATIC IP PADA RASP PI MELALUI TERMINAL

Before you begin with the assignment of a private IP address for Raspberry Pi, check whether DHCPCD is already activated using the following command:

sudo service dhcpcd status

In case it’s not, activate DHCPCD as follows:

sudo service dhcpcd start
sudo systemctl enable dhcpcd

Now make sure that the configuration of the file /etc/network/interfaceshas the original status. For this, the ‘iface’ configuration needs to be set at ‘manual’ for the interfaces.

For the editing of the activated DHCPCDs, start by opening the configuration file /etc/dhcpcd.confand running the following command:

sudo nano /etc/dhcpcd.conf

You’ll now carry out the configuration of the static IP address. If your Raspberry Pi is connected to the internet via an Ethernet or network cable, then enter the command ‘interface eth0’; if it takes place over Wi-Fi, then use the ‘interface wlan’ command.

To assign an IP address to Raspberry Pi, use the command ‘static ip_address=’ followed by the desired IPv4 address and the suffix ‘/24’ (an abbreviation of the subnet mak 255.255.255.0). For example, if you want to link a computer with the IPv4 address 192.168.0.4, then you need to use the command ‘static ip_address=192.168.0.4/24’. It goes without saying that the address used here is not yet used anywhere else. As such, it also can’t be located in the address pool of a DHCP server.

You still then need to specify the address of your gateway and domain name server (usually both are the router). Raspberry Pi turns to the gateway address if an IP address to which it wants to send something is outside of the subnet mask (in the example, this would mean outside of the range 192.168.0). In the following command, the IPv4 address 192.168.0.1 is used as an example as both the gateway and DNS server. The complete command looks like this in our example (where a network cable is used for the internet connection):

interface eth0
static ip_address=192.168.0.4/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1

The command lines above match the IPv4 addresses that you want to use for your Raspberry Pi, or where your router is assigned. Save the changes with ‘Ctrl + O’ and then press the enter key. Close the configuration file with ‘Ctrl + X’. Restart to adopt the newly assigned static IP address in the network:

sudo reboot

Install Driver untuk WiFi Dongle | Rasp Pi

Nasihat kami, sebelum memilih untuk beli Raspberry Pi, pastikan anda betul-betul beli Rasp Pi yang mempunyai WiFi Chip.

Jika Raspberry Pi anda tiada WiFi,
seperti yang terjadi pada kami, kami membeli RaspBerry Pi yang tiada WiFi, teruskan ke URL yang kami cadangkan berikut untuk install WiFi Dongle driver:

https://www.raspberrypi.org/forums/viewtopic.php?t=210834

RUMUSAN dari FORUM/ARTIKEL di atas:

Untuk Driver MT7610u : TPLINK T2U WiFi Dongle

Code: Select all

sudo wget http://downloads.fars-robotics.net/wifi-drivers/install-wifi -O /usr/bin/install-wifi
sudo chmod +x /usr/bin/install-wifi

and run it using command

Code: Select all

sudo install-wifi

ALTERNATIF UNTUK WIFI DRIVER LAIN:

Untuk Driver WiFi Dongle lain-lain.

https://raspberrypi.stackexchange.com/questions/67719/how-do-i-install-the-drivers-for-a-wifi-dongle-with-the-realtek-8812au-chipset-o

The best and easiest way to handle this problem is as following

  1. sudo wget http://www.fars-robotics.net/install-wifi -O /usr/bin/install-wifi
    • Downloads the installation file
  2. sudo chmod +x /usr/bin/install-wifi
    • makes it executable
  3. Installation process
    • sudo install-wifi -c rpi-update
      – check for driver if rpi-update is run.
    • sudo rpi-update
      – if a driver is available you can run rpi-update to update firmware.
    • sudo install-wifi -u rpi-update
      – then update the driver for the new kernel installed by rpi-update.
    • sudo reboot
      – now reboot to update the kernel with the new wifi driver.

Install OpenCV3 v3.1.0 pada Python 2.7 | Rasp Pi

Website yang di-refer dalam tutorial ini adalah berikut:
https://www.pyimagesearch.com/2018/09/19/pip-install-opencv/

Terdapat beberapa error yang bakal ditempuhi kerana masalah version dan terlalu banyak outsource library.
Kami bersengkan mata siang-malam untuk menyelesaikan masalh ini.

#1 Masalah Bila Tiba Install OpenCV

Untuk menyelesaikan masalah ini, jawapannya berada di URL di bawah:
https://www.pyimagesearch.com/2015/07/27/installing-opencv-3-0-for-both-python-2-7-and-python-3-on-your-raspberry-pi-2/

PENERANGAN:
Dalam link URL di atas, kaedah install OpenCVpip install opencv-contrib-python akan memberikan error:

ERROR: Could not find a version that satiesfies the requirement opencv-contrib-python (from versions: none)
ERROR: No matching distribution found for opencv-contrib-python

Melalui URL ini, kaedah install menggunakan NUMPY dengan syntax di bawah:
pip install numpy

Selepas itu, anda akan melihat Download bar bergerak tanpa ERROR.
PERHATIAN:
Kali ini, mula gunakan VirtualEnv CV3.

#2 Masalah Install VirtualENV

Dari Penerangan di website pyimagesearch , setting pada virtualenvwrapper perlu ditukar kepada:

# virtualenv and virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source /usr/local/bin/virtualenvwrapper.sh

python3 perlu ditukar kepada python