Joeshimaster
Posts: 4
Joined: Fri Jun 14, 2013 11:15 am

NXT and Raspberry Pi

Fri Jun 14, 2013 12:43 pm

Hi I'm pretty new to the Raspberry Pi... I don't actually have one yet but I am considering purchasing one. Ok well here's my story: I'm building a robot (more specifically a Mobile Virtual Presence Device) much like that from the show "The Big Bang Theory". I have built the robots body out of lego mindstorms (tecnic) pieces and I am trying to control it wirelessly over an internet connection from a remote location (which shall not be revealed). The original plan was to attach a small netbook to the robot and run a remote desktop program (Teamviewer) along with the Lego Mindstorms NXT software and use the remote control tool to move the robot (in short, using the desktop in a remote location, control the laptop over an internet connection to control the robots body and move it around like an rc car). I have attached webcameras and a swivelling mount for one of the cameras so I can look left and right (basic road safety) and I can view a live feedback from the cameras through the remote desktop application. Now the robot all woked perfectly except for one little flaw. When the robot rotates (turns), it puts too much stress on the centre and starts to split the robot in half. I have tried countless ways to fix this issue but none have worked. I recently found out that this was the cause of too much weight on the robot. I though that maby if I reduced the weight it would turn, so I remved the laptop and tested (keeping all the wires connected) it and it turned perfectly. I then figured I could utilise the raspberry pi's minute mass to make my project work. I did a bit of research and found some questions that I couldn't find answers to. QUESTION ONE: Would I be able to run the lego mindstorms software (or a similar software with the remote control function) on the raspberry pi (if I attached an external hard drive of course). QUESTION TWO: Would I be able to run Teamviewer on the raspberry pi (on the website it says it can run on linux but I'm not sure if it would run on this version of linux) and finally QUESTION THREE: Would the project work on the raspberry pi? I'm just doubting if theres enough processing power... If you actually bothered to read all of this I really am very gratefull to you... Please help me... I bet you will never guess my age

User avatar
Davespice
Forum Moderator
Forum Moderator
Posts: 1662
Joined: Fri Oct 14, 2011 8:06 pm
Location: The Netherlands
Contact: Twitter

Re: NXT and Raspberry Pi

Fri Jun 14, 2013 1:21 pm

Age guess: Okay you're either really young, or you're retired :D I'm going to go with young though, so lets try 14?

1) You can have a look on Google for this, I had a quick felch and found NXT-Python, which might be usable since Raspbian comes with Python already installed; http://code.google.com/p/nxt-python/
This might mean rewriting some of your code in Python though!

You can attach an external hard drive via a USB port, but you might need a powered USB hub for this. The Pi can only supply 100 mA of current to each USB device, so either use a hard drive with its own power supply or get a USB hub.

2) You might get away with rebuilding Teamviewer from the source code on the Pi;
Read the section titled "Other systems (not officially supported)", there is a link with instructions that you can try.
http://www.teamviewer.com/en/download/linux.aspx

Don’t try to use the 32bit / 64 bit packages on that page since they’re made for Intel / AMD processors and wouldn’t work for an ARM processor like the Pi has.

3) I’m pretty certain that there would be enough processing power, I’ve seen similar projects involving a hacked Big Trak and various other RC cars.

Gbaman
Posts: 155
Joined: Mon Jan 21, 2013 2:43 pm

Re: NXT and Raspberry Pi

Fri Jun 14, 2013 2:57 pm

I have done nearly exactly what you are trying to do. If you don't know python, it isn't going to be easy, NXT-python is the way to go but you can easily only control one motor at a time without getting into multiple threads which is.... Interesting to say the least and not for the faint hearted. Even though I very regularly use NXTs we decided it was not worth the work with NXT python unless you only have one motor to control at a time.
In saying that, there was a kickstarter a while back for an attachment for the pi (control or SPI or I2C, cant remember which) which allowed you to dump the NXT control unit and just use its motors and sensors.
*Edit* Found it http://www.dexterindustries.com/BrickPi/introduction/

No you can not use the NXT-G software, it is closed source and they have not made a version for the pi, there is no buts or ifs on this, it does not exist.
The easiest way to do it is right some web app to control it, or ssh into your pi from a distance, both will need a firewall port opened.

