Communicating with your GoPiGo Robot

Greetings!

I have been working with various configurations of the GoPiGo-3’s operating systems and I have amassed a body of knowledge about communicating with the robot that others may find useful.

First - The Basics:

  1. In order to communicate with the robot at all, you need an internet connection to the robot itself - either via your own network or via a network connection the robot itself provides.
    • GoPiGo O/S creates its own “network” by becoming an access point with an IP address of 10.10.10.10 and advertises over WiFi as “GoPiGo”.
      • Since the “GoPiGo” access point is an open connection, (no password required), all you need to do is to click on it and wait for it to connect.  The green “antenna” light on the GoPiGo turns blue to let you know you have a good connection to the robot.
    • Raspbian for Robots can automatically connect to an existing WiFi network - though some pre-flight configuration is necessary.
      • Before the robot can connect wirelessly, you need to connect to it using a monitor and keyboard.
      • After booting the robot, you need to open a terminal window and run sudo raspi-config which will allow you to set certain important configuration settings.  You will need to set:
        • Locale, including the correct region and time-zone.  Note that in my case, (because I am currently in Eastern Europe, but I want the US regional settings for time, currency, etc.), I have to set my locale as "US, English, English keyboard, and the location as “New York”.  (anywhere in the US would be fine.)  Then I have to go to the region settings and set my time-zone, (Europe, Moscow), manually.
        • WiFi country.
        • WiFi SSID and password, if any.
    • Raspbian for Robots can also communicate via a hard-wired Ethernet connection.
      • Sneaky Tip for both WiFi and hard-wired Ethernet:
        • Allow your robot to remain configured for DHCP, (automatic), configuration and then set your router’s DHCP server to give your robot’s MAC address a fixed lease, so it always gets the same IP address every time.
        • This way, even if you go somewhere else, the robot can be found on the foreign network, somewhere, and on your network it will always have the same IP address, every time.
           

Connecting to the robot itself:

There are two ways to connect to the robot, (aside from the network connection itself which was covered above).

  1. Via a remote desktop connection.
    • Though there are several remote desktop connection options available, I strongly advise that you use RealVNC, (Pre-set on GoPiGo O/S and Raspbian for Robots, or enabled via raspi-config for other versions of Raspbian), and download the corresponding RealVNC Viewer for your host system, (Windows, Mac, or whatever).
  2. Via the robot’s web interface, if it exists.
    • Both Raspbian for Robots and GoPiGo O/S support a web interface that you attach to by entering the IP address of the robot.
    • Other versions of Raspbian or Raspberry Pi O/S can have a web interface, but you will have to install and configure it.  Depending on what you install, you may, or may not, have a remote desktop.
    • Since, (as noted below), all versions of Raspbian and/or Raspberry Pi O/S support RealVNC, there may be a way to set up a web interface using that.  I don’t know as I have not tried to do it.
       

Accessing the robot’s desktop from a remote host:
(So you don’t have to use a monitor, keyboard, and mouse all the time!)

  1. As far as I know ALL versions of Raspbian, Raspbian for Robots and GoPiGo O/S, have the capability of sharing the desktop with RealVNC, as the RealVNC server software is “built-in” to Raspbian.  Unless you are using GoPiGo O/S or Raspbian for Robots, you will have to go into raspi-config => interfaces and enable VNC for it to work.
     
    • Note:  RealVNC is payware, but has a limited non-commercial license granted to users of the Raspberry Pi for free.  Other uses require a payware license.
    • Also note that this is very similar to other payware packages like Matlab and Wolfram on the Pi - they also “give away” a free non-commercial license for the Pi. VMware does the same thing for the PC, (and maybe Mac).
       
  2. RealVNC also offers a limited-license RealVNC viewer for platforms like the PC, Mac, and possibly Linux. The RealVNC viewer is a Good Thing for many reasons that I will detail below.
    • I have tried other VNC viewers/servers and have found them to be far from seamless.  Since RealVNC is built in, go with a known winner.
       

Using RealVNC:

  1. GoPiGo O/S uses RealVNC exclusively to access the desktop - that is unless you attach a monitor, keyboard, and mouse!  (Which is a pain in the tush - especially if you want the robot to be able to move.)
    • What that means is that if you want to access the desktop remotely, you have no other choice but to use RealVNC.  (i.e.  There is no web interface as there is with Raspbian for Robots.)
    • Because GoPiGo O/S does NOT have a web interface to the desktop, you need to download and use RealVNC’s viewer to access the GoPiGo O/S desktop remotely.
       
      N.B.  I was originally peeved about having to download and install another piece of software to do what should be reasonable and easy to do.  But!  My mind has changed dramatically after using it for reasons that I will detail below.  (Spoiler:  It makes your life so much easier!)
       
  2. Raspbian for Robots has a web interface which binds to the running instance of RealVNC which I have used in the past.  I have discovered that using the RealVNC player as the portal to your device is a tiny bit fussy to start with, but is infinitely easier once you get it set up.
     
  3. Other versions of Raspbian and/or Raspberry Pi O/S also fully support RealVNC and RealVNC viewer.
    • Note that you may have to enable VNC in raspi-config in order to get it working.  It’s well worth the tiny bit of effort.
       

