I roughly put together most of the electronic parts needed to make the robot drive. The video shows operation of the two motors through my cellphone using Bluetooth. Also I added basic playback of PCM audio files through a speaker I connected to the Propeller. The audio is a must to play back the typical R2D2 sounds later on . On the cellphone I use a simple keyboard interface created with Bluetooth SPP.
The driver offers methods to operate each motor individually or both motors together (by sending the same command to each, or sending a different command to each).
Since R2D2 from StarWars is very popular with my kids these days, I started working on a tin can robot which looks something like R2D2 and is remote controllable through a Android device (cell phone, tablet, ..).
The body is made from a can which originally was for coffee. As you can see in the pictures below, I sanded the whole can, since I plan to re-paint it later on. For the legs I used some u-shaped pieces of aluminium I found in my shop. To each leg I added a gear motor with a small wheel. The wheels fit perfectly inside the u-shaped aluminium legs. Beside the to motored legs, which I mounted to the left and right of the can, I used a small roll which I attached on the bottom of the can.
To drive the motors, I use a TB6612FNG motor controller which is operated through a Parallax Propeller Quickstart board. The commands to operate the motors are received through a BTBee. On the Propeller I use my PROPSHELL code to parse what was received from the BTBee. To send commands, I currently use my cell phone with Bluetooth SPP app. With this setup, I am currently able to remotely drive the robots motors. Next step will be to put all the stuff into the can, adding batteries, and see how the thing behaves while driving.
I uploaded (and also on OBEX) a little SPIN script for the Parallax Propeller which helps in creating shells using the serial line. It is meant for both: interactive shells operated by a human, or shells used in machine to machine communication. The setup I currently use for this is a Propeller Quickstart Board with a BTBee connected to pins 0 and 1. Then I connect to the BTBee with my smart phone using BlueTerm (with local echo enabled) for the human to machine comunication, and Bluethooth SPP to simulate M2M communication.
I uploaded the Kernel module examples I wrote some time ago to git. The project is setup in a way, that it will build the modules for the Pi as a target, but they should run on different platforms as well (if compiled the right way).
The following examples are included:
- kmod-basic: Most basic Kernel module
- kmod-clarg: How to pass command-line arguments to modules
- kmod-gpio_inpirq: Use GPIO-interrupts
- kmod-gpio_inpthrd: Use Kernel threads to process interrupts
- kmod-gpio_outptask: Use a task to blink some LED
- kmod-gpio_outptimer: Use a timer to blink some LED
- kmod-gpio_output: Basic GPIO output example
- kmod-pdev: Basic platform device example
- kmod-tasklet: How to use a tasklet
Documentation is pretty poor yet (looks like: no more train-rides, no more documentation). To see how to compile the examples see the projects README.
Some more information on the subjects covered in the examples could be found here:
- Platform Devices explained in the Kernel documentatin
- Platform Devices explained on lwn.net
- Cross Compile (Kernel) on the Pi
- sysfs example (C-Source)
- The Kernels GPIO interface
Since flashing an image to the Cubieboard using the provided LiveSuite sucks so much (actually the only thing the Linux 32 bit version does is killing the contents of your NAND), I was looking for an other way to get a decent OS on the NAND of that board.
By decent OS I mean Debian or something like that, not Android. After some search, I came across Cubian which is a minimal Debian 7.0 image for the Cubieboard using one of the latest Sunxi Kernels (3.4.43),
unlike others who only offer corrupted gnuzip images (come on, how hard is it?). Update: retried the downloads today, worked (still not sure what prevented the gzips earlier from being downloaded correctely).
The image also comes with a NAND installer script which copies the SD-Card image to NAND. Anyways, the image comes with some minor strangeness which could be easily fixed (I will describe how just in a few seconds).
Getting the Image
Putting the Image on SD-Card
A 4GB SD-Card is needed. To unzip and write the image do the following (replace /dev/sdc with the path to your SD-card device, also make sure it is not mounted):
bunzip Cubian-base-r2-arm.img.bz2 dd if=Cubian-base-r2-arm.img of=/dev/sdc bs=4M
First Boot, First Strangeness
Put the SD into the board and power it up. Green blinking LED indicates bootprocess, then the blue led is starting to flash, actuelly it is trying to tell you the last three digits of the IP the board received from your DHCP in morse code. Nevertheless, at the moment the blue LED starts flashing, you are ready to connect to the board through ssh.
First Login, Second Strangeness
Now, you could use ssh to login to the board. But for some reason ssh daemon is NOT listening on the default port but on port 36000 (we will fix that later too). Thus, one needs to connect like so:
ssh -p 36000 cubie@YOUR_CUBIEBOARD_IP
Note: user and password are both cubie.
Flasing to NAND
Flashing to NAND is pretty simple. When logged into the Cubieboard, execute the following commands:
When asked if you are sure to replace all content on NAND with Cubian press y+ENTER (thanks for asking, but LiveSuite already killed everything that was on NAND before). After some time flashing is complete, and you are asked to shutdown. Then remove the SD card, and boot from NAND (again that IP-morse thing will take some time). After that, you could login again to the board through ssh (note, that the ssh-key changed, and you need to remove the old one first).
When logged in first, it might be a good idea to update your system:
sudo apt-get update sudo apt-get upgrade
As mentioned above, there are some strangeness which could be fixed easily. First, lets put ssh daemon back on its default port (22).
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.orig sudo sed "s/Port 36000/Port 22/g" sshd_config_config.orig > /etc/ssh/sshd_config
You might realize that locales are not setup properly for you, this could be fixed by selecting your locales with the following configuration command:
sudo dpkg-reconfigure locales
Here are some pictures showing how to crack a Sansa Shaker MP3 player open. The main “trick” is to remove the two rings (which one uses to control volume or skip tracks). After the rings are removed, the cover could be taken into two half’s by removing the small screws which are hidden under the rings.
PartSim is a online circuits simulation. It allows one to draw and simulate schematics in your web-browser:
PartSim includes a full SPICE simulation engine, web-based schematic capture tool, and a graphical waveform viewer.