TekBots

This bulletin board will help connect the developers and supporters of TekBots with users from OSU and other schools.
It is currently Wed Sep 03, 2014 12:02 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Setting up the development environment for different OS's
PostPosted: Sat Oct 12, 2013 2:30 pm 
Offline

Joined: Mon Jul 25, 2011 1:59 pm
Posts: 8
(From Jacobson M.)

Windows 8 Teensy Driver install information:

To install the drivers for Teensy on Windows 8, follow the instructions linked in the text file:
http://www.pjrc.com/teensy/windows8.txt

Then, install the drivers located on pjrc.com:
http://www.pjrc.com/teensy/usb_serial.html

After these steps have been followed, the programs should recognize the Teensy. To check if it works, open up any of the GUIs, click Scan, and look for the Teensy in the "Port" dropdown menu.


Last edited by shuman on Sat Oct 12, 2013 2:33 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Setting up the development environment for different OS'
PostPosted: Sat Oct 12, 2013 2:32 pm 
Offline

Joined: Mon Jul 25, 2011 1:59 pm
Posts: 8
From (Oliver P.)

I got teensy to work on OSX and decided to share the instructions.

Instructions for getting Teensy 2.0 to work with OSX (Note: will not work for 10.4). This will require use of Terminal to get things to work and some computer skills (Should be no problem for all of us prospective engineers :) )

Download pyserial from the link

https://pypi.python.org/pypi/pyserial

Go to Terminal type: cd ./Downloads/pyserial*

(Note: Caps may matter depending on your filesystem)

Hit enter


Type: sudo python setup.py install

Enter your password

When thats done type: ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Type: brew install pyqt

Download teensy loader from: http://www.pjrc.com/teensy/teensy.dmg

Open teensy.dmg and copy it to your Application folder.

(Tip: If you get permission denied errors, add sudo at the front of the command for super user, this will ask for your password)

(2nd Tip: You might want to add one step. The .tar.gz in the first download link needs to be extracted before it can be ran in terminal.)


Top
 Profile  
 
 Post subject: Re: Setting up the development environment for different OS'
PostPosted: Sat Oct 12, 2013 2:34 pm 
Offline

Joined: Mon Jul 25, 2011 1:59 pm
Posts: 8
(From Timothy B)

Finding the previous email's instructions I've put together a comprehensive guide that will point students in the right direction for installing Python and in the case of the Teensy Driver provide detailed instructions on how to get that working. Hopefully this will be useful for people.


