Skip to content

Commit 711ab4a

Browse files
committed
Merge branch 'master' of github.com:HumanDynamics/openbadge-hub-py
2 parents f2222d0 + 6f4d367 commit 711ab4a

File tree

1 file changed

+52
-7
lines changed

1 file changed

+52
-7
lines changed

README.md

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ Connect to raspberry pi, and run the following commands:
9797
* ssh pirate@badgepi-xx
9898
* change your password using passwd
9999
* change the timezone using sudo dpkg-reconfigure tzdata
100-
* sudo apt-get update
101-
* sudo apt-get upgrade
100+
* DO NOT RUN update & upgrade before installting docker. It causes issues (sudo apt-get update && sudo apt-get upgrade -y)
102101

103102
Double check that your hubs sync their time with a NTP server. Unsync clocks will lead to data corruption and loss
104103

@@ -119,7 +118,7 @@ flash --device /dev/mmcblk0 2017-04-10-raspbian-jessie-lite.img
119118

120119
Now, we'll need to turn on SSH and change the hostname. We'll do that by altering the following files on the SD card:
121120
* First, mount the boot partition and main partition
122-
* Create a file call "ssh" under the book partition
121+
* Create a file call "ssh" under the boot partition
123122
* Edit /etc/hostname in the main partition and replace "raspberrypi" with your hostname
124123
* Unmonut both partitions
125124

@@ -139,10 +138,9 @@ ssh pi@badgepi-xx sudo sed -i \'s/ID=raspbian/ID=debian/g\' /etc/os-release
139138
Connect to raspberry pi, and run the following commands:
140139
* ssh pi@badgepi-xx
141140
* change your password using passwd
142-
* extend the file system (sudo raspi-config , Advanced -> Expand filesystem), then reboot
143-
* change the timezone using sudo dpkg-reconfigure tzdata
144-
* sudo apt-get update
145-
* sudo apt-get upgrade
141+
* extend the file system (sudo raspi-config --expand-rootfs), then reboot
142+
* change the timezone (sudo dpkg-reconfigure tzdata)
143+
* DO NOT RUN update & upgrade before installting docker. It causes issues (sudo apt-get update && sudo apt-get upgrade -y)
146144

147145
Double check that your hubs sync their time with a NTP server. Unsync clocks will lead to data corruption and loss
148146

@@ -159,6 +157,11 @@ Use docker-machine to setup Docker on your raspberry pi (it will use your SSH ke
159157
docker-machine create --engine-storage-driver=overlay --driver generic --generic-ssh-user pi --generic-ip-address badgepi-xx.yourdomain.com badgepi-xx
160158
'''
161159

160+
Note - in the latest docker version (true for 2017/07/07), there's a bug. Try adding the following to the create command:
161+
'''
162+
--engine-install-url=https://web.archive.org/web/20170623081500/https://get.docker.com
163+
'''
164+
162165
Make the new machine the active machine:
163166
```
164167
eval $(docker-machine env badgepi-xx)
@@ -226,6 +229,48 @@ sudo make install
226229
For Raspbian, you can follow the procedure described in stackexchange (http://raspberrypi.stackexchange.com/questions/39254/updating-bluez-5-23-5-36)
227230
and install a newer version of BlueZ from the stretch sources
228231

232+
## How to set the keyboard to a English-US layout
233+
Go to Localization options, then:
234+
235+
Locale -> remove en_GB, add en_US.UTF-8, then choose enUS.UTF-8 as default
236+
237+
Keyboard layout -> choose a generic keyboard -> in the next list you'll see only UK keyboards. Go down and choose "other" -> Choose English (US) -> Choose English (US) agian
238+
239+
## Notes on how to create an image and copying it on multiple hubs
240+
Ingeneral, follow the instructions on how to setup a regular hub, except:
241+
* Do not expand the file system. It seems that HypriotOS and Jessie both expand it automatically. So in order to turn it off, edit /boot/boot/cmdline.txt and remove the call to init=/usr/lib/raspi-config/init_resize.sh
242+
* Istead, use fdisk to extend it to a smaller partition. You can find more infomration here - http://www.raspberry-projects.com/pi/pi-operating-systems/raspbian/troubleshooting/expand-filesystem-issues . In general:
243+
* sudo fdisk /dev/mmcblk0
244+
* Then press 'p' to see the current partitions on the disk
245+
* Now delete the 2nd partition (it won't actually delete the data on it)
246+
* Press 'd' > Enter
247+
* Press '2' > Enter
248+
* Now re-create it:
249+
* Press 'n' > Enter
250+
* Press 'p' > Enter
251+
* Press '2' > Enter
252+
* Enter the First sector and the same value as the original /dev/mmcblk0p2 partition
253+
* Set the new size. I used +3G to create a 3GB partition (you'll need some space for building the hub images)
254+
* Now press 'p' > Enter to see the new partition setup.
255+
* Finally press 'w' > Enter to write it
256+
* Now reboot: sudo shutdown -r now
257+
* Once its back do the resize: sudo resize2fs /dev/mmcblk0p2
258+
* Use docker-machine to install docker dependencies, etc
259+
* Then run update & upgrade
260+
261+
Then save the image
262+
* See this post for information - https://raspberrypi.stackexchange.com/questions/8305/how-to-make-an-image-img-from-whats-on-the-sd-card-but-as-compact-as-the-or
263+
* make sure partitions are unmounted
264+
* sudo fdisk -l /dev/mmcblk0
265+
* sudo dd if=/dev/mmcblk0 of=openbadge-hub-py.img bs=512 count=<END of second partition + 1>
266+
267+
Burn image into a new SD card
268+
* Use dd, flash or Etcher.io
269+
270+
After you create a copy, make sure to:
271+
* Change the hostname
272+
* Extend the filesystem
273+
229274
## Old instructions on setting up a Raspberry Pi with Raspbian
230275
Download the Raspbian lite (e.g. 2017-04-10-raspbian-jessie-lite.img) the the offical site.
231276

0 commit comments

Comments
 (0)