Network Setup — Orange Pi
I’ve been playing with an Orange Pi Zero. These are pretty amazing products at a pretty inexpensive price point. Do note, there are some oddities here. I’ve been following a pretty impressive article on the Orange Pi Zero written by Luc Small.
Luc talks about setting up the connection to the wifi network, by updating the interfaces file:
$ nano /etc/network/interfaces
Add the following 4 lines to the end of the file:
iface wlan0 inet dhcp
wpa-ssid ≺Your Access Point Name aka SSID≻ # wpa-ssid myNetwork
wpa-psk ≺Your WPA Password≻ # wpa-psk myPassword
Er, yeah. So what makes this sort of difficult is you can’t add the ability to update the wifi system unless you are able to communicate with the device. It’s like playing the game of Twister, where the comment is “I won’t get off your foot, until you get off my hand. Well I won’t get off your hand until you get off my foot.” Until you are networked to the device, you can’t set up the device so it will work on the network, ugh.
Obviously there are two different ways to set up the wireless connection. With the Orange Pi Zero, you can:
- Create a hard wired ethernet connection thru a DHCP router
- Create a serial connection via FTDI device
I’d like to talk about that a bit. And here’s my dilemma. I wanted to give a public presentation showing an Orange Pi Zero in use, with a SSH connection and a VNC connection. The problem was that public venue had an odd WiFi system. At that particular venue, there was an “Open” network without traditional WPA-PSK password. I had a heck of a time getting the system up and running. I want to share what I’ve learned.
I was able to bring in an old wifi / switch router to the venue. I was successfully able to ethernet connect between my laptop, to the router, to the device. Because it was my router, I could use the browser on the laptop to look at the DHCP routing table, and determine the IP address of the hard wired Orange Pi device. From there, I could use my terminal command line tool to SSH over to the device. I was easily able to login, and set up wifi communications on the Pi. I will say, lugging around a router, two ethernet cables, and a separate power supply is kind of a hassle. I wanted to know if there was an easier way. I ended up trying to use a FTDI serial cable to communicate. I followed the instructions from Luc Small. This worked rather well.
One difference for me: I was using a Mac Laptop, where Luc is using windows. To enable the serial communications, I used the native Mac Terminal program. First you want to identify the available ports.
$ ls /dev/tty.* # to see all available ports.
You can then use the
$ screen command to to establish a simple serial connection. Note: you are going to want to set up the serial connection / terminal / screen BEFORE you power up the Orange Pi.
$ screen ≺port_name≻ ≺baud_rate≻ # to create a connection
In my case the screen command looked like this:
$ screen /dev/tty.usbserial-AE00BS5L 115200
A few more comments. First, the open network setup. Remember the sample format from Luc Small just won’t work at the facility I was visiting. I did find this reference. I was able to get the open network setup to work by modifying the /etc/network/interfaces
iface wlan0 inet dhcp
Do note that although connected successfully, the DNS lookup didn’t work. We added our own DNS lookup links to the image, thank you Google.
Another surprise: There appears to be a much better way to set up a virgin installation to a wifi network. Instead of modifying the contents of /etc/network/interfaces, you can also use the
$ nmtui or
$ nmcli commands. The nmtui command is particularly easy to use. Follow the prompts, select your network, type in a password when prompted to do so. From what I can see, this command installs a separate connection data stored in the directory:
/etc/NetworkManager/system-connections. Each connection gets its own file. The attached image shows three different screens from the
$ nmtui function. Note the simple text based wifi power strength meter.
Yet one more surprise. I did a whole lot of testing with the FTDI serial communications. I tested two different operating system images:
Armbian_5.25_Orangepizero_Ubuntu_xenial_default_3.4.113.img and Armbian_5.25_Orangepizero_Debian_jessie_default_3.4.113.img . There were definitely some differences there. When using Debian Jessie, I had some difficulty with
$ nano and
$ nmtui commands in serial communication mode. The commands fail to display correctly. You can still make things work, barely, as long as you know which keystrokes will work, but the display doesn’t always look quite right. No problem at all when there is a hard wired ethernet connection. Ubuntu Xenial image didn’t have this issue. Not sure what is going on there.
Many thanks to Luc Small for his posting. Stay tuned for more Orange Pi projects on this site…