Showing posts with label lap trinh raspberry pi. Show all posts
Showing posts with label lap trinh raspberry pi. Show all posts

Wednesday, March 16, 2016

Totorial - How to setup PI WEB SERVER


Overview :
  • Download the latest Rasbian
  • Prepare a SD / Micro SD card to receive the downloaded Images.
  • Un compress and Transfer the downloaded Raspbian Image to the SD / Micro SD card.
  • Install Raspbian.
  • Configure Raspbian for a static network.
  • Install  Apache Web Server
  • Install PHP and Associated Packages
  • Install MySql
  • Configure your router to access your Webserver and a domain name that points to your webserver.

Monday, March 14, 2016

Bonus 2 : Tip and trick with Raspberry Pi


GETTING THE NETWORK DETAILS

To scan for WiFi networks, use the command
sudo iwlist wlan0 scan | grep 'ESSID\|IE: IEEE'
This will list all available WiFi network names and their encryption methods. Look for yours in the list:
  1. ESSID:"yournetwork". This is the name of the WiFi network, find the one that you want to use.
  2. IE: IEEE 802.11i/WPA2 Version 1.
    1. This is the authentication used; in this case it is WPA2, the newer and more secure wireless standard which replaces WPA1. This guide should work for WPA or WPA2, but may not work for WPA2 enterprise; for WEP hex keys.

ADDING THE NETWORK TO THE RASPBERRY PI

Open the wpa-supplicant configuration file in nano:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Go to the bottom of the file and add the following:
network={
    ssid="The_ESSID_from_earlier"
    psk="Your_wifi_password"
}
In the case of the example network, we would enter:
network={
    ssid="testing"
    psk="testingPassword"
}
Now save the file by pressing ctrl+x then y, then finally press enter.
At this point, wpa-supplicant will normally notice a change has occurred within a few seconds, and it will try and connect to the network. If it does not, either manually restart the interface with
sudo ifdown wlan0
and
sudo ifup wlan0
or reboot your Raspberry Pi with
sudo reboot
You can verify if it has successfully connected using ifconfig wlan0. If the inet addr field has an address beside it, the Pi has connected to the network. If not, check your password and ESSID are correct.
You can also check your DHCP server to see if it gave out a new IP address.

Remove any unneeded packages

There will eventually be packages that are unneeded. Apt-get can get rid of them by issuing this command:

sudo apt-get autoremove

Remote Desktop

Installing this allows you to connect via RDP on Windows.
sudo apt-get install xrdp

Add Chrome/Chromium to Desktop

Adds “Chrome” web browser to the GUI interface.
sudo apt-get install chromium-browser

Check CPU Clock Speed

This will show the current CPU clock speed in hertz
 cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq

Raspi-config

This is the initial configuration utility. I always forget its name..
sudo raspi-config

Wednesday, March 9, 2016

CÀI ĐẶT RASPBERRY PI - Bài 9 : SETUP DROPBOX FOR MOTION ON THE RASPBERRY PI


Raspbian, the recommended default operating system of the Raspberry Pi, does not come with a native Dropbox package. The hacks I saw online were all pretty sloppy, with many showing how to bounce files from your raspberry pi to another device like a desktop PC that has dropbox installed, then using that PC to sync files. I wanted Dropbox synchronization for only a single folder, and for one purpose: to collect the photos my webcam takes when using the motion software.

I decided to use Dropbox’s Python API to create a script that could save my security footage. I had a number of uninvited painters scheduled to come to my apartment while I was away at work and needed something that would save to a remote location. The code that follows is tailored to the motion program. Since motion can automatically execute a program or script upon writing a file (ie: saving a photo or video triggered by motion), I decided to take advantage of this and upload each file individually as opposed to running an additional script that continually monitors the filesystem for changes.

Tuesday, March 8, 2016

CÀI ĐẶT RASPBERRY PI - Bài 8 : SETUP Raspberry Pi as low-cost HD surveillance camera

Build a low-cost HD video surveillance cam with worldwide access from any browser

Introduction

This article describes how to build a surveillance cam based on a Raspberry Pi micro-computer which records HD video when something moves in the monitored area. Live picture can be viewed from any web browser, even from your mobile while you're on the road.
What you will get:
  • See live stream in any web browser from anywhere
  • Record any motion into video file
