2016年11月8日 星期二

web cam server


Whole project come from
https://pimylifeup.com/raspberry-pi-webcam-server/


1. install "ffmpeg"
http://www.deb-multimedia.org/
http://ffmpeg.org/

2. install  "libjpeg-turbo" for JPEG support
http://www.libjpeg-turbo.org/
http://www.linuxfromscratch.org/blfs/view/svn/general/libjpeg.html

3. install "motion"
https://github.com/Motion-Project/motion

4. enable /dev/video0
http://raspberrypi.stackexchange.com/questions/10480/raspi-camera-board-and-motion
$sudo modprobe bcm2835-v4l2

5. allow stream to other computer
$vim motion-dist.conf
replace "stream_localhost off" by "stream_localhost on"

5. execute motion camera server
$cd ~/mmal/motion-master
$sudo ./motion -n -c motion-dist.conf

6. link to web server by broswer
ex. IP:8081 (default port)
192.168.x.x:8081

7. you could also set up authentication for user to log in server
In motion-dist.conf

set  "stream_auth_method 2"
set  "stream_authentication username:password"




some open source

http://www.jvcref.com/files/PI/documentation/html/
https://www.ffmpeg.org/

camera available function from official web
https://www.raspberrypi.org/blog/camera-board-available-for-sale/

!!! RPi-cam-web-interface
http://elinux.org/RPi-Cam-Web-Interface

!!! pi car
https://github.com/shaunuk/picar

Find my raspberry on nerwork



https://www.raspberrypi.org/documentation/remote-access/ip-address.md



ex.
nmap -sn 192.168.1.0/24

1. Install namp in my Mac air

install brew first
http://brew.sh/index_zh-tw.html

install by brew
$brew install nmap

2016年10月9日 星期日

Set up network

1. network setting

 (1) /etc/network/interfaces

=====

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

=====

(2) /etc/wpa_supplicant/wpa_supplicant.conf

=====

network={
        ssid="mySSID"
        psk="myPASSWD"
}

=====

(3) restart network interface

$ sudo ifdown wlan0
$ sudo ifup wlan0

=====

2. useful command

(1) ifconfig

(2) iwconfig

(3) sudo dhclient

(4) route -n

ex. route add default gw 192.168.1.1

(5) /etc/init.d/networking restart

(6) sudo ifdown/ifup wlan0





REFER

https://www.raspberrypi.com.tw/2152/setting-up-wifi-with-the-command-line/

http://raspberrypi.stackexchange.com/questions/14101/connect-network-is-unreachable-on-a-working-connected-wlan0-interface


http://www.cyberciti.biz/faq/linux-setup-default-gateway-with-route-command/

2016年10月8日 星期六

Screen "Out of Range"

I use VGA adapter for HDMI port, but I got no signal on screen.
After Google for a while, I found it is caused that my screen is too old, and can not accept the frame over size.

After dd raspberr pi image from computer to SD card,
change the following config in config.txt from system files.

hdmi_group=2
hdmi_mode=16
hdmi_drive=2

hdmi_force_hotplug=1
config_hdmi_boost=4


you could also refer the wiki to have different config on various monitor resolution: http://elinux.org/RPiconfig

REFER:
http://www.arthurtoday.com/2014/05/raspberry-pi-hdmi-to-vga-how-to.html


2015年11月4日 星期三

[學習] 使用多個 servo motors 的電源問題


最近我用Arduino 做一個貓咪的玩具

使用了四個伺服馬達(servo motors)

但每次想要拔掉usb

只用9v AA電池給電的狀況下都無法運轉

我就猜測

一定是電源不足的問題!!!!




剛好被我在網路上找到了解答

回去來試看看

網址:
http://rcarduino.blogspot.tw/2012/04/servo-problems-with-arduino-part-1.html




裡面最重要的一點是

如果外接電源

『一定要把地線和Arduino 的DCC相連接才行』