Remote Kernel on Raspberry Pi

Hello Arnoud,
I installed Mathematica yesterday and wanted to connect it to my Raspberry Pi.
I also have the same problem as described in the above posts:

From my Mac I can ssh to my RasPi and launch there Wolfram, and make it add 1+1.
But I can’t figure out how to get a connection to the RasPi from Mathematica on my Mac using the RDK.

In the setup mask of the RDK (Configure Pi Connection) I entered

Network machine of Pi: IP address of the WLAN connection of my RasPi (as said, this one works for connecting via ssh)

Login of Pi: pi

I my point of view there is not much that the user can do there wrong, it should work out of the box.

When I try to connect to my RasP and evaluate the Pi Test & Example notebook I am asked to enter my password for my pi login, I have to wait then quite a while, then I get the following two errors:

The child process 594 reports: sh: Private: command not found

The kernel Raspberry Pi failed to connect to the front end. (Error = MLECONNECT). You should try running the kernel connection outside the front end.

When I enter Options[$FrontEnd, EvaluatorNames] on my local desktop I get

In[2]:= Options[$FrontEnd, EvaluatorNames]

Out[2]= {EvaluatorNames → {“Local” → {“AutoStartOnLaunch” → True},
“Raspberry Pi” → {“RemoteMachine” → True,
“TranslateReturns” → True, “AutoStartOnLaunch” → False,
“Executable” → “/usr/bin/wolfram”,
“HostName” → “192.168.178.22”, “RemoteLogin” → “pi”}}}

I googled the problem but couldn’t find anything that would solve my connection problem.
I would be very happy if you could help me with this issue.

Kind Regards
Björn

OK, now I have a Raspberry Pi 2. Still no luck with the RDK. I can’t even get the RDK to successfully install… the CDF installer reports that it succeeds, but the RDK palette never appears in the Palettes menu.

I am running Raspbian, installed from the NOOBS image:

pi@raspberrypi ~ $ uname -r
3.18.7-v7+

pi@raspberrypi ~ $ wolfram
Wolfram Language (Raspberry Pi Pilot Release)
Copyright 1988-2015 Wolfram Research
Information & help: Wolfram + Raspberry Pi Project: A Wolfram Engine on Every Raspberry Pi

In[1]:= $Version

Out[1]= 10.0 for Linux ARM (32-bit) (February 3, 2015)

Taking yet another run at this a year or so later.

Raspberry Pi 2
Fresh NOOBS 1.4.0 (2015-02-18) SD card
Macbook Pro (Retina late 2012) OSX 10.10.2
Mathematica 10.0.2.0
Network ethernet cable

Purpose - Run Mma on the RPi kernel from a front end running on the Mac

This was a new RPi, and the network had been reshuffled, so the first problem was getting a functional ssh from Mac Terminal to RPi. Resolution (after a day and a half of googling) was to find the .ssh/known_hosts from the Mac file system. I tried several edits suggested in the forums but could make none work. Removal of the known_hosts file was the only thing that fixed it. That file was a half-encrypted text file that included recognizable host ip addresses from past configurations, but why the simple persistence of old data causes fatal termination with such alarming security warnings, I have no idea.

Now, I evidently have a resysthesized known_hosts file, a functioning ssh from the Mac Terminal, and a functioning wolfram program on the PRi.

Next I tried hooking the Mac to the RPi using the Mac’s Mma RDK. First, I verified that I only had the single (Local) kernel installed in Evaluation>Kernel Configuration Options, then I clicked on the Configure Pi Connection on the Remote Development Control Panel, filling in the RPi’s ip address (from running ifconfig on the RPi after I first set it up). I used the palette to open a Pi Test & Example Notebook. Executing $MachineName got me nothing. Options[$FrontEnd,EvaluatorNames] gets me nothing. As a matter of fact, 2+2 gets me nothing. Evaluation>Notebook’s Kernel shows Raspberry Pi checked.

I clicked on the Raspberry Pi in the Evaluation>Kernel Configuration Options panel and found an entry in the Basic Options > Remote Host: e$738, and that looked suspiciously like a Module variable that somehow didn’t get resolved, so I edited it to the RPi’s ip address, opened a fresh Pi test notebook. $MachineName gets me a Message “The child process 2095 reports:” and “The kernel Raspberry Pi failed to connect to the front end. (Error = MLECONNECT). You should try running the kernel connection outside the front end.”

I need a hint.

Here is what worked.

In the Pi Test notebook, I set the Evaluation>Notebook’s Kernel to Local, then

$MachineName

"lapstation4"

Options[$FrontEnd, EvaluatorNames]

{EvaluatorNames -> {"Local" -> {"AutoStartOnLaunch" -> True}, 
   "Raspberry Pi" -> {"RemoteMachine" -> True, 
     "TranslateReturns" -> True, "AutoStartOnLaunch" -> False, 
     "Executable" -> "/usr/bin/wolfram", 
     "HostName" -> 
      "RemoteDevelopmentKit`Private`dialogWolframEngin10.0.1.18", 
     "RemoteLogin" -> "pi"}}}

SetOptions[
 $FrontEnd
 , EvaluatorNames ->
  {
   "Local" -> {"AutoStartOnLaunch" -> True}
   , "Raspberry Pi" ->
    {
     "RemoteMachine" -> True
     , "TranslateReturns" -> True
     , "AutoStartOnLaunch" -> False
     , "Executable" -> "/usr/bin/wolfram"
     , "HostName" -> "10.0.1.18", "RemoteLogin" -> "pi"
     }
   }]

Then set the Evaluation>Notebook’s Kernel to Raspberry Pi and execute

  $MachineName
  "raspberrypi"

It seems clear (to me anyway) that this is a buggy Remote Development Kit failing to resolve the variable reference in RemoteDevelopmentKit`Private`

This worked for me:

(Using Mac OS X Yosemite)

SSHing into the Raspberry Pi threw an RSA key error.

So I went to the Mac Terminal and Typed: open /Users/yourusernamehere/.ssh. I navigated to the “knownhosts” file and I found the key associated with my Pi’s IP address and deleted it.

I tried to login into the Pi again and it asked my to verify the key.

After I logged into the Pi I went to Wolfram(local machine not pi) and changed my notebook type to from (Local) to (Raspberry Pi). I then typed $MachineName and the Output was “raspberrypi”.

For me at least I am guessing that the RSA key was the issue.

I just thought I would post this in case anyone else had the same Problem.

I have this working reasonably well.

IN the remote kernel status setup a remote kernel with the following custom launch command. The hostname should be the hostname of he working ssh command outlined in the second comment below. Generally i set the number of kernels on rasp pi 2 to be 3.

ssh -x -f -l pi 1 wolfram -mathlink -linkmode Connect 4 -linkname
‘2’ -subkernel -noinit

The numbers in the command above all have ` quotes around them and the 2 also has ’ quotes around it.

It is important/necessary that you are able to remote ssh without a password for this to work. eg: ssh pi@mathterm.local where math term. local is avalid hostanme or ip addres. (to enable this look on the web for how to add rsa keys to the .ssh files).

LaunchKernels[] in a notebook should now launch local kernels + remote kernels.

I have a related question and wonder whether any of you could help me.

Using a Linux machine, I logged with a remote desktop service (rdp protocol) onto a Raspberry Pi 2. Everytime I try to start Mathematica with the User Interface the connection crashes. Has anybody experience on how to get that to work, or is that not supported?

The terminal option using Wolfram works well.

I am not a rdp expert but I had similar problems trying to run rdp with smalltalk on a linux amazon box to a macintosh. I found VNC worked well. You may want to try vnc to your pi.
But this is just a guess .