Skip to content

Instantly share code, notes, and snippets.

@uraimo
uraimo / bananapi_m3_sd.md
Created April 29, 2017 10:26
How to enable the SD card insertion detection on a Banana Pi M3

Once you dd the image they provide, you'll notice that you can only boot from eMMC when the SD is not inserted and if you inser it after boot, the system doesn't even discover the devices.

There is an easy fix for this.

At boot, uBoot looks for /boot/bananapi/bpi-m3/linux/uEnv.txt and loads /boot/bananapi/bpi-m3/linux/script.bin that contains additional configuration, like how to manage the SD, in binary format.

You just need to follow a few simple steps to enable SD discovery after boot (there is a way to boot from the boot partition on the SD and then load the OS from eMMC but I didn't have time to experiment with that).

Keybase proof

I hereby claim:

  • I am uraimo on github.
  • I am uraimo (https://keybase.io/uraimo) on keybase.
  • I have a public key ASB3_Fgns26IOoIg0jNmT2xC0bb1qeHwyAmDRXAX8OInpAo

To claim this, I am signing this object:

  1. Use a cp2102 usb-to-uart adapter or something similar

  2. Cross-connect to the first three pins of the first column of the right header: GND,TX,RX.

  3. Connect with minicom to the usb device, 115200,no parity,8 bits, 2 stop bits

@uraimo
uraimo / ubuntu_mate_on_raspberrypi_macos.md
Last active January 10, 2018 08:58
How to install ubuntu mate on an SD for RaspberryPi

Install xz with homebrew:

brew install xz

Insert the SD and get the device name for the SD with df:

Filesystem    512-blocks      Used Available Capacity iused      ifree %iused  Mounted on
/dev/disk1     487867392 157859992 329495400    33% 2352643 4292614636    0%   /
devfs                373       373         0   100%     647          0  100%   /dev
map -hosts             0         0         0   100%       0          0  100%   /net
pi@raspberrypi:~ $ apt list --installed
Listing... Done
acl/stable,now 2.2.52-2 armhf [installed]
adduser/stable,now 3.113+nmu3 all [installed]
alsa-utils/stable,now 1.0.28-1 armhf [installed,automatic]
apt/stable,now 1.0.9.8.4 armhf [installed]
apt-listchanges/stable,now 2.85.13+nmu1 all [installed]
apt-utils/stable,now 1.0.9.8.4 armhf [installed]
aptitude/stable,now 0.6.11-1 armhf [installed]
aptitude-common/stable,now 0.6.11-1 all [installed]
@uraimo
uraimo / swift3_raspbian_may2016
Last active March 22, 2017 13:08
How to use new joe's builds of Swift3 on a Raspberry with raspbian may 2016
sudo vim /etc/apt/sources.list
# replace every occurence of jessie with stretch (it's the upcoming Debian 9)
sudo apt-get update (don't upgrade!)
sudo apt-get install libicu-dev
#undo the changes to sources.list, update again
@uraimo
uraimo / digitalocean_swiftbuild.sh
Created June 30, 2016 12:54
digitalocean_swiftbuild.sh
#!/bin/sh
YOU="%%%%%YOUR GIT USERNAME HERE%%%%%"
## Use with a droplet and Ubuntu 15+
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git vim cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libblocksruntime-dev
sudo apt-get clean; sudo apt-get autoremove; sudo apt-get purge
import Glibc
var sz = winsize()
let res = ioctl(0, UInt(TIOCGWINSZ),&sz)
print("Screen width: ", sz.ws_col, "Screen height: " ,sz.ws_row)

Last update: 5/18

C.H.I.P.

Just use nmtui.

RaspberryPis

On recent ubuntus (16.04+) with the new net interfaces mac rename thingy, disable it to get back to the old naming scheme with:

@uraimo
uraimo / pimoroni_unicornhat_nulsom_rainbow_matrix.markdown
Created March 5, 2016 20:46
Using the Pimoroni Unicorn Hat python library with a Nulsom 8x8 Led matrix

The Nulsom rainbow matrix is compatible with the Pimoroni unicorn hat Raspberry Pi library but needs a few modifications. Tested on a Raspberry 2.

Connections

Connect the matrix 5V and GND to the Raspberry, connect the DI pin to P18.

Modifications

Install the unicorn hat library with \curl -sS get.pimoroni.com/unicornhat | bash.