Introduction: Tiny Linux Server - VoCore2 - Getting Started
The VoCore2 Ultimate is an impressive piece of miniaturization and is worth considering for embedded control applications.
This tutorial will help you learn how to:
- configure the device's settings,
- add secure internet access, and
- control the on-board LED.
I bought the Ultimate version (with enclosure and standard connections) since it seemed like a quick way to get started. For embedded control, the PCB is also available and is about the size of a postage stamp.
- VoCore2 Ultimate (https://vocore.io)
- USB Cable (USB to USB-mini)
To configure a VoCore2 using this tutorial, you will need to use the vi text editor and a serial emulator. If you are not familiar with these, there are links in the tutorial which will provide assistance.
Step 1: Power-up the VoCore2
Connect a USB adapter cable between your computer and the VoCore2. The mini-USB connection on the VoCore should be used for this.
Step 2: Connect to the Luci Config App
The config application runs on the VoCore2 and you can get to it through your browser.
- From you host computer/laptop, connect to the device's wifi network (SSID: VoCore2-…)
- In your browser go to: http://192.168.61.1/
- You should see a web page asking for credentials.
- Enter ID: root
- Enter Password: vocore
- You should be in the OpenWrt system config app now.
You can also enter configuration commands using the VoCore2 console, which we will do later.
Step 3: Load Latest Firmware
Use the Luci Navigation to go to:
System > Backup / Flash Firmware
- Get latest download from https://vocore.io/v2u.html Section titled: "Upgrade VoCore2 Firmware". As of 2019-Nov-03, the latest version is shown in the screenshot above.
- Save the file to your computer.
- Use the Luci interface to select it.
- Press the "Flash Image" button to load it into your VoCore2.
Step 4: Set System Time
- After loading the new firmware, wait a few minutes before reconnecting to the VoCore's WiFi network (SSID: VoCore2-…)
- In browser go to: http://192.168.61.1/
- Go to Menu: System > System
- Skip down to Timezone and select your timezone
- Go back up and press "Sync with browser" button
- Leave the rest of the options as default
- Press "Save & Apply" button
Step 5: Add Internet Access
The device's default mode is to run as a network Access Point (AP). You can connect to the device by mini-usb, WiFi, or Ethernet, but the device will have no Internet access. To add Internet access, follow the instructions below which will enable STA (network Station) mode to operate. (After adding STA mode, the device will still operate as an AP and the Luci configuration app will still be available.)
The following steps will add Internet Access.
Step 6: Connect to the VoCore Console
- Open Control Panel > Device Manager > Ports, look for "USB Serial Device", remember COM port number
- Use Serial Terminal Emulator (Example: Putty)
- Set up connection params: Com_Port_Number, 115200 bps, 8 data bits,1 stop bit, no parity, no flow control
- Once connected, press Enter to get Linux shell prompt
Open Mac's Terminal app and run the following command to find Serial Port info.
The response looks like:
Enter your actual response within the next command, to start the terminal emulator.
screen /dev/cu.usbmodem6A68DE4F34311 115200,cs8,-parenb,-cstopb
That will open the Screen terminal emulator. You can now press Enter to get the Linux shell prompt.
Step 7: Add Station (STA) Mode
This section is derived from: https://vocore.io/v2u.html. I abridged the instructions for clarity. In order to avoid errors with "uci commit":
- I put all uci parameter values in quotations.
- I omitted commands for parameters that are already set in their respective /etc/config files.
I also added a few extra commands to configure the new Access Point's WiFi network, including:
- appropriate frequencies to match your country's regulations, and
- secure login credentials.
1. Connect to device's console through its microUSB (see prior sections)
2. Run the following commands in the console.
uci set wireless.sta.ssid="Your_Existing_WiFi_SSID" uci set wireless.sta.key="Your_Existing_WiFi_Password" uci set wireless.sta.network="wwan" uci commit
3. Configure boot-up script so that if your existing WiFi network is down, you can still connect to VoCore2.
Use the vi editor (included with OpenWrt) to insert the following code into /etc/rc.local
uci set wireless.sta.disabled="0" uci commit/etc/init.d/network restart sleep 10 uci set wireless.sta.disabled="1" uci commit
4. Setup firewall to enable access internet through your hotspot.
uci set firewall.@zone.forward="ACCEPT" uci commit
5. Add additional parameters to configure appropriate WiFI radio frequencies based on your country such as Canada or US, respectively:
uci set wireless.ra0.country="CA" uci set wireless.ra0.country="US"
More country codes at: https://www.arubanetworks.com/techdocs/InstantWen...
6. Set Access Point Login Credentials and Encryption
The device comes without a password on its WiFi access point (SSID: VoCore2…), so add one here.
uci set wireless.ap.key="New_WiFi_Password" uci set wireless.ap.encryption="psk2" uci commit
Note that psk2 includes WPA2
7. Update Wirelesss by running:
or by running
or if it's still not behaving, by rebooting device:
which will of course take longer than reload or restart.
8. Wait 30-60 seconds for the device to enter AP+STA mode.
9. Connect your host computer to WiFi, picking the network called VoCore2...
10. Confirm Internet connection by running:
ping -w 5 www.vocore.io
The response should show something like:
64 bytes from 184.108.40.206: seq=0 ttl=56 time=76.269 ms 64 bytes from 220.127.116.11: seq=1 ttl=56 time=65.666 ms 64 bytes from 18.104.22.168: seq=2 ttl=56 time=68.216 ms 64 bytes from 22.214.171.124: seq=3 ttl=56 time=63.554 ms 64 bytes from 126.96.36.199: seq=4 ttl=56 time=66.769 ms
If you're having troubles getting network connections to work, use the previously mentioned reboot command. If that doesn't work, disconnect the USB cable, wait 30 seconds, reconnect the cable. You can also check the /sys/config/ folder to ensure that the commands (above) configured their associated files correctly.
Step 8: Controlling the Onboard Red LED
To control the onboard LED which flashes red during WiFi activity, I found that the following approach works:
Un-trigger LED in Luci App
From the Luci app:
- Use the menu to navigate to System > LED Configuration.
- Set the trigger to "none".
- Press Save and Apply
Presumably the default setting would make this the state after boot-up, but I didn't test that.
Control LED with Console Commands
To turn the LED on:
echo 1 > /sys/class/leds/vocore2\:fuchsia\:status/brightness
To turn the LED off:
echo 0 > /sys/class/leds/vocore2\:fuchsia\:status/brightness
Controlling the LED this way may conflict with OpenWrt's use of the LED, but worked during my tests.
A better way of controlling GPIO is to use the export command, however this command does not work for GPIO44 (which controls the LED, based on schematics and router manual screenshots shown above). So the Operating System is likely, still holding on to this LED, despite Luci setting.
Step 9: Resources
Here are some links that I found helpful or interesting as I learned about the VoCore-OpenWrt ecosystem.
Wiki VoCore https://vocore.io/wiki.html
Luci http://192.168.61.1/cgi-bin/luci (once connected to VoCore WiFi)
Designer's Blog http://vonger.cn
User Guide https://openwrt.org/docs/guide-user/start
Quick Start https://openwrt.org/docs/start
- Client https://openwrt.org/docs/guide-user/network/openwr...
- Encrypt https://openwrt.org/docs/guide-user/network/wifi/...
- Utilities https://openwrt.org/docs/guide-user/network/wifi/...
Home Automation https://openwrt.org/docs/guide-user/services/auto...
- cRelay Library https://openwrt.org/docs/guide-user/services/auto...
Puffy LEDs https://shiftj.is/post/puffy/
Global Engineer https://globalengineer.wordpress.com/tag/openwrt/
PC Connect http://vonger.cn/?p=8127