Therefore, it looks the simplest solution is to
just download OpenMV IDE from https://openmv.io/pages/download.
However, to run the installed openmvide only brought me
the following ERROR messages.
1 2 3 4 5 6 7
➜ openmv ./openmv-ide-linux-x86_64-2.2.0.run This application failed to start because it could not find or load the Qt platform plugin "xcb" in "".
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.
Reinstalling the application may fix this problem.
Test OpenMV
In the following, we ONLY use picocom to carry out the
test.
1. OpenMV Cam M4 V2
(OPENMV2 with STM32F427)
Current Contents In OpenMV Cam M4
V2OpenMV Cam M4 V2 Properties
port is : /dev/ttyACM0 flowcontrol : none baudrate is : 9600 parity is : none databits are : 8 stopbits are : 1 escape is : C-a local echo is : no noinit is : no noreset is : no hangup is : no nolock is : no send_cmd is : sz -vv receive_cmd is : rz -vv -E imap is : omap is : emap is : crcrlf,delbs, logfile is : none initstring : none exit_after is : not set exit is : no
Type [C-a] [C-h] to see available commands Terminal ready MicroPython v1.9.3-4922-ge0f81c867 on 2018-04-23; OPENMV2 with STM32F427 Type "help()" for more information. >>>
Press Ctrl+A then Ctrl+x,
picocom will terminate its execution.
1 2 3
>>> Terminating... Thanks for using picocom
2. OpenMV Cam M7 (OPENMV3
with STM32F765)
Current Contents In OpenMV Cam
M7OpenMV Cam M7 Properties
port is : /dev/ttyACM0 flowcontrol : none baudrate is : 9600 parity is : none databits are : 8 stopbits are : 1 escape is : C-a local echo is : no noinit is : no noreset is : no hangup is : no nolock is : no send_cmd is : sz -vv receive_cmd is : rz -vv -E imap is : omap is : emap is : crcrlf,delbs, logfile is : none initstring : none exit_after is : not set exit is : no
Type [C-a] [C-h] to see available commands Terminal ready MicroPython v1.9.4-4510-g23e8457de on 2018-06-29; OPENMV3 with STM32F765 Type "help()" for more information. >>> Terminating... Thanks for using picocom ➜ ~
Flash OpenMV Firmware
Onto OpenMV Board
1. Entering DFU Mode
Similar to what's discussed in our previous
blog, we need to enter DFU mode before flashing. * Disconnect the
power for OpenMV board FIRST * Connect BOOT
pin and RST pin afterwards * Then, reconnect
the USB cable for flashing.
Before entering DFU mode:
1 2 3 4
➜ ~ lsusb ... Bus 001 Device 027: ID 1209:abd1 InterBiometrics ...
After entering DFU mode:
1 2 3 4
➜ ~ lsusb ... Bus 001 Device 028: ID 0483:df11 STMicroelectronics STM Device in DFU Mode ...
2. Flashing OpenMV's Firmware
Checkout the NEWESTOpenMV. Find the
corrensponding version of OpenMV board, flash it by command
python pydfu.py -u <firmware.dfu>.
1) OpenMV Cam M4 V2
(OPENMV2 with STM32F427)
1 2 3 4 5 6 7 8 9 10 11
➜ openmv git:(master) python ./tools/pydfu.py -u firmware/OPENMV2/firmware.dfu ./tools/pydfu.py:80: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec() if 'length' in inspect.getargspec(usb.util.get_string).args: File: firmware/OPENMV2/firmware.dfu b'DfuSe' v1, image size: 834757, targets: 1 b'Target' 0, alt setting: 0, name: "ST...", size: 834472, elements: 1 0, address: 0x08010000, size: 834464 usb: 0483:df11, device: 0x0000, dfu: 0x011a, b'UFD', 16, 0x9dfe8e73 Writing memory... 0x08010000 834464 [=========================] 100% Exiting DFU...
port is : /dev/ttyACM0 flowcontrol : none baudrate is : 9600 parity is : none databits are : 8 stopbits are : 1 escape is : C-a local echo is : no noinit is : no noreset is : no hangup is : no nolock is : no send_cmd is : sz -vv receive_cmd is : rz -vv -E imap is : omap is : emap is : crcrlf,delbs, logfile is : none initstring : none exit_after is : not set exit is : no
Type [C-a] [C-h] to see available commands Terminal ready 6792 18.86792 18.86792 18.86792 18.86792 18.86792 18.86792 ...... Traceback (most recent call last): File "/main.py", line 51, in <module> KeyboardInterrupt: MicroPython v1.9.4-4553-gb4eccdfe3 on 2019-05-02; OPENMV2 with STM32F427 Type "help()" for more information. >>> Terminating... Thanks for using picocom
Check file main.py, which starts running
automatically while testing with picocom.
# Face Detection Example # # This example shows off the built-in face detection feature of the OpenMV Cam. # # Face detection works by using the Haar Cascade feature detector on an image. A # Haar Cascade is a series of simple area contrasts checks. For the built-in # frontalface detector there are 25 stages of checks with each stage having # hundreds of checks a piece. Haar Cascades run fast because later stages are # only evaluated if previous stages pass. Additionally, your OpenMV Cam uses # a data structure called the integral image to quickly execute each area # contrast check in constant time (the reason for feature detection being # grayscale only is because of the space requirment for the integral image).
import sensor, time, image
# Reset sensor sensor.reset()
# Sensor settings sensor.set_contrast(1) sensor.set_gainceiling(16) # HQVGA and GRAYSCALE are the best for face tracking. sensor.set_framesize(sensor.HQVGA) sensor.set_pixformat(sensor.GRAYSCALE)
# Load Haar Cascade # By default this will use all stages, lower satges is faster but less accurate. face_cascade = image.HaarCascade("frontalface", stages=25) print(face_cascade)
# FPS clock clock = time.clock()
while (True): clock.tick()
# Capture snapshot img = sensor.snapshot()
# Find objects. # Note: Lower scale factor scales-down the image more and detects smaller objects. # Higher threshold results in a higher detection rate, with more false positives. objects = img.find_features(face_cascade, threshold=0.75, scale_factor=1.25)
# Draw objects for r in objects: img.draw_rectangle(r)
# Print FPS. # Note: Actual FPS is higher, streaming the FB makes it slower. print(clock.fps())
2) OpenMV Cam M7
(OPENMV3 with STM32F765)
1 2 3 4 5 6 7 8 9 10 11
➜ openmv git:(master) python ./tools/pydfu.py -u firmware/OPENMV3/firmware.dfu ./tools/pydfu.py:80: DeprecationWarning: inspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec() if 'length' in inspect.getargspec(usb.util.get_string).args: File: firmware/OPENMV3/firmware.dfu b'DfuSe' v1, image size: 1297173, targets: 1 b'Target' 0, alt setting: 0, name: "ST...", size: 1296888, elements: 1 0, address: 0x08020000, size: 1296880 usb: 0483:df11, device: 0x0000, dfu: 0x011a, b'UFD', 16, 0xeff0bf62 Writing memory... 0x08020000 1296880 [=========================] 100% Exiting DFU...
port is : /dev/ttyACM0 flowcontrol : none baudrate is : 9600 parity is : none databits are : 8 stopbits are : 1 escape is : C-a local echo is : no noinit is : no noreset is : no hangup is : no nolock is : no send_cmd is : sz -vv receive_cmd is : rz -vv -E imap is : omap is : emap is : crcrlf,delbs, logfile is : none initstring : none exit_after is : not set exit is : no
Type [C-a] [C-h] to see available commands Terminal ready MicroPython v1.9.4-4553-gb4eccdfe3 on 2019-05-02; OPENMV3 with STM32F765 Type "help()" for more information. >>> Terminating... Thanks for using picocom ➜ openmv git:(master)
As you can see, firmware has NOW been
updated to MicroPython v1.9.4-4553-gb4eccdfe3 on
2019-05-02.
# Snapshot Example # # Note: You will need an SD card to run this example. # # You can use your OpenMV Cam to save image files.
import sensor, image, pyb
RED_LED_PIN = 1 BLUE_LED_PIN = 3
sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QVGA) # or sensor.QQVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect.
pyb.LED(RED_LED_PIN).on() sensor.skip_frames(time = 2000) # Give the user time to get ready.
# MJPEG Video Recording Example # # Note: You will need an SD card to run this demo. # # You can use your OpenMV Cam to record mjpeg files. You can either feed the # recorder object JPEG frames or RGB565/Grayscale frames. Once you've finished # recording a Mjpeg file you can use VLC to play it. If you are on Ubuntu then # the built-in video player will work too.
import sensor, image, time, mjpeg, pyb
RED_LED_PIN = 1 BLUE_LED_PIN = 3
sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QVGA) # or sensor.QQVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. clock = time.clock() # Tracks FPS.
pyb.LED(RED_LED_PIN).on() sensor.skip_frames(time = 2000) # Give the user time to get ready.
By following our previous blog Build
GCC, we should be able to CROSS-BUILD GCC for
various ARM architectures. Today, we are building GCC 9.1.0 for Hikey 970, which
is of aarch64
architecture. (More details about aarch64 can be found
on ARM
architecture )
➜ aarch64 mkdir build-binutils ➜ aarch64 cd build-binutils lvision@hikey970:~/Downloads/Programming/GCC/build-binutils$ ../binutils-2.32/configure --prefix=/opt/aarch64 --enable-shared --enable-vtable-verify checking build system type... aarch64-unknown-linux-gnu checking host system type... aarch64-unknown-linux-gnu checking target system type... aarch64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether ln works... yes checking whether ln -s works... yes checking for a sed that does not truncate output... /bin/sed checking for gawk... gawk checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking whether g++ accepts -static-libstdc++ -static-libgcc... yes checking for gnatbind... gnatbind checking for gnatmake... gnatmake checking whether compiler driver understands Ada... no checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2 checking for objdir... .libs checking for isl 0.15 or later... yes checking for default BUILD_CONFIG... checking for --enable-vtable-verify... yes checking for bison... bison -y checking for bison... bison checking for gm4... no checking for gnum4... no checking for m4... m4 checking for flex... flex checking for flex... flex checking for makeinfo... makeinfo checking for expect... expect checking for runtest... no checking for ar... ar checking for as... as checking for dlltool... no checking for ld... ld checking for lipo... no checking for nm... nm checking for ranlib... ranlib checking for strip... strip checking for windres... no checking for windmc... no checking for objcopy... objcopy checking for objdump... objdump checking for readelf... readelf checking for cc... cc checking for c++... c++ checking for gcc... gcc checking for gfortran... gfortran checking for gccgo... gccgo checking for ar... ar checking for as... as checking for dlltool... no checking for ld... ld checking for lipo... no checking for nm... nm checking for objcopy... objcopy checking for objdump... objdump checking for ranlib... ranlib checking for readelf... readelf checking for strip... strip checking for windres... no checking for windmc... no checking where to find the target ar... just compiled checking where to find the target as... just compiled checking where to find the target cc... host tool checking where to find the target c++... host tool checking where to find the target c++ for libstdc++... host tool checking where to find the target dlltool... just compiled checking where to find the target gcc... host tool checking where to find the target gfortran... host tool checking where to find the target gccgo... host tool checking where to find the target ld... just compiled checking where to find the target lipo... host tool checking where to find the target nm... just compiled checking where to find the target objcopy... just compiled checking where to find the target objdump... just compiled checking where to find the target ranlib... just compiled checking where to find the target readelf... just compiled checking where to find the target strip... just compiled checking where to find the target windres... just compiled checking where to find the target windmc... just compiled checking whether to enable maintainer-specific portions of Makefiles... no configure: creating ./config.status config.status: creating Makefile ➜ build-binutils make -j4 ...... ➜ build-binutils make install ➜ build-binutils cd ..
➜ aarch64 mkdir -p build-gcc ➜ aarch64 cd build-gcc $ ../gcc-9.1.0/configure --prefix=/opt/aarch64 --enable-multiarch --enable-languages=c,c++,fortran,go --disable-multilib --disable-libvtv --enable-vtable-verify checking build system type... aarch64-unknown-linux-gnu checking host system type... aarch64-unknown-linux-gnu checking target system type... aarch64-unknown-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether ln works... yes checking whether ln -s works... yes checking for a sed that does not truncate output... /bin/sed checking for gawk... gawk checking for libatomic support... yes checking for libitm support... yes checking for libsanitizer support... yes checking for libhsail-rt support... no checking for libphobos support... yes checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking whether g++ accepts -static-libstdc++ -static-libgcc... yes checking for gnatbind... gnatbind checking for gnatmake... gnatmake checking whether compiler driver understands Ada... no checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2 checking for objdir... .libs checking for the correct version of gmp.h... yes checking for the correct version of mpfr.h... yes checking for the correct version of mpc.h... yes checking for the correct version of the gmp/mpfr/mpc libraries... yes checking for isl 0.15 or later... yes *** This configuration is not supported in the following subdirectories: gnattools target-libada target-libhsail-rt target-libphobos target-zlib target-libobjc target-liboffloadmic target-libvtv (Any other directories should still work fine.) checking for default BUILD_CONFIG... bootstrap-debug checking for --enable-vtable-verify... yes checking for bison... bison -y checking for bison... bison checking for gm4... no checking for gnum4... no checking for m4... m4 checking for flex... flex checking for flex... flex checking for makeinfo... makeinfo checking for expect... expect checking for runtest... no checking for ar... ar checking for as... as checking for dlltool... no checking for ld... ld checking for lipo... no checking for nm... nm checking for ranlib... ranlib checking for strip... strip checking for windres... no checking for windmc... no checking for objcopy... objcopy checking for objdump... objdump checking for otool... no checking for readelf... readelf checking for cc... cc checking for c++... c++ checking for gcc... gcc checking for gfortran... gfortran checking for gccgo... gccgo checking for gdc... no checking for ar... /opt/aarch64/aarch64-unknown-linux-gnu/bin/ar checking for as... /opt/aarch64/aarch64-unknown-linux-gnu/bin/as checking for dlltool... no checking for dlltool... no checking for ld... /opt/aarch64/aarch64-unknown-linux-gnu/bin/ld checking for lipo... no checking for lipo... no checking for nm... /opt/aarch64/aarch64-unknown-linux-gnu/bin/nm checking for objcopy... /opt/aarch64/aarch64-unknown-linux-gnu/bin/objcopy checking for objdump... /opt/aarch64/aarch64-unknown-linux-gnu/bin/objdump checking for otool... no checking for otool... no checking for ranlib... /opt/aarch64/aarch64-unknown-linux-gnu/bin/ranlib checking for readelf... /opt/aarch64/aarch64-unknown-linux-gnu/bin/readelf checking for strip... /opt/aarch64/aarch64-unknown-linux-gnu/bin/strip checking for windres... no checking for windres... no checking for windmc... no checking for windmc... no checking where to find the target ar... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target as... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target cc... just compiled checking where to find the target c++... just compiled checking where to find the target c++ for libstdc++... just compiled checking where to find the target dlltool... host tool checking where to find the target gcc... just compiled checking where to find the target gfortran... just compiled checking where to find the target gccgo... just compiled checking where to find the target gdc... host tool checking where to find the target ld... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target lipo... host tool checking where to find the target nm... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target objcopy... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target objdump... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target otool... host tool checking where to find the target ranlib... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target readelf... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target strip... pre-installed in /opt/aarch64/aarch64-unknown-linux-gnu/bin checking where to find the target windres... host tool checking where to find the target windmc... host tool checking whether to enable maintainer-specific portions of Makefiles... no configure: creating ./config.status config.status: creating Makefile ➜ build-gcc make -j4 all-gcc ➜ build-gcc make install-gcc ➜ build-gcc cd ..
Today, let's try to build the MOST RECENTGCC 9.1. We strictly follow the
TERRIFIC blog How
to Build a GCC Cross-Compiler with trivial modifications for my
x86_64 desktop instead of aarch64
cross compile.
Preparations
Packages Required on HOST
Some packages are required to install on the host computer,
including: * g++ * make * gawk * bison * flex * expect * gnat etc.
Get ALL Packages for Building
GCC
A wget-list.txt
file is provided to download ALL required packages
up-to-date. After having downloaded this single text file, the
UNIQUE command to download all files is as follows:
1
➜ gcc ✗ wget -i wget-list.txt
You can of course download the files one by one. All concerned files
are listed below: *
https://gnu.freemirror.org/gnu/binutils/binutils-2.32.tar.gz *
https://gnu.freemirror.org/gnu//gcc/gcc-9.1.0/gcc-9.1.0.tar.gz *
https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.1.12.tar.gz
* https://ftp.gnu.org/glibc/glibc-2.29.tar.xz *
https://ftp.gnu.org/mpfr/mpfr-4.0.2.tar.xz *
https://ftp.gnu.org/gmp/gmp-6.1.2.tar.xz *
https://ftp.gnu.org/mpc/mpc-1.1.0.tar.gz *
ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.18.tar.bz2 *
ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-0.18.1.tar.gz
Then, we extract all .tar files in whatever way you
prefer.
➜ gcc mkdir build-binutils ➜ gcc cd build-binutils ➜ build-binutils ../binutils-2.32/configure --prefix=/opt/native --target=x86_64-linux-gnu --enable-vtable-verify checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking target system type... x86_64-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether ln works... yes checking whether ln -s works... yes checking for a sed that does not truncate output... /usr/bin/sed checking for gawk... gawk checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking whether g++ accepts -static-libstdc++ -static-libgcc... yes checking for gnatbind... gnatbind checking for gnatmake... gnatmake checking whether compiler driver understands Ada... yes checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2 checking for objdir... .libs checking for isl 0.15 or later... no required isl version is 0.15 or later checking for default BUILD_CONFIG... checking for --enable-vtable-verify... yes checking for bison... bison -y checking for bison... bison checking for gm4... no checking for gnum4... no checking for m4... m4 checking for flex... flex checking for flex... flex checking for makeinfo... makeinfo checking for expect... expect checking for runtest... no checking for ar... ar checking for as... as checking for dlltool... no checking for ld... ld checking for lipo... no checking for nm... nm checking for ranlib... ranlib checking for strip... strip checking for windres... no checking for windmc... no checking for objcopy... objcopy checking for objdump... objdump checking for readelf... readelf checking for x86_64-linux-gnu-cc... no checking for cc... cc checking for x86_64-linux-gnu-c++... no checking for c++... c++ checking for x86_64-linux-gnu-gcc... x86_64-linux-gnu-gcc checking for x86_64-linux-gnu-gfortran... x86_64-linux-gnu-gfortran checking for x86_64-linux-gnu-gccgo... no checking for gccgo... no checking for x86_64-linux-gnu-ar... x86_64-linux-gnu-ar checking for x86_64-linux-gnu-as... x86_64-linux-gnu-as checking for x86_64-linux-gnu-dlltool... no checking for dlltool... no checking for x86_64-linux-gnu-ld... x86_64-linux-gnu-ld checking for x86_64-linux-gnu-lipo... no checking for lipo... no checking for x86_64-linux-gnu-nm... x86_64-linux-gnu-nm checking for x86_64-linux-gnu-objcopy... x86_64-linux-gnu-objcopy checking for x86_64-linux-gnu-objdump... x86_64-linux-gnu-objdump checking for x86_64-linux-gnu-ranlib... x86_64-linux-gnu-ranlib checking for x86_64-linux-gnu-readelf... x86_64-linux-gnu-readelf checking for x86_64-linux-gnu-strip... x86_64-linux-gnu-strip checking for x86_64-linux-gnu-windres... no checking for windres... no checking for x86_64-linux-gnu-windmc... no checking for windmc... no checking where to find the target ar... just compiled checking where to find the target as... just compiled checking where to find the target cc... host tool checking where to find the target c++... host tool checking where to find the target c++ for libstdc++... host tool checking where to find the target dlltool... just compiled checking where to find the target gcc... host tool checking where to find the target gfortran... host tool checking where to find the target gccgo... host tool checking where to find the target ld... just compiled checking where to find the target lipo... host tool checking where to find the target nm... just compiled checking where to find the target objcopy... just compiled checking where to find the target objdump... just compiled checking where to find the target ranlib... just compiled checking where to find the target readelf... just compiled checking where to find the target strip... just compiled checking where to find the target windres... just compiled checking where to find the target windmc... just compiled checking whether to enable maintainer-specific portions of Makefiles... no configure: creating ./config.status config.status: creating Makefile ➜ build-binutils make -j4 ...... ➜ build-binutils make install ➜ build-binutils cd ..
Linux Kernel Headers
1 2 3
➜ gcc cd linux-5.1.12 ➜ linux-5.1.12 make ARCH=x86 INSTALL_HDR_PATH=/opt/native/linux headers_install ➜ linux-5.1.12 cd ..
C/C++ Compilers
1 2 3 4 5 6
➜ gcc mkdir -p build-gcc ➜ gcc cd build-gcc ➜ build-gcc ../gcc-9.1.0/configure --prefix=/opt/native --target=x86_64-linux-gnu --enable-languages=c,c++,fortran,go --disable-multilib --enable-vtable-verify ➜ build-gcc make -j4 all-gcc ➜ build-gcc make install-gcc ➜ build-gcc cd ..
The overview of Official Orange Pi's Ubuntu Desktop for Orange Pi 3
looks as:
Overview of Official Orange Pi's Ubuntu
Desktop
2. Kernel Doublechecking
1 2 3 4 5 6 7 8 9 10
orangepi@OrangePi:~$ uname -r 4.9.118+ orangepi@OrangePi:~$ uname -a Linux OrangePi 4.9.118+ #5 SMP PREEMPT Mon Apr 15 09:45:02 CST 2019 aarch64 aarch64 aarch64 GNU/Linux orangepi@OrangePi:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.6 LTS Release: 16.04 Codename: xenial
3. Enable SSH
Auto Start SSH Service After
Booting
After having successfully enabled SSH, you are able
to login Orange Pi
3 remotely. Well, you may still need to figure out how to:
setup Wifi for Orange Pi 3, which
is pretty simple with Ubuntu Desktop GUI
further setup static IP addresses in your router for both Wifi and
Wired connections
4. Update & Upgrade
1 2 3 4 5 6 7 8 9 10 11
orangepi@OrangePi:~$ sudo apt update [sudo] password for orangepi: Hit:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports xenial InRelease Hit:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports xenial-updates InRelease Hit:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports xenial-backports InRelease Hit:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports xenial-security InRelease Reading package lists... Done Building dependency tree Reading state information... Done All packages are up to date. root@orangepi3:~#
Since I've already updated/upgraded all packages, it'll tell you from
terminal that All packages are up to date.. BTW, it
seems Orange Pi is a team from TsingHua Universiity?
orangepi@OrangePi:~$ sudo dpkg-reconfigure tzdata perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_PAPER = "en", LC_ADDRESS = "en", LC_MONETARY = "en", LC_NUMERIC = "en", LC_TELEPHONE = "en", LC_IDENTIFICATION = "en", LC_MEASUREMENT = "en", LC_CTYPE = "en_CA.UTF-8", LC_TIME = "en", LC_NAME = "en", LANG = "en_CA.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory /usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory /usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory /usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Current default time zone: 'America/Vancouver' Local time is now: Wed Jun 5 09:43:12 PDT 2019. Universal Time is now: Wed Jun 5 16:43:12 UTC 2019.
During the above process, you'll set the following 2 pages
correspondingly:
System Locale AmericaSystem Locale Vancouver
By using the command date, we can see the timezone
has been successfully reset.
1 2
orangepi@OrangePi:~# date Wed Jun 5 12:05:40 PDT 2019
For the 1st time, we successfully had distro-info, Markdown,
Pygments, PyGObject installed, but failed to install
pycups. For the 2nd time, after
libcups2-dev had been installed from Ubuntu repository,
we had pycups installed successfully.
However, we still have one LAST issue: why
distro-info is still oudated? ^_^ Can anybody give me
an explanation?
Skill 2 - How
to list all auto-removable packages?
➜ ~ nmap -sP 192.168.1.254/24 Starting Nmap 7.70 ( https://nmap.org ) at 2019-06-03 08:03 PDT Nmap scan report for 192.168.1.64 Host is up (0.082s latency). Nmap scan report for 192.168.1.65 Host is up (0.0092s latency). Nmap scan report for 192.168.1.66 Host is up (0.010s latency). Nmap scan report for 192.168.1.67 Host is up (0.037s latency). Nmap scan report for 192.168.1.71 Host is up (0.032s latency). Nmap scan report for 192.168.1.73 Host is up (0.032s latency). Nmap scan report for 192.168.1.74 Host is up (0.061s latency). Nmap scan report for 192.168.1.98 Host is up (0.044s latency). Nmap scan report for 192.168.1.103 Host is up (0.15s latency). Nmap scan report for lvision-GT72-6QE (192.168.1.200) Host is up (0.00047s latency). Nmap scan report for _gateway (192.168.1.254) Host is up (0.015s latency). Nmap done: 256 IP addresses (11 hosts up) scanned in 8.21 seconds ➜ ~
12 ✔ python 4s ~/.local/lib/python3.6/site-packages Python 3.6.9 (default, Jul 17 2020, 12:50:27) [GCC 8.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from pathlib import Path >>> print(Path().read_text) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'PosixPath' object has no attribute 'read_text'
Skill 15 - Run gdb with user
root
Create a script called gdb in e.g. my home
directory, containing: pkexec /usr/bin/gdb "$@"
make it executable
modify the launch.json in VSCode to
call the script (obviously change username accordingly) by adding
miDebuggerPath:
➜ pip list --outdated WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue. To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Therefore, python -m pip is used instead:
1 2 3
➜ bin python -m pip list --outdated ➜ bin python -m pip --version pip 21.3.1 from /home/jetbot/.local/lib/python3.6/site-packages/pip (python 3.6)
Skill
18 - HOWTO – Resize partitions in raw disk (dd) image files (.img)
➜ myWebsite git:(master) git push Enumerating objects: 1498, done. Counting objects: 100% (1498/1498), done. Delta compression using up to 48 threads Compressing objects: 100% (1227/1227), done. Writing objects: 100% (1498/1498), 1.20 MiB | 10.40 MiB/s, done. Total 1498 (delta 182), reused 0 (delta 0), pack-reused 0 remote: Resolving deltas: 100% (182/182), done. remote: error: refusing to update checked out branch: refs/heads/master remote: error: By default, updating the current branch in a non-bare repository remote: is denied, because it will make the index and work tree inconsistent remote: with what you pushed, and will require 'git reset --hard' to match remote: the work tree to HEAD. remote: remote: You can set the 'receive.denyCurrentBranch' configuration variable remote: to 'ignore' or 'warn' in the remote repository to allow pushing into remote: its current branch; however, this is not recommended unless you remote: arranged to update its work tree to match what you pushed in some remote: other way. remote: remote: To squelch this message and still keep the default behaviour, set remote: 'receive.denyCurrentBranch' configuration variable to 'refuse'. To XXX.XXX.XXX.XXX:~/myWebsite.git ! [remote rejected] master -> master (branch is currently checked out) error: failed to push some refs to 'XXX.XXX.XXX.XXX:~/myWebsite.git'
PART
A: Install Ubuntu Desktop Nightly Built By Armbian onto Orange Pi 3
1. Download
Armbian Ubuntu Desktop for Orange Pi 3
We FIRST go visiting the website https://dl.armbian.com/orangepi3/nightly/
and click on the LAST link, for today May 12,
2019, a file named
Armbian_5.86.190512_Orangepi3_Ubuntu_bionic_dev_5.1.0.7z
will be automatically downloaded.
➜ ~ ssh root@192.168.1.101 root@192.168.1.101's password: You are required to change your password immediately (root enforced) ___ ____ _ _____ / _ \ _ __ __ _ _ __ __ _ ___ | _ \(_) |___ / | | | | '__/ _` | '_ \ / _` |/ _ \ | |_) | | |_ \ | |_| | | | (_| | | | | (_| | __/ | __/| | ___) | \___/|_| \__,_|_| |_|\__, |\___| |_| |_| |____/ |___/ Welcome to ARMBIAN 5.86.190512 nightly Ubuntu 18.04.2 LTS 5.1.0-sunxi64 System load: 0.01 0.13 0.08 Up time: 5 min Memory usage: 4 % of 1997MB IP: 192.168.1.101 CPU temp: 40°C Usage of /: 3% of 29G Last login: Mon May 13 08:59:30 2019 from 192.168.1.11 Changing password for root. (current) UNIX password: Enter new UNIX password: Retype new UNIX password: You are using an Armbian nightly build meant only for developers to provide constructive feedback to improve build system, OS settings or user experience. If this does not apply to you, STOP NOW!. Especially don't use this image for daily work since things might not work as expected or at all and may break anytime with next update. YOU HAVE BEEN WARNED!
This image is provided AS IS with NO WARRANTY and NO END USER SUPPORT!.
Creating a new user account. Press <Ctrl-C> to abort
Please provide a username (eg. your forename): Sky Trying to add user sky Adding user `sky' ... Adding new group `sky' (1000) ... Adding new user `sky' (1000) with group `sky' ... Creating home directory `/home/sky' ... Copying files from `/etc/skel' ... Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for sky Enter 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
Dear sky, your account sky has been created and is sudo enabled. Please use this account for your daily work from now on.
root@orangepi3:~#
2. Kernel Doublechecking
1 2 3 4 5 6 7 8 9 10
root@orangepi3:~# uname -r 5.1.0-sunxi64 root@orangepi3:~# uname -a Linux orangepi3 5.1.0-sunxi64 #5.86.190512 SMP Sun May 12 22:26:37 CEST 2019 aarch64 aarch64 aarch64 GNU/Linux root@orangepi3:~# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 18.04.2 LTS Release: 18.04 Codename: bionic