Differences between revisions 1 and 2
Revision 1 as of 2016-12-23 13:25:42
Size: 16145
Editor: RudolfReuter
Comment: new
Revision 2 as of 2016-12-23 19:30:06
Size: 20347
Editor: RudolfReuter
Comment: new #2
Deletions are marked like this. Additions are marked like this.
Line 11: Line 11:

Line 13: Line 15:
The Linux software [[https://docs.armbian.com/|Armbian]] is also described well.


||<tablestyle="float:right;">[[attachment:OrangePi_Lite_DSC06813.jpg|{{attachment:OrangePi_Lite_DSC06813.jpg|attachment:OrangePi_Lite_DSC06813.jpg|width="905"}}]] ||
I will explain here some specific '''Know How'''.

=== RPi 3, SSH password, WLAN ===
2016-06-28 If you try to connect with '''SSH''' via '''WLAN''' to your '''Raspberry Pi 3''' it can be, that after entering the right '''password''' nothing more happens. This problem is well known, please see [[RaspberryPiKnowHow#Links|Links #13]]. The solution is to edit the SSH daemon config file (server side):
{{{
# edit file /etc/ssh/sshd_config
# add at the end of the file the line:
IPQoS cs0 cs0

# restart the SSH server
$ sudo service ssh restart

# see also:
$ man sshd_config
# IPQoS Specifies the IPv4 type-of-service or DSCP class for connections
# cs = Class selector
# cs0 - meaning: Best Effort
}}}
You can read more about '''Differentiated_services''' [[https://en.wikipedia.org/wiki/Differentiated_services|here]]
The Linux software [[https://docs.armbian.com/|Armbian]] is also described well.

I will explain here some specific '''Know How'''. Please see the '''picture''' below for details (click on picture to expand).

||<tablestyle="float:right;">[[attachment:OrangePi_Lite_DSC06813.jpg|{{attachment:OrangePi_Lite_DSC06813.jpg|attachment:OrangePi_Lite_DSC06813.jpg|width="910"}}]] ||

The picture shows the '''Orange Pi Lite''' (!WiFi and Bluetooth version) with the '''serial port''' connected to a '''USB to serial''' converter.

/!\ The serial '''data''' wires '''RX and TX''' (or '''RD and TD''') are connected '''1:1'''.

/!\ Please take care to use the '''3.3 V version''' of the '''serial converter'''. A 5 V version can '''damage''' your Orange Pi.

/!\ If you are using a '''DVI adapter''' on your monitor, you will probably see '''no picture'''. The fix is explained [[OrangePiKnowHow#Screen_resolution_HDMI|later]].


== Orange Pi Lite ==
Orange Pi Lite is the version with '''!WiFi and Bluetooth''', without '''Ethernet''' port. A [[http://linux-sunxi.org/File:Orange_pi-lite-v1_1.pdf|schematic]] is available.


=== Armbian software ===
The Armbian (Debian) [[http://www.armbian.com/orange-pi-lite|software]] can be downloaded in a '''Desktop''' or '''Server''' version. Please read the '''Quick Start''' page for informations.

/!\ When the software on the micro SD-card is OK, the '''green LED''' blinks, or lits steady.


=== WiFi connect ===
Because the '''Orange Pi Lite''' does '''not''' have an '''Ethernet port''', the '''!WiFi''' connection must be configured via the '''serial port''' (115200 Baud 8N1). To make the connection to a computer with a '''terminal''' ('''PUTTY or !CoolTerm'''), you need an '''USB to serial''' converter ('''3.3 V version'''), as shown in the '''picture''' above.

Next insert the programmed '''micro SD''' card into the socket of the board and switch on power. In the '''terminal''' you will see:
{{{
U-Boot SPL 2016.09-armbian (Sep 15 2016 - 07:09:20)
DRAM: 512 MiB
Trying to boot from MMC1


U-Boot 2016.09-armbian (Sep 15 2016 - 07:09:20 +0200) Allwinner Technology

CPU: Allwinner H3 (SUN8I 1680)
Model: Xunlong Orange Pi Lite
DRAM: 512 MiB
MMC: SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In: serial
Out: serial
Err: serial
Net: No ethernet found.
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot/boot.scr
2789 bytes read in 144 ms (18.6 KiB/s)
## Executing script at 43100000
gpio: pin PL10 (gpio 298) value is 1
   Warning: value of pin is still 0
gpio: pin PG11 (gpio 203) value is 1
** File not found /boot/.verbose **
** File not found /boot/.next **
** Unrecognized filesystem type **
** File not found .next **
35912 bytes read in 400 ms (86.9 KiB/s)
3114597 bytes read in 307 ms (9.7 MiB/s)
5025168 bytes read in 455 ms (10.5 MiB/s)
## Loading init Ramdisk from Legacy Image at 43300000 ...
   Image Name: uInitrd
   Image Type: ARM Linux RAMDisk Image (gzip compressed)
   Data Size: 3114533 Bytes = 3 MiB
   Load Address: 00000000
   Entry Point: 00000000
   Verifying Checksum ... OK
Using machid 0x1029 from environment

Starting kernel ...

[sun8i_fixup]: From boot, get meminfo:
        Start: 0x40000000
        Size: 512MB
ion_carveout reserve: 160m@0 256m@0 130m@1 200m@1
ion_reserve_select: ion chipid [0x2004620!
ion_reserve_common: ion reserve: [0x56000000, 0x60000000]!

Debian GNU/Linux 8 orangepilite ttyS0
}}}
Next you will be asked for the '''root''' password ("1234"), and need to change it to a new one. The you will be asked for a '''user name''' with some not so important details, and a '''user password'''.

Then it is time to '''reboot''', in order to login as a user:
{{{
orangepilite login: rudi
Password: xxxxx

Linux orangepilite 3.4.112-sun8i #14 SMP PREEMPT Wed Sep 14 20:29:31 CEST 2016 armv7l
  ___ ____ _ _ _ _
 / _ \ _ __ __ _ _ __ __ _ ___ | _ \(_) | | (_) |_ ___
| | | | '__/ _` | '_ \ / _` |/ _ \ | |_) | | | | | | __/ _ \
| |_| | | | (_| | | | | (_| | __/ | __/| | | |___| | || __/
 \___/|_| \__,_|_| |_|\__, |\___| |_| |_| |_____|_|\__\___|
                       |___/

Welcome to ARMBIAN Debian GNU/Linux 8 (jessie) 3.4.112-sun8i
System load: 1.46 Up time: 32 sec
Memory usage: 24 % of 494Mb IP:
CPU temp: 20°C
Usage of /: 16% of 15G

# you see, there is not yet an IP number available!
}}}

Now it is time to connect to the '''!WiFi router''', with the setup. The '''network manager''' scans already for available hotspots (router):
{{{
$ sudo nmtui # network manager text user interface
    Set system hostname - orangepilite1 # for example
    Activate a connection
        Wi-Fi # scan for available hotspots (router)
            FRITZ-7360 - <Activate> # SSID for example
            .....
    Password: xxxx <OK>
    connecting...
    <QUIT>

# check in the router for the IP address
# for example a Fritz!box
orangepilite1 192.168.17.170 00:E0:4C:D7:FE:15 WLAN 42 Mbit/s
}}}

Then try a '''SSH''' connect for '''remote control''', with a Terminal or PUTTY:
{{{
# Try SSH connect:
$ ssh rudi@192.168.17.170
  ___ ____ _ _ _ _
 / _ \ _ __ __ _ _ __ __ _ ___ | _ \(_) | | (_) |_ ___
| | | | '__/ _` | '_ \ / _` |/ _ \ | |_) | | | | | | __/ _ \
| |_| | | | (_| | | | | (_| | __/ | __/| | | |___| | || __/
 \___/|_| \__,_|_| |_|\__, |\___| |_| |_| |_____|_|\__\___|
                       |___/

Welcome to ARMBIAN Debian GNU/Linux 8 (jessie) 3.4.112-sun8i
System load: 0.00 Up time: 25 min
Memory usage: 23 % of 494Mb IP: 192.168.17.170
CPU temp: 36°C
Usage of /: 16% of 15G

Last login: Thu Sep 15 07:30:19 2016

$ sudo date MMDDhhmmYYYY # M=Monat, D=Tag, h=Stunde, m=Minute, Y=Jahr
}}}

Now it is time to do an '''software update''' via '''internet''':
{{{
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo shutdown -r # reboot
}}}

The following chapters concerning configuration and setup are common for '''the Orange Pi One/Lite'''.


== Orange Pi One ==
Orange Pi One is the version with '''Ethernet''' port, without '''!WiFi and Bluetooth'''. A [[http://linux-sunxi.org/File:ORANGE_PI-ONE-V1_1.pdf|schematic]] is available.


=== Armbian software ===
The Armbian (Debian) [[http://www.armbian.com/orange-pi-one/|software]] can be downloaded in a '''Desktop''' or '''Server''' version. Please read the '''Quick Start''' page for informations.

/!\ When the software on the micro SD-card is OK, the '''green LED''' blinks, or lits steady.


== Shared software additions ==
The following software additions will make it more comfortable to work with the '''Orange Pi'''.


=== Screen resolution HDMI ===
If you are using a '''HDMI to DVI''' adapter you will probably see no '''picture''' on your monitor. For changing the resolution on your monitor, and a fix for the DVI Adapter, a [[https://forum.armbian.com/index.php/topic/752-tutorial-h3disp-change-display-settings-on-h3-devices/|tool]] is provided:
{{{
Desktop size: 1024 x 768 # initial setup

$ sudo h3disp
Usage: h3disp [-h/-H] -m [video mode] [-d] [-c [0-2]]

############################################################################

 This is a tool to set the display resolution of your Orange
 Pi by patching script.bin.

 In case you use an HDMI-to-DVI converter please use the -d switch.

 The resolution can be set using the -m switch. The following resolutions
 are currently supported:

    480i use "-m 480i" or "-m 0"
    576i use "-m 576i" or "-m 1"
    480p use "-m 480p" or "-m 2"
    576p use "-m 576p" or "-m 3"
    720p50 use "-m 720p50" or "-m 4"
    720p60 use "-m 720p60" or "-m 5"
    1080i50 use "-m 1080i50" or "-m 6"
    1080i60 use "-m 1080i60" or "-m 7"
    1080p24 use "-m 1080p24" or "-m 8"
    1080p50 use "-m 1080p50" or "-m 9"
    1080p60 use "-m 1080p60" or "-m 10"
    1080p25 use "-m 1080p25" or "-m 11"
    1080p30 use "-m 1080p30" or "-m 12"
    1080p24_3d use "-m 1080p24_3d" or "-m 13"
    720p50_3d use "-m 720p50_3d" or "-m 14"
    720p60_3d use "-m 720p60_3d" or "-m 15"
    1080p24_3d use "-m 1080p24_3d" or "-m 23"
    720p50_3d use "-m 720p50_3d" or "-m 24"
    720p60_3d use "-m 720p60_3d" or "-m 25"
    1080p25 use "-m 1080p25" or "-m 26"
    1080p30 use "-m 1080p30" or "-m 27"
    4kp30 use "-m 4kp30" or "-m 28"
    4kp25 use "-m 4kp25" or "-m 29"
    800x480 use "-m 800x480" or "-m 31"
    1024x768 use "-m 1024x768" or "-m 32"
    1280x1024 use "-m 1280x1024" or "-m 33"
    1360x768 use "-m 1360x768" or "-m 34"
    1440x900 use "-m 1440x900" or "-m 35"
    1680x1050 use "-m 1680x1050" or "-m 36"

 Two examples:

    'h3disp -m 1080p60 -d' (1920x1080@60Hz DVI)
    'h3disp -m 720i' (1280x720@30Hz HDMI)

 You can also specify the colour-range for your HDMI-display with the -c switch.

 The following values for -c are currently supported:

    0 -- RGB range 16-255 (Default, use "-c 0")
    1 -- RGB range 0-255 (Full range, use "-c 1")
    2 -- RGB range 16-235 (Limited video, "-c 2")

Now trying to patch script.bin with your settings. Successfully finished. Please reboot for changes to take effect
}}}
Line 41: Line 254:
First you have to install on the Raspberry Pi a '''VNC Server''', preferably the '''tightvncserver''': First you have to install on the Orange Pi a '''VNC Server''', preferably the '''tightvncserver''':
Line 65: Line 278:
# VNC server beenden # finish VNC server daemon
Line 100: Line 313:
Unfortunately the '''clipboard''' just works in one direction only. The other direction can be enabled with the programm '''autocutsel''' on the '''Raspberry Pi''': Unfortunately the '''clipboard''' just works in one direction only. The other direction can be enabled with the programm '''autocutsel''' on the '''Orange Pi''':
Line 106: Line 319:
# edit /home/pi/.vnc/xstartup # edit ~/.vnc/xstartup
Line 123: Line 336:
 * '''Mac OS X''' Mavericks 10.9.2:  * '''Mac OS X''' Sierra 10.12.2:
Line 177: Line 390:
||<tablestyle="float:right;">[[attachment:RPi_PSU_5V2A_Probe_DSC05296.jpg|{{attachment:RPi_PSU_5V2A_Probe_DSC05296.jpg|attachment:RPi_PSU_5V2A_Probe_DSC05296.jpg|width="320"}}]] ||
=== PSU Problem ===
In order to have enough current for some peripherals, I bought a '''power supply 5 V, 2 A''' from China. Have a look to the name plate, in the '''picture''' above (click to enlarge).

With that switching power supply the Raspberry Pi works in principle, but the '''HDMI output''' did not show any information on the monitor. So, I measured the voltage. With no load I measured 5.6 V, with 0.7 A load 5.5 V.


First I thought that the voltage was too high and searched for a method to reduce the voltage to 5.0 V under load. Fortunately you can open the housing with one screw. The circuit looks pretty standard. At the secondary side '''TL431''' adjustable zener diode is used. Looking at the voltage divider for the '''Ref''' Input of the TL431, it was obvious that the voltage is so hight, with R1 = 2k7, R2 = 2k2 (data sheet naming).

||<tablestyle="float:right;">[[attachment:RPi_PSU_5V2A_22k_DSC05426.jpg|{{attachment:RPi_PSU_5V2A_22k_DSC05426.jpg|attachment:RPi_PSU_5V2A_22k_DSC05426.jpg|width="320"}}]] ||
By soldering a '''27k resistor''' (1/10 W size) parallel to the 2k7 resistor the output voltage was reduced to 5.0 V under load. But that '''did not solve the problem''' with the dark monitor.

'''Next step''' was to measure the output voltage with an '''oscilloscope'''. Fortunately I had '''two power supplies''', one original, and the other already modified with the choke.

You see in the upper trace (CH1) a high frequency (about 5 MHz) oscillation with an '''amplitude''' of 700 mVpp. It happened at the '''switching transient''' only, but not always the same strength.


||<tablestyle="float:right;">[[attachment:RPi_PSU_5V2A_org_choke.gif|{{attachment:RPi_PSU_5V2A_org_choke.gif|attachment:RPi_PSU_5V2A_org_choke.gif|width="395"}}]] ||
The switching frequency was about 8 KHz. It looks like, that it is in synchronism with the 50 Hz of the 230 VAC supply.

This was measure at the '''GPIO''' connector of the Raspberry Pi, please see the first '''picture'''.

After some trial I added a '''choke in series''' of the +5 V line. The choke has a ferrite core and must stand the 2 A maximum current. The resistor of the coil I measured with 0.05 Ohm (12 turns, L = 2.5 uH).

The result you can see in the lower trace (CH2) of the '''oscilloscope''' diagram that the amplitude was reduced to 400 mVpp. The second power supply showed 280 mVpp only, after the modification. With the choke and a '''100 uF capacitor to ground''' the signal was less than 100 mV.

This '''solved the problem''' with the blank monitor. Hence, it was not the over voltage of the power supply, instead the large amplitude of the 5 MHz oscillation.

||<tablestyle="float:right;">[[attachment:RRPi_PSU_5V2A_22k_DSC05427.jpg|{{attachment:RPi_PSU_5V2A_22k_DSC05427.jpg|attachment:RPi_PSU_5V2A_22k_DSC05427.jpg|width="240"}}]] ||
The '''picture''' on the right you can see '''position of the choke''' on the circuit board. Fortunately there is some free space on the circuit board to fit the choke. The '''+5 V trace''' on the copper side must be '''cut''' for the choke to work, see the above '''picture''' of the PCB.

In order to increase the output voltage under load a little bit, I added a 22k resistor parallel to the 2k2 resistor on board. The output voltage under load (1 A) is now 5.2 V.

=== PSU Problem #2 ===
2 years later I bought a set of 5 pieces '''power supply 5 V, 2 A''' from China (banggood.com, Prod-ID 1033702), in the hope, they will be better, than the first one. This time, the output voltage was '''too low''':
{{{
# Load was the Raspberry Pi 2B, about 0.6 to 0.7 A
Voltages: 4.80 V, 4.64 V, 4,70 V, 4,70 V, 4,71 V
}}}

So, I tried to modified the PSU by myself, in order to come closer to the specification.

||<tablestyle="float:right;">[[attachment:PSU_5V2A_housing_DSC06518.jpg|{{attachment:PSU_5V2A_housing_DSC06518.jpg|attachment:PSU_5V2A_housing_DSC06518.jpg|width="320"}}]] ||
This time, the housing had no longer 2 screws for opening. You have to use a knife and a small flat screw driver to open the housing, by opening the '''4 plastic interlocks'''.

Please see the '''picture''' to the right for the '''position of the interlocks'''.

At the secondary side of the power supply a '''TL431''' programmable shunt regulator is used. Looking at the voltage divider for the '''Ref''' Input of the TL431, I found a '''resistor R102''' (15 KOhm), connected to +5 V.

By adding a 39 Kohm resistor (SMD 0805) to ground, I could lift the output voltage by 0.5 V. The closest Ground point for the resistor I found at '''capacitor C104'''. The connection to resistor R102 was made by a thin wire-wrap wire.

After modifying all 5 units, it shows up, that I need '''different resistors''', 39 k, 47 k and 56 k to achieve the specification of +5 V +/- 5%.

||<tablestyle="float:right;">[[attachment:PSU_5V2A_mod3k9m_DSC06519.jpg|{{attachment:PSU_5V2A_mod3k9m_DSC06519.jpg|attachment:PSU_5V2A_mod3k9m_DSC06519.jpg|width="320"}}]] ||
Please see the '''picture''' to the right for the wiring (click on the picture to expand).

Another '''problem''' is the '''high resistance''' of the '''power cable''' to the '''micro USB plug'''. At a current of about 0.75 A (Raspberry Pi 2B) the cable + plug '''voltage loss''' is about '''0.5 V'''. That looks like '''AWG 26''' wires (0.128 mm2) which have a specific resistance of 132 Ohm/km. With a cable length of 2 x 90 cm that will be 0.24 Ohm. So, at the rated current of 2 A this will be a '''voltage loss''' of about 0.48 V.

As a counter measure I cutted off the original cable, about 15 mm from their ends, and soldered a thicker cable (AWG 18 = 0.75 mm2, Schlauchleitung H03 VVH2-F 2x0,75 mm² schwarz) in place, isolating with hot shrink tube. Now the '''voltage loss''' drops to '''0.3 V at 1.5 A'''. This cable will bring in a '''voltage loss''' of about 0.08 V at 2 A.

But there is still some unknown '''current limitation''' left. The current limit at +5 V - 5% of the single units after all modification is:
{{{
1.0 A, 1.2 A, 1.5 A, 1.5 A, 1.5 A
}}}
This time the '''output voltage ripple''' was much better than before, just 80 mVpp at 56 KHz at 0.7 A.

For this '''low price''' of 2.50 EUR a piece (including shipping), those 1.5 A are acceptable, you just have to know. For more details have a look at the [[RaspberryPiKnowHow#Links|Links #11 and #12]]
=== Terminal TAB command complete ===
Unfortunately the function '''command complete''' in the '''terminal''' with the '''TAB''' key does not work in XFCE, see [[http://stackoverflow.com/questions/23418831/command-line-auto-complete-tab-key-not-work-in-terminal-for-ubuntu|here]].

The quick solution is to use '''CTRL/STRG TAB''' instead '''TAB'''. The better solution is to work at the reason. XFCE has captured the '''TAB key''' for the funtion '''switch_window_key''', but I think, the function '''command complete''' is more important. So what to do:
{{{
Applications Menu->Settings->Settings Manager->Settings Editor xfce4-keyboard-shortcuts
    <Super>Tab -> delete value "switch_window_key"

# to make it work:
$ sudo shutdown -r # reboot

}}}

=== Often use programs ===
In '''XFCE''' often used programs, like '''Terminal, File Manager, Texteditor and File Finder''' are on a low convenience level, to save resources. Because I often work with Ubuntu, I want to have the same often used programs. The installation is easy:
{{{
$ sudo apt-get install nautilus gnome-terminal gedit locate eog
# Menu Settings->Preferred Applications
# Nautilus for file manager
# Gnome-Terminal for terminal

$ sudo updatedb # for locate, to immediately index file names

# "tree view" in file manager Nautilus, version 3.14.1
# Click on folder icon in upper left edge of the window.
# Select: Preferences->Display->List View-> check mark "Navigate folders in a tree"

# eog = eye of gnome, picture viewer
}}}

=== Samba share ===
For easier '''file sharing''' in the in-house network, I like to have a '''Samba share''' installed:
{{{
$ sudo apt-get install nautilus-share
$ sudo apt-get install samba

$ sudo adduser $USER sambashare

# edit /etc/samba/smb.conf, add line in global section
    usershare owner only = false

$ sudo service smbd restart
# for adduser to work, reboot:
$ sudo shutdown -r
# test if user was added to group "sambashare"
$ groups
rudi dialout sudo audio video plugdev netdev bluetooth sambashare

# set password for samba, same as user password
$ sudo smbpasswd -a rudi

# create samba share with Nautilus
   select in Nautilus the folder /home/rudi # user
   click with right mouse button on the icon
   click on "sharing options"
   in window " Folder sharing" mark "share this folder"
       share name: rudi-orange
       option: mark "Allow others to create and delete files in this folder"
   click on "Create Share"

# change owner for easier access:
$ sudo chown rudi:rudi /var/lib/samba/usershares/rudi-orange

# test if you can connect the share
}}}
Line 248: Line 458:
 * '''Build date of the software''':
 {{{
 $ uname -a
  Linux orangepilite1 3.4.112-sun8i #10 SMP PREEMPT Sun Oct 23 16:06:55 CEST 2016 armv7l GNU/Linux
 }}}
 * '''find newer files''', [[http://stackoverflow.com/questions/6964747/find-all-files-recursively-newer-than-given-time|explanation]]:
 {{{
 # Syntax
  find /directory -newermt $(date +%Y-%m-%d -d '1 day ago') -type f -print
 # example
 $ find moin-1.9.9/wiki/data/pages -newermt $(date +%Y-%m-%d -d '1 month ago') -type f -print

 # Delete all Mac OS control files:
 $ sudo find . -name "._.DS_Store" -type f -delete
 }}}
 * '''Test file system''' at boot time
 {{{
 $ sudo touch /forcefsck

 # Restart OrangePi
 $ sudo shutdown -r
 }}}
 * '''Power button''': [[http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=1339|info 1]], [[http://www.orangepi.org/orangepibbsen/forum.php?mod=viewthread&tid=28|info 2]]
Line 250: Line 482:
  * I tested with good success the above mentioned wireless mouse and keyboard, see on the first '''picture''' on this page the wireless dongle. The benefit is, that you have now '''1 free USB port'''.<<BR>> Unfortunately it '''does not work''' in Raspbian version 2013-02-09, just in version 2014-01-07.
 * '''Problem with Flicker in the HDMI video''' and periodic shutdown (black screen)
  * the +5 V power supply is weak (< 4.7 V)
  * Try [[http://elinux.org/R-Pi_Troubleshooting#Interference_visible_on_a_HDMI_or_DVI_monitor|Interference_visible_on_a_HDMI_or_DVI_monitor]]
  * Edit file '''/boot/config.txt''' and remove comment:
  {{{
  $ sudo nano /boot/config.txt
    config_hdmi_boost=4
  # save file

  # reboot Raspberry Pi
  }}}
  * I tested with good success the above mentioned wireless mouse and keyboard, see on the first '''picture''' on this page the wireless dongle. The benefit is, that you have now '''1 free USB port'''.
Line 265: Line 485:
 1. [[http://www.cnx-software.com/2016/06/08/allwinner-h3-boards-comparison-tables-with-orange-pi-banana-pi-m2-nanopi-p1-and-h3-olinuxino-nano-boards|allwinner-h3-boards-comparison-tables]]
 1. [[https://github.com/igorpecovnik/lib/blob/master/documentation/H3_mini_faq.md|CPU H3 mini FAQ]]
Line 267: Line 489:
 1. [[http://elinux.org/RPi_Low-level_peripherals|Raspberry Pi, low level peripherals]]
Line 269: Line 490:
 1. [[http://www.ti.com/product/tl431|Texas Instruments TL431 description and data sheet]]
 1. [[http://www.pocketmagic.net/2012/05/simple-switched-power-supplies/#.U1Ftm8dmGmM|switching power supply examples, schematics]]
 1. [[http://www.mikrocontroller.net/articles/Controller_an_230V|Netzteil Beispiele, Schaltnetzteil]]
 1. [[http://www.mikrocontroller.net/articles/Raspberry_Pi|Mikrocontroller.net, Deutsch]] Raspberry Pi Erklärungen
 1. [[http://www.raspberrypi-spy.co.uk/2014/07/raspberry-pi-model-b-3-5mm-audiovideo-jack/|Raspberry Pi Model B+ 3.5mm Audio/Video Jack]]
 1. [[http://blog.pi3g.com/2014/07/modell-b-getestet-und-im-detail-erklrt-was-ist-neu-was-ist-besser/|Modell B+ getestet und im Detail erklärt – was ist neu, was ist besser?]]
Line 277: Line 492:
 1. [[https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=138631&start=100|[RPi3] SSH not working via wifi]]

Know How for the Orange Pi

The http://orangepi.com/orange-pi-lite is a palm sized (69 x 48 mm) computer that plugs into your TV and gets an USB keyboard and an USB mouse. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. The community page has some more details.

Because it is so cheap (about 27 EUR ), it is very attractive to use it in all kinds of embedded computer projects. The offer is from https://www.aliexpress.com, search for Orange Pi Lite SET12, it contains an Orange Pi Lite + Transparent ABS case + power cable + 16 GB class 10 micro SD card.

The Linux software Armbian is also described well.

I will explain here some specific Know How. Please see the picture below for details (click on picture to expand).

attachment:OrangePi_Lite_DSC06813.jpg

The picture shows the Orange Pi Lite (WiFi and Bluetooth version) with the serial port connected to a USB to serial converter.

/!\ The serial data wires RX and TX (or RD and TD) are connected 1:1.

/!\ Please take care to use the 3.3 V version of the serial converter. A 5 V version can damage your Orange Pi.

/!\ If you are using a DVI adapter on your monitor, you will probably see no picture. The fix is explained later.

Orange Pi Lite

Orange Pi Lite is the version with WiFi and Bluetooth, without Ethernet port. A schematic is available.

Armbian software

The Armbian (Debian) software can be downloaded in a Desktop or Server version. Please read the Quick Start page for informations.

/!\ When the software on the micro SD-card is OK, the green LED blinks, or lits steady.

WiFi connect

Because the Orange Pi Lite does not have an Ethernet port, the WiFi connection must be configured via the serial port (115200 Baud 8N1). To make the connection to a computer with a terminal (PUTTY or CoolTerm), you need an USB to serial converter (3.3 V version), as shown in the picture above.

Next insert the programmed micro SD card into the socket of the board and switch on power. In the terminal you will see:

U-Boot SPL 2016.09-armbian (Sep 15 2016 - 07:09:20)
DRAM: 512 MiB
Trying to boot from MMC1


U-Boot 2016.09-armbian (Sep 15 2016 - 07:09:20 +0200) Allwinner Technology

CPU:   Allwinner H3 (SUN8I 1680)
Model: Xunlong Orange Pi Lite
DRAM:  512 MiB
MMC:   SUNXI SD/MMC: 0
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot/boot.scr
2789 bytes read in 144 ms (18.6 KiB/s)
## Executing script at 43100000
gpio: pin PL10 (gpio 298) value is 1
   Warning: value of pin is still 0
gpio: pin PG11 (gpio 203) value is 1
** File not found /boot/.verbose **
** File not found /boot/.next **
** Unrecognized filesystem type **
** File not found .next **
35912 bytes read in 400 ms (86.9 KiB/s)
3114597 bytes read in 307 ms (9.7 MiB/s)
5025168 bytes read in 455 ms (10.5 MiB/s)
## Loading init Ramdisk from Legacy Image at 43300000 ...
   Image Name:   uInitrd
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    3114533 Bytes = 3 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
Using machid 0x1029 from environment

Starting kernel ...

[sun8i_fixup]: From boot, get meminfo:
        Start:  0x40000000
        Size:   512MB
ion_carveout reserve: 160m@0 256m@0 130m@1 200m@1
ion_reserve_select: ion chipid  [0x2004620!
ion_reserve_common: ion reserve: [0x56000000, 0x60000000]!

Debian GNU/Linux 8 orangepilite ttyS0

Next you will be asked for the root password ("1234"), and need to change it to a new one. The you will be asked for a user name with some not so important details, and a user password.

Then it is time to reboot, in order to login as a user:

orangepilite login: rudi
Password: xxxxx

Linux orangepilite 3.4.112-sun8i #14 SMP PREEMPT Wed Sep 14 20:29:31 CEST 2016 armv7l
  ___                               ____  _   _     _ _
 / _ \ _ __ __ _ _ __   __ _  ___  |  _ \(_) | |   (_) |_ ___
| | | | '__/ _` | '_ \ / _` |/ _ \ | |_) | | | |   | | __/ _ \
| |_| | | | (_| | | | | (_| |  __/ |  __/| | | |___| | ||  __/
 \___/|_|  \__,_|_| |_|\__, |\___| |_|   |_| |_____|_|\__\___|
                       |___/

Welcome to ARMBIAN Debian GNU/Linux 8 (jessie) 3.4.112-sun8i
System load:   1.46             Up time:       32 sec
Memory usage:  24 % of 494Mb    IP:
CPU temp:      20°C
Usage of /:    16% of 15G

# you see, there is not yet an IP number available!

Now it is time to connect to the WiFi router, with the setup. The network manager scans already for available hotspots (router):

$ sudo nmtui  # network manager text user interface
    Set system hostname - orangepilite1  # for example
    Activate a connection
        Wi-Fi         # scan for available hotspots (router)
            FRITZ-7360 - <Activate>  # SSID for example
            .....
    Password: xxxx <OK>
    connecting...
    <QUIT>

# check in the router for the IP address
# for example a Fritz!box
orangepilite1   192.168.17.170  00:E0:4C:D7:FE:15 WLAN 42 Mbit/s 

Then try a SSH connect for remote control, with a Terminal or PUTTY:

# Try SSH connect:
$ ssh rudi@192.168.17.170
  ___                               ____  _   _     _ _       
 / _ \ _ __ __ _ _ __   __ _  ___  |  _ \(_) | |   (_) |_ ___ 
| | | | '__/ _` | '_ \ / _` |/ _ \ | |_) | | | |   | | __/ _ \
| |_| | | | (_| | | | | (_| |  __/ |  __/| | | |___| | ||  __/
 \___/|_|  \__,_|_| |_|\__, |\___| |_|   |_| |_____|_|\__\___|
                       |___/                                  

Welcome to ARMBIAN Debian GNU/Linux 8 (jessie) 3.4.112-sun8i 
System load:   0.00             Up time:       25 min           
Memory usage:  23 % of 494Mb    IP:            192.168.17.170
CPU temp:      36°C             
Usage of /:    16% of 15G       

Last login: Thu Sep 15 07:30:19 2016

$ sudo date MMDDhhmmYYYY  # M=Monat, D=Tag, h=Stunde, m=Minute, Y=Jahr

Now it is time to do an software update via internet:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo shutdown -r   # reboot

The following chapters concerning configuration and setup are common for the Orange Pi One/Lite.

Orange Pi One

Orange Pi One is the version with Ethernet port, without WiFi and Bluetooth. A schematic is available.

Armbian software

The Armbian (Debian) software can be downloaded in a Desktop or Server version. Please read the Quick Start page for informations.

/!\ When the software on the micro SD-card is OK, the green LED blinks, or lits steady.

Shared software additions

The following software additions will make it more comfortable to work with the Orange Pi.

Screen resolution HDMI

If you are using a HDMI to DVI adapter you will probably see no picture on your monitor. For changing the resolution on your monitor, and a fix for the DVI Adapter, a tool is provided:

Desktop size: 1024 x 768 # initial setup

$ sudo h3disp
Usage: h3disp [-h/-H] -m [video mode] [-d] [-c [0-2]]

############################################################################

 This is a tool to set the display resolution of your Orange
 Pi by patching script.bin.

 In case you use an HDMI-to-DVI converter please use the -d switch.

 The resolution can be set using the -m switch. The following resolutions
 are currently supported:

    480i        use "-m 480i" or "-m 0"
    576i        use "-m 576i" or "-m 1"
    480p        use "-m 480p" or "-m 2"
    576p        use "-m 576p" or "-m 3"
    720p50      use "-m 720p50" or "-m 4"
    720p60      use "-m 720p60" or "-m 5"
    1080i50     use "-m 1080i50" or "-m 6"
    1080i60     use "-m 1080i60" or "-m 7"
    1080p24     use "-m 1080p24" or "-m 8"
    1080p50     use "-m 1080p50" or "-m 9"
    1080p60     use "-m 1080p60" or "-m 10"
    1080p25     use "-m 1080p25" or "-m 11"
    1080p30     use "-m 1080p30" or "-m 12"
    1080p24_3d  use "-m 1080p24_3d" or "-m 13"
    720p50_3d   use "-m 720p50_3d" or "-m 14"
    720p60_3d   use "-m 720p60_3d" or "-m 15"
    1080p24_3d  use "-m 1080p24_3d" or "-m 23"
    720p50_3d   use "-m 720p50_3d" or "-m 24"
    720p60_3d   use "-m 720p60_3d" or "-m 25"
    1080p25     use "-m 1080p25" or "-m 26"
    1080p30     use "-m 1080p30" or "-m 27"
    4kp30       use "-m 4kp30" or "-m 28"
    4kp25       use "-m 4kp25" or "-m 29"
    800x480     use "-m 800x480" or "-m 31"
    1024x768    use "-m 1024x768" or "-m 32"
    1280x1024   use "-m 1280x1024" or "-m 33"
    1360x768    use "-m 1360x768" or "-m 34"
    1440x900    use "-m 1440x900" or "-m 35"
    1680x1050   use "-m 1680x1050" or "-m 36"

 Two examples:

    'h3disp -m 1080p60 -d' (1920x1080@60Hz DVI)
    'h3disp -m 720i' (1280x720@30Hz HDMI)

 You can also specify the colour-range for your HDMI-display with the -c switch.

 The following values for -c are currently supported:

    0 -- RGB range 16-255 (Default, use "-c 0")
    1 -- RGB range 0-255 (Full range, use "-c 1")
    2 -- RGB range 16-235 (Limited video, "-c 2")

Now trying to patch script.bin with your settings. Successfully finished. Please reboot for changes to take effect

VNC server

Virtual Network Computing (VNC) allows you, to show the monitor screen of a remote computer (VNC Server) on a local computer (VNC Client), also to use your local keyboard and mouse for control of the remote computer. That allows to control a remote computer which does not have its own screen, keyboard and mouse.

First you have to install on the Orange Pi a VNC Server, preferably the tightvncserver:

# update first the software Repository
$ sudo apt-get update

# upgrade packages
$ sudo apt-get upgrade

$ sudo apt-get install tightvncserver

# start server
$ vncserver :1
You will require a password to access your desktops.

Password: raspberr     # max 8 characters, e.g. raspberr
Verify:
Would you like to enter a view-only password (y/n)? n

New 'X' desktop is raspberrypi:1

Creating default startup script /home/pi/.vnc/xstartup
Starting applications specified in /home/pi/.vnc/xstartup
Log file is /home/pi/.vnc/raspberrypi:1.log

# finish VNC server daemon
$ vncserver -kill :1

For an automatic start of the VNC server, you need a script, see at the links.

# Get the script
$ wget http://www.penguintutor.com/otherfiles/tightvncserver-init.txt

# copy to the init.d folder
$ sudo cp tightvncserver-init.txt /etc/init.d/tightvncserver

# Check the user name in line 16 and adopt if necessary. At the moment it is set to "pi".
# For safety reasons the user should NOT be named "root".

# Change user and group
$ sudo chown root:root /etc/init.d/tightvncserver

# Adjust the rights (execute)
$ sudo chmod 755 /etc/init.d/tightvncserver 

# Put the script in the "run levels" 
$ sudo update-rc.d tightvncserver defaults

# Manual start
$ sudo /etc/init.d/tightvncserver start

# Manual stop
$ sudo /etc/init.d/tightvncserver stop

# Check, if the process is active
$ ps -Af | grep vnc
pi        5135     1  0 06:42 ?        00:00:05 Xtightvnc :1 -desktop X -auth /home/pi/.Xauthority -geometry 1024x768 -depth 24 -rfbwait 120000 -rfbauth /home/pi/.vnc/passwd -rfbport 5901 -fp /usr/share/fonts/X11/misc/,/usr/share/fonts/X11/Type1/,/usr/share/fonts/X11/75dpi/,/usr/share/fonts/X11/100dpi/ -co /etc/X11/rgb

Unfortunately the clipboard just works in one direction only. The other direction can be enabled with the programm autocutsel on the Orange Pi:

# Install program to synchronise the clipboard
$ sudo apt-get install autocutsel

# enable auto start
# edit ~/.vnc/xstartup
# append at the third line:
autocutsel -fork
xrdb $HOME/.Xresources
...

# stop the VNC Server
$ sudo /etc/init.d/tightvncserver stop

# start with "autocutsel"
$ sudo /etc/init.d/tightvncserver start

Now you can establish a connection with a VNC client viewer.

/!\ It may be needed, to append the port numer 5901 to the IP address (Real VNC: Connection refused (61))

  • Password (was entered at setup, max. 8 characters): raspberr

  • Mac OS X Sierra 10.12.2:

    • In Finder you cab call: Goto/connect to server, Server address (e.g.): vnc://192.168.17.187:5901 . Unfortunately the build in VNC client does not support alt gr characters.

    • RealVNC: VNC-Viewer-5.1.1: supports the alt gr characters. Address (z.B.): 192.168.17.187:5901

    • The window size default is 1024 x 768 Pixel.
  • Windows

    • RealVNC: VNC-Viewer-5.1.1

VNC and sudo

In the VNC viewer, if you start a program with sudo, you can get an error _tkinter.TclError: couldn't connect to display ":1.0".

The solution is to setup XAUTHORITY, see more about at the links:

$ cd /etc/sudoers.d
# create a new parameter file
$ sudo touch xauthority
# edit file
$ sudo visudo xauthority
# enter the following 5 lines and save to file:
# setup for VNC with sudo
Defaults    env_reset
Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
Defaults    env_keep += "DISPLAY"
Defaults    env_keep += "XAUTHORITY"

# Add these few lines to ~/.bashrc:

if [ -z "$XAUTHORITY" ]; then
    if [ -e $HOME/.Xauthority ]; then
        export XAUTHORITY=$HOME/.Xauthority;
    fi;
fi

# logout and login again
# Please be care that for entering the password an ENGLISH keyboard is used!
# for password "raspberry" you must type "raspberrz"!

Now it should be possible to start a X-Windows program with sudo.

VNC and Screen Shot

If you like to do a screen shot from your graphic window, type on the command line:

$ scrot -s -d 4

# option "-s" select a window, or a rectangle, with the mouse
# option "-d 4" have a 4 s delay before the screen shot, in order to restore the window
# and read "man scrot"

# result:
$ ls -ls | grep 2014-05-05
   36 -rw-r--r-- 1 pi   pi      33458 Mai  5 14:00 2014-05-05-140020_655x643_scrot.png

Terminal TAB command complete

Unfortunately the function command complete in the terminal with the TAB key does not work in XFCE, see here.

The quick solution is to use CTRL/STRG TAB instead TAB. The better solution is to work at the reason. XFCE has captured the TAB key for the funtion switch_window_key, but I think, the function command complete is more important. So what to do:

Applications Menu->Settings->Settings Manager->Settings Editor xfce4-keyboard-shortcuts
    <Super>Tab -> delete value "switch_window_key"

# to make it work:
$ sudo shutdown -r   # reboot

Often use programs

In XFCE often used programs, like Terminal, File Manager, Texteditor and File Finder are on a low convenience level, to save resources. Because I often work with Ubuntu, I want to have the same often used programs. The installation is easy:

$ sudo apt-get install nautilus gnome-terminal gedit locate eog
# Menu Settings->Preferred Applications
#  Nautilus for file manager
#  Gnome-Terminal for terminal

$ sudo updatedb  # for locate, to immediately index file names

# "tree view" in file manager Nautilus, version 3.14.1
#   Click on folder icon in upper left edge of the window.
#   Select: Preferences->Display->List View-> check mark "Navigate folders in a tree"

# eog = eye of gnome, picture viewer

Samba share

For easier file sharing in the in-house network, I like to have a Samba share installed:

$ sudo apt-get install nautilus-share
$ sudo apt-get install samba

$ sudo adduser $USER sambashare

# edit /etc/samba/smb.conf, add line in global section
    usershare owner only = false

$ sudo service smbd restart
# for adduser to work, reboot:
$ sudo shutdown -r
# test if user was added to group "sambashare"
$ groups
rudi dialout sudo audio video plugdev netdev bluetooth sambashare

# set password for samba, same as user password
$ sudo smbpasswd -a rudi

# create samba share with Nautilus 
   select in Nautilus the folder /home/rudi  # user
   click with right mouse button on the icon
   click on "sharing options"
   in window " Folder sharing" mark "share this folder"
       share name: rudi-orange
       option: mark "Allow others to create and delete files in this folder"
   click on "Create Share"

# change owner for easier access:
$ sudo chown rudi:rudi /var/lib/samba/usershares/rudi-orange

# test if you can connect the share

Tipps

  • Build date of the software:

     $ uname -a
      Linux orangepilite1 3.4.112-sun8i #10 SMP PREEMPT Sun Oct 23 16:06:55 CEST 2016 armv7l GNU/Linux
  • find newer files, explanation:

     # Syntax
      find /directory -newermt $(date +%Y-%m-%d -d '1 day ago') -type f -print
     # example
     $ find moin-1.9.9/wiki/data/pages -newermt $(date +%Y-%m-%d -d '1 month ago') -type f -print
    
     # Delete all Mac OS control files:
     $ sudo find . -name "._.DS_Store" -type f -delete
  • Test file system at boot time

     $ sudo touch /forcefsck
    
     # Restart OrangePi
     $ sudo shutdown -r
  • Power button: info 1, info 2

  • Wireless optical mouse and keyboard X1800 from RAPOO

    • I tested with good success the above mentioned wireless mouse and keyboard, see on the first picture on this page the wireless dongle. The benefit is, that you have now 1 free USB port.

  1. allwinner-h3-boards-comparison-tables

  2. CPU H3 mini FAQ

  3. Setup of tightvncserver

  4. VNC with sudo

  5. raspberry-pi-rev2-gpio-pinout, JPG

  6. USB cable size matters

  7. Micro USB test jig

List of pages in this category:

-- RudolfReuter 2016-12-23 13:25:42


Go back to CategoryRaspberryPi or FrontPage

OrangePiKnowHow (last edited 2017-09-19 04:28:17 by RudolfReuter)