Wednesday, May 31, 2017

Getting Started with Orange PI Zero

Orange PI Zero is a small SBC (single board computer) with 256/512MB memory, its similar to Raspberry PI Zero with some minor differences:

Raspberry PI Zero
Orange PI Zero


BCM2835 1GHz, Single-core CPU
H2+ Quad-core Cortex-A7 1.2GHz
512MB RAM
256MB/512MB
None
Ethernet 10/100 (PoE) + WiFi
Mini-HDMI port
None
Micro-USB OTG port
1 micro-USB and 1 USB 2.0
Micro-USB power

HAT-compatible 40-pin header
26 Pins Header, compatible with Raspberry Pi B+
13 Pins Header, with 2x USB, IR pin, AUDIO(MIC, AV)
Composite video and reset headers
Via 13 pins header
Optional CSI camera connector (v1.3 only) (w $20/ wo $5)
None
Realistic Price: ~$30 
Limited to 1 per order but not on AliExpress
Realistic Price ~$15 (256/512)



First you’ll need to get an image to flash on your SD card, I’ve used Ubuntu server from armbian.

Then I've used 7zip to decompress the image and write it on SD card with Win32DiskImager.

- Configure Ethernet NIC as static IP 192.168.0.1
- You can use DualServer to start up a DHCP server on the Ethernet port, you can either install the server from sourceforce or download just the executable from here, you can start a temporary instance by running RunStandAlone.bat.

- Insert the SD Card, connect the Orange PI Zero to power and connect the network and wait for about a minute, you'll see the DHCP request in the console:
DHCPREQUEST for ee:77:55:88:44:dd (orangepizero) from interface 192.168.0.1 received
Host ee:77:55:88:44:dd (orangepizero) allotted 192.168.0.2 for 36000 seconds

Alternatively if you power up the Orange PI Zero with a PC you get a COM port, fire up putty, and set to 9600 and you're ready to go!

use root and 1234 as default login credentials and follow up the instructions to change the password and create a default account.

when that is done, you can configure the wifi with nmcli:

- list wifi networks:
nmcli dev wifi list
- create a new connection:
nmcli con add con-name SSIDName ifname wlan0 type wifi ssid SSIDName
- set password:
nmcli con modify SSIDName wifi-sec.key-mgmt wpa-psk
nmcli con modify SSIDName wifi-sec.psk PASSWORD

- set up avahi to get mDNS, its easier than going into the DHCP/Router each time:
sudo apt-get install avahi-daemon
sudo apt-get install avahi-utils

sudo nano /etc/avahi/avahi-daemon.conf
publish-addresses=yes
publish-domain=yes

- to set up hostname resolution - install nss mdns resolution, another unexplored option is to use libnss-resolve, purge/install):
sudo apt-get install libnss-mdns

- edit nsswitch.conf file:
sudo nano /etc/nsswitch.conf

- modify hosts to:
hosts:          files dns myhostname mdns4_minimal mdns4

you should be able to ping the mdns record name now:
ping <hostname>.local

To enable mdns on windows, you can download Bonjour from Apple.

And last but not least, mDNS uses Multicast, which needs router support but its usually disabled, You should find a way to enable it, I can't really guide you on your particular router, in my Netgear it was something else, unchecking "Disable IGMP Proxying" fixed it.

You can monitor your device temperature with:
sudo armbianmonitor -m



References:
Luc Small did a more thorough beginners guide.


No comments:

Post a Comment