Ask Your Question

pyMCU access from within Sage

asked 2013-04-23 18:31:12 -0500

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

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-04-23 22:59:01 -0500

tmonteil gravatar image

updated 2013-04-23 23:04:04 -0500

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
edit flag offensive delete link more

answered 2013-04-27 07:08:00 -0500

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?

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools


Asked: 2013-04-23 18:31:12 -0500

Seen: 72 times

Last updated: Apr 27 '13