<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pine64.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cypherpunks</id>
	<title>PINE64 - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pine64.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cypherpunks"/>
	<link rel="alternate" type="text/html" href="https://wiki.pine64.org/wiki/Special:Contributions/Cypherpunks"/>
	<updated>2026-05-11T23:34:42Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=Pinebook_Pro_Software_Releases&amp;diff=9326</id>
		<title>Pinebook Pro Software Releases</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=Pinebook_Pro_Software_Releases&amp;diff=9326"/>
		<updated>2021-02-20T14:41:49Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* NixOS for Pinebook Pro */ fix link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Linux OS Image Releases =&lt;br /&gt;
For information on how to install these images onto your device, please see the [[NOOB]] Page, which includes information on writing images to the device eMMC or an SD card.&lt;br /&gt;
&lt;br /&gt;
If Manjaro is installed on the eMMC you may experience issues booting different installations from SD card. [https://gitlab.manjaro.org/snippets/490 List of known affected distros and workaround].&lt;br /&gt;
&lt;br /&gt;
== elementary OS ==&lt;br /&gt;
[[File:elementaryLogo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== elementary OS 6 [microSD/eMMC boot] ===&lt;br /&gt;
&lt;br /&gt;
* Full version of elementary OS optimized for Pinebook Pro&lt;br /&gt;
* Experimental [https://builds.elementary.io/ “Early Access” build of elementary OS 6] (which has not been released as stable)&lt;br /&gt;
** Size: ~1.2 GB (varies since images are built daily)&lt;br /&gt;
* Polished first-run setup which helps you create a user before logging in&lt;br /&gt;
* Downloading, installation, etc. details at the [https://github.com/elementary/os/wiki/Pinebook-Pro elementary OS Wiki]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Kali Linux==&lt;br /&gt;
[[File:Kali.jpeg|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== Kali Linux prebuilt OS images for Pinebook Pro [SD/eMMC boot]===&lt;br /&gt;
* Official pre-built OS images of Kali Linux for the Pinebook Pro featuring all tools you'd expect from the distribution. &lt;br /&gt;
* DD image (for 8GB microSD card /16GB eMMC module and above):&lt;br /&gt;
** [https://www.offensive-security.com/kali-linux-arm-images/ Direct download latest images from Offensive Security's website]&lt;br /&gt;
** size: 2.0GB&lt;br /&gt;
* Login with&lt;br /&gt;
** username: kali&lt;br /&gt;
** password: kali&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Arch Linux ==&lt;br /&gt;
[[File:Archlinux-logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== Arch Linux ARM install image [microSD/USB Boot] ===&lt;br /&gt;
* archiso image customized for Arch Linux ARM on the Pinebook Pro&lt;br /&gt;
* DD image (for 1GB or larger microSD card/USB stick):&lt;br /&gt;
** [https://github.com/nadiaholmquist/archiso-pbp/releases Direct download for latest releases from GitHub]&lt;br /&gt;
** size: 579MB&lt;br /&gt;
* Automatic login as root&lt;br /&gt;
* Make sure to thoroughly read the [https://github.com/nadiaholmquist/archiso-pbp/blob/master/README.md readme] and [https://github.com/nadiaholmquist/archiso-pbp/blob/master/FAQ.md FAQ], otherwise follow the normal Arch installation guide.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Manjaro ARM ==&lt;br /&gt;
[[File:Manjaro.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
* The Manjaro project offers a mainline kernel with patches and modules to support PBPro hardware in two flavors. Both provide DD images and installer images (DD to SD card which will then install to eMMC when booted).&lt;br /&gt;
* To learn more about Manjaro please visit [https://forum.manjaro.org/tags/manjaroarm Manjaro Forum]&lt;br /&gt;
* You can follow the ongoing discussion about Twister OS on the PINE64 forum (https://forum.pine64.org/showthread.php?tid=8207)&lt;br /&gt;
&lt;br /&gt;
=== Manjaro ARM with KDE (Plasma) desktop [microSD / eMMC Boot] ===&lt;br /&gt;
&lt;br /&gt;
* [https://manjaro.org/downloads/arm/pinebook-pro/arm8-pinebook-pro-kde-plasma/ Direct download from Manjaro]  (microSD image only)&lt;br /&gt;
* [https://osdn.net/projects/manjaro-arm/storage/pbpro/kde-plasma/ Direct download from osdn.net] (both microSD and emmc-installer images)&lt;br /&gt;
&lt;br /&gt;
=== Manjaro ARM with GTK (XFCE) desktop [microSD / eMMC Boot] ===&lt;br /&gt;
&lt;br /&gt;
* [https://manjaro.org/downloads/arm/pinebook-pro/arm8-pinebook-pro-xfce/ Direct download from Manjaro]&lt;br /&gt;
* [https://osdn.net/projects/manjaro-arm/storage/pbpro/xfce/ Direct download from osdn.net]&lt;br /&gt;
&lt;br /&gt;
=== Manjaro ARM with i3 tiling window manager [microSD / eMMC Boot] ===&lt;br /&gt;
&lt;br /&gt;
* [https://manjaro.org/downloads/arm/pinebook-pro/arm8-pinebook-pro-i3/ Direct download from Manjaro]&lt;br /&gt;
* [https://osdn.net/projects/manjaro-arm/storage/pbpro/i3/ Direct download from osdn.net]&lt;br /&gt;
&lt;br /&gt;
=== Manjaro ARM with Sway tiling window manager [microSD / eMMC Boot] ===&lt;br /&gt;
&lt;br /&gt;
* [https://osdn.net/projects/manjaro-arm/storage/pbpro/sway/ Direct download from osdn.net]&lt;br /&gt;
&lt;br /&gt;
=== Manjaro ARM installer ===&lt;br /&gt;
&lt;br /&gt;
The [https://gitlab.manjaro.org/manjaro-arm/applications/manjaro-arm-installer manjaro-arm-installer] script is intended to install Manjaro ARM directly to SD/eMMC cards without the need for images (including LXQT, Mate &amp;amp; CuboCore editions, as well as full disk encryption). Running on a Linux x86 computer, it can install Manjaro ARM directly to an empty eMMC using an eMMC to USB adapter. The script can also be run from SD to install an image to the eMMC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OpenSUSE ==&lt;br /&gt;
[[File:Opensuse1.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== OpenSUSE XFCE OS Image [microSD / eMMC Boot] ===&lt;br /&gt;
* This image contains an install of openSUSE tumbleweed with XFCE desktop environment.&lt;br /&gt;
* To learn more about OpenSUSE please visit the [https://www.opensuse.org/ official website].&lt;br /&gt;
* Pinebook Pro build instructions can be found [https://github.com/smithmcgriff/opensuse-on-pinebookpro-gnome here]&lt;br /&gt;
* DD image (for 16GB microSD card / eMMC module and above)&lt;br /&gt;
** [https://sourceforge.net/projects/opensuse-on-pinebookpro/files/Rel_1/ Direct download latest release build from SourceForge]&lt;br /&gt;
* login with:&lt;br /&gt;
** username: root&lt;br /&gt;
** password: linux&lt;br /&gt;
&lt;br /&gt;
=== OpenSUSE GNOME 3 OS Image [microSD / eMMC Boot] ===&lt;br /&gt;
* This image contains an install of openSUSE tumbleweed with GNOME 3 desktop environment.&lt;br /&gt;
* To learn more about OpenSUSE please visit the [https://www.opensuse.org/ official website].&lt;br /&gt;
* Pinebook Pro build instructions can be found [https://github.com/smithmcgriff/opensuse-on-pinebookpro-gnome here]&lt;br /&gt;
* DD image (for 16GB microSD card / eMMC module and above)&lt;br /&gt;
** [https://sourceforge.net/projects/opensuse-on-pinebookpro/files/Rel_1/ Direct download latest release build from SourceForge]&lt;br /&gt;
* login with:&lt;br /&gt;
** username: tux&lt;br /&gt;
** password: susepassword&lt;br /&gt;
&lt;br /&gt;
== Fedora ==&lt;br /&gt;
[[File:fedora1.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Fedora 32 Cinnamon Desktop OS Image [microSD / eMMC Boot] ===&lt;br /&gt;
* This image contains an install of Fedora with [https://cinnamon-spices.linuxmint.com/ Cinnamon] desktop environment. &lt;br /&gt;
* To learn more about Fedora please visit the [https://getfedora.org/ official website].&lt;br /&gt;
* DD image (for 12GB microSD card / eMMC module and above)&lt;br /&gt;
** [https://builds.armdevelopers.com/pinebook-pro/releases/dev/Fedora32-Cinnamon-Desktop-202009.0.pinebook-pro.img.xz Fedora 32 Pinebook Pro Image]&lt;br /&gt;
* login with:&lt;br /&gt;
** username: root&lt;br /&gt;
** password: fedora&lt;br /&gt;
&lt;br /&gt;
=== Fedora 32 KDE Desktop OS Image [microSD / eMMC Boot] ===&lt;br /&gt;
* This image contains an install of Fedora with [https://kde.org/ KDE aka Plasma] desktop environment. &lt;br /&gt;
* To learn more about Fedora please visit the [https://getfedora.org/ official website].&lt;br /&gt;
* DD image (for 12GB microSD card / eMMC module and above)&lt;br /&gt;
** [https://builds.armdevelopers.com/pinebook-pro/releases/dev/Fedora32-KDE-Desktop-202009.0.pinebook-pro.img.xz Fedora 32 Pinebook Pro Image]&lt;br /&gt;
* login with:&lt;br /&gt;
** username: root&lt;br /&gt;
** password: fedora&lt;br /&gt;
&lt;br /&gt;
=== Fedora 32 Xfce Desktop OS Image [microSD / eMMC Boot] ===&lt;br /&gt;
* This image contains an install of Fedora with [https://xfce.org/ xfce] desktop environment. &lt;br /&gt;
* To learn more about Fedora please visit the [https://getfedora.org/ official website].&lt;br /&gt;
* DD image (for 12GB microSD card / eMMC module and above)&lt;br /&gt;
** [https://builds.armdevelopers.com/pinebook-pro/releases/dev/Fedora32-Xfce-Desktop-202009.0.pinebook-pro.img.xz Fedora 32 Pinebook Pro Image]&lt;br /&gt;
* login with:&lt;br /&gt;
** username: root&lt;br /&gt;
** password: fedora&lt;br /&gt;
&lt;br /&gt;
=== Fedora 32 Workstation OS Image [microSD / eMMC Boot] ===&lt;br /&gt;
* This image contains an install of Fedora with [https://www.gnome.org/gnome-3/ GNOME 3] desktop environment. &lt;br /&gt;
* To learn more about Fedora please visit the [https://getfedora.org/ official website].&lt;br /&gt;
* DD image (for 12GB microSD card / eMMC module and above)&lt;br /&gt;
** [https://builds.armdevelopers.com/pinebook-pro/releases/dev/Fedora32-Workstation-202009.0.pinebook-pro.img.xz Fedora 32 Pinebook Pro Image]&lt;br /&gt;
* login with:&lt;br /&gt;
** username: root&lt;br /&gt;
** password: fedora&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Armbian ==&lt;br /&gt;
[[File:armbian.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
* To find out more about Armbian and available options please visit their [https://www.armbian.com/pinebook-pro/ site]&lt;br /&gt;
* DD image to microSD card or eMMC module and boot. Highly recommend using [https://etcher.io/ Etcher]&lt;br /&gt;
&lt;br /&gt;
=== Armbian Ubuntu Focal XFCE Desktop mainline kernel [microSD / eMMC Boot]  ===&lt;br /&gt;
* Armbian provides a mainline kernel build images for Ubuntu Focal with XFCE Desktop&lt;br /&gt;
* DD image (for 8GB micoSD card or eMMC Module and above)&lt;br /&gt;
** [https://dl.armbian.com/pinebook-pro/Focal_current_desktop Armbian's Pinebook Pro Ubuntu Focal XFCE Desktop download site]&lt;br /&gt;
&lt;br /&gt;
=== Armbian Ubuntu Focal XFCE Desktop legacy kernel [microSD / eMMC Boot]  ===&lt;br /&gt;
* Armbian provides a legacy kernel 4.4 build images for Ubuntu Focal with XFCE Desktop&lt;br /&gt;
* DD image (for 8GB microSD card or eMMC Module and above)&lt;br /&gt;
** [https://dl.armbian.com/pinebook-pro/Focal_legacy_desktop Armbian's Pinebook Pro Ubuntu Focal XFCE Desktop download site]&lt;br /&gt;
&lt;br /&gt;
=== Armbian Debian Buster XFCE Desktop legacy kernel [microSD / eMMC Boot]  ===&lt;br /&gt;
* Armbian provides a legacy kernel 4.4 build images for Debian Buster with XFCE Desktop&lt;br /&gt;
* DD image (for 8GB micoSD card or eMMC Module and above)&lt;br /&gt;
** [https://dl.armbian.com/pinebook-pro/Buster_legacy_desktop Armbian's Pinebook Pro Debian Buster XFCE Desktop download site]&lt;br /&gt;
&lt;br /&gt;
=== Armbian Ubuntu Bionic XFCE Desktop legacy kernel [microSD / eMMC Boot]  ===&lt;br /&gt;
* Armbian provides a legacy kernel 4.4 build images for Ubuntu Bionic with XFCE Desktop&lt;br /&gt;
* DD image (for 8GB micoSD card or eMMC Module and above)&lt;br /&gt;
** [https://dl.armbian.com/pinebook-pro/Bionic_legacy_desktop Armbian's Pinebook Pro Ubuntu Bionic XFCE Desktop download site]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== AOSC ==&lt;br /&gt;
[[File:aosc.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
* To learn more about AOSC, please visit the official [https://aosc.io/ AOSC website]&lt;br /&gt;
* AOSC using LZ4 compression algorithm, please visit the [https://github.com/lz4/lz4 LZ4 github site] for utility&lt;br /&gt;
* 8GB microSD card or eMMC module and above&lt;br /&gt;
* Login with&lt;br /&gt;
** username: aosc&lt;br /&gt;
** password: anthon&lt;br /&gt;
=== AOSC KDE Community Build Image [microSD and eMMC Boot] ===&lt;br /&gt;
* [https://releases.aosc.io/os-arm64/rockchip64/kde/pinebook-pro/ Direct download from AOSC]&lt;br /&gt;
&lt;br /&gt;
=== AOSC GNOME Community Build Image [microSD and eMMC Boot] ===&lt;br /&gt;
* [https://releases.aosc.io/os-arm64/rockchip64/gnome/pinebook-pro/ Direct download from AOSC]&lt;br /&gt;
&lt;br /&gt;
=== AOSC MATE Community Build Image [microSD and eMMC Boot] ===&lt;br /&gt;
* [https://releases.aosc.io/os-arm64/rockchip64/mate/pinebook-pro/ Direct download from AOSC]&lt;br /&gt;
&lt;br /&gt;
=== AOSC Cinnamon Community Build Image [microSD and eMMC Boot] ===&lt;br /&gt;
* [https://releases.aosc.io/os-arm64/rockchip64/cinnamon/pinebook-pro/ Direct download from AOSC]&lt;br /&gt;
&lt;br /&gt;
=== AOSC XFCE Community Build Image [microSD and eMMC Boot] ===&lt;br /&gt;
* [https://releases.aosc.io/os-arm64/rockchip64/xfce/pinebook-pro/ Direct download from AOSC]&lt;br /&gt;
&lt;br /&gt;
=== AOSC LXDE Community Build Image [microSD and eMMC Boot] ===&lt;br /&gt;
* [https://releases.aosc.io/os-arm64/rockchip64/lxde/pinebook-pro/ Direct download from AOSC]&lt;br /&gt;
&lt;br /&gt;
== Twister OS ==&lt;br /&gt;
[[File:Twister_OS.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== Twister OS Armbian-Reforged XFCE Dsktop beta images [SD boot]===&lt;br /&gt;
* For more infomation on Twister OS, please visit this {https://twisteros.com/ official site]&lt;br /&gt;
* You can follow the ongoing discussion about Twister OS on the PINE64 forum (https://forum.pine64.org/showthread.php?tid=12192)&lt;br /&gt;
* After flashing image with Etcher, edit /boot/armbianEnv.txt, replace the dtb name with rk3399-pinebook-pro.dtb.&lt;br /&gt;
* DD image (for 16GB microSD card /16GB eMMC module and above):&lt;br /&gt;
** [https://twisteros.com/twisterarmbian.html Direct download latest images from Twister OS's website]&lt;br /&gt;
** size: 2.8GB&lt;br /&gt;
* Login with&lt;br /&gt;
** password: asdasd&lt;br /&gt;
&lt;br /&gt;
=== Twister OS Monka-Manjaro XFCE Dsktop beta images [SD boot]===&lt;br /&gt;
* For more infomation on Twister OS, please visit this {https://twisteros.com/ official site]&lt;br /&gt;
* You can follow the ongoing discussion about Twister OS on the PINE64 forum (https://forum.pine64.org/showthread.php?tid=12192)&lt;br /&gt;
* After flashing image with Etcher, edit /boot/armbianEnv.txt, replace the dtb name with rk3399-pinebook-pro.dtb.&lt;br /&gt;
* DD image (for 16GB microSD card /16GB eMMC module and above):&lt;br /&gt;
** [https://drive.google.com/file/d/1I0yHIDfezqnz1jdphJ4gooWbGtNw0ArW/view?usp=sharing Direct download latest images from Google Drive]&lt;br /&gt;
** size: 8.9GB&lt;br /&gt;
* Login with&lt;br /&gt;
** username: pi&lt;br /&gt;
** password: root&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Debian Desktop ==&lt;br /&gt;
[[File:debian.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== Debian Desktop Community Build Image [microSD to eMMC] by mrfixit2001 ===&lt;br /&gt;
* This was previously the default operating system for the Pinebook Pro&lt;br /&gt;
* Includes desktop, Firefox browser, and LibreOffice&lt;br /&gt;
* DD image (for 8GB microSD card / 16GB eMMC module and above):&lt;br /&gt;
** [https://github.com/mrfixit2001/debian_desktop/releases/download/191226/pinebookpro-debian-desktop-mrfixit191226.img.xz Direct download release build 191226 from mrfixit2001's github]&lt;br /&gt;
*** MD5 (img file): 59838c1518b8b6da86a00d38b31ae904&lt;br /&gt;
*** File Size: 1.19GB&lt;br /&gt;
* Login with&lt;br /&gt;
** username: rock&lt;br /&gt;
** password: rock&lt;br /&gt;
&lt;br /&gt;
== Ubuntu 20.04 Focal Fossa MATE / GNOME ==&lt;br /&gt;
[[File:UbuntuLogo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 20.04 Focal Fossa MATE and GNOME Community Builds [microSD/ eMMC Boot] by ayufan ===&lt;br /&gt;
* Desktop Images featurng a standard Ubuntu suite of software to get you started. &lt;br /&gt;
* DD image (for 8GB microSD card /16GB eMMC module and above):&lt;br /&gt;
** [https://github.com/ayufan-rock64/linux-build/releases Direct download for latests releases and pre-releases on ayufan's github]&lt;br /&gt;
** size: 1.06GB&lt;br /&gt;
* Login with&lt;br /&gt;
** username: rock64&lt;br /&gt;
** password: rock64 (must be changed on initial boot)&lt;br /&gt;
&lt;br /&gt;
== Ubuntu 18.04 Bionic Beaver LXDE ==&lt;br /&gt;
[[File:lxde.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu 18.04 Bionic Beaver LXDE Community Build Image by ayufan [microSD and eMMC Boot] ===&lt;br /&gt;
* Included LXDE Desktop, Firefox Browser, and LibreOffice Suite&lt;br /&gt;
* DD image (for 8GB microSD card /16GB eMMC module and above):&lt;br /&gt;
** [https://github.com/ayufan-rock64/linux-build/releases/download/0.9.14/bionic-lxde-pinebookpro-0.9.14-1159-armhf.img.xz Direct download release build 0.9.14 from ayufan's github]&lt;br /&gt;
** MD5 (XZ file): B74E8366615DAE89AEB5CC878F2B316B&lt;br /&gt;
** size: 763MB&lt;br /&gt;
* Login with&lt;br /&gt;
** username: rock64&lt;br /&gt;
** password: rock64&lt;br /&gt;
&lt;br /&gt;
== Bionic Mate ==&lt;br /&gt;
[[File:mate.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== Bionic Mate Community Build Image [microSD Boot] by ayufan ===&lt;br /&gt;
* Included Mate Desktop, Firefox Browser, and LibreOffice Suite&lt;br /&gt;
* DD image (for 8GB microSD card / 16GB eMMC module and above):&lt;br /&gt;
** [https://github.com/ayufan-rock64/linux-build/releases/download/0.9.14/bionic-mate-pinebookpro-0.9.14-1159-armhf.img.xz Direct download release build 0.9.14 from ayufan's github]&lt;br /&gt;
** MD5 (XZ file): 5F60494B9248570FAF5853860A26B489&lt;br /&gt;
** size: 1.06GB&lt;br /&gt;
* Login with&lt;br /&gt;
** username: rock64&lt;br /&gt;
** password: rock64&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== postmarketOS ==&lt;br /&gt;
[[File:PostmarketOS logo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
===Official postmarketOS build [microSD/ eMMC Boot] ===&lt;br /&gt;
* Official postmarketOS build with the GNOME desktop for the Pinebook Pro. &lt;br /&gt;
* DD image (for 8GB microSD card /16GB eMMC module and above):&lt;br /&gt;
** [http://images.postmarketos.org/pinebookpro/ Direct download latest images from postmarketOS]&lt;br /&gt;
** size: 400MB&lt;br /&gt;
* Login with&lt;br /&gt;
** username: demo&lt;br /&gt;
** password: demo OR 147147&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Q4OS ==&lt;br /&gt;
[[File:q4os.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== Q4OS Test Build Image [microSD / eMMC Boot] ===&lt;br /&gt;
* Q4OS is advertised as a 'fast and powerful operating system based on the latest technologies while offering highly productive desktop environment'&lt;br /&gt;
* To learn more please visit the [https://forum.pine64.org/showthread.php?tid=8385 PINE64 forum] or official [https://q4os.org/index.html Q4OS website]&lt;br /&gt;
* DD image (for 8GB microSD card / eMMC module and above)&lt;br /&gt;
** [https://sourceforge.net/projects/q4os/files/testing/ Direct download latest release build from SourceForge]&lt;br /&gt;
*  User account and password are created on first run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Recalbox==&lt;br /&gt;
[[File:RB.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== Recalbox for Pinebook Pro [SD/eMMC boot]===&lt;br /&gt;
* Recalbox is a retrogaming Linux distribution allowing for emulation of all classic videogame systems. &lt;br /&gt;
* DD image (for 8GB microSD card /16GB eMMC module and above):&lt;br /&gt;
** [https://github.com/mrfixit2001/recalbox-rockchip/releases Direct download latest images from MrFixit's gitbub]&lt;br /&gt;
** size: 450MB&lt;br /&gt;
* SSH Login &lt;br /&gt;
** username: root	&lt;br /&gt;
** password: recalboxroot&lt;br /&gt;
&lt;br /&gt;
= BSD OS Image Release =&lt;br /&gt;
&lt;br /&gt;
==NetBSD==&lt;br /&gt;
[[File:netbsd.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== NetBSD [microSD /eMMC Boot] ===&lt;br /&gt;
* To learn more about NetBSD please visit [https://www.netbsd.org/ NetBSD main page] &lt;br /&gt;
* DD image to microSD card or eMMC module. Highly recommend using [https://etcher.io/ Etcher]&lt;br /&gt;
** [http://www.armbsd.org/arm/ Direct download from NetBSD]&lt;br /&gt;
* Console and SSH default login:&lt;br /&gt;
** username: root&lt;br /&gt;
** password: [none]&lt;br /&gt;
* Instructions concerning enabling SSH can be found [https://www.netbsd.org/docs/guide/en/chap-boot.html#chap-boot-ssh here]&lt;br /&gt;
&lt;br /&gt;
==OpenBSD==&lt;br /&gt;
[[File:Puffy_mascot_openbsd.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== OpenBSD ===&lt;br /&gt;
* To learn more about OpenBSD, please visit [https://www.openbsd.org/ OpenBSD main page]&lt;br /&gt;
* ARM64 images, (including support for Pinebook Pro), can be found here [https://www.openbsd.org/arm64.html  OpenBSD arm64]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Chromium OS Image Release =&lt;br /&gt;
&lt;br /&gt;
== FydeOS ==&lt;br /&gt;
[[File:FydeOS.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
To learn more about FydeOS please visit [https://releases.fydeos.io/11.2/pinebook-pro] &lt;br /&gt;
&lt;br /&gt;
* You can follow the ongoing discussion about FydeOS on the PINE64 forum (https://forum.pine64.org/showthread.php?tid=12201)&lt;br /&gt;
* DD image to microSD card or eMMC module. Highly recommend using [https://etcher.io/ Etcher]&lt;br /&gt;
** [https://fydeos.com/download/ Direct download latest release build from FydeOS by select &amp;quot;FydeOS for You Pinebook Pro&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
== ChromiumOS Community Build Image by ayufan [microSD and eMMC Boot] ==&lt;br /&gt;
[[File:chromium.jpg|right|100px]]&lt;br /&gt;
&lt;br /&gt;
* DD image (for 8GB microSD card/16GB eMMC module and above)&lt;br /&gt;
** [https://github.com/ayufan-rock64/chromiumos-build/releases/download/R77-12371.7.104.g78f88d6/chromiumos-rockpro64-R77-12371.7.104.g78f88d6.img.xz Direct download R77 build from ayufan's github]&lt;br /&gt;
** MD5 (XZ file): 7B747B6D2B041C5C0C6434DDB524DB66&lt;br /&gt;
** size: 387MB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Android Image Releases =&lt;br /&gt;
&lt;br /&gt;
== Android 7.1 microSD ==&lt;br /&gt;
[[File:android_7.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== Stock Android for DD method [micro SD Boot] [20190918] ===&lt;br /&gt;
* Production floor testing image &lt;br /&gt;
* Use 'dd' to write the image to the microSD card and boot. Using [https://www.balena.io/etcher/ Etcher] or another specialized SD writing tool is preferred.&lt;br /&gt;
* Please allow 3-5 minutes boot up time on first time for initialization&lt;br /&gt;
* DD image for 8GB microSD card&lt;br /&gt;
** [http://files.pine64.org/os/PinebookPro/Android/PinebookPro_dd_20190918_stock_android_7.1_sdboot-8GB.img.gz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (GZip file): 207BCBFFF59C1AB29F8ADC63D426EACB&lt;br /&gt;
*** File Size: 562MB&lt;br /&gt;
* DD image for 16GB microSD card&lt;br /&gt;
** [http://files.pine64.org/os/PinebookPro/Android/PinebookPro_dd_20190918_stock_android_7.1_sdboot-16GB.img.gz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (GZip file): B1FC25A2F896F5C6B4B85EA6D1E75CDA&lt;br /&gt;
*** File Size: 571MB&lt;br /&gt;
* DD image for 32GB microSD card&lt;br /&gt;
** [http://files.pine64.org/os/PinebookPro/Android/PinebookPro_dd_20190918_stock_android_7.1_sdboot-32GB.img.gz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (GZip file): A07E2C2A2798A77375268E423A30048A&lt;br /&gt;
*** File Size: 589MB&lt;br /&gt;
* DD image for 64GB microSD card&lt;br /&gt;
** [http://files.pine64.org/os/PinebookPro/Android/PinebookPro_dd_20190918_stock_android_7.1_sdboot-64GB.img.gz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (GZip file): D7626BD50443A88AEB9254C88C575284&lt;br /&gt;
*** File Size: 627MB&lt;br /&gt;
&lt;br /&gt;
=== Stock for RK Flash tool [SD Boot] [20190427] ===&lt;br /&gt;
* Please unzip first and then using [http://files.pine64.org/os/ROCK64/android/SDDiskTool_v1.57.zip Rockchip SD Firmware Tool ver 1.57] to flash in, please remember to select &amp;quot;SD boot&amp;quot; option.&lt;br /&gt;
** [http://files.pine64.org/os/PinebookPro/Android/PinebookPro_20190918_stock_android_7.1_sdboot.img.gz Direct download from pine64.org]&lt;br /&gt;
** MD5 (GZip file): DBA2109C393F514132EC8D5FB6E8EBE2&lt;br /&gt;
** File Size: 555MB&lt;br /&gt;
&lt;br /&gt;
== Android 7.1 eMMC ==&lt;br /&gt;
=== Stock Android for DD method [eMMC Boot] [20190807] ===&lt;br /&gt;
* Production floor testing image &lt;br /&gt;
* Please allows some time (around 5 minutes) for the initialization process on 1st boot&lt;br /&gt;
* DD image for 64GB eMMC Module&lt;br /&gt;
** [http://files.pine64.org/os/PinebookPro/Android/PinebookPro_dd_20190807_stock_android_7.1_emmcboot-64GB.img.gz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (GZip file): 314583B550AFF0F424D9997D237D7046&lt;br /&gt;
*** File Size: 634MB&lt;br /&gt;
* DD image for 128GB eMMC Module&lt;br /&gt;
** [http://files.pine64.org/os/PinebookPro/Android/PinebookPro_dd_20190807_stock_android_7.1_emmcboot-128GB.img.gz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (GZip file): 16942B8F9EEE79B81FADDB09AF7E2E80&lt;br /&gt;
*** File Size: 700MB&lt;br /&gt;
&lt;br /&gt;
=== Stock for RK Flash tool [eMMC Boot] [20190807] ===&lt;br /&gt;
* Please unzip first and then using [http://files.pine64.org/os/ROCK64/android/AndroidTool_Release_v2.63.zip Rockchip Android tool ver 2.63] to flash in&lt;br /&gt;
* The OTG port located at USB type-C connector, needs USB type A to type C cable.&lt;br /&gt;
* [http://wiki.pine64.org/index.php/NOOB#Flashing_to_eMMC_using_Rockchip_Tools_.28Rock64_Only.29 Guide to flashing eMMC using Rockchip Tools]&lt;br /&gt;
* Please allow 3-5 minutes boot up time on first time for initialization&lt;br /&gt;
** [http://files.pine64.org/os/PinebookPro/Android/PinebookPro_20190807_stock_android_7.1_emmcboot.img.gz Direct download from pine64.org]&lt;br /&gt;
** MD5 (GZip file): DC4C330787E57FC05F9D7D740F741620&lt;br /&gt;
** File Size: 555MB&lt;br /&gt;
&lt;br /&gt;
= Linux Installer Releases =&lt;br /&gt;
== Debian Installer ==&lt;br /&gt;
[[File:debian.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== Daniel Thompson's Debian Installer for the Pinebook Pro ===&lt;br /&gt;
* This is an image creator and Debian installer that runs from an existing Linux OS and installs Debian Bullseye&lt;br /&gt;
** Installer can configure an encrypted rootfs and provides a choice of desktops, including the default Debian desktop based on Gnome 3&lt;br /&gt;
** Strict adoption of upstream Debian packages (with exception of kernel and bootloaders) in order to provide a clean upgrade path as Bullseye matures&lt;br /&gt;
* Download at: https://github.com/daniel-thompson/pinebook-pro-debian-installer/&lt;br /&gt;
* Pull requests welcome but for discussion and support please use [https://forum.pine64.org/showthread.php?tid=8487 the forum topic].&lt;br /&gt;
&lt;br /&gt;
For more information, see the [[Pinebook_Pro_Debian_Installer]] wiki page&lt;br /&gt;
&lt;br /&gt;
=== Official Debian Installer Images ===&lt;br /&gt;
* Uses only the upstream kernel and firmware without special patches&lt;br /&gt;
* No graphical display yet, works only through serial console&lt;br /&gt;
* Requires adding the non-free component to your /etc/apt/sources.list file and installing the &amp;quot;firmware-linux&amp;quot; package for Wi-Fi and Bluetooth support&lt;br /&gt;
* Installer is loaded into RAM, can install onto the same media from which it’s booted&lt;br /&gt;
* Supports automatic partitioning and full disk encryption through LVM&lt;br /&gt;
* Installer currently doesn't install the bootloader, leaving the installed system in an unbootable state until it's manually added&lt;br /&gt;
&lt;br /&gt;
[https://d-i.debian.org/daily-images/arm64/daily/netboot/SD-card-images/ The relevant files are built daily here] and may sometimes be unavailable if the build system is having issues. The &amp;quot;README.concatenateable_images&amp;quot; file provides instructions on how to combine the partition.img.gz file with the firmware.pinebook-pro.rk3399.img.gz file in order to create a DD-able image.&lt;br /&gt;
&lt;br /&gt;
The official images are '''not''' recommended yet until the display begins working and the installer properly installs the bootloader. Most users will want to see [[Pinebook Pro Debian Installer|Daniel Thompson's Debian Installer]] instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Gentoo Script ==&lt;br /&gt;
[[File:GentooLogo.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== Gentoo Script for Pinebook Pro ===&lt;br /&gt;
* This is a script that prepares a Gentoo arm64 stage 3 tarball for the Pinebook Pro&lt;br /&gt;
** The script takes care of device specifics like an optimized make.conf, an overlay that provides kernel and firmware amongst others, and other miscellaneous fixes&lt;br /&gt;
* The usual tarball setup as per [https://wiki.gentoo.org/wiki/Handbook:AMD64 Gentoo Handbook] is left to the user.&lt;br /&gt;
* Forum thread with instructions at https://forum.pine64.org/showthread.php?tid=8765&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Kali Script==&lt;br /&gt;
[[File:Kali.jpeg|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== Kali Linux for Pinebook Pro ===&lt;br /&gt;
* This is a script to create official Kali Linux OS images for the Pinebook Pro&lt;br /&gt;
** The script carries out the build process in entirety and is Pinebook Pro specific&lt;br /&gt;
* Please pull the latest [https://gitlab.com/kalilinux/build-scripts/kali-arm/blob/master/pinebook-pro.sh Kali Linux install script] from the project's GitLab.&lt;br /&gt;
* For more information regarding building the OS image please read the README instruction at https://gitlab.com/kalilinux/build-scripts/kali-arm/blob/master/README.md&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==K1ss OS Script==&lt;br /&gt;
[[File:K1ss.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== K1ss Linux for Pinebook Pro ===&lt;br /&gt;
* This is a repository containing an unofficial port of KISS Linux to aarch64. The tarball is built for generic aarch64, currently being tested on the Pinebook Pro.&lt;br /&gt;
* Please pull the latest [https://github.com/jedavies-dev/kiss-aarch64 K1ss Linux install script] from the project's GitHub.&lt;br /&gt;
* * You can follow the ongoing discussion about K1ss Linux on the PINE64 forum (https://forum.pine64.org/showthread.php?tid=9304)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==NixOS Script==&lt;br /&gt;
[[File:nixos.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== NixOS for Pinebook Pro ===&lt;br /&gt;
* This is instructions to install NixOS on the Pinebook Pro: https://nixos.wiki/wiki/NixOS_on_ARM/PINE64_Pinebook_Pro&lt;br /&gt;
* Please pull the latest [https://github.com/samueldr/wip-pinebook-pro samueldr's repository ] from the project's GitHub.&lt;br /&gt;
* * You can follow the ongoing discussion about NixOS on the PINE64 forum (https://forum.pine64.org/showthread.php?tid=10524)&lt;br /&gt;
&lt;br /&gt;
==SkiffOS for Pinebook Pro ==&lt;br /&gt;
[[File:SkiffOS-Icon-1.png|right|100px]]&lt;br /&gt;
&lt;br /&gt;
=== SkiffOS Boot Image for Pinebook Pro ===&lt;br /&gt;
* Instructions to build/install on the Pinebook Pro: https://github.com/skiffos/SkiffOS/tree/master/configs/pine64/book&lt;br /&gt;
* Please pull the latest version from the project's GitHub.&lt;br /&gt;
* Compiling the boot image takes approximately 30 minutes.&lt;br /&gt;
* Easily configure the kernel, compiler, etc with Buildroot.&lt;br /&gt;
* Pre-built ISOs will be available with the upcoming 2021.02 &lt;br /&gt;
release.&lt;br /&gt;
&lt;br /&gt;
=== Skiff Core ===&lt;br /&gt;
* Supports multiple distros running simultaneously.&lt;br /&gt;
* Optionally build from scratch on device on first boot.&lt;br /&gt;
* Pre-built multi-arch core container images are available.&lt;br /&gt;
&lt;br /&gt;
=== GentooLTO with KDE Apps ===&lt;br /&gt;
&lt;br /&gt;
* GentooLTO with O3 optimized KDE Desktop configuration.&lt;br /&gt;
* Use &amp;lt;tt&amp;gt;SKIFF_CONFIG=pine64/book,core/pinebook_gentoo&amp;lt;/tt&amp;gt;&lt;br /&gt;
* Default sign-in is username &amp;quot;core&amp;quot; w/ empty password.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineBook Pro]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8877</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8877"/>
		<updated>2021-01-03T19:36:45Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* Streaming the camera to the network */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motion [microSD Boot] [20201222] ====&lt;br /&gt;
* Armbian Ubuntu Focal build for the Pinecube with the motion (detection) package preinstalled.&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for the the device IP (with hostname pinecube)&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER to login to the serial console, then check for assigned IP&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
[https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 GitHub gist] for the userpatch which pre-installs and configures the motion (detection) package. &lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although [https://www.armbian.com/download/?device_support=No+official+support+(CSC) not officially supported] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian (login: root, password: 1234).&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   510 MBytes  71.2 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   509 MBytes  71.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.01  sec   642 MBytes  89.8 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   641 MBytes  89.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
== Streaming the camera to the network ==&lt;br /&gt;
&lt;br /&gt;
In this section we document a variety of ways to stream video to the network from the PineCube. Unless specified otherwise, all of these examples have been tested on Ubuntu groovy (20.10). See [https://github.com/ioerror/pinecube this small project for the pinecube] for easy to use programs tuned for the PineCube.&lt;br /&gt;
&lt;br /&gt;
In the examples which use h264, we are currently encoding using the x264 library which is not very fast on this CPU. The SoC in the PineCube does have a hardware h264 encoder, which the authors of these examples have so far not tried to use. It appears that https://github.com/gtalusan/gst-plugin-cedar might provide easy access to it, however. Please update this wiki if you find out how to use the hardware encoder!&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h264 HLS ===&lt;br /&gt;
&lt;br /&gt;
HLS (HTTP Live Streaming) has the advantage that it is easy to play in any modern web browser, including Android and iPhone devices, and that it is easy to put an HTTP caching proxy in front of it to scale to many viewers. It has the disadvantages of adding (at minimum) several seconds of latency, and of requiring an h264 encoder (which we have in hardware, but haven't figured out how to use yet, so, we're stuck with the slow software one).&lt;br /&gt;
&lt;br /&gt;
HLS segments a video stream into small chunks which are stored as .ts (MPEG Transport Stream) files, and (re)writes a playlist.m3u8 file which clients constantly refresh to discover which .ts files they should download. We use a tmpfs file system to avoid needing to write these files to the sdcard in the PineCube. Besides the program which writes the .ts and .m3u8 files (gst-launch-1.0, in our case), we'll also need a very basic web page in tmpfs and a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create an hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js]. We recommend downloading the hls.js file and editing the example index.html to serve your local copy of it instead of fetching it from a CDN. This file provides HLS playback capabilities in browsers which don't natively support it (which is most browsers aside from the iPhone).&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternately, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
You can also view the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt; (or with mpv, ffplay, etc)&lt;br /&gt;
&lt;br /&gt;
To find out about other options you can configure in the &amp;lt;code&amp;gt;hlssink&amp;lt;/code&amp;gt; gstreamer element, you can run &amp;lt;code&amp;gt;gst-inspect-1.0 hlssink&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is worth noting here that the &amp;lt;code&amp;gt;hlssink&amp;lt;/code&amp;gt; element in GStreamer is not widely used in production environments. It is handy for testing, but for real-world free-software HLS live streaming deployments the standard tool today (January 2021) is nginx's RTMP module which can be used with ffmpeg to produce &amp;quot;adaptive streams&amp;quot; which are reencoded at varying quality levels. You can send data to an nginx-rtmp server from a gstreamer pipeline using the &amp;lt;code&amp;gt;rtmpsink&amp;lt;/code&amp;gt; element. It is also worth noting that gstreamer has a new &amp;lt;code&amp;gt;hlssink2&amp;lt;/code&amp;gt; element which we have not tested; perhaps in the future it will even have a webserver!&lt;br /&gt;
&lt;br /&gt;
=== v4l2rtspserver: h264 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Install dependencies and build required v4l2 software:&lt;br /&gt;
&lt;br /&gt;
 apt install -y gstreamer1.0-plugins-bad gstreamer1.0-tools \&lt;br /&gt;
 gstreamer1.0-plugins-good v4l-utils gstreamer1.0-alsa alsa-utils libpango1.0-0 \&lt;br /&gt;
 libpango1.0-dev gstreamer1.0-plugins-base gstreamer1.0-x x264 \&lt;br /&gt;
 gstreamer1.0-plugins-{good,bad,ugly} liblivemedia-dev liblog4cpp5-dev \&lt;br /&gt;
 libasound2-dev vlc libssl-dev iotop libasound2-dev  liblog4cpp5-dev \&lt;br /&gt;
 liblivemedia-dev autoconf automake libtool v4l2loopback-dkms liblog4cpp5-dev \&lt;br /&gt;
 libvpx-dev libx264-dev libjpeg-dev libx265-dev;&lt;br /&gt;
&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2tools &amp;amp;&amp;amp; cd v4l2tools &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2rtspserver &amp;amp;&amp;amp; cd v4l2rtspserver &amp;amp;&amp;amp; cmake -D LIVE555URL=https://download.videolan.org/pub/contrib/live555/live.2020.08.19.tar.gz . &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
&lt;br /&gt;
Running the camera:&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/640x480@1/30]';&lt;br /&gt;
 modprobe v4l2loopback video_nr=10 debug=2;&lt;br /&gt;
 v4l2compress -fH264  -w -vv /dev/video0 /dev/video10 &amp;amp;&lt;br /&gt;
 v4l2rtspserver -v -S -W 640 -H 480 -F 10 -b /usr/local/share/v4l2rtspserver/ /dev/video10&lt;br /&gt;
&lt;br /&gt;
The v4l2compress/v4l2rtspserver method of streaming the camera uses around ~45-50% of the CPU for compression of the stream into H264 (640x480@7fps) and around 1-2% of the CPU for serving the HLS stream. Total system RAM used is roughly 64MB and the load average is ~0.4-~0.5 when idle, and ~0.51-~0.60 with one HLS client streaming the camera.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTSP ===&lt;br /&gt;
&lt;br /&gt;
GStreamer's RTSP server isn't an element you can use with gst-launch, but rather a library. We failed to build its example program, so instead used this very small 3rd party tool which is based on it: https://github.com/sfalexrog/gst-rtsp-launch/&lt;br /&gt;
&lt;br /&gt;
After building gst-rtsp-launch (which is relatively simple on Ubuntu groovy; just &amp;lt;code&amp;gt;apt install libgstreamer1.0-dev libgstrtspserver-1.0-dev&amp;lt;/code&amp;gt; first), you can read JPEG data directly from the camera and stream it via RTSP: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1280x720]' &amp;amp;&amp;amp; gst-rtsp-launch 'v4l2src ! image/jpeg,width=1280,height=720 ! rtpjpegpay name=pay0'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This stream can be played using &amp;lt;code&amp;gt;vlc rtsp://pinecube.local:8554/video&amp;lt;/code&amp;gt; or mpv, ffmpeg, gst-play-1.0, etc. If you increase the resolution to 1920x1080, mpv and gst-play can still play it, but VLC will complain &amp;lt;code&amp;gt;The total received frame size exceeds the client's buffer size (2000000).  73602 bytes of trailing data will be dropped!&amp;lt;/code&amp;gt; if you don't tell it to increase its buffer size with &amp;lt;code&amp;gt;--rtsp-frame-buffer-size=300000&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h264 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Left as an exercise to the reader (please update the wiki). Hint: involves bits from the HLS and the JPEG RTSP examples above, but needs a &amp;lt;code&amp;gt;rtph264pay name=pay0&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP UDP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 ! udpsink host=$client_ip port=8000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 udpsrc port=8000 !  application/x-rtp, encoding-name=JPEG,payload=26 !  rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the sender must specify the recipient's IP address in place of &amp;lt;code&amp;gt;$client_ip&amp;lt;/code&amp;gt;; this can actually be a multicast address allowing for many receivers! (You'll need to specify a valid multicast address in the receivers' pipeline also; see &amp;lt;code&amp;gt;gst-inspect-1.0 udpsrc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gst-inspect-1.0 udpsink&amp;lt;/code&amp;gt; for details.)&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP TCP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 ! rtpstreampay ! tcpserversink host=0.0.0.0 port=1234&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 tcpclientsrc host=pinecube.local port=1234 ! application/x-rtp-stream,encoding-name=JPEG ! rtpstreamdepay ! application/x-rtp, media=video, encoding-name=JPEG ! rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== gstreamer and socat: MJPEG HTTP server ===&lt;br /&gt;
&lt;br /&gt;
This rather ridiculous method uses bash, socat, and gstreamer to implement an HTTP-ish server which will serve your video as an MJPEG stream which is playable in browsers.&lt;br /&gt;
&lt;br /&gt;
This approach has the advantage of being relatively low latency (under a second), browser-compatible, and not needing to reencode anything on the CPU (it gets JPEG data from the camera itself). Compared to HLS, it has the disadvantages that MJPEG requires more bandwidth than h264 for similar quality, pause and seek are not possible, stalled connections cannot jump ahead when they are unstalled, and, in the case of this primitive implementation, it only supports one viewer at a time. (Though, really, the RTSP examples on this page perform very poorly with multiple viewers, so...)&lt;br /&gt;
&lt;br /&gt;
Gstreamer can almost do this by itself, as it has a multipartmux element which produces the headers which precede each frame. But sadly, despite various forum posts lamenting the lack of one over the last 12+ years, as of the end of the 50th year of the UNIX era (aka 2020), somehow nobody has yet gotten a webserver element merged in to gstreamer (which is necessary to produce the HTTP response, which is required for browsers other than firefox to play it). So, here is an absolutely minimal &amp;quot;webserver&amp;quot; which will get MJPEG displaying in a (single) browser.&lt;br /&gt;
&lt;br /&gt;
Create a file called &amp;lt;code&amp;gt;mjpeg-response.sh&amp;lt;/code&amp;gt;:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&lt;br /&gt;
 b=&amp;quot;--duct_tape_boundary&amp;quot;&lt;br /&gt;
 echo -en &amp;quot;HTTP/1.1 200 OK\r\nContent-type: multipart/x-mixed-replace;boundary=$b\r\n\r\n&amp;quot;&lt;br /&gt;
 gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! multipartmux boundary=$b ! fdsink fd=2 2&amp;gt;&amp;amp;1 &amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
Make it executable: &amp;lt;code&amp;gt;chmod +x mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run the server: &amp;lt;code&amp;gt;socat TCP-LISTEN:8080,reuseaddr,fork EXEC:./mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And browse to http://pinecube.local:8080/ in your browser.&lt;br /&gt;
&lt;br /&gt;
== Debugging camera issues with the gstreamer pipeline ==&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8874</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8874"/>
		<updated>2021-01-03T03:12:33Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* gstreamer and socat: MJPEG HTTP server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   510 MBytes  71.2 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   509 MBytes  71.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.01  sec   642 MBytes  89.8 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   641 MBytes  89.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
== Streaming the camera to the network ==&lt;br /&gt;
&lt;br /&gt;
In this section we document a variety of ways to stream video to the network from the PineCube. Unless specified otherwise, all of these examples have been tested on Ubuntu groovy (20.10).&lt;br /&gt;
&lt;br /&gt;
In the examples which use h264, we are currently encoding using the x264 library which is not very fast on this CPU. The SoC in the PineCube does have a hardware h264 encoder, which the authors of these examples have so far not tried to use. It appears that https://github.com/gtalusan/gst-plugin-cedar might provide easy access to it, however. Please update this wiki if you find out how to use the hardware encoder!&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h264 HLS ===&lt;br /&gt;
&lt;br /&gt;
HLS (HTTP Live Streaming) has the advantage that it is easy to play in any modern web browser, including Android and iPhone devices, and that it is easy to put an HTTP caching proxy in front of it to scale to many viewers. It has the disadvantages of adding (at minimum) several seconds of latency, and of requiring an h264 encoder (which we have in hardware, but haven't figured out how to use yet, so, we're stuck with the slow software one).&lt;br /&gt;
&lt;br /&gt;
HLS segments a video stream into small chunks which are stored as .ts (MPEG Transport Stream) files, and (re)writes a playlist.m3u8 file which clients constantly refresh to discover which .ts files they should download. We use a tmpfs file system to avoid needing to write these files to the sdcard in the PineCube. Besides the program which writes the .ts and .m3u8 files (gst-launch-1.0, in our case), we'll also need a very basic web page in tmpfs and a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create an hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js]. We recommend downloading the hls.js file and editing the example index.html to serve your local copy of it instead of fetching it from a CDN. This file provides HLS playback capabilities in browsers which don't natively support it (which is most browsers aside from the iPhone).&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternately, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
You can also view the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt; (or with mpv, ffplay, etc)&lt;br /&gt;
&lt;br /&gt;
To find out about other options you can configure in the &amp;lt;code&amp;gt;hlssink&amp;lt;/code&amp;gt; gstreamer element, you can run &amp;lt;code&amp;gt;gst-inspect-1.0 hlssink&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is worth noting here that the &amp;lt;code&amp;gt;hlssink&amp;lt;/code&amp;gt; element in GStreamer is not widely used in production environments. It is handy for testing, but for real-world free-software HLS live streaming deployments the standard tool today (January 2021) is nginx's RTMP module which can be used with ffmpeg to produce &amp;quot;adaptive streams&amp;quot; which are reencoded at varying quality levels. You can send data to an nginx-rtmp server from a gstreamer pipeline using the &amp;lt;code&amp;gt;rtmpsink&amp;lt;/code&amp;gt; element. It is also worth noting that gstreamer has a new &amp;lt;code&amp;gt;hlssink2&amp;lt;/code&amp;gt; element which we have not tested; perhaps in the future it will even have a webserver!&lt;br /&gt;
&lt;br /&gt;
=== v4l2rtspserver: h264 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Install dependencies and build required v4l2 software:&lt;br /&gt;
&lt;br /&gt;
 apt install -y gstreamer1.0-plugins-bad gstreamer1.0-tools \&lt;br /&gt;
 gstreamer1.0-plugins-good v4l-utils gstreamer1.0-alsa alsa-utils libpango1.0-0 \&lt;br /&gt;
 libpango1.0-dev gstreamer1.0-plugins-base gstreamer1.0-x x264 \&lt;br /&gt;
 gstreamer1.0-plugins-{good,bad,ugly} liblivemedia-dev liblog4cpp5-dev \&lt;br /&gt;
 libasound2-dev vlc libssl-dev iotop libasound2-dev  liblog4cpp5-dev \&lt;br /&gt;
 liblivemedia-dev autoconf automake libtool v4l2loopback-dkms liblog4cpp5-dev \&lt;br /&gt;
 libvpx-dev libx264-dev libjpeg-dev libx265-dev;&lt;br /&gt;
&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2tools &amp;amp;&amp;amp; cd v4l2tools &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2rtspserver &amp;amp;&amp;amp; cd v4l2rtspserver &amp;amp;&amp;amp; cmake -D LIVE555URL=https://download.videolan.org/pub/contrib/live555/live.2020.08.19.tar.gz . &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
&lt;br /&gt;
Running the camera:&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/640x480@1/30]';&lt;br /&gt;
 modprobe v4l2loopback video_nr=10 debug=2;&lt;br /&gt;
 v4l2compress -fH264  -w -vv /dev/video0 /dev/video10 &amp;amp;&lt;br /&gt;
 v4l2rtspserver -v -S -W 640 -H 480 -F 10 -b /usr/local/share/v4l2rtspserver/ /dev/video10&lt;br /&gt;
&lt;br /&gt;
The v4l2compress/v4l2rtspserver method of streaming the camera uses around ~45-50% of the CPU for compression of the stream into H264 (640x480@7fps) and around 1-2% of the CPU for serving the HLS stream. Total system RAM used is roughly 64MB and the load average is ~0.4-~0.5 when idle, and ~0.51-~0.60 with one HLS client streaming the camera.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTSP ===&lt;br /&gt;
&lt;br /&gt;
GStreamer's RTSP server isn't an element you can use with gst-launch, but rather a library. We failed to build its example program, so instead used this very small 3rd party tool which is based on it: https://github.com/sfalexrog/gst-rtsp-launch/&lt;br /&gt;
&lt;br /&gt;
After building gst-rtsp-launch (which is relatively simple on Ubuntu groovy; just &amp;lt;code&amp;gt;apt install libgstreamer1.0-dev libgstrtspserver-1.0-dev&amp;lt;/code&amp;gt; first), you can read JPEG data directly from the camera and stream it via RTSP: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1280x720]' &amp;amp;&amp;amp; gst-rtsp-launch 'v4l2src ! image/jpeg,width=1280,height=720 ! rtpjpegpay name=pay0'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This stream can be played using &amp;lt;code&amp;gt;vlc rtsp://pinecube.local:8554/video&amp;lt;/code&amp;gt; or mpv, ffmpeg, gst-play-1.0, etc. If you increase the resolution to 1920x1080, mpv and gst-play can still play it, but VLC will complain &amp;lt;code&amp;gt;The total received frame size exceeds the client's buffer size (2000000).  73602 bytes of trailing data will be dropped!&amp;lt;/code&amp;gt; if you don't tell it to increase its buffer size with &amp;lt;code&amp;gt;--rtsp-frame-buffer-size=300000&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h264 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Left as an exercise to the reader (please update the wiki). Hint: involves bits from the HLS and the JPEG RTSP examples above, but needs a &amp;lt;code&amp;gt;rtph264pay name=pay0&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP UDP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 ! udpsink host=$client_ip port=8000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 udpsrc port=8000 !  application/x-rtp, encoding-name=JPEG,payload=26 !  rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the sender must specify the recipient's IP address in place of &amp;lt;code&amp;gt;$client_ip&amp;lt;/code&amp;gt;; this can actually be a multicast address allowing for many receivers! (You'll need to specify a valid multicast address in the receivers' pipeline also; see &amp;lt;code&amp;gt;gst-inspect-1.0 udpsrc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gst-inspect-1.0 udpsink&amp;lt;/code&amp;gt; for details.)&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP TCP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 ! rtpstreampay ! tcpserversink host=0.0.0.0 port=1234&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 tcpclientsrc host=pinecube.local port=1234 ! application/x-rtp-stream,encoding-name=JPEG ! rtpstreamdepay ! application/x-rtp, media=video, encoding-name=JPEG ! rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== gstreamer and socat: MJPEG HTTP server ===&lt;br /&gt;
&lt;br /&gt;
This rather ridiculous method uses bash, socat, and gstreamer to implement an HTTP-ish server which will serve your video as an MJPEG stream which is playable in browsers.&lt;br /&gt;
&lt;br /&gt;
This approach has the advantage of being relatively low latency (under a second), browser-compatible, and not needing to reencode anything on the CPU (it gets JPEG data from the camera itself). Compared to HLS, it has the disadvantages that MJPEG requires more bandwidth than h264 for similar quality, pause and seek are not possible, stalled connections cannot jump ahead when they are unstalled, and, in the case of this primitive implementation, it only supports one viewer at a time. (Though, really, the RTSP examples on this page perform very poorly with multiple viewers, so...)&lt;br /&gt;
&lt;br /&gt;
Gstreamer can almost do this by itself, as it has a multipartmux element which produces the headers which precede each frame. But sadly, despite various forum posts lamenting the lack of one over the last 12+ years, as of the end of the 50th year of the UNIX era (aka 2020), somehow nobody has yet gotten a webserver element merged in to gstreamer (which is necessary to produce the HTTP response, which is required for browsers other than firefox to play it). So, here is an absolutely minimal &amp;quot;webserver&amp;quot; which will get MJPEG displaying in a (single) browser.&lt;br /&gt;
&lt;br /&gt;
Create a file called &amp;lt;code&amp;gt;mjpeg-response.sh&amp;lt;/code&amp;gt;:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&lt;br /&gt;
 b=&amp;quot;--duct_tape_boundary&amp;quot;&lt;br /&gt;
 echo -en &amp;quot;HTTP/1.1 200 OK\r\nContent-type: multipart/x-mixed-replace;boundary=$b\r\n\r\n&amp;quot;&lt;br /&gt;
 gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! multipartmux boundary=$b ! fdsink fd=2 2&amp;gt;&amp;amp;1 &amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
Make it executable: &amp;lt;code&amp;gt;chmod +x mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run the server: &amp;lt;code&amp;gt;socat TCP-LISTEN:8080,reuseaddr,fork EXEC:./mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And browse to http://pinecube.local:8080/ in your browser.&lt;br /&gt;
&lt;br /&gt;
== Debugging camera issues with the gstreamer pipeline ==&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8873</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8873"/>
		<updated>2021-01-03T02:59:55Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* gstreamer: JPEG RTP TCP */ oops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   510 MBytes  71.2 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   509 MBytes  71.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.01  sec   642 MBytes  89.8 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   641 MBytes  89.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
== Streaming the camera to the network ==&lt;br /&gt;
&lt;br /&gt;
In this section we document a variety of ways to stream video to the network from the PineCube. Unless specified otherwise, all of these examples have been tested on Ubuntu groovy (20.10).&lt;br /&gt;
&lt;br /&gt;
In the examples which use h264, we are currently encoding using the x264 library which is not very fast on this CPU. The SoC in the PineCube does have a hardware h264 encoder, which the authors of these examples have so far not tried to use. It appears that https://github.com/gtalusan/gst-plugin-cedar might provide easy access to it, however. Please update this wiki if you find out how to use the hardware encoder!&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h264 HLS ===&lt;br /&gt;
&lt;br /&gt;
HLS (HTTP Live Streaming) has the advantage that it is easy to play in any modern web browser, including Android and iPhone devices, and that it is easy to put an HTTP caching proxy in front of it to scale to many viewers. It has the disadvantages of adding (at minimum) several seconds of latency, and of requiring an h264 encoder (which we have in hardware, but haven't figured out how to use yet, so, we're stuck with the slow software one).&lt;br /&gt;
&lt;br /&gt;
HLS segments a video stream into small chunks which are stored as .ts (MPEG Transport Stream) files, and (re)writes a playlist.m3u8 file which clients constantly refresh to discover which .ts files they should download. We use a tmpfs file system to avoid needing to write these files to the sdcard in the PineCube. Besides the program which writes the .ts and .m3u8 files (gst-launch-1.0, in our case), we'll also need a very basic web page in tmpfs and a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create an hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js]. We recommend downloading the hls.js file and editing the example index.html to serve your local copy of it instead of fetching it from a CDN. This file provides HLS playback capabilities in browsers which don't natively support it (which is most browsers aside from the iPhone).&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternately, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
You can also view the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt; (or with mpv, ffplay, etc)&lt;br /&gt;
&lt;br /&gt;
To find out about other options you can configure in the &amp;lt;code&amp;gt;hlssink&amp;lt;/code&amp;gt; gstreamer element, you can run &amp;lt;code&amp;gt;gst-inspect-1.0 hlssink&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is worth noting here that the &amp;lt;code&amp;gt;hlssink&amp;lt;/code&amp;gt; element in GStreamer is not widely used in production environments. It is handy for testing, but for real-world free-software HLS live streaming deployments the standard tool today (January 2021) is nginx's RTMP module which can be used with ffmpeg to produce &amp;quot;adaptive streams&amp;quot; which are reencoded at varying quality levels. You can send data to an nginx-rtmp server from a gstreamer pipeline using the &amp;lt;code&amp;gt;rtmpsink&amp;lt;/code&amp;gt; element. It is also worth noting that gstreamer has a new &amp;lt;code&amp;gt;hlssink2&amp;lt;/code&amp;gt; element which we have not tested; perhaps in the future it will even have a webserver!&lt;br /&gt;
&lt;br /&gt;
=== v4l2rtspserver: h264 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Install dependencies and build required v4l2 software:&lt;br /&gt;
&lt;br /&gt;
 apt install -y gstreamer1.0-plugins-bad gstreamer1.0-tools \&lt;br /&gt;
 gstreamer1.0-plugins-good v4l-utils gstreamer1.0-alsa alsa-utils libpango1.0-0 \&lt;br /&gt;
 libpango1.0-dev gstreamer1.0-plugins-base gstreamer1.0-x x264 \&lt;br /&gt;
 gstreamer1.0-plugins-{good,bad,ugly} liblivemedia-dev liblog4cpp5-dev \&lt;br /&gt;
 libasound2-dev vlc libssl-dev iotop libasound2-dev  liblog4cpp5-dev \&lt;br /&gt;
 liblivemedia-dev autoconf automake libtool v4l2loopback-dkms liblog4cpp5-dev \&lt;br /&gt;
 libvpx-dev libx264-dev libjpeg-dev libx265-dev;&lt;br /&gt;
&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2tools &amp;amp;&amp;amp; cd v4l2tools &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2rtspserver &amp;amp;&amp;amp; cd v4l2rtspserver &amp;amp;&amp;amp; cmake -D LIVE555URL=https://download.videolan.org/pub/contrib/live555/live.2020.08.19.tar.gz . &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
&lt;br /&gt;
Running the camera:&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/640x480@1/30]';&lt;br /&gt;
 modprobe v4l2loopback video_nr=10 debug=2;&lt;br /&gt;
 v4l2compress -fH264  -w -vv /dev/video0 /dev/video10 &amp;amp;&lt;br /&gt;
 v4l2rtspserver -v -S -W 640 -H 480 -F 10 -b /usr/local/share/v4l2rtspserver/ /dev/video10&lt;br /&gt;
&lt;br /&gt;
The v4l2compress/v4l2rtspserver method of streaming the camera uses around ~45-50% of the CPU for compression of the stream into H264 (640x480@7fps) and around 1-2% of the CPU for serving the HLS stream. Total system RAM used is roughly 64MB and the load average is ~0.4-~0.5 when idle, and ~0.51-~0.60 with one HLS client streaming the camera.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTSP ===&lt;br /&gt;
&lt;br /&gt;
GStreamer's RTSP server isn't an element you can use with gst-launch, but rather a library. We failed to build its example program, so instead used this very small 3rd party tool which is based on it: https://github.com/sfalexrog/gst-rtsp-launch/&lt;br /&gt;
&lt;br /&gt;
After building gst-rtsp-launch (which is relatively simple on Ubuntu groovy; just &amp;lt;code&amp;gt;apt install libgstreamer1.0-dev libgstrtspserver-1.0-dev&amp;lt;/code&amp;gt; first), you can read JPEG data directly from the camera and stream it via RTSP: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1280x720]' &amp;amp;&amp;amp; gst-rtsp-launch 'v4l2src ! image/jpeg,width=1280,height=720 ! rtpjpegpay name=pay0'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This stream can be played using &amp;lt;code&amp;gt;vlc rtsp://pinecube.local:8554/video&amp;lt;/code&amp;gt; or mpv, ffmpeg, gst-play-1.0, etc. If you increase the resolution to 1920x1080, mpv and gst-play can still play it, but VLC will complain &amp;lt;code&amp;gt;The total received frame size exceeds the client's buffer size (2000000).  73602 bytes of trailing data will be dropped!&amp;lt;/code&amp;gt; if you don't tell it to increase its buffer size with &amp;lt;code&amp;gt;--rtsp-frame-buffer-size=300000&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h264 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Left as an exercise to the reader (please update the wiki). Hint: involves bits from the HLS and the JPEG RTSP examples above, but needs a &amp;lt;code&amp;gt;rtph264pay name=pay0&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP UDP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 ! udpsink host=$client_ip port=8000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 udpsrc port=8000 !  application/x-rtp, encoding-name=JPEG,payload=26 !  rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the sender must specify the recipient's IP address in place of &amp;lt;code&amp;gt;$client_ip&amp;lt;/code&amp;gt;; this can actually be a multicast address allowing for many receivers! (You'll need to specify a valid multicast address in the receivers' pipeline also; see &amp;lt;code&amp;gt;gst-inspect-1.0 udpsrc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gst-inspect-1.0 udpsink&amp;lt;/code&amp;gt; for details.)&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP TCP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 ! rtpstreampay ! tcpserversink host=0.0.0.0 port=1234&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 tcpclientsrc host=pinecube.local port=1234 ! application/x-rtp-stream,encoding-name=JPEG ! rtpstreamdepay ! application/x-rtp, media=video, encoding-name=JPEG ! rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== gstreamer and socat: MJPEG HTTP server ===&lt;br /&gt;
&lt;br /&gt;
This rather ridiculous method uses bash, socat, and gstreamer to implement an HTTP-ish server which will serve your video as an MJPEG stream which is playable in browsers.&lt;br /&gt;
&lt;br /&gt;
This approach has the advantage of being relatively low latency (under a second), browser-compatible, and not needing to reencode anything on the CPU (it gets JPEG data from the camera itself). It has the disadvantage of only supporting one viewer at a time. (Though, really, the RTSP examples on this page perform very poorly with multiple viewers, so...)&lt;br /&gt;
&lt;br /&gt;
Gstreamer can almost do this by itself, as it has a multipartmux element which produces the headers which precede each frame. But sadly, despite various forum posts lamenting the lack of one over the last 12+ years, as of the end of the 50th year of the UNIX era (aka 2020), somehow nobody has yet gotten a webserver element merged in to gstreamer (which is necessary to produce the HTTP response, which is required for browsers other than firefox to play it). So, here is an absolutely minimal &amp;quot;webserver&amp;quot; which will get MJPEG displaying in a (single) browser.&lt;br /&gt;
&lt;br /&gt;
Create a file called &amp;lt;code&amp;gt;mjpeg-response.sh&amp;lt;/code&amp;gt;:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&lt;br /&gt;
 b=&amp;quot;--duct_tape_boundary&amp;quot;&lt;br /&gt;
 echo -en &amp;quot;HTTP/1.1 200 OK\r\nContent-type: multipart/x-mixed-replace;boundary=$b\r\n\r\n&amp;quot;&lt;br /&gt;
 gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! multipartmux boundary=$b ! fdsink fd=2 2&amp;gt;&amp;amp;1 &amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
Make it executable: &amp;lt;code&amp;gt;chmod +x mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run the server: &amp;lt;code&amp;gt;socat TCP-LISTEN:8080,reuseaddr,fork EXEC:./mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And browse to http://pinecube.local:8080/ in your browser.&lt;br /&gt;
&lt;br /&gt;
== Debugging camera issues with the gstreamer pipeline ==&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8872</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8872"/>
		<updated>2021-01-03T02:59:30Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* gstreamer: JPEG RTP UDP */ oops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   510 MBytes  71.2 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   509 MBytes  71.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.01  sec   642 MBytes  89.8 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   641 MBytes  89.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
== Streaming the camera to the network ==&lt;br /&gt;
&lt;br /&gt;
In this section we document a variety of ways to stream video to the network from the PineCube. Unless specified otherwise, all of these examples have been tested on Ubuntu groovy (20.10).&lt;br /&gt;
&lt;br /&gt;
In the examples which use h264, we are currently encoding using the x264 library which is not very fast on this CPU. The SoC in the PineCube does have a hardware h264 encoder, which the authors of these examples have so far not tried to use. It appears that https://github.com/gtalusan/gst-plugin-cedar might provide easy access to it, however. Please update this wiki if you find out how to use the hardware encoder!&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h264 HLS ===&lt;br /&gt;
&lt;br /&gt;
HLS (HTTP Live Streaming) has the advantage that it is easy to play in any modern web browser, including Android and iPhone devices, and that it is easy to put an HTTP caching proxy in front of it to scale to many viewers. It has the disadvantages of adding (at minimum) several seconds of latency, and of requiring an h264 encoder (which we have in hardware, but haven't figured out how to use yet, so, we're stuck with the slow software one).&lt;br /&gt;
&lt;br /&gt;
HLS segments a video stream into small chunks which are stored as .ts (MPEG Transport Stream) files, and (re)writes a playlist.m3u8 file which clients constantly refresh to discover which .ts files they should download. We use a tmpfs file system to avoid needing to write these files to the sdcard in the PineCube. Besides the program which writes the .ts and .m3u8 files (gst-launch-1.0, in our case), we'll also need a very basic web page in tmpfs and a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create an hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js]. We recommend downloading the hls.js file and editing the example index.html to serve your local copy of it instead of fetching it from a CDN. This file provides HLS playback capabilities in browsers which don't natively support it (which is most browsers aside from the iPhone).&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternately, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
You can also view the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt; (or with mpv, ffplay, etc)&lt;br /&gt;
&lt;br /&gt;
To find out about other options you can configure in the &amp;lt;code&amp;gt;hlssink&amp;lt;/code&amp;gt; gstreamer element, you can run &amp;lt;code&amp;gt;gst-inspect-1.0 hlssink&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is worth noting here that the &amp;lt;code&amp;gt;hlssink&amp;lt;/code&amp;gt; element in GStreamer is not widely used in production environments. It is handy for testing, but for real-world free-software HLS live streaming deployments the standard tool today (January 2021) is nginx's RTMP module which can be used with ffmpeg to produce &amp;quot;adaptive streams&amp;quot; which are reencoded at varying quality levels. You can send data to an nginx-rtmp server from a gstreamer pipeline using the &amp;lt;code&amp;gt;rtmpsink&amp;lt;/code&amp;gt; element. It is also worth noting that gstreamer has a new &amp;lt;code&amp;gt;hlssink2&amp;lt;/code&amp;gt; element which we have not tested; perhaps in the future it will even have a webserver!&lt;br /&gt;
&lt;br /&gt;
=== v4l2rtspserver: h264 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Install dependencies and build required v4l2 software:&lt;br /&gt;
&lt;br /&gt;
 apt install -y gstreamer1.0-plugins-bad gstreamer1.0-tools \&lt;br /&gt;
 gstreamer1.0-plugins-good v4l-utils gstreamer1.0-alsa alsa-utils libpango1.0-0 \&lt;br /&gt;
 libpango1.0-dev gstreamer1.0-plugins-base gstreamer1.0-x x264 \&lt;br /&gt;
 gstreamer1.0-plugins-{good,bad,ugly} liblivemedia-dev liblog4cpp5-dev \&lt;br /&gt;
 libasound2-dev vlc libssl-dev iotop libasound2-dev  liblog4cpp5-dev \&lt;br /&gt;
 liblivemedia-dev autoconf automake libtool v4l2loopback-dkms liblog4cpp5-dev \&lt;br /&gt;
 libvpx-dev libx264-dev libjpeg-dev libx265-dev;&lt;br /&gt;
&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2tools &amp;amp;&amp;amp; cd v4l2tools &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2rtspserver &amp;amp;&amp;amp; cd v4l2rtspserver &amp;amp;&amp;amp; cmake -D LIVE555URL=https://download.videolan.org/pub/contrib/live555/live.2020.08.19.tar.gz . &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
&lt;br /&gt;
Running the camera:&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/640x480@1/30]';&lt;br /&gt;
 modprobe v4l2loopback video_nr=10 debug=2;&lt;br /&gt;
 v4l2compress -fH264  -w -vv /dev/video0 /dev/video10 &amp;amp;&lt;br /&gt;
 v4l2rtspserver -v -S -W 640 -H 480 -F 10 -b /usr/local/share/v4l2rtspserver/ /dev/video10&lt;br /&gt;
&lt;br /&gt;
The v4l2compress/v4l2rtspserver method of streaming the camera uses around ~45-50% of the CPU for compression of the stream into H264 (640x480@7fps) and around 1-2% of the CPU for serving the HLS stream. Total system RAM used is roughly 64MB and the load average is ~0.4-~0.5 when idle, and ~0.51-~0.60 with one HLS client streaming the camera.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTSP ===&lt;br /&gt;
&lt;br /&gt;
GStreamer's RTSP server isn't an element you can use with gst-launch, but rather a library. We failed to build its example program, so instead used this very small 3rd party tool which is based on it: https://github.com/sfalexrog/gst-rtsp-launch/&lt;br /&gt;
&lt;br /&gt;
After building gst-rtsp-launch (which is relatively simple on Ubuntu groovy; just &amp;lt;code&amp;gt;apt install libgstreamer1.0-dev libgstrtspserver-1.0-dev&amp;lt;/code&amp;gt; first), you can read JPEG data directly from the camera and stream it via RTSP: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1280x720]' &amp;amp;&amp;amp; gst-rtsp-launch 'v4l2src ! image/jpeg,width=1280,height=720 ! rtpjpegpay name=pay0'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This stream can be played using &amp;lt;code&amp;gt;vlc rtsp://pinecube.local:8554/video&amp;lt;/code&amp;gt; or mpv, ffmpeg, gst-play-1.0, etc. If you increase the resolution to 1920x1080, mpv and gst-play can still play it, but VLC will complain &amp;lt;code&amp;gt;The total received frame size exceeds the client's buffer size (2000000).  73602 bytes of trailing data will be dropped!&amp;lt;/code&amp;gt; if you don't tell it to increase its buffer size with &amp;lt;code&amp;gt;--rtsp-frame-buffer-size=300000&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h264 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Left as an exercise to the reader (please update the wiki). Hint: involves bits from the HLS and the JPEG RTSP examples above, but needs a &amp;lt;code&amp;gt;rtph264pay name=pay0&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP UDP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 ! udpsink host=$client_ip port=8000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 udpsrc port=8000 !  application/x-rtp, encoding-name=JPEG,payload=26 !  rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the sender must specify the recipient's IP address in place of &amp;lt;code&amp;gt;$client_ip&amp;lt;/code&amp;gt;; this can actually be a multicast address allowing for many receivers! (You'll need to specify a valid multicast address in the receivers' pipeline also; see &amp;lt;code&amp;gt;gst-inspect-1.0 udpsrc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gst-inspect-1.0 udpsink&amp;lt;/code&amp;gt; for details.)&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP TCP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 pt=96 ! rtpstreampay ! tcpserversink host=0.0.0.0 port=1234&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 tcpclientsrc host=pinecube.local port=1234 ! application/x-rtp-stream,encoding-name=JPEG ! rtpstreamdepay ! application/x-rtp, media=video, encoding-name=JPEG ! rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== gstreamer and socat: MJPEG HTTP server ===&lt;br /&gt;
&lt;br /&gt;
This rather ridiculous method uses bash, socat, and gstreamer to implement an HTTP-ish server which will serve your video as an MJPEG stream which is playable in browsers.&lt;br /&gt;
&lt;br /&gt;
This approach has the advantage of being relatively low latency (under a second), browser-compatible, and not needing to reencode anything on the CPU (it gets JPEG data from the camera itself). It has the disadvantage of only supporting one viewer at a time. (Though, really, the RTSP examples on this page perform very poorly with multiple viewers, so...)&lt;br /&gt;
&lt;br /&gt;
Gstreamer can almost do this by itself, as it has a multipartmux element which produces the headers which precede each frame. But sadly, despite various forum posts lamenting the lack of one over the last 12+ years, as of the end of the 50th year of the UNIX era (aka 2020), somehow nobody has yet gotten a webserver element merged in to gstreamer (which is necessary to produce the HTTP response, which is required for browsers other than firefox to play it). So, here is an absolutely minimal &amp;quot;webserver&amp;quot; which will get MJPEG displaying in a (single) browser.&lt;br /&gt;
&lt;br /&gt;
Create a file called &amp;lt;code&amp;gt;mjpeg-response.sh&amp;lt;/code&amp;gt;:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&lt;br /&gt;
 b=&amp;quot;--duct_tape_boundary&amp;quot;&lt;br /&gt;
 echo -en &amp;quot;HTTP/1.1 200 OK\r\nContent-type: multipart/x-mixed-replace;boundary=$b\r\n\r\n&amp;quot;&lt;br /&gt;
 gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! multipartmux boundary=$b ! fdsink fd=2 2&amp;gt;&amp;amp;1 &amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
Make it executable: &amp;lt;code&amp;gt;chmod +x mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run the server: &amp;lt;code&amp;gt;socat TCP-LISTEN:8080,reuseaddr,fork EXEC:./mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And browse to http://pinecube.local:8080/ in your browser.&lt;br /&gt;
&lt;br /&gt;
== Debugging camera issues with the gstreamer pipeline ==&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8871</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8871"/>
		<updated>2021-01-03T02:51:23Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* gstreamer: JPEG RTP UDP */ multicast hint&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   510 MBytes  71.2 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   509 MBytes  71.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.01  sec   642 MBytes  89.8 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   641 MBytes  89.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
== Streaming the camera to the network ==&lt;br /&gt;
&lt;br /&gt;
In this section we document a variety of ways to stream video to the network from the PineCube. Unless specified otherwise, all of these examples have been tested on Ubuntu groovy (20.10).&lt;br /&gt;
&lt;br /&gt;
In the examples which use h264, we are currently encoding using the x264 library which is not very fast on this CPU. The SoC in the PineCube does have a hardware h264 encoder, which the authors of these examples have so far not tried to use. It appears that https://github.com/gtalusan/gst-plugin-cedar might provide easy access to it, however. Please update this wiki if you find out how to use the hardware encoder!&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h264 HLS ===&lt;br /&gt;
&lt;br /&gt;
HLS (HTTP Live Streaming) has the advantage that it is easy to play in any modern web browser, including Android and iPhone devices, and that it is easy to put an HTTP caching proxy in front of it to scale to many viewers. It has the disadvantages of adding (at minimum) several seconds of latency, and of requiring an h264 encoder (which we have in hardware, but haven't figured out how to use yet, so, we're stuck with the slow software one).&lt;br /&gt;
&lt;br /&gt;
HLS segments a video stream into small chunks which are stored as .ts (MPEG Transport Stream) files, and (re)writes a playlist.m3u8 file which clients constantly refresh to discover which .ts files they should download. We use a tmpfs file system to avoid needing to write these files to the sdcard in the PineCube. Besides the program which writes the .ts and .m3u8 files (gst-launch-1.0, in our case), we'll also need a very basic web page in tmpfs and a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create an hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js]. We recommend downloading the hls.js file and editing the example index.html to serve your local copy of it instead of fetching it from a CDN. This file provides HLS playback capabilities in browsers which don't natively support it (which is most browsers aside from the iPhone).&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternately, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
You can also view the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt; (or with mpv, ffplay, etc)&lt;br /&gt;
&lt;br /&gt;
To find out about other options you can configure in the &amp;lt;code&amp;gt;hlssink&amp;lt;/code&amp;gt; gstreamer element, you can run &amp;lt;code&amp;gt;gst-inspect-1.0 hlssink&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is worth noting here that the &amp;lt;code&amp;gt;hlssink&amp;lt;/code&amp;gt; element in GStreamer is not widely used in production environments. It is handy for testing, but for real-world free-software HLS live streaming deployments the standard tool today (January 2021) is nginx's RTMP module which can be used with ffmpeg to produce &amp;quot;adaptive streams&amp;quot; which are reencoded at varying quality levels. You can send data to an nginx-rtmp server from a gstreamer pipeline using the &amp;lt;code&amp;gt;rtmpsink&amp;lt;/code&amp;gt; element. It is also worth noting that gstreamer has a new &amp;lt;code&amp;gt;hlssink2&amp;lt;/code&amp;gt; element which we have not tested; perhaps in the future it will even have a webserver!&lt;br /&gt;
&lt;br /&gt;
=== v4l2rtspserver: h264 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Install dependencies and build required v4l2 software:&lt;br /&gt;
&lt;br /&gt;
 apt install -y gstreamer1.0-plugins-bad gstreamer1.0-tools \&lt;br /&gt;
 gstreamer1.0-plugins-good v4l-utils gstreamer1.0-alsa alsa-utils libpango1.0-0 \&lt;br /&gt;
 libpango1.0-dev gstreamer1.0-plugins-base gstreamer1.0-x x264 \&lt;br /&gt;
 gstreamer1.0-plugins-{good,bad,ugly} liblivemedia-dev liblog4cpp5-dev \&lt;br /&gt;
 libasound2-dev vlc libssl-dev iotop libasound2-dev  liblog4cpp5-dev \&lt;br /&gt;
 liblivemedia-dev autoconf automake libtool v4l2loopback-dkms liblog4cpp5-dev \&lt;br /&gt;
 libvpx-dev libx264-dev libjpeg-dev libx265-dev;&lt;br /&gt;
&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2tools &amp;amp;&amp;amp; cd v4l2tools &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2rtspserver &amp;amp;&amp;amp; cd v4l2rtspserver &amp;amp;&amp;amp; cmake -D LIVE555URL=https://download.videolan.org/pub/contrib/live555/live.2020.08.19.tar.gz . &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
&lt;br /&gt;
Running the camera:&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/640x480@1/30]';&lt;br /&gt;
 modprobe v4l2loopback video_nr=10 debug=2;&lt;br /&gt;
 v4l2compress -fH264  -w -vv /dev/video0 /dev/video10 &amp;amp;&lt;br /&gt;
 v4l2rtspserver -v -S -W 640 -H 480 -F 10 -b /usr/local/share/v4l2rtspserver/ /dev/video10&lt;br /&gt;
&lt;br /&gt;
The v4l2compress/v4l2rtspserver method of streaming the camera uses around ~45-50% of the CPU for compression of the stream into H264 (640x480@7fps) and around 1-2% of the CPU for serving the HLS stream. Total system RAM used is roughly 64MB and the load average is ~0.4-~0.5 when idle, and ~0.51-~0.60 with one HLS client streaming the camera.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTSP ===&lt;br /&gt;
&lt;br /&gt;
GStreamer's RTSP server isn't an element you can use with gst-launch, but rather a library. We failed to build its example program, so instead used this very small 3rd party tool which is based on it: https://github.com/sfalexrog/gst-rtsp-launch/&lt;br /&gt;
&lt;br /&gt;
After building gst-rtsp-launch (which is relatively simple on Ubuntu groovy; just &amp;lt;code&amp;gt;apt install libgstreamer1.0-dev libgstrtspserver-1.0-dev&amp;lt;/code&amp;gt; first), you can read JPEG data directly from the camera and stream it via RTSP: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1280x720]' &amp;amp;&amp;amp; gst-rtsp-launch 'v4l2src ! image/jpeg,width=1280,height=720 ! rtpjpegpay name=pay0'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This stream can be played using &amp;lt;code&amp;gt;vlc rtsp://pinecube.local:8554/video&amp;lt;/code&amp;gt; or mpv, ffmpeg, gst-play-1.0, etc. If you increase the resolution to 1920x1080, mpv and gst-play can still play it, but VLC will complain &amp;lt;code&amp;gt;The total received frame size exceeds the client's buffer size (2000000).  73602 bytes of trailing data will be dropped!&amp;lt;/code&amp;gt; if you don't tell it to increase its buffer size with &amp;lt;code&amp;gt;--rtsp-frame-buffer-size=300000&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h264 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Left as an exercise to the reader (please update the wiki). Hint: involves bits from the HLS and the JPEG RTSP examples above, but needs a &amp;lt;code&amp;gt;rtph264pay name=pay0&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP UDP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 pt=96 ! udpsink host=$client_ip port=8000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 udpsrc port=8000 !  application/x-rtp, encoding-name=JPEG,payload=26 !  rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the sender must specify the recipient's IP address in place of &amp;lt;code&amp;gt;$client_ip&amp;lt;/code&amp;gt;; this can actually be a multicast address allowing for many receivers! (You'll need to specify a valid multicast address in the receivers' pipeline also; see &amp;lt;code&amp;gt;gst-inspect-1.0 udpsrc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;gst-inspect-1.0 udpsink&amp;lt;/code&amp;gt; for details.)&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP TCP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 pt=96 ! rtpstreampay ! tcpserversink host=0.0.0.0 port=1234&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 tcpclientsrc host=pinecube.local port=1234 ! application/x-rtp-stream,encoding-name=JPEG ! rtpstreamdepay ! application/x-rtp, media=video, encoding-name=JPEG ! rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== gstreamer and socat: MJPEG HTTP server ===&lt;br /&gt;
&lt;br /&gt;
This rather ridiculous method uses bash, socat, and gstreamer to implement an HTTP-ish server which will serve your video as an MJPEG stream which is playable in browsers.&lt;br /&gt;
&lt;br /&gt;
This approach has the advantage of being relatively low latency (under a second), browser-compatible, and not needing to reencode anything on the CPU (it gets JPEG data from the camera itself). It has the disadvantage of only supporting one viewer at a time. (Though, really, the RTSP examples on this page perform very poorly with multiple viewers, so...)&lt;br /&gt;
&lt;br /&gt;
Gstreamer can almost do this by itself, as it has a multipartmux element which produces the headers which precede each frame. But sadly, despite various forum posts lamenting the lack of one over the last 12+ years, as of the end of the 50th year of the UNIX era (aka 2020), somehow nobody has yet gotten a webserver element merged in to gstreamer (which is necessary to produce the HTTP response, which is required for browsers other than firefox to play it). So, here is an absolutely minimal &amp;quot;webserver&amp;quot; which will get MJPEG displaying in a (single) browser.&lt;br /&gt;
&lt;br /&gt;
Create a file called &amp;lt;code&amp;gt;mjpeg-response.sh&amp;lt;/code&amp;gt;:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&lt;br /&gt;
 b=&amp;quot;--duct_tape_boundary&amp;quot;&lt;br /&gt;
 echo -en &amp;quot;HTTP/1.1 200 OK\r\nContent-type: multipart/x-mixed-replace;boundary=$b\r\n\r\n&amp;quot;&lt;br /&gt;
 gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! multipartmux boundary=$b ! fdsink fd=2 2&amp;gt;&amp;amp;1 &amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
Make it executable: &amp;lt;code&amp;gt;chmod +x mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run the server: &amp;lt;code&amp;gt;socat TCP-LISTEN:8080,reuseaddr,fork EXEC:./mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And browse to http://pinecube.local:8080/ in your browser.&lt;br /&gt;
&lt;br /&gt;
== Debugging camera issues with the gstreamer pipeline ==&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8870</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8870"/>
		<updated>2021-01-03T02:41:28Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* gstreamer: h264 HLS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   510 MBytes  71.2 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   509 MBytes  71.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.01  sec   642 MBytes  89.8 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   641 MBytes  89.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
== Streaming the camera to the network ==&lt;br /&gt;
&lt;br /&gt;
In this section we document a variety of ways to stream video to the network from the PineCube. Unless specified otherwise, all of these examples have been tested on Ubuntu groovy (20.10).&lt;br /&gt;
&lt;br /&gt;
In the examples which use h264, we are currently encoding using the x264 library which is not very fast on this CPU. The SoC in the PineCube does have a hardware h264 encoder, which the authors of these examples have so far not tried to use. It appears that https://github.com/gtalusan/gst-plugin-cedar might provide easy access to it, however. Please update this wiki if you find out how to use the hardware encoder!&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h264 HLS ===&lt;br /&gt;
&lt;br /&gt;
HLS (HTTP Live Streaming) has the advantage that it is easy to play in any modern web browser, including Android and iPhone devices, and that it is easy to put an HTTP caching proxy in front of it to scale to many viewers. It has the disadvantages of adding (at minimum) several seconds of latency, and of requiring an h264 encoder (which we have in hardware, but haven't figured out how to use yet, so, we're stuck with the slow software one).&lt;br /&gt;
&lt;br /&gt;
HLS segments a video stream into small chunks which are stored as .ts (MPEG Transport Stream) files, and (re)writes a playlist.m3u8 file which clients constantly refresh to discover which .ts files they should download. We use a tmpfs file system to avoid needing to write these files to the sdcard in the PineCube. Besides the program which writes the .ts and .m3u8 files (gst-launch-1.0, in our case), we'll also need a very basic web page in tmpfs and a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create an hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js]. We recommend downloading the hls.js file and editing the example index.html to serve your local copy of it instead of fetching it from a CDN. This file provides HLS playback capabilities in browsers which don't natively support it (which is most browsers aside from the iPhone).&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternately, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
You can also view the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt; (or with mpv, ffplay, etc)&lt;br /&gt;
&lt;br /&gt;
To find out about other options you can configure in the &amp;lt;code&amp;gt;hlssink&amp;lt;/code&amp;gt; gstreamer element, you can run &amp;lt;code&amp;gt;gst-inspect-1.0 hlssink&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
It is worth noting here that the &amp;lt;code&amp;gt;hlssink&amp;lt;/code&amp;gt; element in GStreamer is not widely used in production environments. It is handy for testing, but for real-world free-software HLS live streaming deployments the standard tool today (January 2021) is nginx's RTMP module which can be used with ffmpeg to produce &amp;quot;adaptive streams&amp;quot; which are reencoded at varying quality levels. You can send data to an nginx-rtmp server from a gstreamer pipeline using the &amp;lt;code&amp;gt;rtmpsink&amp;lt;/code&amp;gt; element. It is also worth noting that gstreamer has a new &amp;lt;code&amp;gt;hlssink2&amp;lt;/code&amp;gt; element which we have not tested; perhaps in the future it will even have a webserver!&lt;br /&gt;
&lt;br /&gt;
=== v4l2rtspserver: h264 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Install dependencies and build required v4l2 software:&lt;br /&gt;
&lt;br /&gt;
 apt install -y gstreamer1.0-plugins-bad gstreamer1.0-tools \&lt;br /&gt;
 gstreamer1.0-plugins-good v4l-utils gstreamer1.0-alsa alsa-utils libpango1.0-0 \&lt;br /&gt;
 libpango1.0-dev gstreamer1.0-plugins-base gstreamer1.0-x x264 \&lt;br /&gt;
 gstreamer1.0-plugins-{good,bad,ugly} liblivemedia-dev liblog4cpp5-dev \&lt;br /&gt;
 libasound2-dev vlc libssl-dev iotop libasound2-dev  liblog4cpp5-dev \&lt;br /&gt;
 liblivemedia-dev autoconf automake libtool v4l2loopback-dkms liblog4cpp5-dev \&lt;br /&gt;
 libvpx-dev libx264-dev libjpeg-dev libx265-dev;&lt;br /&gt;
&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2tools &amp;amp;&amp;amp; cd v4l2tools &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2rtspserver &amp;amp;&amp;amp; cd v4l2rtspserver &amp;amp;&amp;amp; cmake -D LIVE555URL=https://download.videolan.org/pub/contrib/live555/live.2020.08.19.tar.gz . &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
&lt;br /&gt;
Running the camera:&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/640x480@1/30]';&lt;br /&gt;
 modprobe v4l2loopback video_nr=10 debug=2;&lt;br /&gt;
 v4l2compress -fH264  -w -vv /dev/video0 /dev/video10 &amp;amp;&lt;br /&gt;
 v4l2rtspserver -v -S -W 640 -H 480 -F 10 -b /usr/local/share/v4l2rtspserver/ /dev/video10&lt;br /&gt;
&lt;br /&gt;
The v4l2compress/v4l2rtspserver method of streaming the camera uses around ~45-50% of the CPU for compression of the stream into H264 (640x480@7fps) and around 1-2% of the CPU for serving the HLS stream. Total system RAM used is roughly 64MB and the load average is ~0.4-~0.5 when idle, and ~0.51-~0.60 with one HLS client streaming the camera.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTSP ===&lt;br /&gt;
&lt;br /&gt;
GStreamer's RTSP server isn't an element you can use with gst-launch, but rather a library. We failed to build its example program, so instead used this very small 3rd party tool which is based on it: https://github.com/sfalexrog/gst-rtsp-launch/&lt;br /&gt;
&lt;br /&gt;
After building gst-rtsp-launch (which is relatively simple on Ubuntu groovy; just &amp;lt;code&amp;gt;apt install libgstreamer1.0-dev libgstrtspserver-1.0-dev&amp;lt;/code&amp;gt; first), you can read JPEG data directly from the camera and stream it via RTSP: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1280x720]' &amp;amp;&amp;amp; gst-rtsp-launch 'v4l2src ! image/jpeg,width=1280,height=720 ! rtpjpegpay name=pay0'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This stream can be played using &amp;lt;code&amp;gt;vlc rtsp://pinecube.local:8554/video&amp;lt;/code&amp;gt; or mpv, ffmpeg, gst-play-1.0, etc. If you increase the resolution to 1920x1080, mpv and gst-play can still play it, but VLC will complain &amp;lt;code&amp;gt;The total received frame size exceeds the client's buffer size (2000000).  73602 bytes of trailing data will be dropped!&amp;lt;/code&amp;gt; if you don't tell it to increase its buffer size with &amp;lt;code&amp;gt;--rtsp-frame-buffer-size=300000&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h264 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Left as an exercise to the reader (please update the wiki). Hint: involves bits from the HLS and the JPEG RTSP examples above, but needs a &amp;lt;code&amp;gt;rtph264pay name=pay0&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP UDP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 pt=96 ! udpsink host=$client_ip port=8000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 udpsrc port=8000 !  application/x-rtp, encoding-name=JPEG,payload=26 !  rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP TCP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 pt=96 ! rtpstreampay ! tcpserversink host=0.0.0.0 port=1234&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 tcpclientsrc host=pinecube.local port=1234 ! application/x-rtp-stream,encoding-name=JPEG ! rtpstreamdepay ! application/x-rtp, media=video, encoding-name=JPEG ! rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== gstreamer and socat: MJPEG HTTP server ===&lt;br /&gt;
&lt;br /&gt;
This rather ridiculous method uses bash, socat, and gstreamer to implement an HTTP-ish server which will serve your video as an MJPEG stream which is playable in browsers.&lt;br /&gt;
&lt;br /&gt;
This approach has the advantage of being relatively low latency (under a second), browser-compatible, and not needing to reencode anything on the CPU (it gets JPEG data from the camera itself). It has the disadvantage of only supporting one viewer at a time. (Though, really, the RTSP examples on this page perform very poorly with multiple viewers, so...)&lt;br /&gt;
&lt;br /&gt;
Gstreamer can almost do this by itself, as it has a multipartmux element which produces the headers which precede each frame. But sadly, despite various forum posts lamenting the lack of one over the last 12+ years, as of the end of the 50th year of the UNIX era (aka 2020), somehow nobody has yet gotten a webserver element merged in to gstreamer (which is necessary to produce the HTTP response, which is required for browsers other than firefox to play it). So, here is an absolutely minimal &amp;quot;webserver&amp;quot; which will get MJPEG displaying in a (single) browser.&lt;br /&gt;
&lt;br /&gt;
Create a file called &amp;lt;code&amp;gt;mjpeg-response.sh&amp;lt;/code&amp;gt;:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&lt;br /&gt;
 b=&amp;quot;--duct_tape_boundary&amp;quot;&lt;br /&gt;
 echo -en &amp;quot;HTTP/1.1 200 OK\r\nContent-type: multipart/x-mixed-replace;boundary=$b\r\n\r\n&amp;quot;&lt;br /&gt;
 gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! multipartmux boundary=$b ! fdsink fd=2 2&amp;gt;&amp;amp;1 &amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
Make it executable: &amp;lt;code&amp;gt;chmod +x mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run the server: &amp;lt;code&amp;gt;socat TCP-LISTEN:8080,reuseaddr,fork EXEC:./mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And browse to http://pinecube.local:8080/ in your browser.&lt;br /&gt;
&lt;br /&gt;
== Debugging camera issues with the gstreamer pipeline ==&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8869</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8869"/>
		<updated>2021-01-03T02:10:19Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* gstreamer: h264 RTSP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   510 MBytes  71.2 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   509 MBytes  71.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.01  sec   642 MBytes  89.8 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   641 MBytes  89.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
== Streaming the camera to the network ==&lt;br /&gt;
&lt;br /&gt;
In this section we document a variety of ways to stream video to the network from the PineCube. Unless specified otherwise, all of these examples have been tested on Ubuntu groovy (20.10).&lt;br /&gt;
&lt;br /&gt;
In the examples which use h264, we are currently encoding using the x264 library which is not very fast on this CPU. The SoC in the PineCube does have a hardware h264 encoder, which the authors of these examples have so far not tried to use. It appears that https://github.com/gtalusan/gst-plugin-cedar might provide easy access to it, however. Please update this wiki if you find out how to use the hardware encoder!&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h264 HLS ===&lt;br /&gt;
&lt;br /&gt;
HLS (HTTP Live Streaming) has the advantage that it is easy to play in any modern web browser, including Android and iPhone devices, and that it is easy to put an HTTP caching proxy in front of it to scale to many viewers. It has the disadvantages of adding (at minimum) several seconds of latency, and of requiring an h264 encoder (which we have in hardware, but haven't figured out how to use yet, so, we're stuck with the slow software one).&lt;br /&gt;
&lt;br /&gt;
HLS segments a video stream into small chunks which are stored as .ts (MPEG Transport Stream) files, and (re)writes a playlist.m3u8 file which clients constantly refresh to discover which .ts files they should download. We use a tmpfs file system to avoid needing to write these files to the sdcard in the PineCube. Besides the program which writes the .ts and .m3u8 files (gst-launch-1.0, in our case), we'll also need a very basic web page in tmpfs and a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create an hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js]. We recommend downloading the hls.js file and editing the example index.html to serve your local copy of it instead of fetching it from a CDN. This file provides HLS playback capabilities in browsers which don't natively support it (which is most browsers aside from the iPhone).&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternately, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
You can also view the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt; (or with mpv, ffplay, etc)&lt;br /&gt;
&lt;br /&gt;
=== v4l2rtspserver: h264 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Install dependencies and build required v4l2 software:&lt;br /&gt;
&lt;br /&gt;
 apt install -y gstreamer1.0-plugins-bad gstreamer1.0-tools \&lt;br /&gt;
 gstreamer1.0-plugins-good v4l-utils gstreamer1.0-alsa alsa-utils libpango1.0-0 \&lt;br /&gt;
 libpango1.0-dev gstreamer1.0-plugins-base gstreamer1.0-x x264 \&lt;br /&gt;
 gstreamer1.0-plugins-{good,bad,ugly} liblivemedia-dev liblog4cpp5-dev \&lt;br /&gt;
 libasound2-dev vlc libssl-dev iotop libasound2-dev  liblog4cpp5-dev \&lt;br /&gt;
 liblivemedia-dev autoconf automake libtool v4l2loopback-dkms liblog4cpp5-dev \&lt;br /&gt;
 libvpx-dev libx264-dev libjpeg-dev libx265-dev;&lt;br /&gt;
&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2tools &amp;amp;&amp;amp; cd v4l2tools &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2rtspserver &amp;amp;&amp;amp; cd v4l2rtspserver &amp;amp;&amp;amp; cmake -D LIVE555URL=https://download.videolan.org/pub/contrib/live555/live.2020.08.19.tar.gz . &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
&lt;br /&gt;
Running the camera:&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/640x480@1/30]';&lt;br /&gt;
 modprobe v4l2loopback video_nr=10 debug=2;&lt;br /&gt;
 v4l2compress -fH264  -w -vv /dev/video0 /dev/video10 &amp;amp;&lt;br /&gt;
 v4l2rtspserver -v -S -W 640 -H 480 -F 10 -b /usr/local/share/v4l2rtspserver/ /dev/video10&lt;br /&gt;
&lt;br /&gt;
The v4l2compress/v4l2rtspserver method of streaming the camera uses around ~45-50% of the CPU for compression of the stream into H264 (640x480@7fps) and around 1-2% of the CPU for serving the HLS stream. Total system RAM used is roughly 64MB and the load average is ~0.4-~0.5 when idle, and ~0.51-~0.60 with one HLS client streaming the camera.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTSP ===&lt;br /&gt;
&lt;br /&gt;
GStreamer's RTSP server isn't an element you can use with gst-launch, but rather a library. We failed to build its example program, so instead used this very small 3rd party tool which is based on it: https://github.com/sfalexrog/gst-rtsp-launch/&lt;br /&gt;
&lt;br /&gt;
After building gst-rtsp-launch (which is relatively simple on Ubuntu groovy; just &amp;lt;code&amp;gt;apt install libgstreamer1.0-dev libgstrtspserver-1.0-dev&amp;lt;/code&amp;gt; first), you can read JPEG data directly from the camera and stream it via RTSP: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1280x720]' &amp;amp;&amp;amp; gst-rtsp-launch 'v4l2src ! image/jpeg,width=1280,height=720 ! rtpjpegpay name=pay0'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This stream can be played using &amp;lt;code&amp;gt;vlc rtsp://pinecube.local:8554/video&amp;lt;/code&amp;gt; or mpv, ffmpeg, gst-play-1.0, etc. If you increase the resolution to 1920x1080, mpv and gst-play can still play it, but VLC will complain &amp;lt;code&amp;gt;The total received frame size exceeds the client's buffer size (2000000).  73602 bytes of trailing data will be dropped!&amp;lt;/code&amp;gt; if you don't tell it to increase its buffer size with &amp;lt;code&amp;gt;--rtsp-frame-buffer-size=300000&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h264 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Left as an exercise to the reader (please update the wiki). Hint: involves bits from the HLS and the JPEG RTSP examples above, but needs a &amp;lt;code&amp;gt;rtph264pay name=pay0&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP UDP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 pt=96 ! udpsink host=$client_ip port=8000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 udpsrc port=8000 !  application/x-rtp, encoding-name=JPEG,payload=26 !  rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP TCP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 pt=96 ! rtpstreampay ! tcpserversink host=0.0.0.0 port=1234&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 tcpclientsrc host=pinecube.local port=1234 ! application/x-rtp-stream,encoding-name=JPEG ! rtpstreamdepay ! application/x-rtp, media=video, encoding-name=JPEG ! rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== gstreamer and socat: MJPEG HTTP server ===&lt;br /&gt;
&lt;br /&gt;
This rather ridiculous method uses bash, socat, and gstreamer to implement an HTTP-ish server which will serve your video as an MJPEG stream which is playable in browsers.&lt;br /&gt;
&lt;br /&gt;
This approach has the advantage of being relatively low latency (under a second), browser-compatible, and not needing to reencode anything on the CPU (it gets JPEG data from the camera itself). It has the disadvantage of only supporting one viewer at a time. (Though, really, the RTSP examples on this page perform very poorly with multiple viewers, so...)&lt;br /&gt;
&lt;br /&gt;
Gstreamer can almost do this by itself, as it has a multipartmux element which produces the headers which precede each frame. But sadly, despite various forum posts lamenting the lack of one over the last 12+ years, as of the end of the 50th year of the UNIX era (aka 2020), somehow nobody has yet gotten a webserver element merged in to gstreamer (which is necessary to produce the HTTP response, which is required for browsers other than firefox to play it). So, here is an absolutely minimal &amp;quot;webserver&amp;quot; which will get MJPEG displaying in a (single) browser.&lt;br /&gt;
&lt;br /&gt;
Create a file called &amp;lt;code&amp;gt;mjpeg-response.sh&amp;lt;/code&amp;gt;:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&lt;br /&gt;
 b=&amp;quot;--duct_tape_boundary&amp;quot;&lt;br /&gt;
 echo -en &amp;quot;HTTP/1.1 200 OK\r\nContent-type: multipart/x-mixed-replace;boundary=$b\r\n\r\n&amp;quot;&lt;br /&gt;
 gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! multipartmux boundary=$b ! fdsink fd=2 2&amp;gt;&amp;amp;1 &amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
Make it executable: &amp;lt;code&amp;gt;chmod +x mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run the server: &amp;lt;code&amp;gt;socat TCP-LISTEN:8080,reuseaddr,fork EXEC:./mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And browse to http://pinecube.local:8080/ in your browser.&lt;br /&gt;
&lt;br /&gt;
== Debugging camera issues with the gstreamer pipeline ==&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8868</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8868"/>
		<updated>2021-01-03T02:07:02Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* gstreamer: h264 HLS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   510 MBytes  71.2 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   509 MBytes  71.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.01  sec   642 MBytes  89.8 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   641 MBytes  89.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
== Streaming the camera to the network ==&lt;br /&gt;
&lt;br /&gt;
In this section we document a variety of ways to stream video to the network from the PineCube. Unless specified otherwise, all of these examples have been tested on Ubuntu groovy (20.10).&lt;br /&gt;
&lt;br /&gt;
In the examples which use h264, we are currently encoding using the x264 library which is not very fast on this CPU. The SoC in the PineCube does have a hardware h264 encoder, which the authors of these examples have so far not tried to use. It appears that https://github.com/gtalusan/gst-plugin-cedar might provide easy access to it, however. Please update this wiki if you find out how to use the hardware encoder!&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h264 HLS ===&lt;br /&gt;
&lt;br /&gt;
HLS (HTTP Live Streaming) has the advantage that it is easy to play in any modern web browser, including Android and iPhone devices, and that it is easy to put an HTTP caching proxy in front of it to scale to many viewers. It has the disadvantages of adding (at minimum) several seconds of latency, and of requiring an h264 encoder (which we have in hardware, but haven't figured out how to use yet, so, we're stuck with the slow software one).&lt;br /&gt;
&lt;br /&gt;
HLS segments a video stream into small chunks which are stored as .ts (MPEG Transport Stream) files, and (re)writes a playlist.m3u8 file which clients constantly refresh to discover which .ts files they should download. We use a tmpfs file system to avoid needing to write these files to the sdcard in the PineCube. Besides the program which writes the .ts and .m3u8 files (gst-launch-1.0, in our case), we'll also need a very basic web page in tmpfs and a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create an hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js]. We recommend downloading the hls.js file and editing the example index.html to serve your local copy of it instead of fetching it from a CDN. This file provides HLS playback capabilities in browsers which don't natively support it (which is most browsers aside from the iPhone).&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternately, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
You can also view the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt; (or with mpv, ffplay, etc)&lt;br /&gt;
&lt;br /&gt;
=== v4l2rtspserver: h264 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Install dependencies and build required v4l2 software:&lt;br /&gt;
&lt;br /&gt;
 apt install -y gstreamer1.0-plugins-bad gstreamer1.0-tools \&lt;br /&gt;
 gstreamer1.0-plugins-good v4l-utils gstreamer1.0-alsa alsa-utils libpango1.0-0 \&lt;br /&gt;
 libpango1.0-dev gstreamer1.0-plugins-base gstreamer1.0-x x264 \&lt;br /&gt;
 gstreamer1.0-plugins-{good,bad,ugly} liblivemedia-dev liblog4cpp5-dev \&lt;br /&gt;
 libasound2-dev vlc libssl-dev iotop libasound2-dev  liblog4cpp5-dev \&lt;br /&gt;
 liblivemedia-dev autoconf automake libtool v4l2loopback-dkms liblog4cpp5-dev \&lt;br /&gt;
 libvpx-dev libx264-dev libjpeg-dev libx265-dev;&lt;br /&gt;
&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2tools &amp;amp;&amp;amp; cd v4l2tools &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2rtspserver &amp;amp;&amp;amp; cd v4l2rtspserver &amp;amp;&amp;amp; cmake -D LIVE555URL=https://download.videolan.org/pub/contrib/live555/live.2020.08.19.tar.gz . &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
&lt;br /&gt;
Running the camera:&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/640x480@1/30]';&lt;br /&gt;
 modprobe v4l2loopback video_nr=10 debug=2;&lt;br /&gt;
 v4l2compress -fH264  -w -vv /dev/video0 /dev/video10 &amp;amp;&lt;br /&gt;
 v4l2rtspserver -v -S -W 640 -H 480 -F 10 -b /usr/local/share/v4l2rtspserver/ /dev/video10&lt;br /&gt;
&lt;br /&gt;
The v4l2compress/v4l2rtspserver method of streaming the camera uses around ~45-50% of the CPU for compression of the stream into H264 (640x480@7fps) and around 1-2% of the CPU for serving the HLS stream. Total system RAM used is roughly 64MB and the load average is ~0.4-~0.5 when idle, and ~0.51-~0.60 with one HLS client streaming the camera.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTSP ===&lt;br /&gt;
&lt;br /&gt;
GStreamer's RTSP server isn't an element you can use with gst-launch, but rather a library. We failed to build its example program, so instead used this very small 3rd party tool which is based on it: https://github.com/sfalexrog/gst-rtsp-launch/&lt;br /&gt;
&lt;br /&gt;
After building gst-rtsp-launch (which is relatively simple on Ubuntu groovy; just &amp;lt;code&amp;gt;apt install libgstreamer1.0-dev libgstrtspserver-1.0-dev&amp;lt;/code&amp;gt; first), you can read JPEG data directly from the camera and stream it via RTSP: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1280x720]' &amp;amp;&amp;amp; gst-rtsp-launch 'v4l2src ! image/jpeg,width=1280,height=720 ! rtpjpegpay name=pay0'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This stream can be played using &amp;lt;code&amp;gt;vlc rtsp://pinecube.local:8554/video&amp;lt;/code&amp;gt; or mpv, ffmpeg, gst-play-1.0, etc. If you increase the resolution to 1920x1080, mpv and gst-play can still play it, but VLC will complain &amp;lt;code&amp;gt;The total received frame size exceeds the client's buffer size (2000000).  73602 bytes of trailing data will be dropped!&amp;lt;/code&amp;gt; if you don't tell it to increase its buffer size with &amp;lt;code&amp;gt;--rtsp-frame-buffer-size=300000&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h24 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Left as an exercise to the reader (please update the wiki). Hint: involves bits from the HLS and the JPEG RTSP examples above, but needs a &amp;lt;code&amp;gt;rtph264pay name=pay0&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP UDP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 pt=96 ! udpsink host=$client_ip port=8000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 udpsrc port=8000 !  application/x-rtp, encoding-name=JPEG,payload=26 !  rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP TCP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 pt=96 ! rtpstreampay ! tcpserversink host=0.0.0.0 port=1234&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 tcpclientsrc host=pinecube.local port=1234 ! application/x-rtp-stream,encoding-name=JPEG ! rtpstreamdepay ! application/x-rtp, media=video, encoding-name=JPEG ! rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== gstreamer and socat: MJPEG HTTP server ===&lt;br /&gt;
&lt;br /&gt;
This rather ridiculous method uses bash, socat, and gstreamer to implement an HTTP-ish server which will serve your video as an MJPEG stream which is playable in browsers.&lt;br /&gt;
&lt;br /&gt;
This approach has the advantage of being relatively low latency (under a second), browser-compatible, and not needing to reencode anything on the CPU (it gets JPEG data from the camera itself). It has the disadvantage of only supporting one viewer at a time. (Though, really, the RTSP examples on this page perform very poorly with multiple viewers, so...)&lt;br /&gt;
&lt;br /&gt;
Gstreamer can almost do this by itself, as it has a multipartmux element which produces the headers which precede each frame. But sadly, despite various forum posts lamenting the lack of one over the last 12+ years, as of the end of the 50th year of the UNIX era (aka 2020), somehow nobody has yet gotten a webserver element merged in to gstreamer (which is necessary to produce the HTTP response, which is required for browsers other than firefox to play it). So, here is an absolutely minimal &amp;quot;webserver&amp;quot; which will get MJPEG displaying in a (single) browser.&lt;br /&gt;
&lt;br /&gt;
Create a file called &amp;lt;code&amp;gt;mjpeg-response.sh&amp;lt;/code&amp;gt;:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&lt;br /&gt;
 b=&amp;quot;--duct_tape_boundary&amp;quot;&lt;br /&gt;
 echo -en &amp;quot;HTTP/1.1 200 OK\r\nContent-type: multipart/x-mixed-replace;boundary=$b\r\n\r\n&amp;quot;&lt;br /&gt;
 gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! multipartmux boundary=$b ! fdsink fd=2 2&amp;gt;&amp;amp;1 &amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
Make it executable: &amp;lt;code&amp;gt;chmod +x mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run the server: &amp;lt;code&amp;gt;socat TCP-LISTEN:8080,reuseaddr,fork EXEC:./mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And browse to http://pinecube.local:8080/ in your browser.&lt;br /&gt;
&lt;br /&gt;
== Debugging camera issues with the gstreamer pipeline ==&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8867</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8867"/>
		<updated>2021-01-03T02:05:03Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* gstreamer and socat: MJPEG HTTP server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   510 MBytes  71.2 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   509 MBytes  71.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.01  sec   642 MBytes  89.8 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   641 MBytes  89.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
== Streaming the camera to the network ==&lt;br /&gt;
&lt;br /&gt;
In this section we document a variety of ways to stream video to the network from the PineCube. Unless specified otherwise, all of these examples have been tested on Ubuntu groovy (20.10).&lt;br /&gt;
&lt;br /&gt;
In the examples which use h264, we are currently encoding using the x264 library which is not very fast on this CPU. The SoC in the PineCube does have a hardware h264 encoder, which the authors of these examples have so far not tried to use. It appears that https://github.com/gtalusan/gst-plugin-cedar might provide easy access to it, however. Please update this wiki if you find out how to use the hardware encoder!&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h264 HLS ===&lt;br /&gt;
&lt;br /&gt;
HLS (HTTP Live Streaming) has the advantage that it is easy to play in any modern web browser, including Android and iPhone devices, and that it is easy to put an HTTP caching proxy in front of it to scale to many viewers. It has the disadvantages of adding (at minimum) several seconds of latency, and of requiring an h264 decoder (which we have in hardware, but haven't figured out how to use yet, so, we're stuck with the slow software one).&lt;br /&gt;
&lt;br /&gt;
HLS segments a video stream into small chunks which are stored as .ts (MPEG Transport Stream) files, and (re)writes a playlist.m3u8 file which clients constantly refresh to discover which .ts files they should download. We use a tmpfs file system to avoid needing to write these files to the sdcard in the PineCube. Besides the program which writes the .ts and .m3u8 files (gst-launch-1.0, in our case), we'll also need a very basic web page in tmpfs and a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create an hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js]. We recommend downloading the hls.js file and editing the example index.html to serve your local copy of it instead of fetching it from a CDN. This file provides HLS playback capabilities in browsers which don't natively support it (which is most browsers aside from the iPhone).&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternately, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
You can also view the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt; (or with mpv, ffplay, etc)&lt;br /&gt;
&lt;br /&gt;
=== v4l2rtspserver: h264 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Install dependencies and build required v4l2 software:&lt;br /&gt;
&lt;br /&gt;
 apt install -y gstreamer1.0-plugins-bad gstreamer1.0-tools \&lt;br /&gt;
 gstreamer1.0-plugins-good v4l-utils gstreamer1.0-alsa alsa-utils libpango1.0-0 \&lt;br /&gt;
 libpango1.0-dev gstreamer1.0-plugins-base gstreamer1.0-x x264 \&lt;br /&gt;
 gstreamer1.0-plugins-{good,bad,ugly} liblivemedia-dev liblog4cpp5-dev \&lt;br /&gt;
 libasound2-dev vlc libssl-dev iotop libasound2-dev  liblog4cpp5-dev \&lt;br /&gt;
 liblivemedia-dev autoconf automake libtool v4l2loopback-dkms liblog4cpp5-dev \&lt;br /&gt;
 libvpx-dev libx264-dev libjpeg-dev libx265-dev;&lt;br /&gt;
&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2tools &amp;amp;&amp;amp; cd v4l2tools &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2rtspserver &amp;amp;&amp;amp; cd v4l2rtspserver &amp;amp;&amp;amp; cmake -D LIVE555URL=https://download.videolan.org/pub/contrib/live555/live.2020.08.19.tar.gz . &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
&lt;br /&gt;
Running the camera:&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/640x480@1/30]';&lt;br /&gt;
 modprobe v4l2loopback video_nr=10 debug=2;&lt;br /&gt;
 v4l2compress -fH264  -w -vv /dev/video0 /dev/video10 &amp;amp;&lt;br /&gt;
 v4l2rtspserver -v -S -W 640 -H 480 -F 10 -b /usr/local/share/v4l2rtspserver/ /dev/video10&lt;br /&gt;
&lt;br /&gt;
The v4l2compress/v4l2rtspserver method of streaming the camera uses around ~45-50% of the CPU for compression of the stream into H264 (640x480@7fps) and around 1-2% of the CPU for serving the HLS stream. Total system RAM used is roughly 64MB and the load average is ~0.4-~0.5 when idle, and ~0.51-~0.60 with one HLS client streaming the camera.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTSP ===&lt;br /&gt;
&lt;br /&gt;
GStreamer's RTSP server isn't an element you can use with gst-launch, but rather a library. We failed to build its example program, so instead used this very small 3rd party tool which is based on it: https://github.com/sfalexrog/gst-rtsp-launch/&lt;br /&gt;
&lt;br /&gt;
After building gst-rtsp-launch (which is relatively simple on Ubuntu groovy; just &amp;lt;code&amp;gt;apt install libgstreamer1.0-dev libgstrtspserver-1.0-dev&amp;lt;/code&amp;gt; first), you can read JPEG data directly from the camera and stream it via RTSP: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1280x720]' &amp;amp;&amp;amp; gst-rtsp-launch 'v4l2src ! image/jpeg,width=1280,height=720 ! rtpjpegpay name=pay0'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This stream can be played using &amp;lt;code&amp;gt;vlc rtsp://pinecube.local:8554/video&amp;lt;/code&amp;gt; or mpv, ffmpeg, gst-play-1.0, etc. If you increase the resolution to 1920x1080, mpv and gst-play can still play it, but VLC will complain &amp;lt;code&amp;gt;The total received frame size exceeds the client's buffer size (2000000).  73602 bytes of trailing data will be dropped!&amp;lt;/code&amp;gt; if you don't tell it to increase its buffer size with &amp;lt;code&amp;gt;--rtsp-frame-buffer-size=300000&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h24 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Left as an exercise to the reader (please update the wiki). Hint: involves bits from the HLS and the JPEG RTSP examples above, but needs a &amp;lt;code&amp;gt;rtph264pay name=pay0&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP UDP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 pt=96 ! udpsink host=$client_ip port=8000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 udpsrc port=8000 !  application/x-rtp, encoding-name=JPEG,payload=26 !  rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP TCP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 pt=96 ! rtpstreampay ! tcpserversink host=0.0.0.0 port=1234&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 tcpclientsrc host=pinecube.local port=1234 ! application/x-rtp-stream,encoding-name=JPEG ! rtpstreamdepay ! application/x-rtp, media=video, encoding-name=JPEG ! rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== gstreamer and socat: MJPEG HTTP server ===&lt;br /&gt;
&lt;br /&gt;
This rather ridiculous method uses bash, socat, and gstreamer to implement an HTTP-ish server which will serve your video as an MJPEG stream which is playable in browsers.&lt;br /&gt;
&lt;br /&gt;
This approach has the advantage of being relatively low latency (under a second), browser-compatible, and not needing to reencode anything on the CPU (it gets JPEG data from the camera itself). It has the disadvantage of only supporting one viewer at a time. (Though, really, the RTSP examples on this page perform very poorly with multiple viewers, so...)&lt;br /&gt;
&lt;br /&gt;
Gstreamer can almost do this by itself, as it has a multipartmux element which produces the headers which precede each frame. But sadly, despite various forum posts lamenting the lack of one over the last 12+ years, as of the end of the 50th year of the UNIX era (aka 2020), somehow nobody has yet gotten a webserver element merged in to gstreamer (which is necessary to produce the HTTP response, which is required for browsers other than firefox to play it). So, here is an absolutely minimal &amp;quot;webserver&amp;quot; which will get MJPEG displaying in a (single) browser.&lt;br /&gt;
&lt;br /&gt;
Create a file called &amp;lt;code&amp;gt;mjpeg-response.sh&amp;lt;/code&amp;gt;:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&lt;br /&gt;
 b=&amp;quot;--duct_tape_boundary&amp;quot;&lt;br /&gt;
 echo -en &amp;quot;HTTP/1.1 200 OK\r\nContent-type: multipart/x-mixed-replace;boundary=$b\r\n\r\n&amp;quot;&lt;br /&gt;
 gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! multipartmux boundary=$b ! fdsink fd=2 2&amp;gt;&amp;amp;1 &amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
Make it executable: &amp;lt;code&amp;gt;chmod +x mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run the server: &amp;lt;code&amp;gt;socat TCP-LISTEN:8080,reuseaddr,fork EXEC:./mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And browse to http://pinecube.local:8080/ in your browser.&lt;br /&gt;
&lt;br /&gt;
== Debugging camera issues with the gstreamer pipeline ==&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8866</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8866"/>
		<updated>2021-01-03T01:59:27Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: ways of seeing video on the network&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   510 MBytes  71.2 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   509 MBytes  71.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.01  sec   642 MBytes  89.8 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   641 MBytes  89.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
== Streaming the camera to the network ==&lt;br /&gt;
&lt;br /&gt;
In this section we document a variety of ways to stream video to the network from the PineCube. Unless specified otherwise, all of these examples have been tested on Ubuntu groovy (20.10).&lt;br /&gt;
&lt;br /&gt;
In the examples which use h264, we are currently encoding using the x264 library which is not very fast on this CPU. The SoC in the PineCube does have a hardware h264 encoder, which the authors of these examples have so far not tried to use. It appears that https://github.com/gtalusan/gst-plugin-cedar might provide easy access to it, however. Please update this wiki if you find out how to use the hardware encoder!&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h264 HLS ===&lt;br /&gt;
&lt;br /&gt;
HLS (HTTP Live Streaming) has the advantage that it is easy to play in any modern web browser, including Android and iPhone devices, and that it is easy to put an HTTP caching proxy in front of it to scale to many viewers. It has the disadvantages of adding (at minimum) several seconds of latency, and of requiring an h264 decoder (which we have in hardware, but haven't figured out how to use yet, so, we're stuck with the slow software one).&lt;br /&gt;
&lt;br /&gt;
HLS segments a video stream into small chunks which are stored as .ts (MPEG Transport Stream) files, and (re)writes a playlist.m3u8 file which clients constantly refresh to discover which .ts files they should download. We use a tmpfs file system to avoid needing to write these files to the sdcard in the PineCube. Besides the program which writes the .ts and .m3u8 files (gst-launch-1.0, in our case), we'll also need a very basic web page in tmpfs and a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create an hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js]. We recommend downloading the hls.js file and editing the example index.html to serve your local copy of it instead of fetching it from a CDN. This file provides HLS playback capabilities in browsers which don't natively support it (which is most browsers aside from the iPhone).&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternately, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
You can also view the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt; (or with mpv, ffplay, etc)&lt;br /&gt;
&lt;br /&gt;
=== v4l2rtspserver: h264 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Install dependencies and build required v4l2 software:&lt;br /&gt;
&lt;br /&gt;
 apt install -y gstreamer1.0-plugins-bad gstreamer1.0-tools \&lt;br /&gt;
 gstreamer1.0-plugins-good v4l-utils gstreamer1.0-alsa alsa-utils libpango1.0-0 \&lt;br /&gt;
 libpango1.0-dev gstreamer1.0-plugins-base gstreamer1.0-x x264 \&lt;br /&gt;
 gstreamer1.0-plugins-{good,bad,ugly} liblivemedia-dev liblog4cpp5-dev \&lt;br /&gt;
 libasound2-dev vlc libssl-dev iotop libasound2-dev  liblog4cpp5-dev \&lt;br /&gt;
 liblivemedia-dev autoconf automake libtool v4l2loopback-dkms liblog4cpp5-dev \&lt;br /&gt;
 libvpx-dev libx264-dev libjpeg-dev libx265-dev;&lt;br /&gt;
&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2tools &amp;amp;&amp;amp; cd v4l2tools &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2rtspserver &amp;amp;&amp;amp; cd v4l2rtspserver &amp;amp;&amp;amp; cmake -D LIVE555URL=https://download.videolan.org/pub/contrib/live555/live.2020.08.19.tar.gz . &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
&lt;br /&gt;
Running the camera:&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/640x480@1/30]';&lt;br /&gt;
 modprobe v4l2loopback video_nr=10 debug=2;&lt;br /&gt;
 v4l2compress -fH264  -w -vv /dev/video0 /dev/video10 &amp;amp;&lt;br /&gt;
 v4l2rtspserver -v -S -W 640 -H 480 -F 10 -b /usr/local/share/v4l2rtspserver/ /dev/video10&lt;br /&gt;
&lt;br /&gt;
The v4l2compress/v4l2rtspserver method of streaming the camera uses around ~45-50% of the CPU for compression of the stream into H264 (640x480@7fps) and around 1-2% of the CPU for serving the HLS stream. Total system RAM used is roughly 64MB and the load average is ~0.4-~0.5 when idle, and ~0.51-~0.60 with one HLS client streaming the camera.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTSP ===&lt;br /&gt;
&lt;br /&gt;
GStreamer's RTSP server isn't an element you can use with gst-launch, but rather a library. We failed to build its example program, so instead used this very small 3rd party tool which is based on it: https://github.com/sfalexrog/gst-rtsp-launch/&lt;br /&gt;
&lt;br /&gt;
After building gst-rtsp-launch (which is relatively simple on Ubuntu groovy; just &amp;lt;code&amp;gt;apt install libgstreamer1.0-dev libgstrtspserver-1.0-dev&amp;lt;/code&amp;gt; first), you can read JPEG data directly from the camera and stream it via RTSP: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1280x720]' &amp;amp;&amp;amp; gst-rtsp-launch 'v4l2src ! image/jpeg,width=1280,height=720 ! rtpjpegpay name=pay0'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This stream can be played using &amp;lt;code&amp;gt;vlc rtsp://pinecube.local:8554/video&amp;lt;/code&amp;gt; or mpv, ffmpeg, gst-play-1.0, etc. If you increase the resolution to 1920x1080, mpv and gst-play can still play it, but VLC will complain &amp;lt;code&amp;gt;The total received frame size exceeds the client's buffer size (2000000).  73602 bytes of trailing data will be dropped!&amp;lt;/code&amp;gt; if you don't tell it to increase its buffer size with &amp;lt;code&amp;gt;--rtsp-frame-buffer-size=300000&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: h24 RTSP ===&lt;br /&gt;
&lt;br /&gt;
Left as an exercise to the reader (please update the wiki). Hint: involves bits from the HLS and the JPEG RTSP examples above, but needs a &amp;lt;code&amp;gt;rtph264pay name=pay0&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP UDP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 pt=96 ! udpsink host=$client_ip port=8000&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 udpsrc port=8000 !  application/x-rtp, encoding-name=JPEG,payload=26 !  rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== gstreamer: JPEG RTP TCP ===&lt;br /&gt;
&lt;br /&gt;
Configure camera: &amp;lt;code&amp;gt;media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Transmit with: &amp;lt;code&amp;gt;gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! rtpjpegpay name=pay0 pt=96 ! rtpstreampay ! tcpserversink host=0.0.0.0 port=1234&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Receive with: &amp;lt;code&amp;gt;gst-launch-1.0 tcpclientsrc host=pinecube.local port=1234 ! application/x-rtp-stream,encoding-name=JPEG ! rtpstreamdepay ! application/x-rtp, media=video, encoding-name=JPEG ! rtpjpegdepay !  jpegdec !  autovideosink&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== gstreamer and socat: MJPEG HTTP server ===&lt;br /&gt;
&lt;br /&gt;
This rather ridiculous method produces a small HTTP-ish server with socat and bash which will serve your video as an MJPEG stream which is playable in browsers. This means it is a multipart HTTP request which keeps on returning more parts, which with another JPEG in it.&lt;br /&gt;
&lt;br /&gt;
This approach has the advantage of being relatively low latency (under a second), browser-compatible, and not needing to reencode anything on the CPU (it gets JPEG data from the camera itself). It has the disadvantage of only supporting one viewer at a time. (Though, really, the RTSP examples on this page perform very poorly with multiple viewers, so...)&lt;br /&gt;
&lt;br /&gt;
Gstreamer can almost do this by itself; it has a multipartmux element which produces the headers which precede each frame. But, despite various forum posts lamenting the lack of one over the last 12+ years, somehow nobody has yet gotten the webserver part merged in gstreamer (which is necessary to produce the HTTP response, which is required for browsers other than firefox to play it). So, here is an absolutely minimal &amp;quot;webserver&amp;quot; which will get MJPEG displaying in a (single) browser.&lt;br /&gt;
&lt;br /&gt;
Create a file called &amp;lt;code&amp;gt;mjpeg-response.sh&amp;lt;/code&amp;gt;:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:JPEG_1X8/1920x1080]'&lt;br /&gt;
 b=&amp;quot;--duct_tape_boundary&amp;quot;&lt;br /&gt;
 echo -en &amp;quot;HTTP/1.1 200 OK\r\nContent-type: multipart/x-mixed-replace;boundary=$b\r\n\r\n&amp;quot;&lt;br /&gt;
 gst-launch-1.0 v4l2src ! image/jpeg,width=1920,height=1080 ! multipartmux boundary=$b ! fdsink fd=2 2&amp;gt;&amp;amp;1 &amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
Make it executable: &amp;lt;code&amp;gt;chmod +x mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run the server: &amp;lt;code&amp;gt;socat TCP-LISTEN:8080,reuseaddr,fork EXEC:./mjpeg-response.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And browse to http://pinecube.local:8080/ in your browser.&lt;br /&gt;
&lt;br /&gt;
== Debugging camera issues with the gstreamer pipeline ==&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8859</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8859"/>
		<updated>2021-01-01T17:04:02Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* A simple RTSP server with HLS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   510 MBytes  71.2 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   509 MBytes  71.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.01  sec   642 MBytes  89.8 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   641 MBytes  89.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
==== Streaming the camera to the network ====&lt;br /&gt;
&lt;br /&gt;
To stream to web browsers with HLS and x264 encoding, we'll use a tmpfs file system to not write any data to the sdcard in the PineCube. We'll also need a very basic web page in tmpfs, a program to write HLS data to the tmpfs, and finally a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create the hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
View the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
View the HLS stream with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Debugging camera issues with the gstreamer pipeline =====&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== A simple RTSP server with HLS =====&lt;br /&gt;
Install dependencies and build required v4l2 software:&lt;br /&gt;
&lt;br /&gt;
 apt install -y gstreamer1.0-plugins-bad gstreamer1.0-tools \&lt;br /&gt;
 gstreamer1.0-plugins-good v4l-utils gstreamer1.0-alsa alsa-utils libpango1.0-0 \&lt;br /&gt;
 libpango1.0-dev gstreamer1.0-plugins-base gstreamer1.0-x x264 \&lt;br /&gt;
 gstreamer1.0-plugins-{good,bad,ugly} liblivemedia-dev liblog4cpp5-dev \&lt;br /&gt;
 libasound2-dev vlc libssl-dev iotop libasound2-dev  liblog4cpp5-dev \&lt;br /&gt;
 liblivemedia-dev autoconf automake libtool v4l2loopback-dkms liblog4cpp5-dev \&lt;br /&gt;
 libvpx-dev libx264-dev libjpeg-dev libx265-dev;&lt;br /&gt;
&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2tools &amp;amp;&amp;amp; cd v4l2tools &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2rtspserver &amp;amp;&amp;amp; cd v4l2rtspserver &amp;amp;&amp;amp; cmake -D LIVE555URL=https://download.videolan.org/pub/contrib/live555/live.2020.08.19.tar.gz . &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
&lt;br /&gt;
Running the camera:&lt;br /&gt;
 media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/640x480@1/30]';&lt;br /&gt;
 modprobe v4l2loopback video_nr=10 debug=2;&lt;br /&gt;
 v4l2compress -fH264  -w -vv /dev/video0 /dev/video10 &amp;amp;&lt;br /&gt;
 v4l2rtspserver -v -S -W 640 -H 480 -F 10 -b /usr/local/share/v4l2rtspserver/ /dev/video10&lt;br /&gt;
&lt;br /&gt;
The v4l2compress/v4l2rtspserver method of streaming the camera uses around ~45-50% of the CPU for compression of the stream into H264 (640x480@7fps) and around 1-2% of the CPU for serving the HLS stream. Total system RAM used is roughly 64MB and the load average is ~0.4-~0.5 when idle, and ~0.51-~0.60 with one HLS client streaming the camera.&lt;br /&gt;
&lt;br /&gt;
=== Stock Linux ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8858</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8858"/>
		<updated>2021-01-01T17:02:10Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* A simple RTSP server with HLS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   510 MBytes  71.2 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   509 MBytes  71.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.01  sec   642 MBytes  89.8 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   641 MBytes  89.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
==== Streaming the camera to the network ====&lt;br /&gt;
&lt;br /&gt;
To stream to web browsers with HLS and x264 encoding, we'll use a tmpfs file system to not write any data to the sdcard in the PineCube. We'll also need a very basic web page in tmpfs, a program to write HLS data to the tmpfs, and finally a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create the hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
View the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
View the HLS stream with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Debugging camera issues with the gstreamer pipeline =====&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== A simple RTSP server with HLS =====&lt;br /&gt;
Install dependencies and build required v4l2 software:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
apt install -y gstreamer1.0-plugins-bad gstreamer1.0-tools \&lt;br /&gt;
gstreamer1.0-plugins-good v4l-utils gstreamer1.0-alsa alsa-utils libpango1.0-0 \&lt;br /&gt;
libpango1.0-dev gstreamer1.0-plugins-base gstreamer1.0-x x264 \&lt;br /&gt;
gstreamer1.0-plugins-{good,bad,ugly} liblivemedia-dev liblog4cpp5-dev \&lt;br /&gt;
libasound2-dev vlc libssl-dev iotop libasound2-dev  liblog4cpp5-dev \&lt;br /&gt;
liblivemedia-dev autoconf automake libtool v4l2loopback-dkms liblog4cpp5-dev \&lt;br /&gt;
libvpx-dev libx264-dev libjpeg-dev libx265-dev;&lt;br /&gt;
git clone --recursive https://github.com/mpromonet/v4l2tools &amp;amp;&amp;amp; cd v4l2tools &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
git clone --recursive https://github.com/mpromonet/v4l2rtspserver &amp;amp;&amp;amp; cd v4l2rtspserver &amp;amp;&amp;amp; cmake -D LIVE555URL=https://download.videolan.org/pub/contrib/live555/live.2020.08.19.tar.gz . &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running the camera:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/640x480@1/30]';&lt;br /&gt;
modprobe v4l2loopback video_nr=10 debug=2;&lt;br /&gt;
v4l2compress -fH264  -w -vv /dev/video0 /dev/video10 &amp;amp;&lt;br /&gt;
v4l2rtspserver -v -S -W 640 -H 480 -F 10 -b /usr/local/share/v4l2rtspserver/ /dev/video10&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The v4l2compress/v4l2rtspserver method of streaming the camera uses around ~45-50% of the CPU for compression of the stream into H264 (640x480@7fps) and around 1-2% of the CPU for serving the HLS stream. Total system RAM used is roughly 64MB and the load average is ~0.4-~0.5 when idle, and ~0.51-~0.60 with one HLS client streaming the camera.&lt;br /&gt;
&lt;br /&gt;
=== Stock Linux ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8857</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8857"/>
		<updated>2021-01-01T17:01:21Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* A simple RTSP server with HLS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   510 MBytes  71.2 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   509 MBytes  71.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.01  sec   642 MBytes  89.8 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   641 MBytes  89.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
==== Streaming the camera to the network ====&lt;br /&gt;
&lt;br /&gt;
To stream to web browsers with HLS and x264 encoding, we'll use a tmpfs file system to not write any data to the sdcard in the PineCube. We'll also need a very basic web page in tmpfs, a program to write HLS data to the tmpfs, and finally a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create the hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
View the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
View the HLS stream with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Debugging camera issues with the gstreamer pipeline =====&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== A simple RTSP server with HLS =====&lt;br /&gt;
Install dependencies and build required v4l2 software:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 apt install -y gstreamer1.0-plugins-bad gstreamer1.0-tools \&lt;br /&gt;
  gstreamer1.0-plugins-good v4l-utils gstreamer1.0-alsa alsa-utils libpango1.0-0 \&lt;br /&gt;
  libpango1.0-dev gstreamer1.0-plugins-base gstreamer1.0-x x264 \&lt;br /&gt;
  gstreamer1.0-plugins-{good,bad,ugly} liblivemedia-dev liblog4cpp5-dev \&lt;br /&gt;
  libasound2-dev vlc libssl-dev iotop libasound2-dev  liblog4cpp5-dev \&lt;br /&gt;
  liblivemedia-dev autoconf automake libtool v4l2loopback-dkms liblog4cpp5-dev \&lt;br /&gt;
  libvpx-dev libx264-dev libjpeg-dev libx265-dev;&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2tools &amp;amp;&amp;amp; cd v4l2tools &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
 git clone --recursive https://github.com/mpromonet/v4l2rtspserver &amp;amp;&amp;amp; cd v4l2rtspserver &amp;amp;&amp;amp; cmake -D LIVE555URL=https://download.videolan.org/pub/contrib/live555/live.2020.08.19.tar.gz . &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running the camera:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/640x480@1/30]';&lt;br /&gt;
modprobe v4l2loopback video_nr=10 debug=2;&lt;br /&gt;
v4l2compress -fH264  -w -vv /dev/video0 /dev/video10 &amp;amp;&lt;br /&gt;
v4l2rtspserver -v -S -W 640 -H 480 -F 10 -b /usr/local/share/v4l2rtspserver/ /dev/video10&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The v4l2compress/v4l2rtspserver method of streaming the camera uses around ~45-50% of the CPU for compression of the stream into H264 (640x480@7fps) and around 1-2% of the CPU for serving the HLS stream. Total system RAM used is roughly 64MB and the load average is ~0.4-~0.5 when idle, and ~0.51-~0.60 with one HLS client streaming the camera.&lt;br /&gt;
&lt;br /&gt;
=== Stock Linux ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8856</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8856"/>
		<updated>2021-01-01T17:00:24Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* A simple RTSP server with HLS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   510 MBytes  71.2 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   509 MBytes  71.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.01  sec   642 MBytes  89.8 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   641 MBytes  89.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
==== Streaming the camera to the network ====&lt;br /&gt;
&lt;br /&gt;
To stream to web browsers with HLS and x264 encoding, we'll use a tmpfs file system to not write any data to the sdcard in the PineCube. We'll also need a very basic web page in tmpfs, a program to write HLS data to the tmpfs, and finally a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create the hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
View the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
View the HLS stream with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Debugging camera issues with the gstreamer pipeline =====&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== A simple RTSP server with HLS =====&lt;br /&gt;
Install dependencies and build required v4l2 software:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
 apt install -y gstreamer1.0-plugins-bad gstreamer1.0-tools \&lt;br /&gt;
  gstreamer1.0-plugins-good v4l-utils gstreamer1.0-alsa alsa-utils libpango1.0-0 \&lt;br /&gt;
  libpango1.0-dev gstreamer1.0-plugins-base gstreamer1.0-x x264 \&lt;br /&gt;
  gstreamer1.0-plugins-{good,bad,ugly} liblivemedia-dev liblog4cpp5-dev \&lt;br /&gt;
  libasound2-dev vlc libssl-dev iotop libasound2-dev  liblog4cpp5-dev \&lt;br /&gt;
  liblivemedia-dev autoconf automake libtool v4l2loopback-dkms liblog4cpp5-dev \&lt;br /&gt;
  libvpx-dev libx264-dev libjpeg-dev libx265-dev&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
git clone --recursive https://github.com/mpromonet/v4l2tools &amp;amp;&amp;amp; cd v4l2tools &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install&lt;br /&gt;
git clone --recursive https://github.com/mpromonet/v4l2rtspserver &amp;amp;&amp;amp; cd v4l2rtspserver &amp;amp;&amp;amp; cmake -D LIVE555URL=https://download.videolan.org/pub/contrib/live555/live.2020.08.19.tar.gz . &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running the camera:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/640x480@1/30]'&lt;br /&gt;
modprobe v4l2loopback video_nr=10 debug=2&lt;br /&gt;
v4l2compress -fH264  -w -vv /dev/video0 /dev/video10&lt;br /&gt;
v4l2rtspserver -v -S -W 640 -H 480 -F 10 -b /usr/local/share/v4l2rtspserver/ /dev/video10&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The v4l2compress/v4l2rtspserver method of streaming the camera uses around ~45-50% of the CPU for compression of the stream into H264 (640x480@7fps) and around 1-2% of the CPU for serving the HLS stream. Total system RAM used is roughly 64MB and the load average is ~0.4-~0.5 when idle, and ~0.51-~0.60 with one HLS client streaming the camera.&lt;br /&gt;
&lt;br /&gt;
=== Stock Linux ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8855</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8855"/>
		<updated>2021-01-01T17:00:00Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* Streaming the camera to the network */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   510 MBytes  71.2 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   509 MBytes  71.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.01  sec   642 MBytes  89.8 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   641 MBytes  89.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
==== Streaming the camera to the network ====&lt;br /&gt;
&lt;br /&gt;
To stream to web browsers with HLS and x264 encoding, we'll use a tmpfs file system to not write any data to the sdcard in the PineCube. We'll also need a very basic web page in tmpfs, a program to write HLS data to the tmpfs, and finally a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create the hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
View the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
View the HLS stream with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Debugging camera issues with the gstreamer pipeline =====&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== A simple RTSP server with HLS =====&lt;br /&gt;
Install dependencies and build required v4l2 software:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
apt install -y gstreamer1.0-plugins-bad gstreamer1.0-tools \&lt;br /&gt;
  gstreamer1.0-plugins-good v4l-utils gstreamer1.0-alsa alsa-utils libpango1.0-0 \&lt;br /&gt;
  libpango1.0-dev gstreamer1.0-plugins-base gstreamer1.0-x x264 \&lt;br /&gt;
  gstreamer1.0-plugins-{good,bad,ugly} liblivemedia-dev liblog4cpp5-dev \&lt;br /&gt;
  libasound2-dev vlc libssl-dev iotop libasound2-dev  liblog4cpp5-dev \&lt;br /&gt;
  liblivemedia-dev autoconf automake libtool v4l2loopback-dkms liblog4cpp5-dev \&lt;br /&gt;
  libvpx-dev libx264-dev libjpeg-dev libx265-dev&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
git clone --recursive https://github.com/mpromonet/v4l2tools &amp;amp;&amp;amp; cd v4l2tools &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install&lt;br /&gt;
git clone --recursive https://github.com/mpromonet/v4l2rtspserver &amp;amp;&amp;amp; cd v4l2rtspserver &amp;amp;&amp;amp; cmake -D LIVE555URL=https://download.videolan.org/pub/contrib/live555/live.2020.08.19.tar.gz . &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running the camera:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/640x480@1/30]'&lt;br /&gt;
modprobe v4l2loopback video_nr=10 debug=2&lt;br /&gt;
v4l2compress -fH264  -w -vv /dev/video0 /dev/video10&lt;br /&gt;
v4l2rtspserver -v -S -W 640 -H 480 -F 10 -b /usr/local/share/v4l2rtspserver/ /dev/video10&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The v4l2compress/v4l2rtspserver method of streaming the camera uses around ~45-50% of the CPU for compression of the stream into H264 (640x480@7fps) and around 1-2% of the CPU for serving the HLS stream. Total system RAM used is roughly 64MB and the load average is ~0.4-~0.5 when idle, and ~0.51-~0.60 with one HLS client streaming the camera.&lt;br /&gt;
&lt;br /&gt;
=== Stock Linux ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8747</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8747"/>
		<updated>2020-12-30T19:06:31Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* Wired network performance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   510 MBytes  71.2 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   509 MBytes  71.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.01  sec   642 MBytes  89.8 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   641 MBytes  89.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
==== Streaming the camera to the network ====&lt;br /&gt;
&lt;br /&gt;
To stream to web browsers with HLS and x264 encoding, we'll use a tmpfs file system to not write any data to the sdcard in the PineCube. We'll also need a very basic web page in tmpfs, a program to write HLS data to the tmpfs, and finally a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create the hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
View the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
View the HLS stream with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Debugging camera issues with the gstreamer pipeline =====&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stock Linux ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8746</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8746"/>
		<updated>2020-12-30T18:58:52Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* Wired network performance */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   622 MBytes  86.9 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   620 MBytes  86.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   490 MBytes  68.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   489 MBytes  68.4 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
==== Streaming the camera to the network ====&lt;br /&gt;
&lt;br /&gt;
To stream to web browsers with HLS and x264 encoding, we'll use a tmpfs file system to not write any data to the sdcard in the PineCube. We'll also need a very basic web page in tmpfs, a program to write HLS data to the tmpfs, and finally a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create the hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
View the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
View the HLS stream with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Debugging camera issues with the gstreamer pipeline =====&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stock Linux ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8745</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8745"/>
		<updated>2020-12-30T17:58:01Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* Performance results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The Ethernet network does work in the Ubuntu Groovy armbian image.&lt;br /&gt;
&lt;br /&gt;
====== Wireless network performance ======&lt;br /&gt;
The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====== Wired network performance ======&lt;br /&gt;
&lt;br /&gt;
The performance results reflect using the Ethernet network. The link speed was 100Mb/s using a 1000Mb/s prosumer switch. Running sixty second iperf3 tests: the observed throughput varies between 92-102Mb/s to a host on the same network segment. The testing host is connected to the same Ethernet switch which is also connected to the PineCube.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   675 MBytes  94.4 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   673 MBytes  94.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   673 MBytes  94.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
==== Streaming the camera to the network ====&lt;br /&gt;
&lt;br /&gt;
To stream to web browsers with HLS and x264 encoding, we'll use a tmpfs file system to not write any data to the sdcard in the PineCube. We'll also need a very basic web page in tmpfs, a program to write HLS data to the tmpfs, and finally a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create the hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
View the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
View the HLS stream with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Debugging camera issues with the gstreamer pipeline =====&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stock Linux ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8744</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8744"/>
		<updated>2020-12-30T17:44:39Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* Armbian */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
&lt;br /&gt;
The only Armbian release with support for Ethernet and the camera module is the Ubuntu Groovy release. The Ubuntu Groovy release is an experimental, automatically generated release and it appears to support additional hardware from the other Armbian releases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Armbian Build Image with motionEye [microSD Boot] [20201222] ====&lt;br /&gt;
* motionEyeOS is a Linux distribution that turns a single-board computer into a video surveillance system. The OS is based on BuildRoot and uses motion as a backend and motionEye for the frontend&lt;br /&gt;
* There are 2 ways to interact with the OS:&lt;br /&gt;
** Scan for its IP with hostname pinecube&lt;br /&gt;
** Use the PINE64 USB SERIAL CONSOLE/PROGRAMMER and login, then check for assigned IP&lt;br /&gt;
** [https://gist.github.com/Icenowy/ff68f6e4ba8231380d3a295226e63fb3 Github link]&lt;br /&gt;
* DD image (for 8GB micoSD card and above)&lt;br /&gt;
** [https://files.pine64.org//os/PineCube/armbian/Armbian_21.02.0-trunk_Pinecube_focal_dev_5.10.0.img.xz Direct download from pine64.org]&lt;br /&gt;
*** MD5 (XZip file): 61e5a6d3ab0f74ce8367c97b7f8cbb7b&lt;br /&gt;
*** File Size: 328MGB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
==== Streaming the camera to the network ====&lt;br /&gt;
&lt;br /&gt;
To stream to web browsers with HLS and x264 encoding, we'll use a tmpfs file system to not write any data to the sdcard in the PineCube. We'll also need a very basic web page in tmpfs, a program to write HLS data to the tmpfs, and finally a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create the hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
View the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
View the HLS stream with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Debugging camera issues with the gstreamer pipeline =====&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stock Linux ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8476</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8476"/>
		<updated>2020-12-20T17:43:30Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* Streaming the camera to the network */ add nginx note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
==== Streaming the camera to the network ====&lt;br /&gt;
&lt;br /&gt;
To stream to web browsers with HLS and x264 encoding, we'll use a tmpfs file system to not write any data to the sdcard in the PineCube. We'll also need a very basic web page in tmpfs, a program to write HLS data to the tmpfs, and finally a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create the hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, install a more efficient web server (&amp;lt;code&amp;gt;apt install nginx&amp;lt;/code&amp;gt;) and set the server root for the default configuration to be /dev/shm/hls. This will run on port 80 rather than the python3 server which defaults to port 8000.&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
View the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
View the HLS stream with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Debugging camera issues with the gstreamer pipeline =====&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stock Linux ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8475</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8475"/>
		<updated>2020-12-20T17:25:25Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* Streaming the camera to the network */ add 1920x1080 example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
==== Streaming the camera to the network ====&lt;br /&gt;
&lt;br /&gt;
To stream to web browsers with HLS and x264 encoding, we'll use a tmpfs file system to not write any data to the sdcard in the PineCube. We'll also need a very basic web page in tmpfs, a program to write HLS data to the tmpfs, and finally a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create the hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively it is possible to capture at a higher resolution:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/1920x1080@1/15]'&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; gst-launch-1.0 v4l2src ! video/x-raw,width=1920,height=1080,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
View the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
View the HLS stream with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Debugging camera issues with the gstreamer pipeline =====&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stock Linux ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8474</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8474"/>
		<updated>2020-12-20T17:15:10Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* Streaming the camera to the network */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
==== Streaming the camera to the network ====&lt;br /&gt;
&lt;br /&gt;
To stream to web browsers with HLS and x264 encoding, we'll use a tmpfs file system to not write any data to the sdcard in the PineCube. We'll also need a very basic web page in tmpfs, a program to write HLS data to the tmpfs, and finally a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create the hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=15/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
View the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
View the HLS stream with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Debugging camera issues with the gstreamer pipeline =====&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stock Linux ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8473</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8473"/>
		<updated>2020-12-20T17:11:06Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* Streaming the camera to the network */  add note about using gst-play&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
==== Streaming the camera to the network ====&lt;br /&gt;
&lt;br /&gt;
To stream to web browsers with HLS and x264 encoding, we'll use a tmpfs file system to not write any data to the sdcard in the PineCube. We'll also need a very basic web page in tmpfs, a program to write HLS data to the tmpfs, and finally a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create the hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=1/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
&lt;br /&gt;
View the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
View the HLS stream with gst-play-1.0: &amp;lt;code&amp;gt;gst-play-1.0 http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Debugging camera issues with the gstreamer pipeline =====&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stock Linux ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8472</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8472"/>
		<updated>2020-12-20T17:00:12Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* Armbian */ Add example gstreamer pipeline and simple http web server with python3 to stream HLS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
==== Streaming the camera to the network ====&lt;br /&gt;
&lt;br /&gt;
To stream to web browsers with HLS and x264 encoding, we'll use a tmpfs file system to not write any data to the sdcard in the PineCube. We'll also need a very basic web page in tmpfs, a program to write HLS data to the tmpfs, and finally a webserver to serve the files.&lt;br /&gt;
&lt;br /&gt;
Create the hls directory to be shared in the existing tmpfs file system that is mounted at /dev/shm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mkdir /dev/shm/hls/&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an index.html and optionally a favicon.ico or even a set of icons, and then put the files into the /dev/shm/hls directory. An example index.html that works is available in the Getting Started section of the [https://github.com/video-dev/hls.js/#getting-started README] for [https://github.com/video-dev/hls.js/ hls.js].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In one terminal, run the camera capture pipeline:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; &lt;br /&gt;
media-ctl --set-v4l2 '&amp;quot;ov5640 1-003c&amp;quot;:0[fmt:UYVY8_2X8/240x320@1/15]' &amp;amp;&amp;amp; &lt;br /&gt;
gst-launch-1.0 v4l2src ! video/x-raw,width=320,height=240,format=UYVY,framerate=1/1 ! decodebin ! videoconvert ! video/x-raw,format=I420 ! clockoverlay ! timeoverlay valignment=bottom ! x264enc speed-preset=ultrafast tune=zerolatency ! mpegtsmux ! hlssink target-duration=1 playlist-length=2 max-files=3&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In another, run a simple single threaded webserver which will serve html, javascript, and HLS to web clients:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
cd /dev/shm/hls/ &amp;amp;&amp;amp; python3 -m http.server&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It should be possible to view the HLS stream directly in a web browser by visiting [http://pinecube:8000/ http://pinecube:8000/] if pinecube is the correct hostname and the name correctly resolves.&lt;br /&gt;
It is also possible to view the HLS stream with VLC: &amp;lt;code&amp;gt;vlc http://pinecube:8000/playlist.m3u8&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Debugging camera issues with the gstreamer pipeline =====&lt;br /&gt;
&lt;br /&gt;
If the camera does not appear to work, it is possible to change the &amp;lt;code&amp;gt;v4l2src&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;videotestsrc&amp;lt;/code&amp;gt; and the gstreamer pipeline will produce a synthetic test image without using the camera hardware.&lt;br /&gt;
&lt;br /&gt;
If the camera is only sensor noise lines over a black or white image, the camera may be in a broken state. When in that state, the following kernel messages were observed:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[ 1703.577304] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.578570] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.596924] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.598060] alloc_contig_range: [46400, 467f5) PFNs busy&lt;br /&gt;
[ 1703.600480] alloc_contig_range: [46400, 468f5) PFNs busy&lt;br /&gt;
[ 1703.601654] alloc_contig_range: [46600, 469f5) PFNs busy&lt;br /&gt;
[ 1703.619165] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
[ 1703.619528] alloc_contig_range: [46200, 465f5) PFNs busy&lt;br /&gt;
[ 1703.619857] alloc_contig_range: [46300, 466f5) PFNs busy&lt;br /&gt;
[ 1703.641156] alloc_contig_range: [46100, 464f5) PFNs busy&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stock Linux ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8471</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8471"/>
		<updated>2020-12-20T16:10:12Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: /* Armbian */ add iperf3 tests: with and without WireGuard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Basic bandwidth tests with iperf3 ====&lt;br /&gt;
&lt;br /&gt;
Install armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;apt install armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable iperf3 through the menu in armbian-config:&lt;br /&gt;
&amp;lt;code&amp;gt;armbian-config&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a test computer on the same network segment run iperf3 as a client:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same test computer, run iperf3 in the reverse direction:&lt;br /&gt;
&amp;lt;code&amp;gt;iperf3 -c pinecube -t 60 -R&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Performance results =====&lt;br /&gt;
The Ethernet network does not work in the current Ubuntu Focal armbian image. The performance results reflect using the wireless network. The link speed was 72.2Mb/s using 2.462Ghz wireless. Running sixty second iperf3 tests: the observed throughput varies between 28-50Mb/s to a host on the same network segment. The testing host is connected to an Ethernet switch which is also connected to a wireless bridge. The wireless network uses WPA2 and the PineCube is connected to this wireless network bridge.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   293 MBytes  41.0 Mbits/sec    1             sender&lt;br /&gt;
 [  5]   0.00-60.01  sec   291 MBytes  40.7 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.85  sec   263 MBytes  36.2 Mbits/sec    3             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   259 MBytes  36.1 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Using WireGuard to protect the traffic between the PineCube and the test system, the performance characteristics change only slightly.&lt;br /&gt;
&lt;br /&gt;
Client rate for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.00  sec   230 MBytes  32.1 Mbits/sec    0             sender&lt;br /&gt;
 [  5]   0.00-60.09  sec   229 MBytes  32.0 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
Client rate with -R for sixty seconds with WireGuard:&lt;br /&gt;
&lt;br /&gt;
 [ ID] Interval           Transfer     Bitrate         Retr&lt;br /&gt;
 [  5]   0.00-60.14  sec   246 MBytes  34.3 Mbits/sec    7             sender&lt;br /&gt;
 [  5]   0.00-60.00  sec   245 MBytes  34.2 Mbits/sec                  receiver&lt;br /&gt;
&lt;br /&gt;
=== Stock Linux ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
	<entry>
		<id>https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8470</id>
		<title>PineCube</title>
		<link rel="alternate" type="text/html" href="https://wiki.pine64.org/index.php?title=PineCube&amp;diff=8470"/>
		<updated>2020-12-20T15:14:15Z</updated>

		<summary type="html">&lt;p&gt;Cypherpunks: Add instructions for using screen to communicate with the PineCube with the woodpecker usb serial device&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|1=PAGE UNDER CONSTRUCTION, INFO SUBJECT TO CHANGE}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
* '''Dimensions:''' 55mm x 51mm x 51.5mm&lt;br /&gt;
* '''Weight:''' 55g&lt;br /&gt;
* '''Storage:'''&lt;br /&gt;
** MicroSD slot, bootable&lt;br /&gt;
** 128Mb SPI Nor Flash, bootable&lt;br /&gt;
* '''Cameras:''' OV5640, 5Mpx &lt;br /&gt;
* '''CPU:''' Allwinner(Sochip) ARM Cortex-A7 MPCore, 800MHz&lt;br /&gt;
* '''RAM:''' 128MB DDR3&lt;br /&gt;
* '''I/O:'''&lt;br /&gt;
** 10/100Mbps Ethernet with passive PoE&lt;br /&gt;
** USB 2.0 A host&lt;br /&gt;
** 26 pins GPIO port&lt;br /&gt;
*** 2x 3.3V Ouptut&lt;br /&gt;
*** 2x 5V Output&lt;br /&gt;
*** 1x I2C&lt;br /&gt;
*** 2x UART&lt;br /&gt;
*** 2x PWM&lt;br /&gt;
*** 1x SPI&lt;br /&gt;
*** 1x eMMC/SDIO/SD (8-bit)&lt;br /&gt;
*** 6x Interrupts&lt;br /&gt;
*** '''Note: Interfaces are multiplexed, so they can't be all used at same time'''&lt;br /&gt;
** Internal microphone&lt;br /&gt;
* '''Network:'''&lt;br /&gt;
** WiFi&lt;br /&gt;
* '''Screen:''' optional 4.5&amp;quot; RGB LCD screen&lt;br /&gt;
* '''Misc. features:''' &lt;br /&gt;
** Volume and home buttons&lt;br /&gt;
** Speakers and Microphone&lt;br /&gt;
* '''Power DC in:'''&lt;br /&gt;
** 5V 1A from MicroUSB Port or GPIO port&lt;br /&gt;
** 4V-18V from Ethernet passive PoE&lt;br /&gt;
* '''Battery:''' optional 950-1600mAh model: 903048 Lithium Polymer Ion Battery Pack, can be purchase at [https://www.amazon.com/AKZYTUE-1200mAh-Battery-Rechargeable-Connector/dp/B07TWHHCNK/ Amazon.com]&lt;br /&gt;
&lt;br /&gt;
== PineCube board information, schematics and certifications ==&lt;br /&gt;
* PineCube mainboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20MainBoard%20Schematic%20ver%201.0-20200727.pdf PineCube mainboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube faceboard schematic:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20FaceBoard%20Schematic%20ver%201.0-20200727.pdf PineCube faceboard Released Schematic ver 1.0]&lt;br /&gt;
* PineCube certifications:&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-FCC-SDOC%20certification%20S20072502302001.pdf PineCube FCC Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-CE-EMC%20certification%20S20072502301001.pdf PineCube CE RED Certificate]&lt;br /&gt;
** [https://files.pine64.org/doc/cert/PineCube-ROHS%20Test%20Report.pdf PineCube ROHS Test Report]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Datasheets for components and peripherals ==&lt;br /&gt;
* Allwinner (Sochip) S3 SoC information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/S3_Datasheet_V1.1-20180123.pdf Sochip S3 SoC Data Sheet V1.1]&lt;br /&gt;
&lt;br /&gt;
* X-Powers AXP209 PMU (Power Management Unit) information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/AXP209_Datasheet_v1.0en.pdf AXP209 PMIC datasheet]&lt;br /&gt;
&lt;br /&gt;
* CMOS camera module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/CH-5A-DV-V2.0%20Specification.pdf PineCube Camera Module Specification]&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinephone/OV5640_datasheet.pdf OV5640 5MP CMOS Image Sensor SoC datasheet]&lt;br /&gt;
&lt;br /&gt;
* LCD touch screen panel information:&lt;br /&gt;
&lt;br /&gt;
* Lithium battery information:&lt;br /&gt;
&lt;br /&gt;
* WiFi/BT module information:&lt;br /&gt;
** [https://files.pine64.org/doc/datasheet/pinecube/rtl8189es.pdf RTL8189ES specification]&lt;br /&gt;
&lt;br /&gt;
* GPIO Header Pinout: ([[:File:PineCube_GPIO.pdf|PDF]], [https://pine64.gami.ee/pinecube/gpio-pinout.html HTML])&lt;br /&gt;
[[File:PineCube_GPIO_Pinout.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Case information:&lt;br /&gt;
** [https://files.pine64.org/doc/PineCube/PineCube%20Case%203D.zip PinePhone 3D file]&lt;br /&gt;
&lt;br /&gt;
[[File:PineCube_Case-1.jpg|400px]]  [[File:PineCube_Case-2.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Operating Systems ==&lt;br /&gt;
&lt;br /&gt;
=== Mainlining Efforts ===&lt;br /&gt;
&lt;br /&gt;
Please note:&lt;br /&gt;
&lt;br /&gt;
* this list is most likely not complete&lt;br /&gt;
* no review of functionality is done here, it only serves as a collection of efforts&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Linux kernel&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| Devicetree Entry Pinecube&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1241&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
| Correction for AXP209 driver&lt;br /&gt;
| https://lkml.org/lkml/2020/9/22/1243&lt;br /&gt;
| 5.9&lt;br /&gt;
|-&lt;br /&gt;
| Additional Fixes for AXP209 driver&lt;br /&gt;
| https://lore.kernel.org/lkml/20201031182137.1879521-8-contact@paulk.fr/&lt;br /&gt;
| tdb (5.11?)&lt;br /&gt;
|-&lt;br /&gt;
| Device Tree Fixes&lt;br /&gt;
| https://lore.kernel.org/lkml/20201003234842.1121077-1-icenowy@aosc.io/&lt;br /&gt;
| 5.10&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|U-boot&lt;br /&gt;
|-&lt;br /&gt;
| Type&lt;br /&gt;
| Link&lt;br /&gt;
| Available in version&lt;br /&gt;
|-&lt;br /&gt;
| PineCube Board Support&lt;br /&gt;
| https://patchwork.ozlabs.org/project/uboot/list/?series=210044&lt;br /&gt;
| expected in v2021.01&lt;br /&gt;
|-&lt;br /&gt;
!colspan=&amp;quot;3&amp;quot;|Buildroot&lt;br /&gt;
|-&lt;br /&gt;
| No known mainlining efforts yet&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== NixOS ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/danielfullmer/pinecube-nixos danielfullmer's Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Buildroot ===&lt;br /&gt;
[https://elimo.io Elimo Engineering] integrated support for the PineCube into Buildroot.&lt;br /&gt;
&lt;br /&gt;
This has not been merged into upstream Buildroot yet, but you can find the repo on [https://github.com/elimo-engineering/buildroot Elimo's GitHub account] and build instructions in the [https://github.com/elimo-engineering/buildroot/tree/pine64/pinecube/board/pine64/pinecube board support directory] readme.&lt;br /&gt;
The most important thing that this provides is support for the S3's DDR3 in u-boot. Unfortunately mainline u-boot does not have that yet, but the u-boot patches from [https://github.com/danielfullmer/pinecube-nixos Daniel Fullmer's NixOS repo] were easy enough to use on buildroot.&lt;br /&gt;
This should get you a functional system that boots to a console on UART0. It's pretty fast too, getting there in 1.5 seconds from u-boot to login prompt.&lt;br /&gt;
&lt;br /&gt;
=== Armbian ===&lt;br /&gt;
Armbian Builds for PineCube are [https://www.armbian.com/pinecube/ available for download], once again thanks to [https://github.com/armbian/build/pull/2364/files the work] of Icenowy Zheng.&lt;br /&gt;
Although not officially supported ([https://www.armbian.com/download/?device_support=No+official+support+(CSC) CSC Status] it enables the usage of Debian and Ubuntu.&lt;br /&gt;
&lt;br /&gt;
A serial console can be established with 152008N1 (no hardware flow control). Login credentials are as usual in Armbian login: root password: 1234.&lt;br /&gt;
&lt;br /&gt;
==== Example with screen and the woodpecker USB serial device ====&lt;br /&gt;
&lt;br /&gt;
First connect the woodpecker USB serial device to the PineCube. Pin 1 on the PineCube has a small white dot on the PCB - this should be directly next to the microusb power connection. Attach the GND pin on the woodpecker to pin 6 (GND) on the PineCube, TXD from the woodpecker to pin 10 (UART_RXD) on the PineCube, and RXD from the woodpecker to pin 8 (UART_TXD) on the PineCube.&lt;br /&gt;
&lt;br /&gt;
On the host system which has the woodpecker USB serial device attached, it is possible to run screen and to communicate directly with the PineCube:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;screen /dev/ttyUSB0 115200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stock Linux ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SDK ==&lt;br /&gt;
&lt;br /&gt;
==== Stock Linux ====&lt;br /&gt;
* [https://files.pine64.org/SDK/PineCube/PineCube%20Stock%20BSP-SDK%20ver1.0.7z Direct Download from pine64.org]&lt;br /&gt;
** MD5 (7zip file): efac108dc98efa0a1f5e77660ba375f8&lt;br /&gt;
** File Size: 3.50GB&lt;br /&gt;
===== How to compile =====&lt;br /&gt;
&lt;br /&gt;
You can either setup a machine for the build environment, or use a Vagrant virtual machine provided by [https://elimo.io Elimo Engineering]&lt;br /&gt;
&lt;br /&gt;
====== On a dedicated machine ======&lt;br /&gt;
&lt;br /&gt;
Recommended system requirements:&lt;br /&gt;
* OS: (L)Ubuntu 16.04&lt;br /&gt;
* CPU: 64-bit based&lt;br /&gt;
* Memory: 8 GB or higher&lt;br /&gt;
* Disk: 15 GB free hard disk space&lt;br /&gt;
&lt;br /&gt;
'''Install required packages'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install p7zip-full git make u-boot-tools libxml2-utils bison build-essential gcc-arm-linux-gnueabi g++-arm-linux-gnueabi zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32z1-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Install older Make 3.82 and Java JDK 6'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pushd /tmp&lt;br /&gt;
wget https://ftp.gnu.org/gnu/make/make-3.82.tar.gz&lt;br /&gt;
tar xfv make-3.82.tar.gz&lt;br /&gt;
cd make-3.82&lt;br /&gt;
./configure&lt;br /&gt;
make&lt;br /&gt;
sudo apt purge -y make&lt;br /&gt;
sudo ./make install&lt;br /&gt;
cd ..&lt;br /&gt;
# Please, download jdk-6u45-linux-x64.bin from https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html (requires free login)&lt;br /&gt;
chmod +x jdk-6u45-linux-x64.bin &lt;br /&gt;
./jdk-6u45-linux-x64.bin &lt;br /&gt;
sudo mkdir /opt/java/&lt;br /&gt;
sudo mv jdk1.6.0_45/ /opt/java/&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.6.0_45/bin/javac 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.6.0_45/bin/java 1&lt;br /&gt;
sudo update-alternatives --install /usr/bin/javaws javaws /opt/java/jdk1.6.0_45/bin/javaws 1&lt;br /&gt;
sudo update-alternatives --config javac&lt;br /&gt;
sudo update-alternatives --config java&lt;br /&gt;
sudo update-alternatives --config javaws&lt;br /&gt;
popd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Unpack SDK and then compile and pack the image'''&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
7z x 'PineCube Stock BSP-SDK ver1.0.7z'&lt;br /&gt;
mv 'PineCube Stock BSP-SDK ver1.0' pinecube-sdk&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====== Using Vagrant ======&lt;br /&gt;
&lt;br /&gt;
You can avoid setting up your machine and just use Vagrant to spin up a development environment in a VM.&lt;br /&gt;
&lt;br /&gt;
Just clone the [https://github.com/elimo-engineering/pinecube-sdk-vagrant Elimo Engineering repo] and follow the instructions in the [https://github.com/elimo-engineering/pinecube-sdk-vagrant/blob/main/README.md readme file]&lt;br /&gt;
&lt;br /&gt;
After spinning up the VM, you just need to run the build:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd pinecube-sdk/camdroid&lt;br /&gt;
source build/envsetup.sh&lt;br /&gt;
lunch&lt;br /&gt;
mklichee&lt;br /&gt;
make -j3&lt;br /&gt;
pack&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Community Projects ==&lt;br /&gt;
&lt;br /&gt;
Share your project with a PineCube here!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:PineCube]] [[Category:Allwinner(Sochip) S3]]&lt;/div&gt;</summary>
		<author><name>Cypherpunks</name></author>
	</entry>
</feed>