Difference between revisions of "User Manual/1. Chordata parts/1.1. Microcomputer"

From Chordata documentation
Jump to: navigation, search
(add images)
(info to clone and compile Notochord)
Line 12: Line 12:
  
 
=== Flash the SD card ===
 
=== Flash the SD card ===
The software part of the Chordata system is composed of several programs, and most of them should be running on the SBC. The easier way to get them all, and configure them correctly, is to download our [http://web.chordata.cc/downloads/ custom linux (Raspbian based) image], and flash it to the SD card. The card can then be used to boot the raspberry with a complete running Chordata environment.
+
{{note| The software part of the Chordata system is composed of several programs, and most of them should be running on the SBC. We are working on an easier way to get them all, and configure them correctly, by just flashing a custom linux image.
This process only works on Raspberry Pis, if you want to try some different SBC, look at the end of this chapter for some advanced procedures.
+
 
 +
It will be available soon, you can take a look [[Template:Install_custom_linux_image | here]] to see how the process of installing will look like
 +
|warning}}
 +
 
 +
In order to give your SBC an operating system you have to flash it to your SD card.
  
 
The process is really simple using the dedicated tool [https://etcher.io/ Etcher], available for windows, mac and linux. Start by downloading from their webpage, and installing it.  
 
The process is really simple using the dedicated tool [https://etcher.io/ Etcher], available for windows, mac and linux. Start by downloading from their webpage, and installing it.  
  
*Download the [http://web.chordata.cc/downloads/ Chordata linux image from our web page]
+
*Download the Raspbian lite image [https://www.raspberrypi.org/downloads/raspbian/ from the official Raspberry downloads page]  
 
*Insert the SD card on your computer’s card reader.
 
*Insert the SD card on your computer’s card reader.
*On Etcher select the downloaded file, select your SD card as a destination disk and hit Flash!
+
*On Etcher select the downloaded file, select your SD card as a destination disk and hit Flash!  
 +
 
  
 
Wait until the Flash process is finished (it might take a couple of minutes), follow the instructions to unmount the card and voila! you now got a complete working system in your fingertips.  
 
Wait until the Flash process is finished (it might take a couple of minutes), follow the instructions to unmount the card and voila! you now got a complete working system in your fingertips.  
 
[[File:Etcher-gif.gif |left ]]{{clearfix}}
 
[[File:Etcher-gif.gif |left ]]{{clearfix}}
  
[[File:Notochord_banner.png |thumb| frame |Chordata notochord banner]]
 
  
If you want to test if it’s working you can put the card on the raspberry, connect it to and HDMI monitor and power it. You should see the init system log displayed, and at the end the [[:File:Notochord_banner.png |Chordata notochord banner]]. If you don’t have an HDMI monitor, in chapter 1.6 we’ll show you a different method for testing the installation.
+
If you want to test if it’s working you can put the card on the raspberry, connect it to and HDMI monitor and power it. You should see the init system log displayed, and at the end a prompt asking you to log in (the default credentials are [user:''pi'', pass:''raspberry'']. If you don’t have an HDMI monitor, in chapter 1.6 we’ll show you a different method for testing the installation.
 +
 
 +
 
 +
=== Install the Chordata Software ===
 +
The main software of the Chordata system is the [[Notochord]].
 +
During the [[Releases| Beta stage]] the recommended way to install it is to clone the git repository and compile it. Don't worry if you have never compiled a program yourself, just follow the instructions here!
 +
 
 +
Log into your Raspbian Lite, you will find yourself on a terminal environment where to issue the following commands (the ones starting with a ''#'' are comments to be readed by humans, you can ignore that ones)
  
{{note | If you prefer to impress your friends with your ninja-hacker console capacities, and your computer runs mac or linux, you can always use the old and good dd to flash your card
 
After identifying the device file for your SD card, (and probably unmounting it) you can just
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
cd <directory where the image file is>
+
#Install deps
gzip -d notochord_raspbian_0-1-0a.img.gz
+
sudo apt update
sudo dd bs=4M if=notochord_raspbian_0-1-0a.img of=<SD card device file>
+
sudo apt install i2c-tools libboost-dev libi2c-dev libxml2-utils liboctave-dev scons git vim
</syntaxhighlight> | hint}}
 
  
 +
#Clone the Notochord repo, and go to the [develop] branch (the one active during Beta-testing period)
 +
git clone https://gitlab.com/chordata/notochord.git
 +
cd notochord
 +
git checkout develop
  
=== Advanced system configuration ===
+
#Compile a debug build, using 3 cores from your raspberry (attemping to use 4 might result in an out-of-memory error)
If you want to use a different SBC, or just want to install the Chordata utilities without re flashing you SD card (why would you?), there are alternative ways of achieving the same result. If you are happy with the default method, feel free to skip the rest of this chapter
+
scons -j3 debug=1
 +
</syntaxhighlight>
  
==== Configuration scripts ====
+
or, the lazy version is this one-line command:
In the repository at http://gitlab.com/chordata/sd-card_factory you will find some configuration scripts with a unique entry point <code>notochord_OS.sh</code>. From your SBC you can use the following commands:
 
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
git clone http://gitlab.com/chordata/sd-card-factory
+
bash <(curl -sL https://gitlab.com/chordata/notochord/raw/develop/install_notochord.sh)
cd sd-card-factory
 
sudo notochord_OS.sh
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
If you are not in a raspbian system you can change the system specific configuration by tweaking the file called <code>configure.sh</code>
+
These scripts are downloading the dependencies to compile and run the Notochord. So you will need an internet connection for the to work.
Keep in mind that, for all these scripts, the dependencies are installed using <code>apt-get</code>. If you are not in a debian-based system, all of the command lines in the script that run this app should be adapted to your distribution.
+
 
We would love to see portings of the Chordata system to different SBCs, so if you are attempting to do so and have some issues please ask in the [[http://forum.chordata.cc | forum]], we’ll be there to assist you personally. If you already managed to do it, please share the steps it took you to do so in the same forum section!
+
 
 +
=== Run it===
 +
 
 +
After compiling you will find the notochord binary inside the <code>bin</code> folder.  
 +
<syntaxhighlight lang="bash">
 +
cd bin
 +
./notochord <YOUR COMPUTER'S IP ADDRESS>
 +
</syntaxhighlight>
 +
 
 +
That will run the notochord using the default <code>Chordata.xml</code> configuration file, which by default reads only one K-Ceptor with a value of ''1'' from the ''JP1'' gate on the Hub.
 +
 
 +
If you want to change the configuration file for the notochord use the <code>-c</code> flag. For example, to read a [[Default_Biped_Configuration]] you can issue:
 +
 
 +
<syntaxhighlight lang="bash">
 +
./notochord -c ../default_byped.xml <YOUR COMPUTER'S IP ADDRESS>
 +
</syntaxhighlight>
 +
 
 +
 
  
 
{{Sibling nav | {{PREVSIBLING}} | {{NEXTSIBLING}} }}
 
{{Sibling nav | {{PREVSIBLING}} | {{NEXTSIBLING}} }}

Revision as of 10:17, 8 April 2019

A Raspberry Pi 3 SBC and the Chordata Hub

We wanted Chordata to be modular and easily extensible, so instead of having a dedicated hardware to do all the sensor readings and data processing, we preferred to implement a device that can be easily found on most electronic laboratories, in which is easy to write and modify software, and is generally powerful enough to take a human being to the moon (if you think we’re exaggerating here, take a look at the specifications of the computer on board of the apollo13 ).

The main software running inside the microcomputer is called Notochord, so by extension we sometimes refer informally to the whole microcomputer as the notochord


SBC and memory card

Meet the modern SBCs: little computers no much bigger than a credit card, that can run a complete operating system with complex applications, and often give you access to regular and low-level peripherals. The most well known of these devices is the Raspberry pi. And this is the platform on which the Chordata system was built and is tested. But if you’re savvy enough, any SCB that exposes an i2c port would work (but part of the configuration might need to be changed). In order to start using Chordata you should get one of those. Chances are that either you already have one, or you have simply always desired to get your hands on them. If the latter is true, go ahead and purchase one. They don’t cost much and it will undoubtedly be an investment that you won’t regret.

The other thing you will need is a micro SD card with at least 2Gb of memory. If you are currently using your SBC for something else, our advice is to get a different SDcard in which to install the Chordata system. That way you can go back to the previous state whenever needed.

Flash the SD card

The software part of the Chordata system is composed of several programs, and most of them should be running on the SBC. We are working on an easier way to get them all, and configure them correctly, by just flashing a custom linux image.

It will be available soon, you can take a look here to see how the process of installing will look like


In order to give your SBC an operating system you have to flash it to your SD card.

The process is really simple using the dedicated tool Etcher, available for windows, mac and linux. Start by downloading from their webpage, and installing it.

  • Download the Raspbian lite image from the official Raspberry downloads page
  • Insert the SD card on your computer’s card reader.
  • On Etcher select the downloaded file, select your SD card as a destination disk and hit Flash!


Wait until the Flash process is finished (it might take a couple of minutes), follow the instructions to unmount the card and voila! you now got a complete working system in your fingertips.

Etcher-gif.gif


If you want to test if it’s working you can put the card on the raspberry, connect it to and HDMI monitor and power it. You should see the init system log displayed, and at the end a prompt asking you to log in (the default credentials are [user:pi, pass:raspberry]. If you don’t have an HDMI monitor, in chapter 1.6 we’ll show you a different method for testing the installation.


Install the Chordata Software

The main software of the Chordata system is the Notochord. During the Beta stage the recommended way to install it is to clone the git repository and compile it. Don't worry if you have never compiled a program yourself, just follow the instructions here!

Log into your Raspbian Lite, you will find yourself on a terminal environment where to issue the following commands (the ones starting with a # are comments to be readed by humans, you can ignore that ones)

#Install deps
sudo apt update
sudo apt install i2c-tools libboost-dev libi2c-dev libxml2-utils liboctave-dev scons git vim

#Clone the Notochord repo, and go to the [develop] branch (the one active during Beta-testing period)
git clone https://gitlab.com/chordata/notochord.git
cd notochord
git checkout develop

#Compile a debug build, using 3 cores from your raspberry (attemping to use 4 might result in an out-of-memory error)
scons -j3 debug=1

or, the lazy version is this one-line command:

bash <(curl -sL https://gitlab.com/chordata/notochord/raw/develop/install_notochord.sh)

These scripts are downloading the dependencies to compile and run the Notochord. So you will need an internet connection for the to work.


Run it

After compiling you will find the notochord binary inside the bin folder.

cd bin
./notochord <YOUR COMPUTER'S IP ADDRESS>

That will run the notochord using the default Chordata.xml configuration file, which by default reads only one K-Ceptor with a value of 1 from the JP1 gate on the Hub.

If you want to change the configuration file for the notochord use the -c flag. For example, to read a Default_Biped_Configuration you can issue:

./notochord -c ../default_byped.xml <YOUR COMPUTER'S IP ADDRESS>