Manual
User Manual:
Open the PDF directly: View PDF .
Page Count: 6
Download | |
Open PDF In Browser | View PDF |
GeckoBot Code Manual Lars Schiller June 21, 2018 Contents 1 Setting Up the BBB 1.1 Install OS on BBB . . . . . . . . . . . 1.2 Log in BBB for the first time . . . . . 1.3 Set LAN connection on BBB at AmP 1.4 Configure SSH Connection to BBB . . 1.5 Configure BBB Device Tree . . . . . . 1.6 Installing Software on BBB . . . . . . 1.7 Running the Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 2 2 3 4 4 5 2 Pin Layout 5 3 Auxilary 3.1 Formatting SD Card with debian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Set WiFi connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 Setup for analog inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 5 6 6 1 Setting Up the BBB 1.1 Install OS on BBB The developers of BBB embedded linux systems decided to change the device tree structure from kernel overlay (till version 8.7), to uboot overlay (9.1+). (Don’t ask me to explain). However, the PWM setup for all pins is only possible with kernel overlay (or at least I’m not able to configure it in version 9.1+). Therefore you have to use the following image: bone-debian-8.7-iot-armhf-2017-03-19-4gb.img (Download: http://beagleboard.org/latest-images) To install it on a 8GB Micro-SD Card follow the instructions: • You can use Etcher (https://etcher.io/). OR (on debian): • Instructions from: http://derekmolloy.ie/write-a-new-image-to-the-beaglebone-black/ and from: https://learn.adafruit.com/beaglebone-black-installing-operating-systems?view= all#copying-the-image-to-a-microsd • Decompress and write on SD card (need to be su and make sure the security locker of SD Adapter is in writing mode): 1 2 $ xz −d bone−debian −∗∗. img . xz $ dd i f =./bone−debian −∗∗. img o f =/dev /sdX (Here, sdX is the mounted empty uSD Card. It can be found with multiple use of the command mount or df.) 1 • Obsolete: – In order to turn these images into eMMC flasher images, edit the /boot/uEnv.txt file on the BBB and remove the # on the line with cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh. Enabling this will cause booting the microSD card to flash the eMMC. Images are no longer provided here to avoid people accidentally overwriting their eMMC flash. – Insert the SD Card in the unpowered BBB, and power it by plugging in the USB or the 5VDC supply. Wait until all 4 LED have solid lights. This can take up to 45 minutes. – Flash MicroSD 4 with: Debian 8.7 2017-03-19 4GB SD IoT from http://beagleboard.org/latest-images (MicroSD 3 is weird ...). – Insert MicroSD in (unpowered) BBB, press the USER Button, and apply power. – It will take 30-45 minutes to flash the image onto the on-board chip. Once it is done, the bank of 4 LEDs to the right of the Ethernet port will all turn off. You can then power down your BBB. 1.2 Log in BBB for the first time Assuming you are called bianca and your PC is also called bianca, your BBB is called beaglebone and the default user on BBB is called debian, then the following sythax is correct. • Connect your PC with a MicroUSB cable to the BBB. • Open a terminal and ssh into BBB as debian and then get superuser to configure the Board. 1 2 3 4 5 b i a n c a @ b i a n c a : ˜ s s h debian@192 . 1 6 8 . 7 . 2 temppwd d e b i a n @ b e a g l e b o n e : ˜ su root r o o t @ b e a g l e b o n e :˜# • Note that the default passwords are: temppwd root for debian for root 1.3 Set LAN connection on BBB at AmP This is from: https://groups.google.com/forum/#!msg/beaglebone/AS2US9rtNd4/8y0mZ3LxAwAJ • You have to configure eth0 like this: address netmask dns-nameservers gateway 134.28.136.51 (ask administrator for your personal IP) 255.255.255.0 134.28.205.14 134.28.136.1 • Plug in LAN cable. • Get the name of the LAN connection: 1 2 3 su r o o t @ b e a g l e b o n e : / e t c / network# connmanctl s e r v i c e s ∗Ac Wired ethernet 689e19b50543 cable • Using the appropriate ethernet service, tell connman to setup a static IP address for this service. Syntax: 1 connmanctl c o n f i g−−i p v 4 manual−−n a m e s e r v e r s < dns server > In our case: 1 connmanctl c o n f i g e t h e r n e t 6 8 9 e 1 9 b 5 0 5 4 3 c a b l e −−i p v 4 manual 1 3 4 . 2 8 . 1 3 6 . 5 1 2 5 5 . 2 5 5 . 2 5 5 . 0 1 3 4 . 2 8 . 1 3 6 . 1 −−n a m e s e r v e r s 1 3 4 . 2 8 . 2 0 5 . 1 4 2 • Reboot and you are done. • You can revert back to a DHCP configuration simply as follows: 1 $ sudo connmanctl c o n f i g e t h e r n e t 6 8 9 e 1 9 b 5 0 5 4 3 c a b l e −−i p v 4 dhcp 1.4 Configure SSH Connection to BBB • Source: https://askubuntu.com/questions/115151/how-to-set-up-passwordless-ssh-access-forroot-user • If your Board crashed, and you were forced to reinstall the OS, there already exist a ssh-key. This you have to remove first (this is for USB cable): 1 b i a n c a @ b i a n c a : ˜ ssh−keygen −f ”/home/ b i a n c a / . s s h / k n o w n h o s t s ” −R 1 9 2 . 1 6 8 . 7 . 2 • Generate a new key: 1 b i a n c a @ b i a n c a : ˜ ssh−keygen −f ”/home/ b i a n c a / . s s h / k e y b i a n c a ” When you are prompted for a password, just hit the enter key and you will generate a key with no password. • Allow to log in as root with a password on the server, in aim to transfer the created key to it: 1 r o o t @ b e a g l e b o n e :# nano / e t c / s s h / s s h d c o n f i g Make sure you allow root to log in with the following syntax 1 2 PermitRootLogin y e s PasswordAuthentication yes Restart the ssh-server: 1 r o o t @ b e a g l e b o n e :# s e r v i c e s s h r e s t a r t • Now you are able to transfer the key to the server: 1 b i a n c a @ b i a n c a : ˜ ssh−copy−i d − i /home/ b i a n c a / . s s h / k e y b i a n c a root@192 . 1 6 8 . 7 . 2 • Check if its work: 1 b i a n c a @ b i a n c a : ˜ s s h root@192 . 1 6 8 . 7 . 2 • Now disable root login with password on server (for saftey): 1 r o o t @ b e a g l e b o n e :# nano / e t c / s s h / s s h d c o n f i g And modify the Line: 1 2 PermitRootLogin without−password PasswordAuthentication yes This will allow to login as root with valid key, but not with a password. All other users can further login with a password. Restart the ssh-server and you are done: 1 r o o t @ b e a g l e b o n e :# s e r v i c e s s h r e s t a r t 3 1.5 Configure BBB Device Tree In order to enable P9.28 as pwm pin, you have to load cape-universala. This you gonna do in /boot/uEnv.txt: • source: https://groups.google.com/forum/#!topic/beagleboard/EYSwmyxYjdM • /boot/uEnv.txt should be looking something like this: r o o t @ b e a g l e b o n e :# c a t / boot /uEnv . t x t | g r e p −v ”#” 1 uname r =4.4.54 − t i −r 9 3 c m d l i n e=c o h e r e n t p o o l =1M q u i e t c a p e u n i v e r s a l=e n a b l e 3 4 Edit it with: r o o t @ b e a g l e b o n e :# nano / boot /uEnv . t x t 1 Add the following lines, such that /boot/uEnv.txt looks like: r o o t @ b e a g l e b o n e :# c a t / boot /uEnv . t x t | g r e p −v ”#” 1 uname r =4.4.54 − t i −r 9 3 dtb=am335x−b o n e b l a c k −o v e r l a y . dtb c m d l i n e=c o h e r e n t p o o l =1M q u i e t c a p e u n i v e r s a l=e n a b l e c a p e e n a b l e=bone capemgr . e n a b l e p a r t n o=cape−u n i v e r s a l a 3 4 5 6 • Reboot and you should be able to configure with: r o o t @ b e a g l e b o n e :# c o n f i g −p i n P9 28 pwm 1 Note: • In debian-elinux-version-9.1+ the /boot/uEnv.txt looks like: 1 3 4 5 6 r o o t @ b e a g l e b o n e :# c a t / boot /uEnv . t x t | g r e p −v ”#” uname r =4.9.82 − t i −r 1 0 2 e n a b l e u b o o t o v e r l a y s =1 e n a b l e u b o o t c a p e u n i v e r s a l =1 c m d l i n e=c o h e r e n t p o o l =1M n e t . i f n a m e s=0 q u i e t If you see this, you may want to find a way to enable all the pins. I failed. Robert C Nelson seems to be the only one, who has an idea whats going on... https://elinux.org/Beagleboard:BeagleBo neBlack Debian#U-Boot Overlays 1.6 Installing Software on BBB In order to run the GeckoBot software on the BBB install following packages: • on BBB as su 1 2 3 4 5 6 7 8 9 11 12 13 r o o t @ b e a g l e b o n e :# r o o t @ b e a g l e b o n e :# r o o t @ b e a g l e b o n e :# r o o t @ b e a g l e b o n e :# r o o t @ b e a g l e b o n e :# r o o t @ b e a g l e b o n e :# r o o t @ b e a g l e b o n e :# r o o t @ b e a g l e b o n e :# r o o t @ b e a g l e b o n e :# apt−get update apt−get i n s t a l l n t p d a t e n t p d a t e p o o l . ntp . o r g apt−get i n s t a l l b u i l d −e s s e n t i a l python−dev python−p i p −y p i p i n s t a l l −−upgrade p i p p i p i n s t a l l Adafruit BBIO p i p i n s t a l l Adafruit GPIO pip i n s t a l l termcolor p i p i n s t a l l numpy r o o t @ b e a g l e b o n e :˜# mkdir Git r o o t @ b e a g l e b o n e :˜# cd Git r o o t @ b e a g l e b o n e : ˜ / Git/# g i t c l o n e h t t p s : / / g i t h u b . com/ l a r s l e v i t y / GeckoBot . g i t 4 1.7 Running the Code To run the geckobot code: • on BBB as su 1 2 r o o t @ b e a g l e b o n e :˜# cd Git / GeckoBot /Code r o o t @ b e a g l e b o n e : ˜ Git / GeckoBot /Code/# python s e r v e r h a r d w a r e c o n t r o l l e d . py 2 Pin Layout Figure 1: Pin layout of BBB The following pins were used, where Fx means foot x and y means leg or belly y: Table 1: Used pins (Outdated) P8-7 F1 P8-8 F2 P8-9 F3 P8-10 F4 P8-13 2 P8-19 1 P9-1 VDD P9-5 GND P9-14 6 P9-16 5 P9-19 I2C-SCL P9-20 I2C-SDA P9-21 4 P9-22 3 3 Auxilary 3.1 Formatting SD Card with debian • Source: https://www.techwalla.com/articles/how-to-format-an-sd-card-in-debian-linux 5 • Determine location of SDCard (in the following called: /dev/mmcblk0p2) and directory where it is mounted (in the following called: /media/SDCard): 1 2 su df • Unmount, format, and remount: 1 2 3 umount / dev /mmcblk0p2 mkdosfs / dev /mmcblk0p2 −F16 mount / dev /mmcblk0p2 / media /SDCard • For formatting SD with more than one partition, use: 1 c f d i s k / dev /mmcblk0 and follow the instructions. 3.2 Set WiFi connection • Order WiFi Antenna TP-LINK WLAN LITEN HI.G USB ADA. WN722N from somewhere. • Complete this tuturial ... 3.3 Setup for analog inputs • https://groups.google.com/forum/#!topic/beagleboard/Lk3vWNIExiQ • Insert in command line on BBB: 1 su apt−g e t i n s t a l l bb−cape−o v e r l a y s 3 cd / opt / source /bb . org−o v e r l a y s 5 . / dtc−o v e r l a y . sh 7 . / i n s t a l l . sh 9 sudo sh −c ” echo ’BB−ADC’ > / s y s / d e v i c e s / p l a t f o r m / bone capemgr / s l o t s ” • Reboot. • For readout the ADC input Pins from python: https://learn.adafruit.com/setting-up-io-pythonlibrary-on-beaglebone-black/adc 6
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.5 Linearized : No Page Count : 6 Page Mode : UseOutlines Author : Title : Subject : Creator : LaTeX with hyperref package Producer : pdfTeX-1.40.18 Create Date : 2018:06:21 16:52:15+02:00 Modify Date : 2018:06:21 16:52:15+02:00 Trapped : False PTEX Fullbanner : This is MiKTeX-pdfTeX 2.9.6300 (1.40.18)EXIF Metadata provided by EXIF.tools