Skip to content

shenerguang/ZyboRobot

Repository files navigation

Zybo Robot Demo(Zrobot IV zybo)

Where to get help:
==================

1.This demo is provide by digilent, you can visit following website for more information.
http://www.digilentchina.com/productSearch.asp?key=zrobot
http://zrobot.org/

Where to get source code:
=========================

1.You can download FAT partition binary from:
https://github.com/shenerguang/Zrobot_Boot/tree/master/ready_to_download

2.You can download EXT partition binary from:
https://github.com/shenerguang/Zrobot_Ubuntu

3.You can download Vivado project from:
https://github.com/shenerguang/ZRobot_Hardware
Please open with Vivado 2014.2

 
How to use TP-LINK WN823N:
==========================

Firstly, you should disconnect battery charger of zrobot.
Secondly, you should connect zybo to bottom board with usb cable.
Thirdly, connect wifi and webcam to bottom board. 

1.run ifconfig -a
and see wlan No. in my zybo, it is wlan2

2.vi /etc/udhcpd.conf
and modify wlan0 to wlan2

3.vi /etc/network/interfaces
modify wlan0 to wlan2

3.vi /etc/hostapd/hostapd.conf
modify ssid to yourssid
modify wlan0 to wlan2

4.vi /root/go_wlan.sh
modify wlan0 to wlan2

5.Reboot zybo or try to run /root/go_wlan.sh

Hot to use mjpeg and Java applet:
=================================

1.cd /root/mjpeg_face_leaf_detection/mjpg-streamer

2.export LD_LIBRARY_PATH=/root/mjpeg_face_leaf_detection/mjpg-streamer

3../mjpg_streamer -i "input_uvc.so -y -f 5 -r 640*480 -q 60" "output_http.so -p 8080 -w /var/www"

4.Open IE, browse to 192.168.0.1, install the Java plug-in folling prompts.

5.Open "Control Pannel"->"Programs"->"Java"->"Security"
Change Security Level to Medium.
Reopen IE and click "allow" in the prompt window.

Compile env:
============
#!/bin/bash 
export CCOMPILER=arm-xilinx-linux-gnueabi-gcc
export ARCH=arm
export CROSS_COMPILE=arm-xilinx-linux-gnueabi-
export PATH=$PATH:/root/CodeSourcery/bin/

Uboot configuration:
====================

1.git clone https://github.com/Digilent/u-boot-Digilent-Dev
or you can clone https://github.com/shenerguang/u-boot-Digilent-Dev
and skip the following changes.

2.cd u-boot-xlnx/include/configs

4.vi zynq_zybo.h
 80     "sdboot=if mmcinfo; then " \
 81             "run uenvboot; " \
 82             "echo Copying my Linux from SD to RAM... && " \
 83             "fatload mmc 0 0x3000000 ${kernel_image} && " \
 84             "fatload mmc 0 0x2A00000 ${devicetree_image} && " \
 85             "bootm 0x3000000 - 0x2A00000; " \
 86         "fi\0" \

5. cd ../../
make zynq_zybo_config
make
cp u-boot u-boot.elf

Kernel Configuration:
=====================

1.download kernel
1.1 For zybo, please download linux-digilent kernel 3.6
git clone https://github.com/shenerguang/linux-digilent
1.2 For zed, please download linux-xup kernel 3.12
git clone https://github.com/shenerguang/linux-xup

2.cd linux_digilent

3.make ARCH=arm digilent_zybo_defconfig
or you can make zybo_robot_defconfig and skip the following configurations.
for zed you can make zed_robot_defconfig in linux-xup kernel.

4.make ARCH=arm menuconfig
4.1.System Type->
	Xilinx Specific Options->
		[ ]Device Tree At Fixed Address
destination:boot from second sector successfully.

4.2.Networking support->
	wireless->
		cfg80211 and its sub items
		Common routines for IEEE802.11 drivers
		Generic IEEE 802.11 Networking Stack (!important!)
