$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04 LTS Release: 18.04 Codename: bionic
1 2 3 4 5
$ gcc --version gcc (Ubuntu 7.3.0-16ubuntu3) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the sourcefor copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ ./configure WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.google.protobuf.UnsafeUtil (file:~/.cache/bazel/_bazel_jiapei/install/ce085f519b017357185750fe457b4648/_embedded_binaries/A-server.jar) to field java.nio.Buffer.address WARNING: Please consider reporting this to the maintainers of com.google.protobuf.UnsafeUtil WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command"bazel shutdown". You have bazel 0.15.0 installed. Please specify the location of python. [Default is /usr/bin/python]:
Found possible Python library paths: /usr/local/lib/python3.6/dist-packages /usr/lib/python3/dist-packages Please input the desired Python library path to use. Default is [/usr/local/lib/python3.6/dist-packages]
Do you wish to build TensorFlow with jemalloc as malloc support? [Y/n]: Y jemalloc as malloc support will be enabled for TensorFlow.
Do you wish to build TensorFlow with Google Cloud Platform support? [Y/n]: Y Google Cloud Platform support will be enabled for TensorFlow.
Do you wish to build TensorFlow with Hadoop File System support? [Y/n]: Y Hadoop File System support will be enabled for TensorFlow.
Do you wish to build TensorFlow with Amazon AWS Platform support? [Y/n]: Y Amazon AWS Platform support will be enabled for TensorFlow.
Do you wish to build TensorFlow with Apache Kafka Platform support? [Y/n]: Y Apache Kafka Platform support will be enabled for TensorFlow.
Do you wish to build TensorFlow with XLA JIT support? [y/N]: N No XLA JIT support will be enabled for TensorFlow.
Do you wish to build TensorFlow with GDR support? [y/N]: N No GDR support will be enabled for TensorFlow.
Do you wish to build TensorFlow with VERBS support? [y/N]: N No VERBS support will be enabled for TensorFlow.
Do you wish to build TensorFlow with OpenCL SYCL support? [y/N]: N No OpenCL SYCL support will be enabled for TensorFlow.
Do you wish to build TensorFlow with CUDA support? [y/N]: y CUDA support will be enabled for TensorFlow.
Please specify the CUDA SDK version you want to use. [Leave empty to default to CUDA 9.0]: 9.2
Please specify the location where CUDA 9.2 toolkit is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:
Please specify the cuDNN version you want to use. [Leave empty to default to cuDNN 7.0]: 7.1.4
Please specify the location where cuDNN 7 library is installed. Refer to README.md for more details. [Default is /usr/local/cuda]:
Do you wish to build TensorFlow with TensorRT support? [y/N]: N No TensorRT support will be enabled for TensorFlow.
Please specify the NCCL version you want to use. [Leave empty to default to NCCL 1.3]:
Please specify a list of comma-separated Cuda compute capabilities you want to build with. You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus. Please note that each additional compute capability significantly increases your build time and binary size. [Default is: 5.2]
Do you want to use clang as CUDA compiler? [y/N]: N nvcc will be used as CUDA compiler.
Please specify which gcc should be used by nvcc as the host compiler. [Default is /usr/bin/gcc]:
Do you wish to build TensorFlow with MPI support? [y/N]: N No MPI support will be enabled for TensorFlow.
Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -march=native]:
Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: N Not configuring the WORKSPACE for Android builds.
Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See tools/bazel.rc for more details. --config=mkl # Build with MKL support. --config=monolithic # Config for mostly static monolithic build. Configuration finished
$ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg Wed Jul 11 00:09:09 PDT 2018 : === Preparing sources indir: /tmp/tmp.5X0zsqfxYo /media/jiapei/Data/Downloads/machinelearning/deeplearning/tensorflow/tensorflow /media/jiapei/Data/Downloads/machinelearning/deeplearning/tensorflow/tensorflow /media/jiapei/Data/Downloads/machinelearning/deeplearning/tensorflow/tensorflow Wed Jul 11 00:09:35 PDT 2018 : === Building wheel warning: no files found matching '*.dll' under directory '*' warning: no files found matching '*.lib' under directory '*' warning: no files found matching '*.h' under directory 'tensorflow/include/tensorflow' warning: no files found matching '*' under directory 'tensorflow/include/Eigen' warning: no files found matching '*.h' under directory 'tensorflow/include/google' warning: no files found matching '*' under directory 'tensorflow/include/third_party' warning: no files found matching '*' under directory 'tensorflow/include/unsupported' Wed Jul 11 00:10:58 PDT 2018 : === Output wheel file is in: /tmp/tensorflow_pkg
Let's have a look at what's been built:
1 2
$ ls /tmp/tensorflow_pkg/ tensorflow-1.9.0rc0-cp36-cp36m-linux_x86_64.whl
4.2 Pip Installation
And, let's have
tensorflow-1.9.0rc0-cp36-cp36m-linux_x86_64.whl
installed.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
$ pip3 install /tmp/tensorflow_pkg/tensorflow-1.9.0rc0-cp36-cp36m-linux_x86_64.whl Processing /tmp/tensorflow_pkg/tensorflow-1.9.0rc0-cp36-cp36m-linux_x86_64.whl Requirement already satisfied: wheel>=0.26 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (0.31.1) Requirement already satisfied: gast>=0.2.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (0.2.0) Requirement already satisfied: numpy>=1.13.3 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (1.14.5) Requirement already satisfied: astor>=0.6.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (0.7.1) Requirement already satisfied: six>=1.10.0 in ./.local/lib/python3.6/site-packages (from tensorflow==1.9.0rc0) (1.11.0) Requirement already satisfied: grpcio>=1.8.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (1.13.0) Requirement already satisfied: absl-py>=0.1.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (0.2.2) Requirement already satisfied: tensorboard<1.9.0,>=1.8.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (1.8.0) Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (1.1.0) Requirement already satisfied: setuptools<=39.1.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (39.1.0) Requirement already satisfied: protobuf>=3.6.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow==1.9.0rc0) (3.6.0) Requirement already satisfied: bleach==1.5.0 in /usr/local/lib/python3.6/dist-packages (from tensorboard<1.9.0,>=1.8.0->tensorflow==1.9.0rc0) (1.5.0) Requirement already satisfied: html5lib==0.9999999 in /usr/local/lib/python3.6/dist-packages (from tensorboard<1.9.0,>=1.8.0->tensorflow==1.9.0rc0) (0.9999999) Requirement already satisfied: werkzeug>=0.11.10 in ./.local/lib/python3.6/site-packages (from tensorboard<1.9.0,>=1.8.0->tensorflow==1.9.0rc0) (0.14.1) Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.6/dist-packages (from tensorboard<1.9.0,>=1.8.0->tensorflow==1.9.0rc0) (2.6.11) Successfully installed tensorflow-1.9.0rc0
Let's test if Tensorflow
has been successfully installed.
4.3 Check Tensorflow
1 2 3 4 5 6 7
$ python Python 3.6.5 (default, Apr 1 2018, 05:46:30) [GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license"for more information. >>> import tensorflow as tf >>> tf.__version__ '1.9.0-rc0'
5. Keras Installation
After successfully check out Keras, we can easily have
Keras installed by command python setup.py
install.
Installed /usr/local/lib/python3.6/dist-packages/Keras-2.2.0-py3.6.egg Processing dependencies for Keras==2.2.0 Searching for Keras-Preprocessing==1.0.1 Best match: Keras-Preprocessing 1.0.1 Adding Keras-Preprocessing 1.0.1 to easy-install.pth file
Using /usr/local/lib/python3.6/dist-packages Searching for Keras-Applications==1.0.2 Best match: Keras-Applications 1.0.2 Adding Keras-Applications 1.0.2 to easy-install.pth file
Using /usr/local/lib/python3.6/dist-packages Searching for h5py==2.8.0 Best match: h5py 2.8.0 Adding h5py 2.8.0 to easy-install.pth file
Using /usr/local/lib/python3.6/dist-packages Searching for PyYAML==3.13 Best match: PyYAML 3.13 Adding PyYAML 3.13 to easy-install.pth file
Using /usr/local/lib/python3.6/dist-packages Searching for six==1.11.0 Best match: six 1.11.0 Adding six 1.11.0 to easy-install.pth file
Using /usr/lib/python3/dist-packages Searching for scipy==1.1.0 Best match: scipy 1.1.0 Adding scipy 1.1.0 to easy-install.pth file
Using /usr/local/lib/python3.6/dist-packages Searching for numpy==1.14.5 Best match: numpy 1.14.5 Adding numpy 1.14.5 to easy-install.pth file
Using /usr/local/lib/python3.6/dist-packages Finished processing dependencies for Keras==2.2.0
That's all for today. I think Python is seriously cool, handy
indeed. I myself will still recommend Pytorch, but it seems Tensorflow and Keras are also very popular in North
America.
I'm quite busy today. So, I'd just post some videos to show the
performance about jiu bu gao su ni😆
Click on the pictures to open an uploaded Facebook video.
1. Key Point Localization
1.1 Nobody
- Yeah, it's ME, 10 YEARS ago. How time flies...
1.2 FRANCK -
What a Canonical Annotated Face Dataset
Just notice this
news about ImageAI today. So, I just had it tested for fun. I
seriously don't want to talk about ImageAI too much,
you can follow the author's github and
it shouldn't be that hard to have everything done in minutes.
1. Preparation
1.1 Prerequisite Dependencies
As described by on ImageAI's Github,
multiple Python dependencies need to be installed:
Tensorflow
Numpy
SciPy
OpenCV
Pillow
Matplotlib
h5py
Keras
All packages can be easily installed by command:
1
pip3 install PackageName
Afterwards, ImageAI can be
installed by a single command:
$ python FirstPrediction.py 2018-07-02 18:12:09.275412: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA convertible : 52.45954394340515 sports_car : 37.61279881000519 pickup : 3.1751133501529694 car_wheel : 1.817503571510315 minivan : 1.748703233897686
$ python FirstDetection.py Using TensorFlow backend. 2018-07-02 18:23:09.634037: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2018-07-02 18:23:11.744790: W tensorflow/core/framework/allocator.cc:101] Allocation of 68300800 exceeds 10% of system memory. 2018-07-02 18:23:11.958081: W tensorflow/core/framework/allocator.cc:101] Allocation of 68403200 exceeds 10% of system memory. 2018-07-02 18:23:12.174739: W tensorflow/core/framework/allocator.cc:101] Allocation of 68403200 exceeds 10% of system memory. 2018-07-02 18:23:12.433540: W tensorflow/core/framework/allocator.cc:101] Allocation of 68403200 exceeds 10% of system memory. 2018-07-02 18:23:12.694631: W tensorflow/core/framework/allocator.cc:101] Allocation of 68403200 exceeds 10% of system memory. 2018-07-02 18:23:16.267111: W tensorflow/core/framework/allocator.cc:101] Allocation of 64224000 exceeds 10% of system memory. 2018-07-02 18:23:16.370939: W tensorflow/core/framework/allocator.cc:101] Allocation of 64224000 exceeds 10% of system memory. 2018-07-02 18:23:16.403353: W tensorflow/core/framework/allocator.cc:101] Allocation of 67435200 exceeds 10% of system memory. person : 55.596935749053955 person : 66.90954566001892 person : 67.96322464942932 person : 50.80411434173584 bicycle : 64.87574577331543 bicycle : 72.0929205417633 person : 80.02063035964966 person : 85.82872748374939 truck : 59.56767797470093 person : 66.69963002204895 person : 79.37889695167542 person : 64.81361389160156 bus : 65.35580158233643 bus : 97.16107249259949 bus : 68.20474863052368 truck : 67.65954494476318 truck : 77.73774266242981 bus : 69.96590495109558 truck : 69.54039335250854 car : 61.26518249511719 car : 59.965676069259644
And, under the program folder, you will get an output image:
$ python FirstDetection.py Using TensorFlow backend. 2018-07-02 18:25:24.919351: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA person : 53.27633619308472 person : 52.71329879760742 person : 63.67729902267456 person : 55.00321388244629 person : 74.53054189682007 person : 51.54905915260315 motorcycle : 59.057921171188354 bus : 93.79504919052124 bus : 86.21828556060791 bus : 77.143394947052 person : 59.69809293746948 car : 71.79147601127625 car : 60.15858054161072 person : 62.758803367614746 person : 58.786213397979736 person : 76.49624943733215 car : 56.977421045303345 person : 67.86248683929443 person : 50.977784395217896 person : 52.3215651512146 motorcycle : 52.81376242637634 person : 76.79281234741211 motorcycle : 74.65972304344177 person : 55.96961975097656 person : 68.15704107284546 motorcycle : 56.21282458305359 bicycle : 71.78951501846313 motorcycle : 69.68616843223572 bicycle : 91.09067916870117 motorcycle : 83.16765427589417 motorcycle : 61.57424449920654
And, under the program folder, you will get an output image:
It has been quite a while that my VOSM has NOT been updated.
My bad for sure. But today, I have it updated, and VOSM-0.3.5 is
released. Just refer to the following 3 pages on
github:
To download videos from Youtube is sometimes
required. Some Chrome plugins can be used to download
Youtube videos, such as: Youtube
Downloader. Other methods can also be found on various resources,
such as: WikiHow.
In this blog, I'm going to cite (copy and paste)
from WikiHow about
How to download Youtube videos by using VLC.
STEP1: Copy Youtube URL
Find the Youtube video that you would like to download, and copy the
Youtube URL.
STEP 2: Broadcast Youtube
Video in VLC
Paste the URL under VLC Media
Player->Media->Open Network
Stream->Network Tab->Please
enter a network URL:, and Play:
STEP 3: Get the
Real Location of Youtube Video
Then, copy the URL under Tools->Codec
Information->Codec->Location:
We can of course directly download the package from WeeChat Download, and have it
installed from source. However, installing WeeChat from repository is
recommended.
Finally, I’ve got some time to write something about PyTorch, a popular deep learning tool. We
suppose you have had fundamental understanding of Anaconda Python, created Anaconda
virtual environment (in my case, it’s named condaenv), and had PyTorch installed successfully under this
Anaconda virtual environment condaenv.
Since I’m using Visual
Studio Code to test my Python code (of course, you can use whichever
coding tool you like), I suppose you’ve already had your own coding tool
configured. Now, you are ready to go!
In my case, I’m giving a tutorial, instead of coding by myself.
Therefore, Jupyter Notebook is
selected as my presentation tool. So, I’ll demonstrate everything both
in .py files, as well as .ipynb files. All codes can be found at Longer Vision
PyTorch_Examples. However, ONLYJupyter Notebook presentation is given in
my blogs. Therefore, I suppose you’ve already successfully installed Jupyter Notebook, as well as any other
required packages under your Anaconda virtual environment
condaenv.
The ONLY concept in CNN we want to
emphasize here is Back
Propagation, which has been widely used in traditional neural
networks, which takes the solution similar to the final Fully
Connected Layer of CNN. You are welcome to get some more
details from https://brilliant.org/wiki/backpropagation/.
Pre-defined Variables
Training Database
\(X={(\vec{x_1},\vec{y_1}),(\vec{x_2},\vec{y_2}),…,(\vec{x_N},\vec{y_N})}\):
the training dataset \(X\) is composed
of \(N\) pairs of training samples,
where \((\vec{x_i},\vec{y_i}),1 \le i \le
N\)
\((\vec{x_i},\vec{y_i}),1 \le i \le
N\): the \(i\)th training sample
pair
\(\vec{x_i}\): the \(i\)th input vector (can be an original
image, can also be a vector of extracted features, etc.)
\(\vec{y_i}\): the \(i\)th desired output vector (can be a one-hot vector, can
also be a scalar, which is a 1-element vector)
\(\hat{\vec{y_i} }\): the \(i\)th output vector from the nerual network
by using the \(i\)th input vector \(\vec{x_i}\)
\(N\): size of dataset, namely, how
many training samples
\(w_{ij}^k\): in the neural
network’s architecture, at level \(k\),
the weight of the node connecting the \(i\)th input and the \(j\)th output
\(\theta\): a generalized denotion
for any parameter inside the neural networks, which can be looked on as
any element from a set of \(w_{ij}^k\).
Hi, today, I'm going to revisit a very old topic, Setup
Repeater Bridge Using A dd-wrt Router. This reminds me of my
FIRST startup Misc
Vision that used to resell Foscam home
security IP cameras. That is a long story. Anyway, this blog is
going to heavily cite the contents on this
page.
PART A:
Flash A Supported Router with DD-WRT Firmware
Before we start to tackle the problem, the open
source firmware DD-WRT is strongly
recommended to flash your router.
1. DD-WRT and OpenWRT
Two widely used open source router firmware have been published
online for quite a bit of time: DD-WRT, OpenWRT In fact, each of these two are
OK for router firmware flashing.
2. DD-WRT Supported Routers
To check if your router is supported by DD-WRT, you need to check this
page.
3. DD-WRT SL-R7202
In my case, I got a lot of such routers in hand and am selling them
on Craigslist
(if anybody is interested in it, please let me know). You can also find
some either continued or discontinued
such products on the market, such as Gearbest.
DD-WRT SL-R7202 looks good:
In one word, find some DD-WRT supported router, and have it
successfully flashed FIRST. As a lazy man, I'm
NOT going to flash anything but just use a router
coming with an existing DD-WRT firmware, namely, DD-WRT
SL-R7202.
PART B: The Problem
The problem that we are going to deal with is how to connect multiple
routers, so that the Internet range can be expanded. For routers with
dd-wrt firmware, there are mulitple ways to connect routers, please
refer to https://www.dd-wrt.com/wiki/index.php/Linking_Routers.
1. Linking Routers
In the following, most contents are CITED directly
from Linking
Routers and its extended webpages.
Access Point / Switch - Extend the Wireless
access area using more routers, with WIRED connections
between routers, or turn a WIRED port on an existing
network into a Wireless Access Point. All computers will be on the same
network segment, and will be able to see one another in Windows Network.
This works with all devices with LAN ports, and does not require dd-wrt
to be installed. "
Wireless
Access Point - Extend Wi-Fi & LAN (Requires physical(just
WIRED) ethernet connection between routers)
Switch -
Similar config as WAP, but radio disabled (accepts only
WIRED connections)
Repeater / Repeater Bridge - Extend the Wireless
access area using a second router WIRELESSLY connected
to the primary. The secondary router must have dd-wrt installed; the
primary does not need dd-wrt.
Repeater
Bridge - A wireless repeater with DHCP & NAT disabled, clients
on same subnet as host AP (primary router). That is, all computers can
see one another in Windows Network.
Repeater
- A wireless repeater with DHCP & NAT enabled, clients on different
subnet from host AP (primary router). Computers connected to one router
can not see computers connected to other routers in Windows
Network.
Universal
Wireless Repeater - Uses a program/script called AutoAP to keep a
connection to the nearest/best host AP.
Client / Client Bridge - Connect two wired
networks using a WiFi link (WIRELESS connection between two routers).
The secondary router must have dd-wrt installed; the primary router does
not need to have dd-wrt.
Client
Bridged - Join two wired networks by two Wireless routers building a
bridge. All computers can see one another in Windows Network.
Client
Mode - Join two wired networks by two Wireless routers (unbridged).
Computers on one wired network can not see computers on other wired
network in Windows Network.
WDS - Extend the Wireless access area using more
routers connected WIRELESSLY. WDS is a mesh network. Routers must almost
always have the SAME chipset type for WDS to work, and any non dd-wrt
routers must be WDS compatible. Using identical routers is best, but not
always necessary if all devices have the same chipset types. (All
Broadcom or all Atheros etc)
OLSR - Extend the Wireless access area using
more routers. Extra routers do not need any wired connections to each
other. Use several ISP (Internet) connections. OLSR is a mesh
network.
In my case, my laptop and some of my IoT devices can be easily
connected to the ShawCable
Modem/Router combo, which is on the 2nd floor in my
living room and directly connected to the Internet. However, my R&D
office is located in my garage on the 1st floor, where
dd-wrt router is put in. In such a case, my dd-wrt router must be
connected to my ShawCable
Modem/Router WIRELESSLY.
Due to the reason explained in the section Difference between
Client Bridge and Repeater Bridge. A standard wireless bridge
(Client Bridge) connects wired clients to a secondary
router as if they were connected to your main router with a cable.
Secondary clients share the bandwidth of a wireless connection back to
your main router. Of course, you can still connect clients to your main
router using either a cable connection or a wireless connection.
The limitation with standard bridging is that it
only allows WIRED clients to connect to your secondary
router. WIRELESS clients cannot connect to your
secondary router configured as a standard bridge. Repeater Bridge
allows both WIRELESS AND WIRED clients to connect to a
the Repeater Bridge router, and through that device
WIRELESSLY to a primary router. You can still use this
mode if you only need to bridge wired clients; the extra wireless
repeater capability comes along for free; however, you are not required
to use it.
Therefore, we select Repeater Bridge as our
solution. Here, DD-WRT SL-R7202 is selected as the
Repeater Bridge. The difficulty is how to setup
DD-WRT SL-R7202 to make it work as a wireless Repeater
Bridge?
PART C: About Firmware
(Optional)
1. Do We Need Firmware
Upgrading?
Actually, before I come to this step, I've already: * strictly
followed the configuration process written on https://www.dd-wrt.com/wiki/index.php/Repeater_Bridge,
but FAILED many times. * and afterwards, I found a
video solution at https://www.youtube.com/watch?v=ByB8vVGBjh4, which
seems to be suitable for my case. However, it finally turns out that my
DD-WRT SL-R7202 router comes with a firmware version
DD-WRT (build 13064), but the tutorial on
Youtube uses a router with firmware version
DD-WRT (build 21061).
It seems to me that a firmware upgrading is a must before we setup
the Wireless Repeater Bridge Mode. But,
How?
2.
Reset to Factory Defaults on DD-WRT Router (The 2nd Router)
First of all, we need to reset DD-WRT. There is a black button on my
DD-WRT SL-R7202, as shown:
In fact, how to reset DD-WRT needs to be paid
attention to. > Hold the reset button until lights flash (10-30sec)
or 30-30-30 if appropriate for your router. (DO NOT 30-30-30 ARM
routers.)
3. Visit http://192.168.1.1:
After successfully reset DD-WRT router to factory default, connect it
with your host computer via a WIRED cable, for better
stablity. Then, we change our network connection from our FIRST
router to SECOND router: dd-wrt router.
Afterwards, let's visit http://192.168.1.1.
NOTE: My host computer's IP address on the
FIRST router, namely, ShawCable
Modem/Router is staticly set as 192.168.0.8 (which is
able to connect to the Internet). After I switch to the Wifi
dd-wrt, my host's IP is DHCP allocated
to 192.168.1.103. The gateway on
ShawCable is 192.168.0.1, which is
different from the gateway on dd-wrt 192.168.1.1 by
default.
1) FIRST Page
DD-WRT home page looks like:
And it's suggested we input a new router username
root and password admin. After the
button Change Password is clicked, we are entering the
very first page of DD-WRT Web GUI.
We can easily tell the firmware's info on the top right corner.
1 2 3
Firmware: DD-WRT v24-sp2 (10/10/09) std Time: 00:01:13 up 1 min, load average: 0.12, 0.04, 0.00 WAN IP: 0.0.0.0
And, we can also easily tell from the bottom of this page that for
now, only 1 DHCP client is connected to this router, which is just our
host computer: jiapei-GT72-6QE.
2) System Info on Status Page
DD-WRT Status page tells a lot about what's in this router:
Clearly, our router model is Buffalo WHR-G300N, and
our firmware build version is 13064.
Clearly, we should be able to upgrade from our current firmware
version 13064 to the newer one
14896.
With the existing firmware version 13064 installed
on the router SL-R7202, we can directly upgrade the
firmware through web flash by downloading the firmware
WHR-G300N-webflash.bin, but ignoring downloading all
TFTP and openvpn files.
4) Firmware Upgrading
Just click Administration -> Firmware Upgrade,
and then choose WHR-G300N-webflash.bin.
After clicking Choose file, the system is
automatically upgraded after several minutes.
NOTE: Do NOT touch anything during the upgrading
process.
After firmware upgrading, we can easily tell some difference: From
Setup Page, on the left-top corner, we can see the
builder version is now 14896. And from the right-top
corner, the current firmware info is:
1 2 3
Firmware: DD-WRT v24-sp2 (08/07/10) std Time: 00:08:20 up 8 min, load average: 0.00, 0.02, 0.00 WAN IP: 0.0.0.0
From the Status Page, we can doublecheck the
firmware version is now 14896.
Wireless Network Mode: Must Be Exactly The Same As
Primary Router
Wireless Network Name (SSID): Must Be Exactly The
Same As Primary Router. Be Careful:
DD-WRT is ONLY a 2.4G router. If your primary router has two bands,
namely, 2.4G and 5G, make sure you connect to the 2.4G
network.
Wireless Channel: Must Be Exactly The Same As
Primary Router
Channel Width: Must Be Exactly The Same As Primary
Router
Wireless SSID Broadcast: Enabled
Network Configuration: Bridged
Then, click Save without Apply, we get:
2. Wireless -> Wireless
Security
Physical Interface section
Security Mode: Must Be WPA2
Personal, and The Primary Router Must Be Exactly The Same.
WPA Algorithms: Must Be AES, and
The Primary Router Must Be Exactly The Same.
WPA Shared Key: Must Be Exactly The Same As Primary
Router
Key Renewal Interval (in seconds): Leave as it is,
normally, 3600.
Then, click Save without Apply, we get:
3. Setup -> Basic Setup
WAN Connection Type Section
Connection Type: Disabled
STP: Disabled
Optional Settings
Router Name: DD-WRT, just let it be
Router IP
IP Address: 192.168.0.2 (in my case, my Primary
Router IP is 192.168.0.1, and 192.168.0.2 has NOT been used yet.)
Subnet Mask: 255.255.255.0
Gateway: 192.168.0.1 (Must Be Primary Router
IP)
Local DNS: 192.168.0.1 (Must Be Primary Router
IP)
WAN Port
Assign WAN Port to Switch: tick
Time Settings
Time Zone: set correspondingly
Then, click Save without Apply, we get:
4. Setup -> Advanced Routing
Operating Mode Section
Operating Mode: Router
Then, click Save without Apply, we get:
5. Services -> Services
DNSMasq Section
DNSMasq: Diable
Secure Shell Section
SSHd: Enable
Telnet Section
Telnet: Enable
Then, click Save without Apply, we get:
6. Security -> Firewall
Note: Process in Sequence. * Block WAN Requests - Block Anonymous
WAN Requests (Ping): untick - Filter
Multicast: tick - Filter WAN NAT Redirection:
untick - Filter IDENT (Port 113): untick *
Firewall Protection - SPI Firewall:
Disable
Then, click Save without Apply, we get:
7. Administration Management
Remote Access Section
Web GUI Management: Enable
SSH Management: Enable
Telnet Remote Port: Enable
Allow Any Remote IP: Enable
Then, click Save without Apply, we get:
Now, it's the time to Apply Settings
And finally, click Reboot Router
PART E: Doublechek Repeater
Bridge
1. Ping
Let's see the ping results directly:
1) PC Wired Connecting
to DD-WRT (Router 2)
2) PC Wirelessly
Connecting to Router 1 - 5G
3) PC Wirelessly
Connecting to Router 1 - 2.4G
2. Visit
http://192.168.0.1 and http://192.168.0.2
Most of the time, in order to get the fastest Internet speed, I use
Primary Router 1's 5G network. Therefore, for my final demonstration, my
PC is wirelessly connected to the 5G network. And, I can successfully
visit http://192.168.0.1 and http://192.168.0.2.
Similar to our previous blog Install
Armbian Debian Server onto NanoPi NEO, to build the Mainline Linux
for Orange Pi Plus 2, we use the Embedded Linux management open source
Armbian. However, this time, we'll have the most recently supported
Linux Kernel updated finally.
PART
A: Install Ubuntu Desktop Built By Armbian onto Orange Pi Plus 2
1.
Download Armbian Ubuntu Desktop for Orange Pi Plus 2
We FIRST go visiting the website https://www.armbian.com/orange-pi-plus-2/
and click Ubuntu desktop - legacy kernel icon, a file
named
Armbian_5.38_Orangepiplus_Ubuntu_xenial_default_3.4.113_desktop.7z
will be automatically downloaded.
Then, we extract this .7z file by
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
$ 7z x Armbian_5.38_Orangepiplus_Ubuntu_xenial_default_3.4.113_desktop.7z
7-Zip (A) [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 p7zip Version 9.20 (locale=en_CA.UTF-8,Utf16=on,HugeFiles=on,8 CPUs)
2. Install
Armbian Ubuntu Desktop for Orange Pi Plus 2
After the extracted image file is prepared, it's the time to install
the Armbian Ubuntu Desktop onto our TF card. We FIRST
format the TF card:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
$ sudo mkfs.ext4 /dev/mmcblk0 [sudo] password for jiapei: mke2fs 1.42.13 (17-May-2015) Found a dos partition table in /dev/mmcblk0 Proceed anyway? (y,n) y Discarding device blocks: done Creating filesystem with 7791744 4k blocks and 1949696 inodes Filesystem UUID: 8873533f-4a66-4e8c-8633-844eaa90116d Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000
Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done
Afterwards, use dd to install the downloaded Armbian
Ubuntu Desktop image.
1 2 3 4 5
$ sudo dd bs=4M if=Armbian_5.38_Orangepiplus_Ubuntu_xenial_default_3.4.113_desktop.img of=/dev/mmcblk0 conv=fsync [sudo] password for jiapei: 730+0 records in 730+0 records out 3061841920 bytes (3.1 GB, 2.9 GiB) copied, 381.133 s, 8.0 MB/s
3. Boot Into Orange Pi Plus 2
We now unplug the TF card from the host and put it into the Orange Pi Plus 2
board, Armbian Ubuntu Desktop boots successfully. Make sure the
username and password are respectively: root and
1234. And you will notice that
1 2 3 4 5 6
You are required to change your password immediately (root enforced) Changing password for root. (current) UNIX password: Enter new UNIX password: Retype new UNIX password: ...
And, for the FIRST boot, we'll be asked to create a
NEW user besides root:
Creating a new user account. Press <Ctrl-C> to abort Desktop enironment will not be enabled if you abort the new user creation
Please provide a username (eg. your forename): orangepiplus2 Trying to add user orangepiplus2 Adding user 'orangepiplus2' ... Adding new group 'orangepiplus2' (1000) ... Adding new user 'orangepiplus2' (1000) with group 'orangepiplus2' ... Creating home directory '/home/orangepiplus2' ... Copying files from '/etc/ske1' ... Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for orangepiplus2 Eter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] Y ...
We are now able to see the kernel version is of
3.4.113, which is a very old Linux Kernel.
We then update/upgrade all upgradable packages, and
have the system rebooted.
After finishing the upgrading, Ubuntu has
successfully upgraded from 16.04.3 to
16.04.4, but Linux
Kernel is still of version 3.4.113.
PART
B: Build The Newest Armbian U-Boot and Linux Kernel for Orange Pi Plus
2
As shown in PART A, the current Linux Kernel on our Orange Pi Plus 2 is of
an old version 3.4.113. Are we able to upgrade the Linux Kernel to the most recent one?
The ANSWER is of course YES.
We now try to compile Armbian
for our very FIRST attempt. This will help us to
download a lot required packages, including all Linaro
toolchains, U-Boot, etc., and save
those packages under folder cache,
$ cd ./armbian $ ./compile.sh [ o.k. ] Using config file [ config-default.conf ] [ warn ] This script requires root privileges, trying to use sudo [sudo] password for jiapei: [ o.k. ] Using config file [ config-default.conf ] [ o.k. ] This script will try to update Permission denied (publickey). fatal: Could not read from remote repository.
Then, a canonical GUI will jump out onto the screen for you to make
selections:
Clearly, our board Orange Pi Plus 2 is
NOT in the list. Therefore, we select
Cancel here for now, and some ERROR
messages will be generated as follows.
1 2 3
[ error ] ERROR infunctionsource [ main.sh:198 ] [ error ] No kernel branch selected [ o.k. ] Process terminated
$ cd ../../ $ ./compile.sh BOARD="orangepiplus2" BRANCH="next" KERNEL_ONLY="yes" KERNEL_CONFIGURE="no" [ o.k. ] Using config file [ config-default.conf ] [ warn ] This script requires root privileges, trying to use sudo [sudo] password for jiapei: [ o.k. ] Using config file [ config-default.conf ] [ o.k. ] This script will try to update Permission denied (publickey). fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists. Already on 'master' Your branch is up-to-date with 'origin/master'. [ o.k. ] Command line: setting BOARD to [ orangepiplus2 ] [ o.k. ] Command line: setting BRANCH to [ next ] [ o.k. ] Command line: setting KERNEL_ONLY to [ no ] [ o.k. ] Command line: setting KERNEL_CONFIGURE to [ no ] [ o.k. ] Preparing [ host ] [ o.k. ] Build host OS release [ xenial ] [ o.k. ] Syncing clock [ host ]
Again, the canonical GUI will jump out onto the screen for you to
make selections, here we select Ubuntu Xenial 16.04 LTS
and Image with console interface (server)
respectively.
We end up with ERROR messages again. Clearly, it's
because U-Boot does NOT support
orangepi_plus2_defconfig. Therefore, we do the same to
U-Boot board configuration by two
steps:
$ cat orangepi_plus2_defconfig CONFIG_ARM=y CONFIG_ARCH_SUNXI=y CONFIG_MACH_SUN8I_H3=y CONFIG_DRAM_CLK=624 CONFIG_DRAM_ZQ=3881979 CONFIG_DRAM_ODT_EN=y CONFIG_MACPWR="PD6" CONFIG_MMC_SUNXI_SLOT_EXTRA=2 CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-orangepi-plus2" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL=y CONFIG_SPL_I2C_SUPPORT=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_FPGA is not set # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_ISO_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y CONFIG_SY8106A_POWER=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
2) STEP 2:
1 2 3 4 5 6 7 8 9 10
$ cd ./cache/sources/u-boot/v2017.11/arch/arm/dts $ ls -1 *sun8i-h3-orangepi* sun8i-h3-orangepi-2.dts sun8i-h3-orangepi-lite.dts sun8i-h3-orangepi-one.dts sun8i-h3-orangepi-pc.dts sun8i-h3-orangepi-pc-plus.dts sun8i-h3-orangepi-plus2e.dts sun8i-h3-orangepi-plus.dts sun8i-h3-orangepi-zeroplus2.dts
Clearly, sun8i-h3-orangepi-plus2.dts is
NOT in the list. Therefore, we do:
1 2
$ sudo cp sun8i-h3-orangepi-plus2e.dts sun8i-h3-orangepi-plus2.dts $ sudo vim sun8i-h3-orangepi-plus2.dts
$ cat sun8i-h3-orangepi-plus2.dts ...... // ignore /* * The Orange Pi Plus 2 is an extended version of the Orange Pi PC Plus 2, * with 2G RAM and an external gbit ethernet phy. */
#include "sun8i-h3-orangepi-pc-plus.dts"
/ { model = "Xunlong Orange Pi Plus 2"; compatible = "xunlong,orangepi-plus2", "allwinner,sun8i-h3";
$ ./compile.sh BOARD="orangepiplus2" BRANCH="next" KERNEL_ONLY="yes" KERNEL_CONFIGURE="no" [ o.k. ] Using config file [ config-default.conf ] [ warn ] This script requires root privileges, trying to use sudo [ o.k. ] Using config file [ config-default.conf ] [ o.k. ] This script will try to update Permission denied (publickey). fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists. Already on 'master' Your branch is up-to-date with 'origin/master'. [ o.k. ] Command line: setting BOARD to [ orangepiplus2 ] [ o.k. ] Command line: setting BRANCH to [ next ] [ o.k. ] Command line: setting KERNEL_ONLY to [ yes ] [ o.k. ] Command line: setting KERNEL_CONFIGURE to [ no ] [ o.k. ] Preparing [ host ] [ o.k. ] Build host OS release [ xenial ] [ o.k. ] Syncing clock [ host ] [ o.k. ] Downloading sources [ o.k. ] Checking git sources [ u-boot v2017.11 ] [ .... ] Checking out [ o.k. ] Checking git sources [ linux-mainline linux-4.14.y ] [ .... ] Up to date [ o.k. ] Checking git sources [ sunxi-tools master ] [ .... ] Up to date [ o.k. ] Checking git sources [ rkbin-tools master ] [ .... ] Up to date [ o.k. ] Checking git sources [ marvell-tools A3700_utils-armada-17.10 ] [ .... ] Up to date [ o.k. ] Checking git sources [ odroidc2-blobs master ] [ .... ] Up to date [ o.k. ] Cleaning output/debs for [ orangepiplus2 next ] [ o.k. ] Cleaning [ u-boot/v2017.11 ] [ o.k. ] Compiling u-boot [ 2017.11 ] [ o.k. ] Compiler version [ arm-linux-gnueabihf-gcc 7.2.1 ] [ .... ] Checking out sources [ o.k. ] Cleaning [ u-boot/v2017.11 ] [ o.k. ] Started patching process for [ u-boot sunxi-orangepiplus2-next ] [ o.k. ] Looking for user patches in [ userpatches/u-boot/u-boot-sunxi ] [ o.k. ] * [l][c] 0020-sunxi-call-fdt_fixup_ethernet-again-to-set-macaddr-f.patch [ o.k. ] * [l][c] 4kfix-limit-screen-to-full-hd.patch [ o.k. ] * [l][c] Add-A20-Olimex-SOM204-EVB-board.patch [ o.k. ] * [l][c] add-a20-olinuxino-micro-emmc-support.patch [ o.k. ] * [l][c] add-a20-optional-eMMC.patch [ o.k. ] * [l][c] add-bananapi-bpi-m2-zero.patch [ o.k. ] * [l][c] add-beelink-x2.patch [ o.k. ] * [l][c] add-nanopi-air-emmc.patch [ o.k. ] * [l][c] add-nanopi-duo.patch [ o.k. ] * [l][c] add-nanopi-m1-plus2-emmc.patch [ o.k. ] * [l][c] add-nanopineoplus2.patch [ o.k. ] * [l][c] add-orangepi-plus2-emmc.patch [ o.k. ] * [l][c] add-orangepi-zeroplus.patch [ o.k. ] * [l][c] add-orangepi-zeroplus2_h3.patch [ o.k. ] * [l][c] add-sunvell-r69.patch [ o.k. ] * [l][c] add-tritium.patch [ o.k. ] * [l][c] add_emmc_olinuxino_a64.patch [ o.k. ] * [l][c] add_emmc_orangepiwin.patch [ o.k. ] * [l][c] adjust-default-dram-clockspeeds.patch [ o.k. ] * [l][c] adjust-small-boards-cpufreq.patch [ o.k. ] * [l][c] enable-DT-overlays-support.patch [ o.k. ] * [l][c] enable-autoboot-keyed.patch [ o.k. ] * [l][c] fdt-setprop-fix-unaligned-access.patch [ o.k. ] * [l][c] fix-sdcard-detect-bpi-m2z.patch [ o.k. ] * [l][c] fix-sunxi-gpio-driver.patch [ o.k. ] * [l][c] fix-usb1-vbus-opiwin.patch [ o.k. ] * [l][c] h3-Fix-PLL1-setup-to-never-use-dividers.patch [ o.k. ] * [l][c] h3-enable-power-led.patch [ o.k. ] * [l][c] h3-set-safe-axi_apb-clock-dividers.patch [ o.k. ] * [l][c] lower-default-DRAM-freq-A64-H5.patch [ o.k. ] * [l][c] lower-default-cpufreq-H5.patch [ o.k. ] * [l][c] sun8i-set-machid.patch [ o.k. ] * [l][c] video-fix-vsync-polarity-bits.patch [ o.k. ] * [l][b] workaround-reboot-is-poweroff-olimex-a20.patch HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf # # configuration written to .config # scripts/kconfig/conf --silentoldconfig Kconfig .config:1120:warning: override: reassigning to symbol BOOTDELAY # # configuration written to .config # CHK include/config.h UPD include/config.h GEN include/autoconf.mk.dep CFG u-boot.cfg CFG spl/u-boot.cfg GEN include/autoconf.mk GEN spl/include/autoconf.mk CHK include/config/uboot.release CHK include/generated/timestamp_autogenerated.h UPD include/generated/timestamp_autogenerated.h UPD include/config/uboot.release CHK include/generated/version_autogenerated.h HOSTCC scripts/dtc/dtc.o ......
And, it took me about 5 minutes to have everything built.
...... patching file tools/include/tools/be_byteshift.h patching file tools/include/tools/le_byteshift.h CLEAN scripts/basic CLEAN scripts/dtc CLEAN scripts/kconfig CLEAN scripts/mod CLEAN scripts/selinux/genheaders CLEAN scripts/selinux/mdp CLEAN scripts dpkg-deb: building package 'linux-dtb-next-sunxi'in'../linux-dtb-next-sunxi_5.41_armhf.deb'. dpkg-deb: building package 'linux-headers-next-sunxi'in'../linux-headers-next-sunxi_5.41_armhf.deb'. dpkg-deb: building package 'linux-image-next-sunxi'in'../linux-image-next-sunxi_5.41_armhf.deb'. dpkg-genchanges: warning: package linux-libc-dev-next-sunxi in control file but not in files list dpkg-genchanges: binary-only upload (no source code included) dpkg-deb: building package 'linux-source-4.14.22-next-sunxi'in'/home/jiapei/Downloads/OperatingSystems/linux/distros/armbian/armbian/.tmp/linux-source-next-sunxi_5.41_all.deb'. [ o.k. ] Kernel build done [ @host ] [ o.k. ] Target directory [ /home/jiapei/Downloads/OperatingSystems/linux/distros/armbian/armbian/output/debs/ ] [ o.k. ] File name [ linux-image-next-sunxi_5.41_armhf.deb ] [ o.k. ] Runtime [ 5 min ]
PART C: Copy
Linux Kernel DEBs for Orange Pi Plus 2
1. Doublecheck
Built Linux Kernel Related DEBs
1 2 3 4 5 6 7 8 9
$ cd ./output/debs $ ls -1 * linux-dtb-next-sunxi_5.41_armhf.deb linux-headers-next-sunxi_5.41_armhf.deb linux-image-next-sunxi_5.41_armhf.deb linux-source-next-sunxi_5.41_all.deb linux-u-boot-next-orangepiplus2_5.41_armhf.deb
extra:
Five .deb files have been successfully generated,
and the folder extra is empty.
2. Copy Built DEBs onto TF
Card
Since Armbian Ubuntu Desktop has already been installed on our TF
card, after plugging TF card back to my host computer again, it's
automatically mounted as
/media/jiapei/ab9545b9-0d2d-4927-83f3-fae97ced83a9.
Then, we copy all five .deb files onto TF card by:
PART
D: Install the Built DEBs, Remove the Old Kernel(s), and Wifi
Configuration
Now we plug the TF card back into the Orange Pi Plus 2 board
and boot into Armbian Ubuntu Desktop with kernel
3.4.113.
1. Install NEW Linux Kernels
Single command will do.
1
$ sudo dpkg -i *.deb
It's OK for us NOT to upgrade u-boot.
2. Remove OLD Linux Kernel(s)
Reboot Orange Pi
Plus 2 board, and you'll see the NEW kernel
4.14.22 is now booted successfully. Now, it's optional
for us to remove old kernel(s) 3.4.113. Two commands
will do.
1
dpkg --list | grep linux-image
will help to list all installed Linux Kernel. And then, we remove all
unwanted kernels, for instance:
1
dpkg --purge linux-image-sun8i
3. Wifi Configuration
As known, Orange Pi
Plus 2 board comes with Wifi 2.4G support. To enable Wifi for Orange Pi Plus 2
board, we need to make sure there are ONLY 3
effective lines in file /etc/network/interfaces:
1 2 3
source /etc/network/interfaces.d/* auto lo iface lo inet loopback
Finally, you are recommended to solve all the other
issues about Ubuntu Desktop via Google.