the interface of the KaosCube
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

334 lines
9.3 KiB

1 year ago
1 year ago
  1. # DIY - Setting up the KaosCube
  2. 1. [Hardware](#hardware)
  3. * [Components](#components)
  4. * [Installing the OS](#installing-the-os)
  5. 2. [Software](#software)
  6. * [Upgrade the OS](#upgrade-the-os)
  7. * [Setting up the Access Point](#setting-up-the-access-point)
  8. * [Installing firmware of the wifi dongle](#installing-firmware-of-the-wifi-dongle)
  9. * [Create network connection with new wifi dongle](#create-network-connection-with-new-wifi-dongle)
  10. * [Installing the KaosCube Interface](#installing-the-kaoscube-interface)
  11. 3. [Setting up functions of the KCInterface manually](#setting-up-functions-of-the-kcinterface-manually)
  12. * [Setting up the Hidden Service](#setting-up-the-hidden-service)
  13. 4. [Features](#features)
  14. * [Installing 12d1:1f01 Huawei E353/E3131 LTE Usb Modem](#installing-12d1:1f01-huawei-e353/e3131-lte-usb-modem)
  15. # Hardware
  16. ## Components
  17. + Orange Pi Zero
  18. + MiniUsb2Usb Cable for power-supply
  19. + An Ethernet !Crossover! Cable for ssh access
  20. + An MicroSD 16 GB for the Installation of the OS
  21. + MicroSD2Usb Reader to plug in the Laptop
  22. + Linux Wifi Dongle
  23. + Wifi Antenna
  24. + A laptop, preferably with Linux installed
  25. ## Installing the OS
  26. Because Ubuntu is half proprietary, and there is a surveillance door for
  27. Amazon on the system, the KAOS Cube runs on ARMbian - Debian based.
  28. First step is to partition the MicroSD
  29. lsblk # list devices see which /dev/sdX is usb
  30. sudo fdisk /dev/sdb # In my case, the usb is /dev/sdb
  31. Command: d # Inside fdisk: delete all partions
  32. Command: n # Inside fdisk: Create new Partion
  33. # Press enter until you are done
  34. Command: w # Write the changes
  35. sudo mkfs.vfat /dev/sdb1 # format the new partition to fat32
  36. Get a buster image from https://www.armbian.com/download/ for the orange pi
  37. zero, as sshd is still running by default on the resulting machine
  38. And, more importantly, as of my writing, the xradio does not work with Bullseye and Bookworm.
  39. Which means, the small on board wifi does not work.
  40. Now copy binarywise the image to the partition
  41. sudo dd bs=4M if=ArmbianBusterForOrangePiZero.img of=/dev/sdb
  42. Thats it! The free system should be installed. Put the MicroSD into your OrangePi.
  43. Now connect the cables. The Orange Pi will boot by supplying it with
  44. power.
  45. Connect your computer with ethernet (crossover, special one) cable to the orange pi zero.
  46. The first boot takes a bit longer, up to 2 minutes.
  47. Make sure, that not only the lights of the ethernet port on the orange pi zero have the lights on.
  48. But there is another small green light on the side of the micro usb power plug. This one has to be on.
  49. Sometimes, especially with the buster image, the startup does not work properly, and you will not see a
  50. connection on your Laptop, because the os did not start at all. Just replug the power if that is the case
  51. (no light on).
  52. On the Armbian System, SSH on ethernet is enabled. We need to give the
  53. Pi an IP Adress now.
  54. # Install a dhcp server, in my case it was Arch and dhcpd
  55. sudo pacman -S dhcpd
  56. Now we have to create a new local network.
  57. The easiest way is to go into your graphical network-manager. Select the
  58. ethernet connection to your Pi and go on settings.
  59. In my case I went to IPv4 settings. Then I selected "Shared to other
  60. computers" Method. After this add a new Address:
  61. Address 10.0.0.1 # The 10.0.0.1 Number is normally used for local
  62. # networks.
  63. Netmask 24 # You can also put in 255.255.255.0, which only
  64. # says to the dhcp to give a certain range of
  65. # adresses starting at 10.0.0.0
  66. Gateway 10.0.0.1 # The Gateway is the adress of your laptop
  67. # itself
  68. Now you can run the command
  69. sudo arp -a
  70. in your bash, after restarting the connection over ethernet to your Pi.
  71. On your Orange Pi, the small green Light close to the mini usb port
  72. should be lighting. If the connection is established, you should see it
  73. blinking. If one or both are not the case, try to reinstall the ARMbian
  74. image, or zero the first part of the partition, maybe it was not booting
  75. You will see an assigned IP Adress on your ethernet interface, on arch
  76. for me it was the standard one enp0s25
  77. The IP was 10.0.0.254, so I could connect through ssh with my Orange
  78. Pi now, and start to set up the system.
  79. ssh root@10.0.0.254
  80. If everything worked, type in 1234 as the password and follow the instructions.
  81. If not, check out
  82. https://docs.armbian.com/User-Guide_Getting-Started/#how-to-prepare-a-sd-card
  83. For example, you can learn there how to verify the hash of your download, to be sure nobody
  84. gave you a virus instead of an OS :)
  85. # Software
  86. ## Upgrade the OS
  87. In the newer versions of armbian, ssh is deactivated by default.
  88. To save time, we installed an armbian buster.
  89. Generally, it is important to keep your KaosCube up to date.
  90. That is why, after getting access to the Cube, the first thing is
  91. an upgrade to bullseye (which is debian stable at the time of this
  92. writing and has the latest debian-security updates inside)
  93. sudo apt update
  94. sudo apt dist-upgrade -y
  95. Then change the apt configuration file
  96. sudo nano /etc/apt/sources.list
  97. and change all words which are "buster" to "bullseye".
  98. Except of the line regarding debian-security. There, you have
  99. to change "buster" to "bullseye-security".
  100. Save (in nano that is strg+o) and exit nano (strg+x)
  101. Then update with the new list and run the upgrade
  102. sudo apt update
  103. sudo apt upgrade
  104. During the upgrade, always choose ok or default :).
  105. Then go to /etc/apt/sources.list.d/armbian.list and change to bullseye there too
  106. Then run again the update and upgrade.
  107. ## Setting up the Access Point
  108. After upgrading to the latest debian bullseye, I needed to install dnsmasq for the interface wlan0 to work:
  109. apt install dnsmasq
  110. After that, the ap could be set up with the commands:
  111. nmcli con add type wifi ifname wlan0 mode ap con-name kaoscube ssid KaosCube ipv4.method shared
  112. nmcli con modify kaoscube wifi-sec.key-mgmt wpa-psk
  113. nmcli con modify kaoscube wifi-sec.psk "ThePasswordYouLike"
  114. nmcli con up kaoscube
  115. ## Installing firmware of the wifi dongle
  116. First thing to do is updating the apt ressources
  117. sudo apt update
  118. Then install git
  119. sudo apt install git
  120. Install dkms
  121. sudo apt install dkms
  122. Install the newest headers
  123. sudo apt-get install linux-headers-current-sunxi build-essential
  124. When installing build-essential, you will be prompted whether to restart
  125. or not. Enter no automatic restart and then for cron and ssh enter ok.
  126. For the ssh config, I kept the old one.
  127. after the install, restart the system with
  128. sudo reboot
  129. Now download the firmware
  130. git clone https://github.com/kelebek333/rtl8188fu
  131. Now go to the folder rtl8188fu. Add, build and install it with dkms
  132. sudo dkms add ./rtl8188fu
  133. sudo dkms build rtl8188fu/1.0
  134. sudo dkms install rtl8188fu/1.0
  135. sudo cp ./rtl8188fu/firmware/rtl8188fufw.bin /lib/firmware/rtlwifi/
  136. After all commands have run successfully, restart the system
  137. sudo reboot
  138. ## Create network connection with new wifi dongle
  139. First look up with ifconfig for the interfaces, and which one is the one of the dongle
  140. sudo ifconfig
  141. there should be one called wlan0 or wlan1, which is the small one already on the orange pi zero.
  142. In addition, there should be one with the name wlx00... something.
  143. This one you should use with the following command:
  144. nmcli device wifi connect 'FRITZ!Box 6430 Cable TL' password "98475637998946115486" ifname wlan0
  145. ## Installing the KaosCube Interface
  146. First add a new user, if you are still root:
  147. adduser kaosuser
  148. Then add the user to sudoers:
  149. usermod -aG sudo kaosuser
  150. Now change to user (still being root) and go to home directory
  151. su kaosuser
  152. cd
  153. First clone the interface from git:
  154. git clone https://code.basabuuka.org/alpcentaur/kc-interface.git
  155. After that, install php (working version is 7.4, but newer ones should
  156. also work)
  157. sudo apt install php
  158. Also the interface needs the following libraries:
  159. sudo apt install tor
  160. Now go in the directory kc-interface and run
  161. bash startserver.sh
  162. You will have the interface running on localhost:666
  163. To get the interface, connect to the ap kaoscube and enter the
  164. IP of its wifi interface with a double point and then 666.
  165. # Setting up functions of the KCInterface manually
  166. ## Setting up the Hidden Service
  167. First install Tor:
  168. sudo apt-get install tor
  169. Edit the torrc file:
  170. sudo nano /etc/tor/torrc
  171. Look for the line ############### This section is just for location-hidden services ###
  172. under this line, enable (uncomment) HiddenServiceDir and HiddenServicePort
  173. in our case,
  174. HiddenServiceDir /var/lib/tor/hidden_service/
  175. HiddenServicePort 80 127.0.0.1:80
  176. HiddenServicePort 22 127.0.0.1:22
  177. After restarting tor with
  178. sudo systemctl restart tor
  179. your hidden service is running, and you can get its address under
  180. /var/lib/tor/hidden_service/ , or whatever name or path you wrote in
  181. the torrc.
  182. # Features
  183. ## Installing 12d1:1f01 Huawei E353/E3131 LTE Usb Modem
  184. First issue
  185. lsusb
  186. to check, if you are trying to install the right LTE usb dongle.
  187. Then, install usb_modeswitch with the command
  188. sudo apt install usb-modeswitch usb-modeswitch-data
  189. and then switch to modem mode for the usb stick
  190. sudo usb_modeswitch -v 12d1 -p 1f01 -M '55534243123456780000000000000a11062000000000000100000000000000'