Diferencia entre revisiones de «Mini-PI»

De WikiRobotics
Saltar a: navegación, buscar
(Raspberry-PI)
(Raspberry-PI)
Línea 59: Línea 59:
 
  #* '''sudo diskutil unmount /dev/disk3s1'''
 
  #* '''sudo diskutil unmount /dev/disk3s1'''
 
  #* ''(or: open Disk Utility and unmount the partition of the SD card (do not eject it, or you have to reconnect it)
 
  #* ''(or: open Disk Utility and unmount the partition of the SD card (do not eject it, or you have to reconnect it)
  # Using the device name of the partition work out the raw device name for the entire disk, by omitting the final "s1" and replacing "disk" with "rdisk" ('''this is very important:''' you '''will''' lose all data on the hard drive on your computer if you get the wrong device name). Make sure the device name is the name of the whole SD card as described above, not just a partition of it (for example, rdisk3, not rdisk3s1. Similarly you might have another SD drive name/number like rdisk2 or rdisk4, etc. -- recheck by using the '''df -h''' command both before & after you insert your SD card reader into your Mac if you have any doubts!):
+
  # Using the device name of the partition work out the raw device name for the entire disk, by omitting the final "s1" and replacing "disk" with "rdisk"  
 +
('''this is very important:''' you '''will''' lose all data on the hard drive on your computer if you get the wrong device name). Make sure the device name
 +
  is the name of the whole SD card as described above, not just a partition of it (for example, rdisk3, not rdisk3s1. Similarly you might have another  
 +
SD drive name/number like rdisk2 or rdisk4, etc. -- recheck by using the '''df -h''' command both before & after you insert your SD card reader into  
 +
your Mac if you have any doubts!):
 
  #* For example, '''/dev/disk3s1''' => '''/dev/rdisk3'''
 
  #* For example, '''/dev/disk3s1''' => '''/dev/rdisk3'''
 
  # In the terminal write the image to the card with this command, using the raw disk device name from above (read '''carefully''' the above step, to be sure you use the correct rdisk# here!):
 
  # In the terminal write the image to the card with this command, using the raw disk device name from above (read '''carefully''' the above step, to be sure you use the correct rdisk# here!):
 
  #* '''sudo dd bs=1m if=~/Downloads/2012-10-28-wheezy-raspbian/2012-12-16-wheezy-raspbian.img of=/dev/rdisk3'''
 
  #* '''sudo dd bs=1m if=~/Downloads/2012-10-28-wheezy-raspbian/2012-12-16-wheezy-raspbian.img of=/dev/rdisk3'''
 
  #* if the above command report an error(dd: bs: illegal numeric value), please change bs=1M to bs=1m
 
  #* if the above command report an error(dd: bs: illegal numeric value), please change bs=1M to bs=1m
  #* (note that dd will not feedback any information until there is an error or it is finished, information will show and disk will re-mount when complete. However if you are curious as to the progresss - ctrl-T (SIGINFO, the status argument of your tty) will display some en-route statistics).
+
  #* (note that dd will not feedback any information until there is an error or it is finished, information will show and disk will re-mount when complete. However if you are curious as to the  
 +
progresss - ctrl-T (SIGINFO, the status argument of your tty) will display some en-route statistics).
 
  # After the dd command finishes, eject the card:
 
  # After the dd command finishes, eject the card:
 
  #* '''sudo diskutil eject /dev/rdisk3'''  
 
  #* '''sudo diskutil eject /dev/rdisk3'''  

Revisión del 07:10 12 may 2013

Raspberry PI

Introduction

The scope of this page is to document the Mini-PI robot.

Mini-PI stands off:

  • Mini: The simplest robot: Miniskybot
  • PI: Raspberry-PI: cheapest Linux PC

The intend is to build a robot, very simple, using 3D printer, and with the Raspeberry-PI as main processor (CPU).

I will start writing here the steps i am following to do it. I have been so many years without building a robot, and now, i feel excited about it. During these years i have been following all Juan's publications, and i will take advantage of all of them: 3D printers, python, Skymega, ...

About me: I am living in California now, that is one of the reasons i am writing this in english, another, is because i would like to present this in my son's school. They knew about my background in robotics and they would like me to present something. They have a strong team in Lego Mindstorms... let's see what i can do!!

Raspberry-PI

The main webs of Raspberry PI are http://www.raspberrypi.org and http://elinux.org/R-Pi_Hub. The board was originally developed as an educational project, and has became very popular during 2012. I recommend to read this note from the authors.

I decided to use it because several reasons:

  • It is cheap
  • It is well documented
  • It is broadly used
  • It has an easy hardware
  • It has a GPIO bus with (IO, I2C, SPI, UART), and of course USB, ETH, ...
  • Supports Debian Linux