Hardware components
      We need some hardware for this project. This is a list of the major things we need:
  • Raspberry Pi 2 Model B: (Link : http://hshop.vn/products/moy-tonh-raspberry-pi-2-model-b-1gb-made-in-prc)
  • Raspberry Pi Camera Module (Link : http://hshop.vn/products/camera-hong-ngoai-raspberry-pi-noir)

Tuesday, March 1, 2016

CÀI ĐẶT RASPBERRY PI - Bài 7 : Điều khiển Raspberry Pi sử dụng SSH (Windows, Linux)

Mục đích:
  • Cấu hình Raspberry Pi để sử dụng tính năng điều khiển từ xa qua SSH
  • Cấu hính trên Windows, Linux để điều khiển SSH

Chuẩn bị:

  • Raspberry Pi có hệ điều hành (Raspbian Wheezy hoặc Jessie)
  • Máy tính chạy: Windows, Linux hoặc Mac

Tiến hành:

Bước 1. Cấu hình Raspberry Pi

Để có thể điều khiển Raspberry Pi sử dụng SSH thì Raspberry Pi phải được Enable SSH server.
Thông thường thì SSH Server được mở mặc định.

Friday, February 26, 2016

Hướng dẫn thiết lập đóng ngắt mach điện qua esp8266 wifi module

Chuẩn bị:

1.     Module 1 Relay (5VDC) với opto và transitor cách ly. 
2.   Module ESP8266 v12 wifi NodeMCU v3. Giá 200k
3.  Supply Power 5V 2A chẻ 2 nhánh cấp nguồn cho esp và relay
4.  Dây nhảy
(Tất cá linh kiện này bạn có thể mua ở hshop.vn)
(

CÀI ĐẶT RASPBERRY PI - Bài 6 : How To Install Multiple OSes On A Single SD Card For Raspberry Pi

Running multiple projects on your Raspberry Pi usually requires a different operating system or configuration for each, best achieved with multiple SD cards. But is there a way to “dual-boot” the OS?
The Raspberry Pi is a very flexible little PC, but this flexibility can have its downsides. Being able to dual- or multi-boot different operating systems (many OSes are available for the Raspberry Pi) can prove extremely useful, particularly with projects that have similar hardware requirements, such as a media centre and a retro gaming centre.

Wednesday, February 24, 2016

Bonus 1 : Một số lệnh thường dùng trên Raspberry Pi:

Command là một công cụ rất mạnh trên linux, Wheezy cung cấp cho bạn môi trường desktop để làm việc tuy nhiên nếu bạn muốn thực sự có cảm giác làm việc với linux, hãy dùng command. :D

Mình liệt kê ở đây một số lệnh thường sử dụng trên môi trường linux, các bạn có thể gõ lệnh trực tiếp vào LXTerminal:

Một topic liệt kê cũng rất nhiều lệnh, bạn có thể tham khảo ở đây:
Chia sẻ - Những câu lệnh cơ bản + 1 vài thủ thuật nhỏ trên Raspberry Pi | Cộng đồng cơ điện tử Việt Nam | Mechatronics 

CÀI ĐẶT RASPBERRY PI - BÀI 4: Cài đặt Python-OpenCV sử dụng lệnh terminal

Nguồn : codientu.org



1. Cài đặt Python OpenCV 
Sau khi cấp nguồn, hệ thống sẽ tự động boot vào hệ điều hành wheezy đang có trong thẻ nhớ, mặc định bạn đăng nhập hệ thống sử dụng username và password: pi/raspberry. Tiếp theo, bạn chạy giao diện LXDE được cài sẵn bằng lệnh: startx

CÀI ĐẶT RASPBERRY PI - BÀI 3 : ĐIỀU KHIỂN, LẬP TRÌNH RASPBERRY PI TỪ XA KHÔNG CẦN MÀN HÌNH

Nguồn : Nguyễn Sơn Lâm

Qua quá trình dạy lớp Raspberry Pi, nhận thấy có 1 vấn đề khá lớn của bo mạch này đó là mặc dù chi phí rất rẻ, nhưng phụ kiện kèm theo không hề rẻ, đặc biệt là thiết bị hiển thị (hầu hết người mới lập trình sẽ muốn lập trình qua giao diện, do đó sẽ cần màn hình hiển thị).
  • Màn hình có HDMI thì có thể kết nối ngay với Rasp Pi bằng 1 dây HDMI, nhưng không phải ai cũng có màn hình, và chi phí rất cao.
  • Màn hình VGA có thể có sẵn và chi phí rẻ hơn, nhưng cũng sẽ phải mua thêm 1 bộ chuyển đổi HDMI-VGA vào khoảng 300k
Xin giới thiệu với các bạn 1 cách khác để lập trình Rasp Pi với giao diện Raspbian mà không cần màn hình, đó là sử dụng XRDP, một chương trình Remote Desktop. Không tốn chút chi phí nào.

LẬP TRÌNH RASPBERRY PI- BÀI 1: LẬP TRÌNH GPIO VÀ ĐIỀU KHIỂN LED

Nguồn : Nguyễn Sơn Lâm
Trong bài này tôi sẽ hướng dẫn cách sử dụng các chân GPIO của Raspberry Pi để điều khiển các thiết bị (đèn Led) cũng như nhận tín hiệu đầu vào (nút bấm)
1. Tải và cài đặt thư viện bcm2835

Monday, January 4, 2016

Tutorial - How to set up simple home automation system - Final

Start OpenHAB

"OpenHAB, How Cold Is It?"

Tutorial - How to set up simple home automation system - Part X

OpenHAB

"A vendor and technology agnostic open source automation software for your home"

Tutorial - How to set up simple home automation system - Part IX

The RF24 Libraries

"Optimized High Speed Arduino/Raspberry Pi driver for nRF24L01"

Tutorial - How to set up simple home automation system - Part VIII

Connecting The RF24 Modules

"A highly integrated, ultra low power 2Mbps RF transceiver for the 2.4GHz band"

Tutorial - How to set up simple home automation system - Part VII

Mosquitto

Tutorial - How to set up simple home automation system - Part VI

Testing Your Arduino

Tutorial - How to set up simple home automation system - Part V

The Arduino

Tutorial - How to set up simple home automation system - Part IV

Raspberry Pi - The Internet

Tutorial - How to set up simple home automation system - Part III

Raspberry Pi - First Time Configuration