Guide for making Lemaker Guita a remote downloading Machine

2 2805
Edited by jacer at Thu Oct 22, 2015 02:39

Here is a guide for making your Lemaker Guita a downloading machine. You can add, delete, stop downloadings from your cellphones, tablets, PCs using a web browser. You should connect your USB drive or portable hard drive to the Lemaker Guita first. Of course you can also to choose download it to the SD card or EMMC but it is not advised. We need to install Aria2, Nginx, and YAAW or Aria2web.First, lauch terminal with shortcut CTRL+ALT+T, then input commands below.
  1. sudo apt-get install aria2 nginx vim
Copy the Code
then run commands belw to  make sure you have the /dev/sda1
  1. df -h
  2. fdisk -l
Copy the Code

make a external folder for mounting sda1
  1. sudo mkdir /media/external
Copy the Code
downloading the YAAW  to the home folder andconfigure it

  1. cd ~
  2. wget https://github.com/binux/yaaw/archive/master.zip
  3. unzip master.zip
  4. cd yaww-master
  5. sudo mkdir /var/www/html/yaaw
  6. sudo cp -R * /var/www/html/yaaw
  7. sudo chmod 777 -R /var/www/html
Copy the Code
You can also use Aria2Web as Aria2 front using below commands to configure
  1. cd ~
  2. wget https://codeload.github.com/ziahamza/webui-aria2/zip/master
  3. unzip webui-aria2-master.zip
  4. cd webui-aria2-master
  5. sudo mkdir /var/www/html/aria2
  6. sudo cp -R * /var/www/html/aria2
  7. sudo chmod 777 /var/www/html/aria2
Copy the Code
Let`s configure Aria2
  1. sudo mkdir /etc/aria2
  2. sudo touch /etc/aria2/session
  3. sudo vi /etc/aria2/aria2.conf
Copy the Code
copy and paste below to the editing fil press ESC then input :wq to save the file.

  1. dir=/media/external
  2. disable-ipv6=true
  3. enable-rpc=true
  4. rpc-allow-origin-all=true
  5. rpc-listen-all=true
  6. rpc-listen-port=6800
  7. input-file=/etc/aria2/aria2.session
  8. save-session=/etc/aria2/aria2.session
  9. max-concurrent-downloads=10
  10. continue=true
  11. max-connection-per-server=5
  12. min-split-size=10M
  13. split=10
  14. max-overall-download-limit=0
  15. max-download-limit=0
  16. max-overall-upload-limit=0
  17. max-upload-limit=0
  18. lowest-speed-limit=0
Copy the Code
Testing with below command for aria2 service, if no error then press CTRL+C
  1. sudo aria2c --conf-path=/etc/aria2/aria2.conf
Copy the Code
Make a autostart script
  1. sudo vi /etc/init.d/aria2c
Copy the Code
  1. #!/bin/sh

  2. RETVAL=0
  3. case "$1" in
  4.         start)
  5.                 echo "Starting aria2c"
  6.                 if [ -e /dev/sda1 ]
  7.                 then
  8.                         mount -t vfat -o iocharset=utf8,uid=lemaker,gid=lemaker /dev/sda1 /media/external
  9.                 fi
  10.                 aria2c --conf-path=/etc/aria2/aria2.conf -D
  11.                 echo "Start aria2c done."
  12.         ;;
  13.         stop)
  14.                 echo "Stoping aria2c"
  15.                 killall aria2c
  16.                 if [ -e /dev/sda1 ]
  17.                 then
  18.                         umount /media/external
  19.                 fi
  20.                 echo "Stop aria2c done"
  21.         ;;
  22. esac
  23. exit $RETVAL
Copy the Code
Make the script executable
  1. sudo chmod +x  /etc/init.d/aria2c
Copy the Code
run the script
  1. sudo service aria2c start
Copy the Code
  1. sudo update-rc.d aria2c defaults
Copy the Code

Now open your web browser and input IP address as below.
  1. http://LemakerGuita`s Lan IP/yaaw
Copy the Code
  1. http://LemakerGuita`s Lan IP/aria2
Copy the Code
You can add download link using two of the GUI as you pleased.
If you have your own Domain, you can use DDNS and rpc 6800 to use the downloading machine wherever
you goes.
Thanks for your sharing

I will share Samba and minidlna configuration next week. Kind busy this week.

You have to log in before you can reply Login | Sign Up

Points Rules