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.

328 lines
8.8 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. On the Armbian System, SSH on ethernet is enabled. We need to give the
  48. Pi an IP Adress now.
  49. # Install a dhcp server, in my case it was Arch and dhcpd
  50. sudo pacman -S dhcpd
  51. Now we have to create a new local network.
  52. The easiest way is to go into your graphical network-manager. Select the
  53. ethernet connection to your Pi and go on settings.
  54. In my case I went to IPv4 settings. Then I selected "Shared to other
  55. computers" Method. After this add a new Address:
  56. Address 10.0.0.1 # The 10.0.0.1 Number is normally used for local
  57. # networks.
  58. Netmask 24 # You can also put in 255.255.255.0, which only
  59. # says to the dhcp to give a certain range of
  60. # adresses starting at 10.0.0.0
  61. Gateway 10.0.0.1 # The Gateway is the adress of your laptop
  62. # itself
  63. Now you can run the command
  64. sudo arp -a
  65. in your bash, after restarting the connection over ethernet to your Pi.
  66. On your Orange Pi, the small green Light close to the mini usb port
  67. should be lighting. If the connection is established, you should see it
  68. blinking. If one or both are not the case, try to reinstall the ARMbian
  69. image, or zero the first part of the partition, maybe it was not booting
  70. You will see an assigned IP Adress on your ethernet interface, on arch
  71. for me it was the standard one enp0s25
  72. The IP was 10.0.0.254, so I could connect through ssh with my Orange
  73. Pi now, and start to set up the system.
  74. ssh root@10.0.0.254
  75. If everything worked, type in 1234 as the password and follow the instructions.
  76. If not, check out
  77. https://docs.armbian.com/User-Guide_Getting-Started/#how-to-prepare-a-sd-card
  78. For example, you can learn there how to verify the hash of your download, to be sure nobody
  79. gave you a virus instead of an OS :)
  80. # Software
  81. ## Upgrade the OS
  82. In the newer versions of armbian, ssh is deactivated by default.
  83. To save time, we installed an armbian buster.
  84. Generally, it is important to keep your KaosCube up to date.
  85. That is why, after getting access to the Cube, the first thing is
  86. an upgrade to bullseye (which is debian stable at the time of this
  87. writing and has the latest debian-security updates inside)
  88. sudo apt update
  89. sudo apt dist-upgrade -y
  90. Then change the apt configuration file
  91. sudo nano /etc/apt/sources.list
  92. and change all words which are "buster" to "bullseye".
  93. Except of the line regarding debian-security. There, you have
  94. to change "buster" to "bullseye-security".
  95. Save (in nano that is strg+o) and exit nano (strg+x)
  96. Then update with the new list and run the upgrade
  97. sudo apt update
  98. sudo apt upgrade
  99. During the upgrade, always choose ok or default :).
  100. Then go to /etc/apt/sources.list.d/armbian.list and change to bullseye there too
  101. Then run again the update and upgrade.
  102. ## Setting up the Access Point
  103. After upgrading to the latest debian bullseye, I needed to install dnsmasq for the interface wlan0 to work:
  104. apt install dnsmasq
  105. After that, the ap could be set up with the commands:
  106. nmcli con add type wifi ifname wlan0 mode ap con-name kaoscube ssid KaosCube ipv4.method shared
  107. nmcli con modify kaoscube wifi-sec.key-mgmt wpa-psk
  108. nmcli con modify kaoscube wifi-sec.psk "ThePasswordYouLike"
  109. nmcli con up kaoscube
  110. ## Installing firmware of the wifi dongle
  111. First thing to do is updating the apt ressources
  112. sudo apt update
  113. Then install git
  114. sudo apt install git
  115. Install dkms
  116. sudo apt install dkms
  117. Install the newest headers
  118. sudo apt-get install linux-headers-current-sunxi build-essential
  119. When installing build-essential, you will be prompted whether to restart
  120. or not. Enter no automatic restart and then for cron and ssh enter ok.
  121. For the ssh config, I kept the old one.
  122. after the install, restart the system with
  123. sudo reboot
  124. Now download the firmware
  125. git clone https://github.com/kelebek333/rtl8188fu
  126. Now go to the folder rtl8188fu. Add, build and install it with dkms
  127. sudo dkms add ./rtl8188fu
  128. sudo dkms build rtl8188fu/1.0
  129. sudo dkms install rtl8188fu/1.0
  130. sudo cp ./rtl8188fu/firmware/rtl8188fufw.bin /lib/firmware/rtlwifi/
  131. After all commands have run successfully, restart the system
  132. sudo reboot
  133. ## Create network connection with new wifi dongle
  134. First look up with ifconfig for the interfaces, and which one is the one of the dongle
  135. sudo ifconfig
  136. there should be one called wlan0 or wlan1, which is the small one already on the orange pi zero.
  137. In addition, there should be one with the name wlx00... something.
  138. This one you should use with the following command:
  139. nmcli device wifi connect 'FRITZ!Box 6430 Cable TL' password "98475637998946115486" ifname wlan0
  140. ## Installing the KaosCube Interface
  141. First add a new user, if you are still root:
  142. adduser kaosuser
  143. Then add the user to sudoers:
  144. usermod -aG sudo kaosuser
  145. Now change to user (still being root) and go to home directory
  146. su kaosuser
  147. cd
  148. First clone the interface from git:
  149. git clone https://code.basabuuka.org/alpcentaur/kc-interface.git
  150. After that, install php (working version is 7.4, but newer ones should
  151. also work)
  152. sudo apt install php
  153. Also the interface needs the following libraries:
  154. sudo apt install tor
  155. Now go in the directory kc-interface and run
  156. bash startserver.sh
  157. You will have the interface running on localhost:666
  158. To get the interface, connect to the ap kaoscube and enter the
  159. IP of its wifi interface with a double point and then 666.
  160. # Setting up functions of the KCInterface manually
  161. ## Setting up the Hidden Service
  162. First install Tor:
  163. sudo apt-get install tor
  164. Edit the torrc file:
  165. sudo nano /etc/tor/torrc
  166. Look for the line ############### This section is just for location-hidden services ###
  167. under this line, enable (uncomment) HiddenServiceDir and HiddenServicePort
  168. in our case,
  169. HiddenServiceDir /var/lib/tor/hidden_service/
  170. HiddenServicePort 80 127.0.0.1:80
  171. HiddenServicePort 22 127.0.0.1:22
  172. After restarting tor with
  173. sudo systemctl restart tor
  174. your hidden service is running, and you can get its address under
  175. /var/lib/tor/hidden_service/ , or whatever name or path you wrote in
  176. the torrc.
  177. # Features
  178. ## Installing 12d1:1f01 Huawei E353/E3131 LTE Usb Modem
  179. First issue
  180. lsusb
  181. to check, if you are trying to install the right LTE usb dongle.
  182. Then, install usb_modeswitch with the command
  183. sudo apt install usb-modeswitch usb-modeswitch-data
  184. and then switch to modem mode for the usb stick
  185. sudo usb_modeswitch -v 12d1 -p 1f01 -M '55534243123456780000000000000a11062000000000000100000000000000'