Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Recently I bought a Raspberry Pi and I installed the Wolfram Language on it. Comparing WL 10.0's commands with Mathematica 9.0.1.0's commands, I found 328 additional commands and variables. I understand that WL is in a preliminary version so more commands may be added (or removed) in the near future but since this seems to be the future, I believe learning as quickly as possible the new possibilities would be a strong asset.

Since my PC's front end is much faster than the RPi's, I would like to call these through my Mathematica 9.0.1 front end and get the results in the same front end. This would save a lot of time lost in going forward-backward between them. So how can I call the WL kernel from my PC (I have attached both to an Ethernet LAN)?

share|improve this question
1  
When you say your PC is so much faster than the Pi is that for running mathematica/WL code? Because if you do succeed in making the connection you desire the code will still be running on the Pi and just as slow. The only gain you will make is convenience of not having to switch. –  Ymareth Feb 25 at 14:43
    
Asking users to comment on some 100-200 new functions is waay too broad and perhaps out of scope for this site. Besides, there is documentation for a lot of these (but not all) available online, so I don't see why you couldn't just look them up. Third, you can't run the functions available in the WL kernel on your Pi in Mathematica 9 on your PC... that's just not how it works. Besides, even if it were possible, it would probably be a violation of the license, so people might not answer that question here. –  rm -rf Feb 25 at 14:43
    
Yes I know - I just want to call the new commands from 9.0 in my PC. I don't mind the delay. –  tchronis Feb 25 at 14:44
2  
I'm looking forward to version 10 too. But you know, I still haven't mastered all the commands that were new in version 7 yet! –  bill s Feb 25 at 14:45
    
@rm -rf I hope there is no license problem. I am a licensed MMA 9.0 user and I would like to explore the new commands from a more robust environment. It is well known that Pi's xwindows are very heavy for it. So I cannot build notebooks larger than a few kb. To produce the help file took 30 minutes. –  tchronis Feb 25 at 14:48
show 16 more comments

2 Answers 2

up vote 6 down vote accepted

You can download the Remote Development Kit here (scroll down a bit).

It's a CDF file that shows this when opened:

Click "INSTALL" to finish the installation.

Now go to Palettes -> Remote Development Control Panel.

Click Configure Pi Connection and enter the IP address of your Pi, as well as the default username.

Click New Pi Notebook, enter an expression to evaluate and press Shift-Enter. A dialog will come up to enter the password for the Pi.

Now you're ready to work with the Pi kernel and a desktop front end!

This works both for front end version 9 and 10.

This sets up a remote kernel with almost the same configuration bobthechemist describes in his answer, however he runs the kernel as root on the Pi, which allows access to hardware (e.g. GPIO).

If this method doesn't work, verify that it is possible to connect to the Pi using ssh from a terminal.

share|improve this answer
    
+1 for putting all the information in a convenient spot. Seems like folks who gather in WC have problems getting this option to work. Another case of YMMV. –  bobthechemist Jul 11 at 16:21
    
@bobthechemist Do I see it correctly that the only difference between this and your configuration is that you ran the Pi kernel as root? –  Szabolcs Jul 11 at 16:44
    
Yes - the benefit of running the kernel as root is to get access to commands such as DeviceWrite["GPIO", {24->1}]. –  bobthechemist Jul 11 at 16:49
add comment

It is possible to connect to the RPi through a PC running v9 using the remote kernel options

  1. From "Kernel Configuration Options..." Add a new kernel
  2. Choose the Advanced options and ensure that Arguments to MLOpen has the following

-LinkMode Listen -LinkProtocol TCPIP -LinkOptions MLDontInteract

and the Shell command to launch kernel is

"`java`" -jar "`mathssh`" pi@192.168.1.110 sudo wolfram -mathlink -LinkMode Connect -LinkProtocol TCPIP -LinkName "`linkname`" -LinkHost `ipaddres`

Obviously, replace your ipaddress as appropriate. The sudo in the kernel launch will allow you to use DeviceWrite functions that access the GPIO; in my opinion one of the main reasons to run Mathematica on a RPi.

As a side note, if you are running avahi you can substitute hostname.local for the ipaddress and not worry about when and if your RPi IP address changes. This may require you to have Apple's bonjour software installed on your PC; however, I was unable to test if this is a requirement since I already had it installed in my case.

One last note; if you encounter problems with SSH keys, you want to look at c:\USERS\$USERNAME.ssh and delete the entries that are causing problems.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.