Manual Install Method
If you are having trouble with easy_install or you have permission issues running the installers you can install pyMCU and pySerial manually by following these steps:
Extract pyserial-2.6.tar.gz to a temporary directory
Inside the directory where you extracted pyserial you should see a serial folder, copy that serial folder to your python install Lib/site-packages folder.
Extract pymcu-1.0.10.zip to a temporary directory
Inside the directory where you extracted pymcu you should see a file called pymcu.py, copy that file to your python install Lib/site-packages folder.
If you still have permission issues with writing those files into your python Lib/site-packages folder then you will need to put them into an alternative location such as a home directory or other place you have permission to write.
For example on windows if I was to put pyserial and pymcu into my home directory I would do something like this:
inside of: C:\Documents and Settings\richard\My Documents
make a folder called python-libs:
C:\Documents and Settings\richard\My Documents\python-libs
copy the serial folder and pymcu.py from the above instructions into that folder.
Now in any of the examples or tutorials from this web site that have: import pymcu
you will need to add some additional code first.
Before the import pymcu line in the code add the following lines: (modify of course for your directory)
sys.path.append('C:/Documents and Settings/richard/My Documents/python-libs')
Now whenever you do an import pymcu after those lines it will know how to find the python modules and import them properly.
For the most part pyMCU is forward and backward compatible, a lot of care was taken to ensure there would be no problems if the version of the hardware module or the version of the python module were not in sync. That being said there are reasons for the various version updates so you may be missing various bug fixes or new features if your not up to date on the latest version. You can check the version info and history log on the Version Info page.
To upgrade the hardware firmware at this time will require the use of a pickit programmer which can be purchased directly from microchip for $34.99.
You will also be able to use that programmer to program pyMCU with your own custom code if you feel like it.
You can grab the latest pyMCU firmware hex file from the Version Info Page.
To upgrade the python module the easiest way is using easy_install, if you used that to do the initial install then to do the upgrade simply type:
easy_install.exe --upgrade pymcu
if you used the manual install method then simply download the latest pyMCU python module from pypi.python.org and overwrite your installed version with the new version of the file.
If find you are missing a function that is described in the documentation you should verify that you are up to date with the latest firmware and python module.
To check your python module version type the following lines in an interactive python shell:
that should echo back something like:
then check the firmware version by typing:
mb = pymcu.mcuModule()
that should echo back something like:
Version Info : pymcu for PIC v1.0.13
Available Digital Pins : 1 - 13
Available Analog Pins : 1 - 6
Analog Value Range : 0 - 1023
PWM Pins : 1 - 5
PWM Duty Cycle Range : 0 - 1023
COM Port: : COM16
Baudrate: : 115200
or whatever version you have, compare that to the latest version on the Version Info page.
If your version does not match then look at the troubleshooting section above labeled: Version Mismatch
No pyMCU Module(s) Found!
If you've followed the installation instruction and it looks like your pyMCU is getting power you may being having an issue with the FTDI USB Drivers.
First check this page and be sure your driver are installed properly:
If the drivers are installed properly and you see the device in your device manager (windows) or in your /dev/ folder (linux and osx) then you can try initializing the pyMCU by specifying the port directly:
Windows: (change your com port to match the one in the device manager)
mb = pymcu.mcuModule(port='COM16')
Linux or OSX: (change the device name to match the one in your /dev/ folder usually named TTYUSB0, TTYUSB1, etc.)
mb = pymcu.mcuModule(port='TTYUSB0')
If that still does not work then it could be a baudrate issue, by default pyMCU is set to work at 115200 baud, if you have changed this default by using the mcuSetBaudRate() function then you need to initialize the pyMCU by specifying the new baudrate.
Here is a list of the supported baud rates:
so for example say I changed the baud rate to 19200 then you would initialize pyMCU like this:
mb = pymcu.mcuModule(baudrate=19200)
If your not sure what baud rate you changed it to you could just go through and try all of them one at a time.
If that still does not work please contact us and give some more details about your OS and hardware so we can better debug the problem.