Linux Image
Opal Kelly has assembled an operating system boot image based on Linux. The image is intended to be small and rather minimal, but does contain some helpful tools. Additional tools may be added to the image by rebuilding the image from sources using Yocto. An abridged list of tools installed in this image is:
- Git
- OpenSSH
- Lighttpd web server
Writing an Image to SD
Writing a new image to the SD card is a low-level operation that usually requires command line usage or specialized applications that are not typically installed in Windows or macOS. This section is intended to be helpful but not necessarily comprehensive.
Brain-1 SD images can be found in its GitHub repositories releases.
macOS and Windows
We recommend using Etcher or similar tools. It’s free. It’s graphical. It works.
Linux
- Determine the filesystem name corresponding to your SD card. One way to do this is to use the
lsblk
command before and after attaching your SD reader. The new filesystem in the listing will correspond to your SD card. It will have a name like “/dev/mmcblk0
“. - On the command line, copy the image to the disk using the commands below. This will take a couple minutes or longer.
# replace mmcblk0 in the command below with your SD card device.
sudo dd bs=4096 if=sdimage.bin of=/dev/mmcblk0
sudo sync
Code language: PHP (php)
Brain-1 Filesystem
We created a GitHub repository to collect several files in root’s home directory. You can use this to keep up to date on the contents of this folder as we may make some changes from time to time as we add capability. Notably, this directory contains the Brain-1 website files (/home/root/brain-fs/www
).
To update the contents, use the command line:
cd /home/root/brain-fs
git pull
USB Ethernet Gadget IP Address
When operating as a USB ethernet gadget to a host computer, the IP address is fixed at 192.168.7.1. You can change this by editing two files on the Brain-1:
/etc/network/interfaces
/etc/udhcpd.conf
Software Tools
Some helpful software tools we’ve included with the Brain-1.
smartvio
This is a command line utility that can be helpful in setting VIO voltages to the peripherals. Here’s the command line usage information:
Usage: smartvio [option [argument]] <i2c device>
<i2c device> is required for all commands. It must contain the
path to the Linux i2c device
Exactly one of the following options must be specified:
-r - run smartVIO, queries attached pods and sets voltages accordingly
-s - set VIO voltages to the values provided by -1 and -2 options
-h - print this text
-w <filename> - write a binary DNA to a pod, takes the DNA filename
as an argument
-d <filename> - dump the DNA from a pod to a binary file, takes the
DNA filename as an argument
The following options may be used in conjunction with the above options:
-1 <vio1> - Sets the voltage for VIO1
-2 <vio2> - Sets the voltage for VIO2
<vio1> and <vio2> must be specified as numbers in 10's of mV's
-p <pod number> - Specifies the pod number for the -w or -d options
Examples:
Run SmartVIO solver:
smartvio -r /dev/i2c-1
Dump DNA from the pod on Port 1:
smartvio -d dna_file.bin -p 1 /dev/i2c-1
Set VIO1 to 3.3V:
smartvio -s -1 330 /dev/i2c-1
Code language: HTML, XML (xml)