So, after having used a lot of embedded kits (TI DMVA2, DM368, Hi3516, Freescale, Versalogic, DM667, ...) i found this kit really interesting for building low cost robotic applications. It took me a while to find the right moment to start, but once i did it, i was surprised about how fast and easy was to set up everything.

I bought the Raspberry-PI here: http://www.alliedelec.com/images/products/mkt/pb/rasp/rasp.aspx

There are two models A and B. In my case i bought the B because i wanted it to have Ethernet on the board. Option A is not a bad idea, for example if you want to have Wifi then, instead of buying the model B that has the ETH, you can buy the model-A (cheaper) and a USB-Wifi-Dongle...

The first thing i did was to flash the SDcard. I followed the following links:

In my case i have used Whezzy as the distribution (the recommended for beginners), and i followed the instructions for MacOS users, and since i am a little bit old i decided to use the command line option. I didn't try the graphical tools, but i am pretty sure that they work and are as easy as the command line method. Once i got the SDcard flashed i put it in the raspberry-PI (model B) and it booted without any problem.

These are the instructions from Raspberry (Using command line tools (2)

Note: Some users have reported issues with using Mac OS X to create SD cards.  
#These commands and actions need to be performed from an account that has administrator privileges.
# Download the image from a mirror or torrent
#* http://www.raspberrypi.org/downloads
# Verify if the the hash key is the same (optional), in the terminal run: 
#* shasum ~/Downloads/2012-12-16-wheezy-raspbian.zip
# Extract the image:
#* unzip ~/Downloads/2012-12-16-wheezy-raspbian.zip
#* (or: just double click the zip, it will extract automatically)
# From the terminal run df -h
# Connect the SD card reader with the SD card inside
# Run df -h again and look for the new device that wasn't listed last time. Record the device name of the filesystem's partition, for example, /dev/disk3s1
# Unmount the partition so that you will be allowed to overwrite the disk:
#* sudo diskutil unmount /dev/disk3s1
#* (or: open Disk Utility and unmount the partition of the SD card (do not eject it, or you have to reconnect it)
# Using the device name of the partition work out the raw device name for the entire disk, by omitting the final "s1" and replacing "disk" with "rdisk" 
(this is very important: you will lose all data on the hard drive on your computer if you get the wrong device name). Make sure the device name
 is the name of the whole SD card as described above, not just a partition of it (for example, rdisk3, not rdisk3s1. Similarly you might have another 
SD drive name/number like rdisk2 or rdisk4, etc. -- recheck by using the df -h command both before & after you insert your SD card reader into 
your Mac if you have any doubts!):
#* For example, /dev/disk3s1 => /dev/rdisk3
# In the terminal write the image to the card with this command, using the raw disk device name from above (read carefully the above step, to be sure you use the correct rdisk# here!):
#* sudo dd bs=1m if=~/Downloads/2012-10-28-wheezy-raspbian/2012-12-16-wheezy-raspbian.img of=/dev/rdisk3
#* if the above command report an error(dd: bs: illegal numeric value), please change bs=1M to bs=1m
#* (note that dd will not feedback any information until there is an error or it is finished, information will show and disk will re-mount when complete. However if you are curious as to the 
progresss - ctrl-T (SIGINFO, the status argument of your tty) will display some en-route statistics).
# After the dd command finishes, eject the card:
#* sudo diskutil eject /dev/rdisk3 
#* (or: open Disk Utility and eject the SD card)
# Insert it in the Raspberry Pi, and have fun


The first think i saw was the raspi-config tool. The first time i didn't change anything, but once i finish investigating the X-options, i decided to turn off the X-Windows. I am going to run console programs and i will use ssh to connect with the raspberry-PI. In other words, there is no need to have it running now.

Connecting Sensors

Well, now that i have the CPU up and running, i am going to start adding the sensors and motors. The list of sensors i have is:

  • Ultrasonic (I2C)
  • Inclinometer (Analog)
  • Compas (I2C)

Motors

  • Futaba S3003
  • Robbe
  • Hittec

Output

  • Display: 2C, 16*4 lines
  • LED
  • Relay
  • TTL3v3 to Bluetooth link.


Almost all these sensors and actuators can be connected directly to the Raspberry-Pi, however, since it has an I2C bus, i want to explore connecting the Skymega as well. By doing this, i could have some others sensors connected using the A/D, and i could take advantage of using a micro for some tasks. It is too early to make decisions, now is time to explore everything.

Before starting, let's go to take a look to the RPI's hardware.

Design

Authors

Links

Licencia

Cc logo.png This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 Spain License.

Noticias

  • 11/Mayo/2013: Creation of the page