Using RealVNC Viewer:

  1. One of the main advantages - and as far as I am concerned it is THE main advantage - is the tight integration of the VNC session with the host system and it’s desktop.
    • One of the things that frustrated me to no end with the web interface on Raspbian for Robots was that you could not drag-and-drop between the VNC session and the desktop.
    • If you needed to copy something, like an important log file or configuration file to post in the forum or send to support, it was a three-legged, Rube Goldberg-esque process.
      • You had to capture and copy the relevant information.
      • You had to open, (and find!), the “chalkboard” or transfer feature on the right-hand-side slide-out.
      • You had to, somehow or other, paste into that interface.  On occasion I needed to actually create a txt file or document to transfer the data.
      • Then you had to “get it on the other side”, (I don’t remember, but I believe it was a “browser download”)
      • Transferring data the other way was even more troublesome.  In many cases I had to configure a third-party SMB server to use as a repository for file transfers or install something like FileZilla to FTP data back and forth.
         
  2. By comparison, using the RealVNC viewer makes it trivial.
    • You open RealVNC viewer and “create a new connection”
    • You give the connection a name that makes sense to you.
    • You supply the IP address of the device - followed by :1.
      (i.e.  10.10.10.10:1)
    • You connect to the device.  It will ask for a password - “robots1234” - and you can check-mark the “save password” box.
       
      Voila’!  You have a working connection.
       
    • Once you have a working connection, and a copy of the desktop saved as the “picture”, (desktop “preview”), for that connection, you can open the connection’s properties by right-clicking on it, scroll all the way down to the bottom of the property sheet and un-check “Update desktop preview automatically”.  Select “Keep existing preview” and away you go.
       
  3. Communication between the remote desktop and the local host system is trivially easy.
    • Communication between the remote desktop and host system is a marvel of simplicity - it’s truly drag-and-drop.
    • Folders, files, data, whatever moves seamlessly between the host and the target system.
      • For example:  I was re-reading the instructions on how to disable access-point mode within GoPiGo O/S and had the page up that had the commands to execute.  All I had to do was copy them off the web page, drag them to a terminal window inside the RealVNC viewer, and paste them there.  It’s as simple as dragging-and-dropping between windows on the host system itself.
         

Using the Web Interface:
You have two choices when using the web interface to a robot, either Raspbian for Robots or GoPiGo O/S:

  1. The native browser interface on your host’s system.  This can be whatever browser you wish to use, however I strongly recommend either Firefox, (my first choice), or Chrome, (my second choice).
    • Connecting to the native browser interface is as simple as entering the IP address of the robot in question.
    • If you’re using Raspbian for Robots, you enter the robot’s IP address and you get a window with options to connect to the robot - one of which is via VNC.
    • If you’re using GoPiGo O/S, entering the device’s IP address, (usually 10.10.10.10), connects you to the main web screen for the robot.
       
  2. Using the web browser from within the remote desktop interface.
    • While experimenting with various development environments on my robot, I was constantly frustrated by having to constantly switch back-and-forth between the web browser and the desktop - either on a remote monitor or on my host system.
    • I recently discovered that I can use the robot’s own web browser to attach to it’s web interface, even if I don’t have a wireless connection established.  I simply attach to the robots desktop, open the browser there, give it the IP address of the robot - and there I was!  Able to cleanly switch between the robot’s desktop and web interface, all from the same screen.

Summary:
The GoPiGo is an excellent robotics platform that allows the classroom or hobbyist to purchase a fully capable robot without having to mortgage the house.

Since a robot that’s tied-down to a monitor or keyboard isn’t very good as a robot, the folks who make the GoPiGo have provided a number of excellent ways to communicate with - and control - the robot you have.  Which one you use will depend on your own specific needs and the environment you’ll be using it in.

Enjoy!

2 Likes

For those who are more technically inclined you can also use SSH with the -X flag. I can run GUI apps on my GoPiGo from a Linux desktop even though I’m not running a GUI on the raspberry pi itself. Not sure about Macs - would probably work if you’re running an X-client. Might work from Windows as well running an X-client. Should be easier soon using WSL (Window subsystem for Linux). It’s already easy enough to run a command line SSH link. But there are already developer preview releases of the ability to run Linux GUI apps. Will be great once this is in the regular release - I won’t have to fire up my Linus laptop as often.
/K

1 Like

Maybe it’s me, but I was underwhelmed by Windows Subsystem for Linux. At least the version that is applicable to my version of Windows 10 Pro, did little else than command-line stuff and that only via Power Shell (which I find complicates things).

For me it was easier to install VMware Player and install Linux Mint 19.3 and just pop into a real Linux environment when I need to.

1 Like

It is just command line stuff for now. I get an actual BASH shell. For some things it’s good enough. I use VMware as well - but that use will probably go way down once I can run more Linux apps. Apparently some folks have already gotten Gazebo for ROS working with the developer preview that lets you run GUI apps.
/K

1 Like