Module Notes
From Digi Developer
This page is intended to be a storehouse of information that people have gathered that describes their experience working with Python modules not included in the normal Digi python.zip file. These may be additional Python standard library files, or third-party modules that have been used.
When adding modules to the Python environment, please make sure that you have already read the Programmer's Guide, particularly, the restrictions. As the amount loaded grows, it will be useful to know how to put compiled .pyc files on the device.
This page is not meant to be an exhaustive reference of libraries that will work. Many if not most pure Python modules that do not depend on operating system internals have a very high chance of success in our environment. You may find additional inspiration or knowledge of how to use certain modules by examining their usage in demo code .
Contents |
Python Standard Modules
Please, when placing additional modules from the Python Standard Library, match the interpreter version of your Digi device with the version of the standard library that you are using.
At the time of this writing, all Digi devices run Python 2.4.3. However, this may change in the future. If there is any uncertainty, please verify by examining the sys.version variable on your system.
BaseHTTPServer
BaseHTTPServer works quite well. However, until version 2.8.10 of the Digi device firmware, the logging functionality of the module exercised socket routines that were not provided when socket.getfqdn() was called. The simplest way to work around this, is to sub-class and replace HTTPServer.server_bind() and BaseHTTPRequestHandler.address_string(). As of 2.8.10, the missing routines have been provided.
SimpleXMLRPCServer
Similar to BaseHTTPServer, the logging path can be problematic until firmware 2.8.10. However, if logging is not necessary, the simplest approach to addressing the issue is to initialize the SimpleXMLRPCServer object with its logRequests keyword argument off. An example of this can be seen in the Digi provided GPS demo
Third party Python libraries
Please add modules to this section if they are not part of the Python Standard Library.
