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.

224 lines
8.5 KiB

  1. # Readme
  2. This repository is developed to cover the embedded systems lecture at summer school in Jade University.
  3. # Issues to solve
  4. - [ ] TODO which version of beagles to buy
  5. - [ ] I prefer to use the beaglebone black wi-fi, if it is possible to connect them to Jade's internet
  6. - [ ] Otherwise the ethernet version is preferred to use with usb-internet sharing
  7. - [ ] Install in computer the PuTTY software and some bash option to use.
  8. - [ ] TODO Adding to day 1: https://linuxpropaganda.wordpress.com/2018/06/26/create-new-user-in-ubuntu-on-beaglebone-black/
  9. # day-1: Introduction to the single-board computers (SBC) and basic applications
  10. ## Basic connections
  11. ### Basic USB connection for Beagle
  12. To connect into the SBC, attach the USB cable into the PC. Then, open the terminal and type:
  13. ```
  14. $ ip addr
  15. en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
  16. ether bc:d0:74:35:a9:39
  17. inet6 fe80::416:aee8:9fce:7def/64 secured scopeid 0xe
  18. inet 192.168.6.2/24 brd 192.168.1.255 en0
  19. inet6 2806:2f0:5040:8572:189b:329e:6e92:ec98/64 autoconf secured
  20. inet6 2806:2f0:5040:8572:796d:4680:2f61:a858/64 autoconf temporary
  21. ```
  22. you will obtain a lot of `enX` or `awdlx` devices, try to search for the new detected devices and specially the one with the ip 192.168.6.2 or 192.168.7.2 that belongs to the BeagleBone devices.
  23. ### TODO Basic USB connection for Raspberry Pi 4(RPi4)
  24. ### TODO Enabling the SSH in the RPi4
  25. - Connect to a IP address
  26. - SSH connection
  27. ```
  28. ssh -X debian@192.168.7.2
  29. debian:temppwd
  30. ```
  31. ### Error connection
  32. When getting the error:
  33. ```
  34. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  35. @ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
  36. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  37. The ECDSA host key for beaglebone.local has changed,
  38. and the key for the corresponding IP address 2806:103e:5:50f4:3ad2:69ff:fef9:46b4
  39. ```
  40. you have to edit the '.ssh/known_hosts' file, and delete the lien that contains the offending key and the corresponding IP address given the warning.
  41. ### Sharing the internet through usb
  42. ### Wi-Fi
  43. To connect to your Wireless network type the following command in the terminal window:
  44. ```bash
  45. $sudo connmanctl
  46. connmanctl> enable wifi
  47. Enabled wifi
  48. connmanctl> scan wifi
  49. Scan completed for wifi
  50. connmanctl> services
  51. wifi_506583d4fc5e_544e434150413937414239_managed_psk
  52. connmanctl> agent on
  53. Agent registered
  54. connmanctl> connect wifi_506583d4fc5e_544e434150413937414239_managed_psk
  55. Passphrase? xxxxxxxxxxx
  56. connected wifi_506583d4fc5e_544e434150413937414239_managed_psk
  57. connmanctl> quit
  58. $ping www.google.com
  59. ```
  60. ## Basic configuration
  61. ### Changing the beaglebone's hostname
  62. First edit the `/etc/hostname` file by:
  63. ```
  64. sudo vim /etc/hostanme
  65. ```
  66. change the first and only line in this file to reflect your new hostname.
  67. Then, edit the `/etc/hosts` file:
  68. ```
  69. 127.0.0.1 localhost
  70. 127.0.1.1 hostname.localdomain hostname
  71. # The following lines are desirable for IPv6 capable hosts
  72. ::1 localhost ip6-localhost ip6-loopback
  73. ff02::1 ip6-allnodes
  74. ff02::2 ip6-allrouters
  75. ```
  76. change the second line in both `hostname` instances for your new hostanme (must be the same previously defined).
  77. Finally, reboot your beagle or raspberry device.
  78. ### Changing the user's password
  79. To change the default user's password use:
  80. ```
  81. $ passwd
  82. Changing password for debian.
  83. Current password: temppwd
  84. New password: xxxxxxx
  85. ...
  86. ```
  87. ### Updating the system
  88. Before any further change, please update the system and packages by:
  89. ```
  90. $ sudo apt update
  91. [sudo] password for debian:
  92. Hit:1 http://deb.debian.org/debian buster InRelease
  93. Hit:2 http://deb.debian.org/debian buster-updates InRelease
  94. Hit:3 http://security.debian.org/debian-security buster/updates InRelease
  95. Hit:4 http://repos.rcn-ee.com/debian buster InRelease
  96. Reading package lists... Done
  97. Building dependency tree
  98. Reading state information... Done
  99. 17 packages can be upgraded. Run 'apt list --upgradable' to see them.
  100. $ sudo apt list --upgradable
  101. Listing... Done
  102. bb-customizations/unknown 1.20220705.6-0~buster+20220705 all [upgradable from: 1.20220513.0-0~buster+20220513]
  103. bbb.io-kernel-4.19-ti/unknown 1.20220705.0-0~buster+20220705 all [upgradable from: 1.20220628.0-0~buster+20220628]
  104. bbb.io-kernel-tasks/unknown 1.20220705.0-0~buster+20220705 all [upgradable from: 1.20220628.0-0~buster+20220628]
  105. dirmngr/oldstable 2.2.12-1+deb10u2 armhf [upgradable from: 2.2.12-1+deb10u1]
  106. gnupg-l10n/oldstable 2.2.12-1+deb10u2 all [upgradable from: 2.2.12-1+deb10u1]
  107. gnupg-utils/oldstable 2.2.12-1+deb10u2 armhf [upgradable from: 2.2.12-1+deb10u1]
  108. gnupg/oldstable 2.2.12-1+deb10u2 all [upgradable from: 2.2.12-1+deb10u1]
  109. gpg-agent/oldstable 2.2.12-1+deb10u2 armhf [upgradable from: 2.2.12-1+deb10u1]
  110. gpg-wks-client/oldstable 2.2.12-1+deb10u2 armhf [upgradable from: 2.2.12-1+deb10u1]
  111. gpg-wks-server/oldstable 2.2.12-1+deb10u2 armhf [upgradable from: 2.2.12-1+deb10u1]
  112. gpg/oldstable 2.2.12-1+deb10u2 armhf [upgradable from: 2.2.12-1+deb10u1]
  113. gpgconf/oldstable 2.2.12-1+deb10u2 armhf [upgradable from: 2.2.12-1+deb10u1]
  114. gpgsm/oldstable 2.2.12-1+deb10u2 armhf [upgradable from: 2.2.12-1+deb10u1]
  115. gpgv/oldstable 2.2.12-1+deb10u2 armhf [upgradable from: 2.2.12-1+deb10u1]
  116. libcpupower1/oldstable 4.19.249-2 armhf [upgradable from: 4.19.235-1]
  117. linux-cpupower/oldstable 4.19.249-2 armhf [upgradable from: 4.19.235-1]
  118. linux-libc-dev/oldstable 4.19.249-2 armhf [upgradable from: 4.19.235-1]
  119. $ sudo apt upgrade
  120. Reading package lists... Done
  121. Building dependency tree
  122. Reading state information... Done
  123. Calculating upgrade... Done
  124. The following packages will be upgraded:
  125. bb-customizations bbb.io-kernel-4.19-ti bbb.io-kernel-tasks dirmngr gnupg gnupg-l10n gnupg-utils gpg gpg-agent
  126. gpg-wks-client gpg-wks-server gpgconf gpgsm gpgv libcpupower1 linux-cpupower linux-libc-dev
  127. 17 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  128. Need to get 9908 kB of archives.
  129. After this operation, 69.6 kB of additional disk space will be used.
  130. Do you want to continue? [Y/n] Y
  131. ...
  132. ...
  133. ...
  134. ```
  135. now we can start to install updated packages, lets try to install the `ntp` package to synchronise the clocks of computer that we will use later:
  136. ```
  137. $ sudo apt install ntp
  138. Reading package lists... Done
  139. Building dependency tree
  140. Reading state information... Done
  141. The following additional packages will be installed:
  142. libevent-core-2.1-6 libevent-pthreads-2.1-6 libopts25 sntp
  143. Suggested packages:
  144. ntp-doc
  145. The following NEW packages will be installed:
  146. libevent-core-2.1-6 libevent-pthreads-2.1-6 libopts25 ntp sntp
  147. 0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
  148. Need to get 1092 kB of archives.
  149. After this operation, 2294 kB of additional disk space will be used.
  150. Do you want to continue? [Y/n] Y
  151. .
  152. .
  153. .
  154. ```
  155. ### Time and internet access
  156. We previously have checked the internet access to our SBC-devices, now, let us use the internet to sync our time zone and locales for the further sync of commits in the git system. Thus, let us check the time at the device by:
  157. ```
  158. $ systemctl status time-sync.target
  159. time-sync.target - System Time Synchronized
  160. Loaded: loaded (/lib/systemd/system/time-sync.target; static; vendor preset: enabled)
  161. Active: active since Wed 2022-07-06 22:06:43 CDT; 14min ago
  162. Docs: man:systemd.special(7)
  163. ```
  164. if time is wrong use the next command and follow the instructions:
  165. ```
  166. $ sudo dpkg-reconfigure tzdata
  167. ```
  168. the, the system will have the correct time now.
  169. ### SSH Key pairs
  170. To create key pairs use:
  171. ```
  172. $ ssh-keygen -t ed25519 -C "your_email@example.com"
  173. ...
  174. ...
  175. ...
  176. ```
  177. then copy the `*.pub` file generated:
  178. ```
  179. $ ssh-copy-id -i ~/.ssh/id_ed25519.pub debian@bbb-marx.local
  180. /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/gmarx/.ssh/id_ed25519.pub"
  181. /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
  182. /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
  183. Debian GNU/Linux 10
  184. BeagleBoard.org Debian Buster IoT Image 2022-07-01
  185. Support: https://bbb.io/debian
  186. default username:password is [debian:temppwd]
  187. debian@bbb-marx.local's password:
  188. Number of key(s) added: 1
  189. Now try logging into the machine, with: "ssh 'debian@bbb-marx.local'"
  190. and check to make sure that only the key(s) you wanted were added.
  191. ```
  192. ### Oh My Bash
  193. Next, to make easy work with the bash system let us install the oh-my-bash tool:
  194. ```
  195. $ bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh)"
  196. ```
  197. you can go deeper and customize the themes and plugins at [oh-my-bash](https://ohmybash.nntoan.com/)