[Other Devices] Rock Pi S + AP-STA

Hi there, some readers report that my previous post: Rock Pi S + Wi-Fi Access Point based on RaspAP isn’t working anymore. Yes, that’s true, RaspAP have been upgraded to a major version and it doesn’t work correctly on Rock Pi S boards yet, issues like can’t start/restart hostapd process are present. Maybe in near future these issues can be fixed by its developer team. In the meantime, I’ve found a good alternative based on ARMBIAN utility: armbian-config, this utility can setup an Access Point in a couple of minutes, similar to RaspAP but without the WebUI.

This time I’ll show you how you can use a Rock Pi S board as a AP-STA, that means as an Access Point and Wireless Client at the same time, also, you can install AriaNG to turn it into a web download server with OpenVPN support and share its content through all your devices via HTTP server in any web browser or Kodi build and by installing samba you will be able to stream the content through VLC player in any Android device.

ARMBIAN OS Image

Let’s start to getting into this step by step. First, you must download ARMBIAN image available from here. Flash the OS image into an SD card, plug it into your Rock Pi S and turn it on. Once you have logged in (via SSH through Ethernet), update the whole system by typing: apt update; apt upgrade-full, once this is completed, reboot your device by typing: reboot.

ARMBIAN-Config Utility

After the device boot, it’s time to install ARMBIAN utility: armbian-config, do that by typing: apt install armbian-config, once that’s completed, execute the utility by typing: armbian-config. In there, select: Wireless, Bluetooth, Access Point, then Hostspot. The utility will guide you and ask which network adapter should be used to setup the AP, the first one must be p2p0 and the second one must be wlan0.

Once that’s completed, exit the utility and edit the network interface file by typing: nano /etc/network/interfaces, go the last line and add the following code:

auto wlan0
iface wlan0 inet dhcp
wpa-ssid "SSID"
wpa-psk "PASSWORD"

Replace SSID with your current Wi-Fi SSID and PASSWORD with its password. Press Ctrl+S to save changes and Ctrl+X to exit the editor. It’s time to add some iptables rules to connecting to internet correctly, do that by typing: nano /etc/rc.local

Place the following code before the exit line:

sleep 03
iptables -t nat -A POSTROUTING -o p2p0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE

Reboot your device by typing: reboot. Now you should remove the ethernet cable from the Rock Pi S and connect to it via Wi-Fi, search for a network with the SSID: ARMBIAN, connect to it with the password: 12345678. Once you’re connected, verify your internet connection by typing: curl ifconfig.me, the output of that should be your public IP Address.

AriaNG & OpenVPN

Now it’s time to setup the web download server, first you must install lighttpd and OpenVPN by typing: apt install lightptd openvpn. Once that’s completed, you must enable the directory listing module, do that by typing: nano /etc/lighttpd/lighttpd.conf go to the last line and add the following code:

dir-listing.activate = "enable"
$HTTP["url"] =~ "^/*($|/)" { dir-listing.activate = "enable" }

Press Ctrl+S to save changes and Ctrl+X to exit the editor.

Once that’s completed, restart lighttpd service by typing: systemctl restart lighttpd. Remove the index.html file from the webroot directory by typing: rm -f /var/www/html/index.html. As a last step, create a sysmlink for the HTTP server in the root directory, do that by typing: cd /root; ln -s /var/www/html webroot

Now it’s time to download latest AriaNG, do that by typing:

mkdir /var/www/html/aria2; cd /var/www/html/aria2; wget https://github.com/mayswind/AriaNg/releases/download/1.2.1/AriaNg-1.2.1-AllInOne.zip; unzip AriaNg*.zip; rm -f AriaNg*.zip

Once that’s completed, you should have access by typing: 172.24.1.1/aria2 in your web browser address bar.

In order to AriaNG work correctly, you should enable the rpc-server at every boot by typing: nano /etc/rc.local/, place the following code before the exit line:

sleep 03
aria2c – enable-rpc – rpc-listen-all –rpc-allow-origin-all=true

To connect through OpenVPN, download your configuration file and connect to it by typing: openvpn ./my-config-file.ovpn. It’s a good idea to use screen for this, in that way you can execute the connection in the background, do that by typing:

screen -d -m -S OpenVPN bash -c "openvpn /root/my-config-file.ovpn"

Press Ctrl+A then D to detach the screen, type screen -r to reattach it.

Samba Environment

Now it’s time to install samba, do that by typing: apt install samba cifs-utils, once that’s completed, edit Samba configuration file by typing: nano /etc/samba/smb.conf, once in there, go to the last line and add the following code:

[LocalShare]
comment = LocalShare
path = /root/webroot
read only = no
guest ok = yes

Press Ctrl+S to save changes and Ctrl+X to exit the editor. Once that’s completed, restart Samba service by typing: /etc/init.d/smbd restart. Lastly, reboot your device by typing: reboot. Now all Android devices connected to the Rock Pi S SSID will automatically discover the Samba server through VLC player.

That’s All

Once your Rock Pi S boot again, you will have your own router with shared internet Wi-Fi connection (Wi-Fi extender), also, you can now download any type of files through AriaNG with OpenVPN (or not) and share them through Kodi via HTTP server, you can also share them via Samba through VLC player in any Android device.

Isn’t this just amazing for a 4cm x 4cm board?

If you want to skip all the copy-paste codes, I’ve built a custom image for Rock Pi S with the AP-STA mode enabled, AriaNG, OpenVPN and Samba already installed and configured, the download link is below, all its login details are here.

My custom image will resize its filesystem partition at the first boot via armbian-resize-filesystem, wait a couple of minutes to make sure this process is completed.

Rock Pi S AP-STA Gallery

AriaNG & Kodi Gallery

Android VLC Player Gallery

Download Custom Rock Pi S AP-STA Pre-Built Image

Leave a comment to let me know any question, suggestion, complaint or issue about all this.

 981 total views,  3 views today


This is a honest review, as you can see there's no ads, affiliate links nor warez content on my blog. All reviews of servers, apps, devices and tools are original content generated by myself. There's not any commercial influence on my blog content from any company nor project developers. Contribute to ensure it stays that way

[Other Devices] Rock Pi S + AP-STA
5 1 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Scroll to top