Ask Your Question
1

pyMCU access from within Sage

asked 12 years ago

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

pyMCU is a real-time python controlled microcontroller that has proven very useful for my experiments. I would like to control and process data from the device in sage, if possible. If compatible with sage, these would be a great couple! pyMCU uses simple commands from the python command line to set pins hi/low, read analog pin values, or control motors, lights, and other devices with external circuitry; data can be sent to numpy, matplotlib, or other python extensions, including web or file I/O.

Any advice for accessing USB devices using FTDI virtual com port drivers through the sageVM?

Thanks, -Ryan

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
0

answered 12 years ago

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

I took your advice- I was able to make the pyserial and pymcu modules into sage, and access them from the sage command line, but they are unavailable in the notebook.

Any idea why?

Preview: (hide)
link
0

answered 12 years ago

tmonteil gravatar image

updated 12 years ago

I have no idea on whether the VM protects the access to USB ports (you can try this). If not, i would advise you to run sage directly from Linux (you can temporary use the liveCD or the liveUSB), since pyMCU documentation says "Linux should automatically recognize the device as a Virtual Comm Port (ttyUSB0 or similar)".

pyMCU seems however very easy to install into Sage from the command line:

$ sage -sh
(sage-sh)$ easy_install pyserial
(sage-sh)$ easy_install pymcu
(sage-sh)$ exit

And then in Sage:

sage: import pymcu
Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 12 years ago

Seen: 306 times

Last updated: Apr 27 '13