- you put together the hardware
- you download the code from https://github.com/petrum/rpi
- you prepare a local file with the WI-FI details
- you run an installation script (provided) that will setup the micro SD card
- you insert in the micro SD card in raspberry pi, power up and enjoy!
Buy the components:
- raspberry pi zero
- 8 Gb micro SD card
- wi-fi usb dongle
- two '4 in 1' MAX7219 LED dot matrix arrays
- micro USB cable
- power supply
- soldering tools
- jumper wires (they could come with the MAX7219)
- you solder together the 2 LED arrays (in a chain, the out of one is the in of the other )
- you solder the pins on the raspberry pi zero (for help check the 'GPIO pin-outs' section https://github.com/rm-hull/max7219)
- you connect the input pins of one array with the raspberry pi
Board Pin Name Remarks RPi Pin RPi Function
1 VCC +5V Power 2 5V0
2 GND Ground 6 GND
3 DIN Data In 19 GPIO 10 (MOSI)
4 CS Chip Select 24 GPIO 8 (SPI CE0)
5 CLK Clock 23 GPIO 11 (SPI CLK)
You get the source code from github.com.
The code consists in a few bash scripts, and some Python code:
petrum@nuc ~$ mkdir github
petrum@nuc ~$ cd github/
petrum@nuc ~/github$ git clone https://github.com/petrum/rpi.git
Cloning into 'rpi'...
remote: Counting objects: 862, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 862 (delta 4), reused 0 (delta 0), pack-reused 848
Receiving objects: 100% (862/862), 4.43 MiB | 0 bytes/s, done.
Resolving deltas: 100% (517/517), done.
Checking connectivity... done.
petrum@nuc ~/github$ ls -ltr
drwxrwxr-x 9 petrum petrum 4096 Oct 12 06:57 rpi
petrum@nuc ~/github$ cd rpi/weather2/
The installation script (rpi/weather2/install.sh) refers to the local ~/rpi-private/wpa_supplicant.conf.
You'll have to create this file (using rpi/net/wpa_supplicant.conf
as a template), and type in your WI-FI details.
Note: After installation (step #4) this file
should be available on the micro SD card, on the /boot FAT partition.
(so you can easily edit it even from a Windows laptop when you need to change the WI-FI details)
You need to download locally a recent version of the Raspbian OS.
Go to https://www.raspberrypi.org/downloads/raspbian/ and download the Raspbian Jessie Lite version.
Note: you have to edit the rpi/weather2/install.sh script with your local image location.
Insert a micro SD card into your Linux desktop, cd to rpi/weather2 folder, and run the install.sh script.
The script will detect the memory card, and ask you for a confirmation if you want to proceed.
Please really pay attention at this step: the script will next use the 'dd' command to write the OS image file to the memory card.
Writing to the wrong card/disk could be disastrous!
(some say 'dd' stands for... disk destroyer!)
petrum@nuc ~/github/rpi/weather2[master]$ ./install.sh
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 447.1G 0 disk
├─sda1 8:1 0 156M 0 part /boot/efi
├─sda2 8:2 0 16G 0 part [SWAP]
├─sda3 8:3 0 39.5G 0 part /
└─sda4 8:4 0 391.5G 0 part /home
sdb 8:16 1 7.4G 0 disk
├─sdb1 8:17 1 63M 0 part /media/petrum/boot
└─sdb2 8:18 1 1.2G 0 part /media/petrum/3598...61dff1d
Using 'sdb'... Please confirm: [y/N]
Make sure there are no errors.