Parallax SimpleIDE on Raspberry Pi with VNC and SSH

This is my setup log for my second Raspberry Pi. It is a little older, but I think some might find the walk through useful.
This could be used to create a robot that is easy to program and control remotely via VNC and SSH.
This is more of a “log” of my work than instructions, so a lot of it is cut and paste from the sources listed.
Please let me know if you run into questions or problems and I will make updates.

My goal with this one is to set it up to work over WiFi
GUI available via VNC

and run the Propeller SimpleIDE to control the Propeller board

Getting started:
  • Put it in the case (if you bought one).
  • Plug in Ethernet
  • Monitor via HDMI (You can use any TV in the house!)
  • Keyboard (This is only temporary so just steal one from your kids!)
  • Mouse (This is only temporary so just steal one from your kids!)
  • Hold off on the power.

 

 Following Propeller’s instructions:

http://learn.parallax.com/propeller-c-set-simpleide/raspberrypi

(The following is cut and pasted from the above site, it is NOT my work!)
Install th?e Operating System
  • Find an available desktop or laptop computer with an SD card reader/writer.
  • Insert the SD card for your Raspberry Pi into the computer’s SD card reader/writer.
  • Point a web browser at the Raspberry Pi downloads site (http://www.raspberrypi.org/downloads).
  • Download, install, and run the SD Card Association’s formatting tool from the link provided at the Raspberry Pi downloads page.
  • Use this software to format the SD card properly for use with the Raspberry Pi.  Make sure to click the Option button, select “Full (Erase)” from the Format Type: field and select “On” from the Format Size Adjustment field, then click the OK and Format buttons.

  • Go back to the Raspberry Pi downloads site to get the OS image.

For the best experience, use the New Out Of Box Software (NOOBS) to install the operating system image. There are many Linux distributions for Raspberry Pi, but NOOBS makes it easy to try them all from a single SD image.

  • Download the NOOBS image and extract its contents onto the SD card.
  • Eject the SD card from your computer and insert it into the Raspberry Pi.
  • Plug in the USB hub’s power supply.
  • Plug in the Micro-USB power supply to power up the Raspberry Pi.
  • After a few moments, NOOBS will boot and present you with a simple OS Installation menu.
  • Set Language to English (US)
  • Select the “Raspbian” operating system and then click Install OS. NOOBS will install Raspbian onto your SD card and will then reboot.

Keep default settings but set GUI desktop to start automatically. At the end of the first reboot, the Raspberry Pi Software Configuration Tool will appear. All the defaults are fine, except we recommend setting the GUI desktop to automatically start up after boot.

  • Default User name/Password is pi/raspberry
  • On the Raspberry Pi Software Configuration Tool, move the highlight down to the “Enable Boot to Desktop/Scratch” item and press Enter to select.
  • On the “Choose boot option” prompt, move the highlight to “Desktop log in as user ‘pi’ at the graphical desktop” and press Enter to select.
  • Back on the Raspberry Pi Software Configuration Tool, move the highlight to “Advanced” and press Enter to select.
  • Select A4, Enable SSH server,
  • Select Enable
  • Back on the Raspberry Pi Software Configuration Tool, press the right arrow key to highlight “Finish,” then press Enter twice to reboot.
  • Upon rebooting, the Raspbian graphical desktop will appear.
 (The preceding section was cut and pasted from the above site, it is NOT my work!)

Set up VNC so I can connect remotely and ditch the keyboard/mouse:
(The following is cut and pasted from the above site, it is NOT my work!)

VNC Service

Another way to access the entire Raspberry Pi desktop remotely is to install VNC server on Rasberry Pi. Then access the desktop remotely via VNC viewer. Follow instructions below to install VNC server on your Raspberry Pi.

$ sudo apt-get install tightvncserver

After the VNC server is installed, run this command to start the server.

$ vncserver :1

This command will start VNC server for display number 1, and will ask for a VNC password. Enter a password (of up to 8 characters). If you are asked to enter a “view-only” password, just answer it no (‘n’). The VNC server will make a configuration file in the current user’s home directory. After that, kill the VNC server process with this command.

$ vncserver -kill :1
Next, create a new init.d script for VNC (e.g., /etc/init.d/vncserver), which will auto-start the VNC server upon boot.
Now is a good time to see if you can SSH into the Pi, so you can paste this script in! 🙂
$ sudo vi /etc/init.d/vncserver

Modify the file permission so it can be executed.

$ sudo chmod 755 /etc/init.d/vncserver

Run the following command to install the init.d script with default run-level.

$ sudo update-rc.d vncserver defaults
Reboot your Raspberry Pi to verify that VNC server auto-starts successfully.
To connect via VNC Use <IP Address>:1, i.e.:
192.168.1.120:1
(The preceding section was cut and pasted from the above site, it is NOT my work!)

Set up the WiFi card:
Shut down the Pi and unplug it. (If you plug anything into the USB port while it is running you will cause it to reset because of the power surge.
sudo shutdown -h now
Now that you are in via VNC & SSH, unplug the keyboard and plug the WiFi Dongle in its place.
“WiFi Config” is right on the desktop. Run it and set up the WiFi, it is pretty easy.
Get the WiFi IP and test VNC and SSH on it.
Now this will not survive a reboot, so carry on to make it autostart:
sudo vi /etc/network/interfaces
#Most of the required stuff was put in there by the GUI app, but not all,
Add:
auto wlan0
So that it looks like:

pi@raspberrypi ~ $ cat /etc/network/interfaces

Now reboot to see if it comes up on boot!
sudo shutdown -r now
Test VNC & SSH, and then unplug the keyboard and Ethernet and reboot again to see if we can work “cordless” (we still need power, but this is the idea anyway).
NOTE: To reduce VNC traffic you may want to right click on the CPU monitor and remove it.
You can do the same for the clock, now the screen should be static when nothing is happening, greatly reducing network traffic and WiFi dongle load on the power (battery?), not to mention the CPU load.
You can also set your TightVNC session to 256 color from the client end to reduce traffic some.
NOTE: If you disconnect abruptly, it does appear to keep your session open in the background.

Set up SimpleIDE and program Propeller from Pi:
(The following is cut and pasted from the above site, it is NOT my work!)

Install SimpleIDE?

  • In the Raspbian desktop, open the Midori web browser and go to the Propeller Raspberry Pi page; the top of this page.
  • Download the SimpleIDE Raspberry Pi binary.
  • Open the LXTerminal application. It should start up in your home directory right where Midori just saved the download. Type “ls” to verify.
  • Use bunzip2 to unzip the archive by typing “bunzip2 -vv SimpleIDE_0-9-45_armv6l-RaspberryPi-Linux.tar.bz2” into the LXTerminal. (The actual file name may very). NOTE: For a shortcut to excessive typing, after entering the first unique letters of the file name “Simp,” press the tab key to auto-complete. Be patient, it will take more than five minutes to unzip.
  • Then extract the files from the resulting tar file by typing “tar -xvf SimpleIDE_0-9-45_armv6l-RaspberryPi-Linux.tar” into the LXTerminal. Once again the tab key shortcut can be used to save on typing. This extraction process will take about two minutes.
  • Move into the resulting SimpleIDE… folder by typing “cd SimpleIDE-0-9-45” into the LXTerminal. (The actual folder name may very).
  • Run the setup script by typing “sudo ./setup.sh install” into the LXTerminal. This installation process will take about two minutes.

Run SimpleIDE

  • When installation is complete, run SimpleIDE by typing “simpleide” into the LXTerminal (from within the folder of the previous step).
  • Verify and clear any first-time-run prompts. (Click “OK” on  any prompts about file location!)

  • Connect your Propeller Activity Board to the external USB hub.
  • Select the proper USB port in SimpleIDE’s port field.
  • Now you can compile and download your code to the Propeller.
(The preceding section was cut and pasted from the above site, it is NOT my work!)


NOTE: If you get “Cannot load empty board type” you probably have a dialogue box that popped up asking about file locations that you did not click “OK” on yet.

Set to Text boot:
As it is now, the Raspberry starts the XWindows GUI on the HDMI interface by default.
This uses a lot of memory, and if you are ONLY using it remotely it is a waste, so do this to make it boot to Text only:
sudo raspi-config
Select “3 Enable Boot to Desktop/Scratch”
Select “Console Text console”
Use right arrow to select “<Finish>”
Reboot: Yes
Now it should boot with a text only prompt, but you can still use VNC to get a GUI!
This seems to make everything a LOT peppier!
 
Remember you can grab files from your desktop with FTP/SFTP. 😉

Install SFTP Client on Pi:
sudo apt-get install filezilla
 
When it is done there should be a Filezilla icon under Internet in the menu.

Shutdown:
sudo halt -h
or
sudo shutdown -h now
 
Then wait, the WiFi dongle blue light will go off, and all lights except for power will eventually quit.
The ACT (green) LED will blink ten times when the Pi is full shut down. Then you can safely unplug it!

Ros, Propeller and Kinect!

I have been very busy over the past few months building up a robot to make use of the Robot Operating System (ROS)

Willow Garage has their own ready to go robot called the TurtleBot which is a very good system, and has amazing abilities right out of the box.

However I’ve already been planning my robot version for a while and ROS is more of an addon, albeit a huge one, then a starting point. While the TurtleBot has a lot of features that I may never be able to come up with myself, it is missing a couple of key ones:

  1. It has a very limited ground clearance.
  2. The payload is quite limited.

What I’ve been looking at is the Arlo Robot from Parallax: http://www.parallax.com/product/arlo-robotic-platform-system

This is by no means a “pull it out of the box and go” platform, but it is well within my skills. No designing circuits, no laser cutting, no hacking together of bits of metal and plywood. It can be built by anyone who can put together a radio controlled car kit, and their site is basically designed around teaching kids how to program their controller board, so the learning curve is well assisted.

Fortunately the Arlo Robot is also similar in shape and layout to the TurtleBot. Once I built code for the Propeller based Activity Board to talk to ROS, I can actually run a lot of the ROS TurtleBot code with very little modification!

Here is a list of my progress so far:

  1. I have written code to communicate between the Propeller based Activity Board and ROS, sending odometry information and accepting twist messages from ROS.
  2. I have adapted the 3D view, robot model and teleop code from the ROS TurtleBot to run on my robot.
  3. I have built a basic URDF model of the Arlo robot.

I am doing all of this on a little ActivityBot, because it uses the exact same controller as the ArloBot. Right now I am just waiting on parts from Parallax to get my ArloBot together so that I can start running ROS with it.

I have not made SLAM or “gmapping” work well yet because the odometry from the ActivityBot is very poor due to the fact that its little rubber clad wheels slip very easily and very unevenly on all floor surfaces. I expect the ArloBot to have much less wheel slip. I will also be experimenting with adding a gyro to the Propeller Activity Board to assist in verifying rotation angles.

Since a photo is worth a thousand words, here is a picture of where I’m at at the moment:

Robot Progress July 17, 2014
Robot Progress July 17, 2014

Here you can see my rudimentary ArloBot URDF with a depth registered 3D image from the ASUS Xtion Live and the simulated red laser scan line. Also notice the small line of white dots in front of the robot. That is a simulated LaserScan built from the PING sensor on the front of the ActivityBot. I plan to place PING (Ultrasonic) and InfraRed sensors around the ArloBot and use simulated LaserScans from them to help the robot navigate around low or close obstacles that the 3D Camera misses.

I have a lot of documentation on my process and my code is all online, so if anyone is interested in more about this please let me know and I will post some more background as well as on going work.

From One Eye to Three Eye Monster

Three Eyed Monster

Thanks to BrickLink I found I could buy used UltraSonic sensors for less than $10 each! So I bought two, and now my little friend shouldn’t run into walls as much.

He should also be able to follow a wall on one side while avoiding obstacles ahead.

I tried putting all three up top, like the picture in my first post, but besides getting top heavy, I found I was unable to see a lot of obstacles. Putting all three down low makes them far more steady, makes it less top heavy, and allows me to see lower obstacles.

Because the sensors are not “adjustable” and only provide a basic “distance to nearest object” response, their position on the vehicle determines what you see and what you miss. So the lower I mount them, the lower of an object I can see. Too low and they see the ground, too high and they miss things. Just right and they see what I cannot driver over!

Now the fun part is programming. leJOS provides great functions for dealing with UltraSonic sensors, but there is a catch with multiple sensors:
The way they work is that they send out a ping and listen for the sound to bounce back. If two are going at once, they cannot tell if the return sound is their own or another one.

By default they run “continuously” and you just poll a sensor for the latest reading, but with more than one, you need to make sure only one sends a ping at a time. So now I get to write code to cycle them:
Turn on sensor 1, ping, record distance measured, turn off.
Turn on sensor 2, ping, record distance measured, turn off.
Turn on sensor 3, ping, record distance measured, turn off.
Repeat.

Then I have to do something with all of this data, but that comes later . . .

System.out.print(“Hello World!”)

This blog is for me to share some of the experiments I do on my own time.

I will throw up some pictures and descriptions over the next few days of some of my past projects and then put updates about what I’m currently doing.

I am a Unix System Admin by trade.
I am working on a degree in Web Development.
I am teaching myself Java.
And I like to play with computers. 🙂

About

“He’s just this guy, you know?”

The primary project I talk about here is my ROS based robot built on a Parallax Arlo platform.
If you want to know more about that start here:
Arlobot Build Index or check out some of my videos.

I am an active member at DevICT where I recently participatd in a Game Jam (I was part of the “What’s Up Chuck?” team) and I am a member at MakeICT.

I am also currently enrolled in online classes to finish my Bachelor’s degree at Fort Hayes State University.

Computers have been my hobby and passion since childhood. My hobby is to experiment with computers. My goal here is to share some of my projects for those who are interested and who may want to try some of these things themselves.

I love explaining things and teaching, so if you want more direction on how to make something work do comment and I will elaborate.

I have a full time job, but if you think I’m brilliant and want to pay me good money to experiment with computers for your company then feel free to contact me. 🙂

If you want a little background:
I am a Unix System Admin by trade.
I am working on a degree in Web Development.
I am teaching myself JavaScript.
And I like to play with computers.
In short, I am a jack of all (computer) trades, and master of none.

If you are wondering about the name see Of ????????? and Froods