Setting up a Windows 8 laptop (or desktop if you're awesome) for ECE111 can be a pain, but it doesn't have to be. The basics that you need are Python, PyQt4 and pyserial. Detailed instructions for installing those can be found here: http://eecs.oregonstate.edu/education/d ... nstall.pdf .
Having Python installed is all good for creating and editing programs for your Teensy, but to actually communicate with it you still need to install a driver. The driver (along with a whole bunch of other great resources) can be found at http://eecs.oregonstate.edu/education/courses/ece111/ under Software Used. Save that file somewhere you will remember as you follow these detailed instructions on how to install it:

1. From the Metro Charm Bar, open Settings
2. Click Change PC Settings
3. Click General, and scroll to Advanced Startup, and click Restart Now
4. Choose Troubleshoot
5. Click Advanced Options
6. CLick Windows Startup Settings
7. Click Restart
8. Wait for restart, and then select Disable Driver Signature Enforcement from the list
9. After the restart, run the driver installer found at
10. The driver should have successfully installed

You should get a message stating:
"Because this INF is not signed by Microsoft, you must still choose it in the Found New Hardware Wizard..."
If you are still getting a permissions error, try again. Or seek help.

11. Reboot
12. Run cmd.exe as administrator
13. Type hdwwiz.exe
14. Choose the (Advanced) option, and then click Next
15. Click Show All Devices in the list, and then click Next
16. Wait for the list to load (unless you really know what you're doing!)
17. Under Manufacturer find PJRC.COM,LLC. and select USB serial, and then click Next
18. Finish the wizard

The driver should now work properly with the Teensy

Test this by opening one of the PythonGUI lab files (i.e. motor_qt.py), and then click scan. If your Teensy appears in the port list, then you have succeeded! Congratulations!

Where all credit is due, the first half of my instructions are from http://www.pjrc.com/teensy/windows8.txt (from the previous email), and the second half is from http://msdn.microsoft.com/en-us/library ... 39(v=vs.85).aspx which I found is a crucial step neglected by the first instructions.


Top
 Profile  
 
 Post subject: Re: Setting up the development environment for different OS'
PostPosted: Wed Oct 16, 2013 3:02 pm 
Offline

Joined: Tue Oct 15, 2013 3:13 pm
Posts: 1
[MORE MAC OSX TIPS]

After helping some others in lab set it up on their Macs here's a few more tips that might help:

shuman wrote:
Download pyserial from the link

https://pypi.python.org/pypi/pyserial

For this first step, if you're having trouble downloading the file in Safari,
try using a different browser to download it (Examples: Chrome, Firefox)

HOW TO OPEN TERMINAL

There's tons of ways to do this, but the fastest way for me is to use
Spotlight (magnifying glass in the upper-right corner of your screen):
1. Click on the Magnifying Glass
2. Type "terminal" (this should bring up a search for all the files/programs named "terminal" in your mac, the program itself should be highlighted at the top)
3. Hit [Enter] (to open that highlighted program)

Superspeed Keyboard Shortcut
1. Press [Command ⌘]+[Space Bar]
2. Type "terminal"
3. Hit [Enter]

shuman wrote:
Type: sudo python setup.py install

Enter your password

When thats done type: ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Type: brew install pyqt

As you follow these steps WATCH the Terminal window after each step.
After one of them, the Terminal will ask "To continue, press ENTER, otherwise press any other key."
when you see this make sure to hit ENTER.
If another key was pressed by accident, simply start again at the "Type: sudo python setup.py install" step.


Last of all, Here's a few other keyboard shortcuts to get to know your Mac a little better
Cut: [Command ⌘] + X
Copy: [Command ⌘] + C
Paste: [Command ⌘] + V
Open Spotlight: [Command ⌘] + [Space Bar]
Sleep the Display: [Control]+[Shift]+[Eject]
Take a Screenshot: [Command ⌘]+[Shift]+[3]

_________________
Must... stay on topic.


Top
 Profile  
 
 Post subject: Re: Setting up the development environment for different OS'
PostPosted: Wed Oct 16, 2013 6:16 pm 
Offline

Joined: Tue Oct 15, 2013 3:08 pm
Posts: 1
Lab 1 under OS X

For this, I'm assuming you've already installed and have working Python 2.7, pyserial, PyQt4, and the Teensy Loader.

When I started Lab 1, I thought I had everything installed and working. But when I went to use the GUI, it was clear there was still work to do!

I couldn't get my Teensy to show up when I scanned from the GUI. To solve that, I had to modify piano_lab.py.

First, I ran
Code:
ls /dev >> ~/Desktop/ls1
then plugged in my Teensy and ran
Code:
ls /dev >> ~/Desktop/ls2
and by comparing the two outputs, determined the Teensy is connected (for me) as
Code:
/dev/cu.usbmodem12341

I'm unsure whether this will be constant for everyone or not. If adding /dev/cu.usbmodem12341 doesn't work for you, I'd recommend following my above procedure for yourself. You could also attempt
Code:
ls /dev | grep "cu.usbmodem"
which assumes the only variance is the number (i.e. 12341). Again, no idea what it's going to be like on other systems! Just a couple things to try.

So, once you've added whatever Teensy is connected as (try "/dev/cu.usbmodem12341" first), your new piano_lab.py should look like so:
Quote:
# create combo box and button for port settings
self.ports = [ "Port",
'/dev/ttyACM0', '/dev/ttyACM1','/dev/ttyACM2', '/dev/ttyACM3','/dev/ttyACM4', '/dev/ttyACM5',
'/dev/ttyUSB0','/dev/ttyUSB1','/dev/ttyUSB2','/dev/ttyUSB3', '/dev/ttyUSB4', '/dev/ttyUSB5',
'/dev/ttyUSB6', '/dev/ttyUSB7', '/dev/ttyUSB8', '/dev/ttyUSB9', '/dev/ttyUSB10',
'/dev/ttyS0', '/dev/ttyS1', '/dev/ttyS2',
'com2', 'com3', 'com4', 'com5', 'com6', 'com7', 'com8', 'com9', 'com10',
'com11', 'com12', 'com13', 'com14', 'com15', 'com16', 'com17', 'com18',
'com19', 'com20', 'com21', 'com1', '/dev/cu.usbmodem12341']


If Teensy shows up in the drop down box when you 'Scan', we're one step closer!

Next is a much simpler modification.

Just modify these 4 lines to be wrapped in the str() function (like below).
Code:
self.ser.write( self.song_array[i].note )
self.ser.write( self.song_array[i].octave )
self.ser.write( self.song_array[i].sharp )
self.ser.write( self.song_array[i].length )
Code:
self.ser.write( str(self.song_array[i].note) )
self.ser.write( str(self.song_array[i].octave) )
self.ser.write( str(self.song_array[i].sharp) )
self.ser.write( str(self.song_array[i].length) )

This has to do with pyserial expecting a string to be passed.

Hope it works for everyone else!

-T


Top
 Profile  
 
 Post subject: Re: Setting up the development environment for different OS'
PostPosted: Thu Oct 17, 2013 4:44 pm 
Offline

Joined: Thu Oct 17, 2013 4:40 pm
Posts: 1
Good work on the modification for lab 1. Was ingenious, I should have been tipped off when I saw /dev in the source under the scan section.

If you guys run into PyQt4 errors when running the GUI, do the following.

Quote:
touch ~/.bash_profile
echo export PYTHONPATH=\"$(brew --prefix)/lib/python2.7/site-packages:\$PYTHONPATH\" >> ~/.bash_profile
source ~/.bash_profile
echo $PYTHONPATH


Top
 Profile  
 
 Post subject: Re: Setting up the development environment for different OS'
PostPosted: Wed Oct 23, 2013 3:14 pm 
Offline

Joined: Wed Oct 23, 2013 3:01 pm
Posts: 1
After typing the ruby command in Terminal, I came across this error:

Image

Can anyone help me?


Top
 Profile  
 
 Post subject: Re: Setting up the development environment for different OS'
PostPosted: Wed Oct 23, 2013 3:26 pm 
Offline

Joined: Wed Oct 23, 2013 3:17 pm
Posts: 1
Ok so here we go. In my travels in trying to get a problem fixed with using Python on a Windows 8 Machine
i was helped by a TA to correct an error while trying to run the ECE 111 Lab 3 GUI. The Error stipulated that
there was a missing "module sip". And related to the PyQT4 installation. The TA and i were able to get the
GUI working when we erased the pQt4 files from the directory C:\Python27\Lib\site-packages . Then following
instructions given us on how to install PQT4 we reinstalled PyQT4 using the standalone installer further down
the PyQT4 page.

Doing this resolved the issue of the error stating there was a missing module "sip"

Also just a word of warning do not move any of the three files in the piano_lab folder. Was a pain because I
had moved the thumbs file and it wouldn't allow the interface between the GUI and the Teensy. FYI

Hope this information helps some of your with debugging this installation and lab


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group