So if you are a 14 year old kid, without a pile of motivation to learn python and learn how to use the GPIO on the pi, or you want to shell out on the brickpi and learn some python, it isn't happening.

In saying all that, I did do it and wouldn't recommend someone else goes down that road, buy some motors, buy a motor controller and make a robot that way.
Also, don't go near teamviewer for the pi, even if you get it working, will run crazy slow.
If you have any further questions though on it, do ask
Lead developer of PiNet, a free and opensource centralised user accounts and file storage system for Raspberry Pi classrooms used in over 200 schools across the world.
http://pinet.org.uk

Joeshimaster
Posts: 4
Joined: Fri Jun 14, 2013 11:15 am

Re: NXT and Raspberry Pi

Sat Jun 15, 2013 8:51 am

Thanks
Last edited by Joeshimaster on Thu Mar 05, 2015 9:06 am, edited 1 time in total.

ghans
Posts: 7874
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: NXT and Raspberry Pi

Sat Jun 15, 2013 11:27 am

Argh , use more paragraphs ! :D

If i were you , i would first look how much time i've got. Do
you have a deadline ?

If not , using NXT-python is the way to go forward.

Linux and Windows are inherently incompatible. The WINE
project addresses that , but it doesn't work on the Pi.
No version of Windows runs on the Pi.

Teamviewer does not work on the Pi , even the Linux version.
You can get alternative software which does work well
enough (and is easy to use) , but i would advise against it
and use Python only.

You can write a control website with Python and have a iPhone
or Android phone open that. You will need several months to
get there though (i would say), if you haven't programmed
before.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
mkopack
Posts: 242
Joined: Mon Nov 07, 2011 8:46 pm

Re: NXT and Raspberry Pi

Sat Jun 15, 2013 8:32 pm

Look on kick starter for something called Brick Pi. It's a project to turn a rpi into a new higher power NXT control block. Using that you could run the NXT motors and sensors directly from the pi, and just SSH into the pi over wifi for control.. For video, just use the pi camera and something like gstreamer to get the video stream back to you windows machine for viewing.

User avatar
dexterindustries
Posts: 47
Joined: Thu Mar 07, 2013 3:51 am
Location: Somewhere
Contact: Website

Re: NXT and Raspberry Pi

Thu Oct 17, 2013 1:20 pm

This is actually now for sale on our website here:

http://www.dexterindustries.com/BrickPi.html
John Cole
Dexter Industries

Code: Select all

http://www.dexterindustries.com

SeeGreatness
Posts: 12
Joined: Mon Feb 20, 2017 11:28 pm

Re: NXT and Raspberry Pi

Tue Feb 21, 2017 7:10 pm

Yes you would be able to run a program to INTERACT with the robot (I have a nxt too and a raspberry pi)
you will need to use python or java to be able to send the same signals that the computer would to the robot (this will reduce the size of mindstorms app because your not using it ) you will actually be tricking the nxt into thinking it's connected to a computer this might sound easy because the pi IS a computer but you will need to install the drivers for the pi and I'm going to tell you first you're going to need to Make drivers for it (or if you can find some then by all means use them if they work) you need this because even windows doesn't know how to use the nxt (the nxt is not a recognized storage device probably due to the file type like fat32 ..and raspberry does not have the drivers for the fat32 pre installed this means that it will not mount a fat32 device like a usb or external hard drive ) also with the drivers which I'm actually more sure is available for linux debian (raspbian) because they go so well together just like you said. So anyways you will need to research how to emulate the connection that the mindstorms software on a actual pc does like how many pulses to make it turn left, right, back, change motor speed, the action motor (default is motor A)
and yeah that sort of thing and as well as how to establish that connection and how to cancel the connection so that you may disconnect ...also when your done this or found a better solution please let me know how to do this so that others can do so

SeeGreatness
Posts: 12
Joined: Mon Feb 20, 2017 11:28 pm

Re: NXT and Raspberry Pi

Tue Feb 21, 2017 7:21 pm

Yeah brickpi is your best bet

Return to “Automation, sensing and robotics”