Device Drivers->
	Network device support->
		Ethernet driver support->
			all xilinx driver choose
		PHY Device support and infrastructure->
			Marvell PHYS
			VITESSE PHYS
			REALTEK PHYS
			Support for bitbanged MDIO buses
		Wireless LAN->
			IEEE802.11 for HOST AP and sub items
			Realtek RTL8192CU/RTL8188CU USB Wireless
destination:tplink  wn823n(RTL8192CU) wifi support

4.3.Device Drivers->
	multimedia support->
		Cameras/video grabbers support
		Video capture adapters->
			V4L USB devices->
				usb video class(UVC)
				GSPCA based webcams
destination:configure web cam support

How to auto build devicetree:
=============================
1.git clone https://github.com/Xilinx/device-tree-xlnx/tree/xilinx-v2014.2

2.copy "device-tree-xlnx-v2014.2" folder to
C:\Xilinx\SDK\2014.2\data\embeddedsw\lib\bsp

3.create bsp choose devicetree In Vivado2014.2 SDK

How to build second sector Ubuntu:
==================================
1.In your host, run apt-get and install qemu environment.
apt-get install qemu-user-static qemu-system

2.create a new folder
mkdir qemu-ubuntu

3.qemu-debootstrap --arch=armhf trusty qemu-ubuntu

4.cp `which qemu-arm-static` qemu-ubuntu/usr/bin/

5.chroot qemu-ubuntu/

6.vi /etc/init/ttyPS0.conf
start on stopped rc RUNLEVEL=[2345] and (
not-container or
container CONTAINER=lxc or
container CONTAINER=lxc-libvirt)
stop on runlevel [!2345]
respawn
exec /bin/login -f root < /dev/ttyPS0 > /dev/ttyPS0 2>&1

7.add apt-get source.
echo "deb http://ports.ubuntu.com trusty main restricted multiverse universe" > /etc/apt/sources.list
apt-get update

8.set up root password.
passwd

9.copy ubuntu to sd card.
sudo rsync –a qemu-ubuntu/ /media/ext4

How to config Wifi AP:
======================
1. apt-get install linux-firmware hostapd udhcpd wireless-tools 

2.vi /etc/default/hostapd
Add one line to the bottom:
DAEMON_CONF="/etc/hostapd/hostapd.conf"

3.vi /etc/hostapd/hostapd.conf
# interface used by access point
interface=wlan0
# firmware driver
driver=nl80211
# access point SSID
ssid=XupSmarterCar
# operation mode (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g)
hw_mode=g
# access point channel
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
# key management algorithm
#wpa_key_mgmt=WPA-PSK
#wpa_passphrase=123456789
#wpa=2
# set ciphers
wpa_pairwise=TKIP
rsn_pairwise=CCMP

4.vi /etc/network/interfaces
iface wlan0 inet static
address 192.168.0.1
netmask 255.255.255.0

5.vi /etc/udhcpd.conf
start           192.168.0.20    #default: 192.168.0.20
end             192.168.0.254   #default: 192.168.0.254
interface       wlan0           #default: eth0
remaining       yes             #default: yes
lease_file      /var/lib/misc/udhcpd.leases
pidfile /var/run/udhcpd.pid
option  subnet  255.255.255.0
opt     router  192.168.0.1
option  domain  local
option  lease   864000          # 10 days of seconds

6.Run
ifconfig wlan0 192.168.0.1
/etc/init.d/udhcpd restart
/etc/init.d/hostapd restart

How to build OpenCV:
====================

sudo apt-get install build-essential cmake libgtk2.0-dev pkg-config python-dev python-numpy libavcodec-dev libavformat-dev libswscale-dev

apt-get install libv4l-dev

cd /root/opencv-2.4.9

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .

make install 

References:
===========

1.You can download openloop FAT partition binary from:

About

zrobot filesystem, include boa, mjpeg, opencv, wifi source code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published