######################################## Hikey970 Wiki ######################################## Getting Started =============== **Hardware Required:** .. image:: extra/hardware-requirements-1.jpg :align: center .. image:: extra/hardware-requirement-2.jpg :align: center **Software Required:** 1) android-tools-fastboot To install the software run the following command: .. code-block:: shell sudo apt-get install android-tools-fastboot Flashing the image ------------------- **Step 1: Boot into fastboot mode by keeping the switches in the position mentioned below:** .. csv-table:: :header: "Switch", "Position" :widths: 100, 100 :align: center "Switch 1", "ON" "Switch 2", "OFF" "Switch 3", "ON" "Switch 4", "OFF" Note: If the switches are not in correct order then fastboot will not work. Giving error message "" **Step 2: Unzip the Linux Image** .. code-block:: shell :linenos: $ unzip Hikey970-shunya-xxxx-image-0.1.zip $ cd Hikey970-shunya-xxxx-image-0.1 .. note:: Please replace xxxx with desktop or console dependending on the image you downloaded **Step 3: Connecting Cables** Connect USB Type C cable to the host and board(next to the HDMI) and make sure it is configured as ttyUSB0. Connect 12V@2A Power Adapter. Confirm if the cables are connected correctly using dmesg command USB Type C should now be connected to ttyUSB0 **Sample dmesg Log:** .. code-block:: shell :linenos: :emphasize-lines: 19 [ 7402.694006] usb 1-1.2: New USB device found, idVendor=18d1,idProduct=d00d [ 7402.694010] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 7402.694012] usb 1-1.2: Product: HiKey970 [ 7402.694014] usb 1-1.2: Manufacturer: 96Boards [ 7402.694016] usb 1-1.2: SerialNumber: 5EA41CC0223F215 [ 7516.698997] usb 1-1.2: USB disconnect, device number 4 [11514.627430] usb 2-1.1: USB disconnect, device number 3 [12112.700336] usb 2-1.2: new full-speed USB device number 4 using ehci-pci [12112.818364] usb 2-1.2: New USB device found, idVendor=12d1, idProduct=3609 [12112.818368] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [12112.818370] usb 2-1.2: Product: USB SER [12112.818372] usb 2-1.2: Manufacturer: HISILICON [12114.530788] usbcore: registered new interface driver usbserial [12114.530843] usbcore: registered new interface driver usbserial_generic [12114.530890] usbserial: USB Serial support registered for generic [12114.625738] usbcore: registered new interface driver option [12114.625783] usbserial: USB Serial support registered for GSM modem (1-port) [12114.625922] option 2-1.2:1.0: GSM modem (1-port) converter detected [12114.628070] usb 2-1.2: GSM modem (1-port) converter now attached to ttyUSB0 **Step 4: Install binaries on the Hikey970 board. This may take about 2-3 minutes** $ ./flash-minimum-binaries.sh **Step 5:Boot your newly installed Linux OS** Remove the power supply and keep the switches in the autoboot mode as follows: .. csv-table:: :header: "Switch", "Position" :widths: 100, 100 :align: center "Switch 1", "ON" "Switch 2", "OFF" "Switch 3", "OFF" "Switch 4", "OFF" .. image:: extra/hikey970-autoboot-switches.jpg :width: 400px :align: right :height: 100px **Remove USB Type C cable (important)** Connect HDMI cable. Connect the Power Adapter .. warning:: Plug the HDMI cable before powering up. HDMI hot plug may not work. .. note:: Congratulations! You are now booting your newly installed Shunya OS directly from UFS on Hikey970! Login details ------------- For user shunya the login details are: .. code-block:: shell Username: shunya Password: shunya For the root user the login details are: .. code-block:: shell Username: root Password: toor Networking =========== **Network Devices available:** - Ethernet - Wifi Using a Camera on Hikey970 ============================ Using GStreamer --------------- **To record a video in the avi format use the following command** .. code-block:: shell gst-launch-1.0 v4l2src ! avimux ! filesink location=filename.avi -e **To record a video in the mkv format use the following command** .. code-block:: shell gst-launch-1.0 -e v4l2src ! videoconvert ! matroskamux ! filesink location=filename.mkv .. note:: Device number might change so be careful. Using FFMPEG ------------- To install ffmpeg use the following command: .. code-block:: shell sudo apt install ffmpeg **To check the index of the USB use v4l-utils.You can install it and get the index using the commands below:** .. code-block:: shell sudo apt install v4l-utils v4l2-ctl --list-devices **To record a video using ffmpeg the following command can be used:** .. code-block:: shell ffmpeg -i /dev/video0 filename.avi **OR** .. code-block:: shell ffmpeg -f v4l2 -video_size 640x480 -i /dev/video0 -c:v libx264 filename.mp4 Sound on Hikey970 ================== Sound recording and playback is tested using a USB Mic and a Speaker connected to USB Sound Adapter. .. note:: Device and card numbers might change so be careful. Sound Recording --------------- To list the recording devices you can use this command: .. code-block:: shell arecord -l To record a wav file you can use the following command: .. code-block:: shell arecord -vv -Dplughw:1,0 -f dat filename.wav Sound Playback -------------- To list the playback devices use this command: .. code-block:: shell aplay -l To playback a wav file you can use the following command: .. code-block:: shell aplay -vv --device=hw:1,0 filename.wav OpenCV on Hikey970 =================== Install **OpenCV-3.3** ---------------------- .. code-block:: shell sudo opkg install python3-opencv Test **OpenCV-3.3** ------------------- .. code-block:: shell :linenos: sudo apt install git git clone https://github.com/shunyaos/object-recognition-dnn.git cd object-recognition-dnn python3 detect.py Test Outcome ------------- .. image:: extra/hikey970-test-opencv.png :align: center Release info ============ **Shunya O/s Version: 0.1-Beta** **Kernel Version: 4.9** **Bootloader: GRUB** **Bootloader Version: UEFI + GNU GRUB 2.02** **Desktop Environment: XFCE**