Using Redpitaya with Mathematica ?

Just about everything about Red Pitaya
Post Reply
CNE
Posts: 5
Joined: Fri Sep 11, 2015 9:14 pm

Using Redpitaya with Mathematica ?

Post by CNE » Fri Sep 11, 2015 9:24 pm

Hello Group,

This is my first post in the forum and I just borrowed a Redpitaya from a friend in order to test it over the weekend. I saw that interfacing with Matlab and Labvie is provided but I am interested in a communication with Mathematica 10.2 running on Windows. Has someone a pointer to some example or adequate documentation on the net ?

Thanks in advance

Christian

CNE
Posts: 5
Joined: Fri Sep 11, 2015 9:14 pm

Re: Using Redpitaya with Mathematica ?

Post by CNE » Mon Sep 14, 2015 12:00 pm

I have been working with the board and Mathematica this weekend :)... see my first results here: http://community.wolfram.com/groups/-/m ... h=yyqCC1hW

CNE

pavel
Posts: 799
Joined: Sat May 23, 2015 5:22 pm

Re: Using Redpitaya with Mathematica ?

Post by pavel » Mon Sep 14, 2015 1:45 pm

Hello Christian,

Thanks for sharing your interface with Mathematica.

I'm not sure that the following line in your introduction is correct:
It seems that the guys from Matlab and National Instruments are already proposing seamless interfaces to their respective ecosystems.
I'd say that the interfaces with Matlab and LabView are developed by the Red Pitaya team.

Out of curiosity I had a quick look at how Mathematica communicates with other devices. The only options are serial port, pure WSTP and J/Link (WSTP interface to Java). So, for fast communication with Red Pitaya I see the following two possibilities:
  • develop a WSTP-to-RedPitaya bridge running on the same computer with Mathematica and communicating over Ethernet with RedPitaya.
  • use J/Link from Mathematica to open a TCP socket and communicate with the SCPI server running on RedPitaya.
Here is an example of how to open TCP socket using J/Link:
http://mathematica.stackexchange.com/qu ... g-platform

Here is a list of the SCPI commands supported by the Red Pitaya SCPI server:
https://dl.dropboxusercontent.com/s/eii ... elease.pdf

Examples of the SCPI commands can be found in the Matlab and Python examples at:
http://redpitaya.com/make-your-app/
https://github.com/RedPitaya/RedPitaya/ ... /Examples/

Best regards,

Pavel

pavel
Posts: 799
Joined: Sat May 23, 2015 5:22 pm

Re: Using Redpitaya with Mathematica ?

Post by pavel » Mon Sep 14, 2015 2:43 pm

Another interesting possibility would be to install Debian 7 (armhf) on Red Pitaya together with Mathematica and The Wolfram Language and then communicate with it using Remote Development Kit.

Remote Development Kit can be downloaded from the following link:
http://www.wolfram.com/raspberry-pi/

The commands to install Mathematica and The Wolfram Language:

Code: Select all

echo "deb http://repository.wolfram.com/raspbian/ stable non-free" > /etc/apt/sources.list.d/wolfram.list
apt-get update
apt-get install wolfram-engine
If you are interested I can build an SD card image with Debian 7 (armhf).

edit: more recent version of the wolfram-engine package can be found at:
http://archive.raspberrypi.org/debian/p ... am-engine/

CNE
Posts: 5
Joined: Fri Sep 11, 2015 9:14 pm

Re: Using Redpitaya with Mathematica ?

Post by CNE » Tue Sep 15, 2015 9:21 pm

Wow! Awesome!

Thank you for the feedback Pavel, this is exactly what I needed! First I was in the same line that you described i.e using JLink + SCPI server commands but I want thank you for proposing this example because I was still searching into Mathematica Stakexchange and Wolfram community, not knowing what was the best approach.

About the install of Debian7 (armhf) on the Red Pitaya, this is a great idea but I do not know if I am skilled enough to do it so quickly so yes I would be glad if you could build a SD crad image for it...and again thank you so much for all these tips!

I'll continue posting my progress, if any, on RedPitaya forum and both Mathematica forums, but not before next weekend :)

Merci beaucoup!

Christian

PS: sorry for my mistake, I really thought that the Matlab and Labview interfaces were developed by they respective providers, not by Red Pitaya guys.

pavel
Posts: 799
Joined: Sat May 23, 2015 5:22 pm

Re: Using Redpitaya with Mathematica ?

Post by pavel » Tue Sep 15, 2015 11:21 pm

I've managed to install the wolfram-engine package but it requires an activation key. So, I could not test more than that.

The following is how I installed Mathematica and The Wolfram Language on the Red Pitaya board.

A pre-built SD card image with Debian 7 (armhf) can be downloaded from the following link:

https://googledrive.com/host/0B-t5klOOy ... 150914.zip

The SD card image size is 1 GB, so it should fit on any SD card starting from 2 GB.

To write the image to a SD card, the dd command-line utility can be used on GNU/Linux and Mac OS X or Win32 Disk Imager can be used on MS Windows.

The default password for the 'root' account is 'changeme'.

After booting Red Pitaya with the Debian SD card, you'll need to resize the SD card partitions to use the full size of the SD card. Here are the commands that should be run from the Debian command line on Red Pitaya:

Code: Select all

# delete second partition
echo -e "d\n2\nw" | fdisk /dev/mmcblk0
# recreate partition
parted -s /dev/mmcblk0 mkpart primary ext4 16MB 100%
# reboot
reboot
After reboot, re-login and finalize the opertaion:

Code: Select all

# resize partition
resize2fs /dev/mmcblk0p2
To enable the Raspberry Pi repositories create /etc/apt/sources.list.d/raspberrypi.list containing the following lines:

Code: Select all

deb http://archive.raspbian.org/raspbian wheezy main
deb http://archive.raspberrypi.org/debian wheezy main
Import keys for the Raspberry Pi repositories

Code: Select all

wget http://archive.raspbian.org/raspbian.public.key -O - | apt-key add -
wget http://archive.raspberrypi.org/debian/raspberrypi.gpg.key -O - | apt-key add -
Install Mathematica and The Wolfram Language:

Code: Select all

apt-get update
apt-get install wolfram-engine

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 36 guests