This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DLP6500FLQ: controlling DLP6500 and DLPC9000 using python

Part Number: DLP6500FLQ
Other Parts Discussed in Thread: DLPC900, DLPC910

Hi, I am trying to control a DLP6500 using a python script. I just want to upload images  and control exposure time and dark time through the script for one of my experiments. i tried using the pycrafter 6500 library but when I'm trying to connect to the DMD I'm getting an resource busy error. I'm using an Linux system and an DLPC9000 board. is there any other python library that would work?

  • Hello Godwyn,

    I believe that the Python library you are using is from a much earlier version of the GUI/FW and is obsolete. 

    As a starting point are you able to communicate with the board via a Windows 10 machine using the current GUI and FW? [6.1.x FW / 5.1.x GUI]

    If so, can you tell me what GUI and FW versions you are using?

    Fizix

  • Hi Fizix, Thank you for the quick reply. Yes I can connect my board using a windows machine and the GUI version I'm using is 5.1.0 and it works fine but I want to control it using Python script on a linux system for one of my experiments. Do you have any suggestions on how i could make this work?

    Thanks,

    Godwyn

  • Hello Godwyn,

    TI does not provide any Linux drivers for the USB interface, but the source code is in the SW folder installed with 5.1.0.  If you installed it in the default loacation (and assuming your system drive is "C") then it will be in:

    "C:\Texas Instruments-DLP\DLPC900REF-SW-5.1.0\DLPC900REF-SW-5.1.0\DLPC900REF-GUI\Source"

    As encouragement I can tell you that we have customers that have written their own Linux drivers for USB for the C900 platform, but of course I do not have access to the code, but it can be done.

    I do not know if there are Linux forums that may be able to help with this.

    Also be sure to look at the DLPC900 Software Programmer's Guide - DLPU018 which has the USB and I2C commands.  Moreover, using the GUI and Batch logging you can see how the GUI builds the USB payloads.

    I hope this is helpful.

    Fizix

  • Hi Fizix, 

                 I understand, That was helpful. I'll try to do that. just want to know are there any pip python packages available that will work well with this sort of devices?

  • Hello Godwyn,

    Which version of Python are you using?  To my knowledge we do not have an install manager.  I know that 3.4 and above has it included.

    Fizix

  • Hi Fizix,

                 I'm using python 3.9. I couldn't find any libraries online that i could use to set the values for the DMD and stuff. is there any library for that or do i have to write all of that on my own. Is it possible in the first place to control and set the values using a python script in a linux system?

  • Hello Godwyn,

    I know that it is possible to make Linux drivers that Python should be able to use.  It would be a matter of adapting the source code to the Linux platform.  But there is not reason it could not be done.  

    As I mentioned I know that several of our customers have written their own Linux drivers/code to control the C900 systems.  I do not know if they use Python with it.  However, once you have a read/write engine that can send the commands in Linux, you should be able to call that from Python or write a read/write Python engine.

    Fizix

  • Hello Fizix,

                    Thank You. Is there any way to install the Lightcrafter GUI on a Linux system?

  • Hi Godwyn,

    Fizix is out of the office for today, so I can help support for the the time he is out.

    I went back to the E2E post this one is derived from and found the DLP PyCrafter6500 python GitHub repo. The README states that this should work but to Python 3.8, but does not guarantee it. Are you able to install an earlier version of Python on your Linux distro?

    I would recommend you create a python virtual environment with an earlier python version (3.8 or under, of course), and then install the proper python packages through pip to avoid dependency issues.

    After this, I think one of the simplest things you can do that allows for visual confirmation is to open connection with the DMD and place it into standby mode if you have not changed the firmware from the factory setting. The factory-supplied embedded firmware, or Out Of Box (OOB) firmware should display various splash patterns shortly after the DLPC900 controller configures correctly and begins to show a heartbeat (blinking LED). You should be able to confirm this on the bare DMD. Try to establish connection through the PyCrafter6500 API and then send the controller a standby command. The images should stop appearing if this standby command is the same as the one we use in our GUI. If powering off the DMD, please let standby mode run for 2 minutes before powering off.

    The above is what I understand after reading through the git repository.

    Please let me know if this works for you or not.

    As for whether or not we can install LightCrafter GUI on a Linux system, I am not entirely certain.

    I have gone to the DLPC900 page and installed the DLPC LightCrafter 5.0.0 version and then looked into the following location to find a few very useful files:

    */<DLPC900REF-SW-5.0.0_Install_Directory>/DLPC900REF-SW-5.0.0/GUI/Source/hidapi-master/

    Since you are on a Linux system, running "find ./ -name README.txt" in your command line interface may be useful in locating what to do. Look into the directories with */hidapi-master as your "root" directory. This should point to a README file in the working directory as well as the Linux directory, which has further instructions.

    Regards,
    Michael Ly

  • Hi Michael,

                    I managed to install the GUI on a linux system but if i connect the board via USB to my linux system, the device shows disconnected how can i make it communicate with my linux system.?

    Thanks,

    Godwyn

  • Hi Godwyn,

    Please be sure to read the README.txt files shown in my previous reply, as those will be your best answer. As Fizix has said last week,
    "TI does not provide any Linux drivers for the USB interface, but the source code is in the SW folder installed with 5.1.0.  If you installed it in the default loacation (and assuming your system drive is "C") then it will be in:

    "C:\Texas Instruments-DLP\DLPC900REF-SW-5.1.0\DLPC900REF-SW-5.1.0\DLPC900REF-GUI\Source"

    As encouragement I can tell you that we have customers that have written their own Linux drivers for USB for the C900 platform, but of course I do not have access to the code, but it can be done."

    I have never gone through the steps for a Linux setup, but the directory Fizix and I mentioned should be your starting point for running our most recent GUI on your machine.

    If you would like, I can attempt to run the Pycrafter6500 python scripts on a setup we have in our lab. Please allow me one or two business days so I can test this. This should work for any OS. I take it that this is still your main goal to run these python scripts?

    Regards,
    Michael Ly

  • Hi Michael,

                     That would be of much help. If you can get it running please let me know how you did it.

    Thanks,

    Godwyn

  • Godywn,

    Okay, I may need an additional day or two then.

    May you also try to see if you can get it running with a python version under 3.8? If not, are you able to go through the README.txt files I mentioned previously to run on Linux? From the looks of it, USB is not communicating because you need to set up the HID. Please let me know how it goes on your end with these two tasks before we continue. Thank you!

    Regards,
    Michael Ly

  • Hi again Godwyn,

    Sorry for the delay, this took me a bit longer than I thought it would. I was unable to get this to run properly on my MS Windows 10 machine using Zadig to install libusb drivers for win32. When I run the test script in the Pycrafter6500 repo, I am met with "AttributeError: 'NoneType' object has no attribute 'set_configuration'" just as another user in the thread I have linked at the bottom of this reply. My setup is python 3.7 with pyusb, winusb, usb, pillow, and numpy python packages installed.


    Please take a look through the E2E link below if you wish to use Pycrafter6500, as it is from the person who made the python scripts. There is no guarantee it will work with the most recent firmware, however. You may have to use a pre-v4.x.x GUIs since there were significant changes to the firmware at one point in time. I am not able to confirm which major revision (2.x.x -> 3.x.x or 3.x.x to 4.x.x?).

    Further testing on my own personal computer which runs Arch Linux also came up with problems. When I run "lsusb" in the command line to list all USB devices, I see that the DLPC900 (after installing libusb drivers from Zadig) show that this is a rawhid device. My Linux environment is unable to run the test script.

    I believe this is as far as my testing can go for the time being since this seems to be more of a question regarding the python scripts you are attempting to use. These are not written by TI, so you may have to open a new issue on the GitHub repository for the user/people who created this script.

    If you wish to get help on the new reference software (DLP900REF-GUI), please reach out to us again by creating a new thread or opening this one back up in 14 days' time. Again, going through the README files in the reference software directory of the DLPC900 reference software may point you in the right direction.

    Lastly, here is the E2E thread created by the write of Pycrafter6500 python scripts: 

    Best regards,
    Michael Ly

  • Hi Michael,

    I finally got it working on my Linux system with a python script. Thank You for your help, it was really helpful in getting my system work.

    Thanks and Regards,

    Godwyn

  • Hi Godwyn,

    That's great to hear! May you please let me know how you were able to achieve this? Did you use a different version of Python? I would be happy to know how you did this so others can also do this in the future.

    Many thanks,
    Michael Ly

  • Hi Michael,

    I used Python 3.9 and it worked. I had some issues with the Pycrafter6500.py library about some library issues eventually it worked.

    Regards,

    Godwyn

  • Hi Michael

    I just have one more question right now I'm using a DLP900 board and it can display upto 400 1 bit patterns. I would like to know what's the capacity for DLP910 board. I couldn't find the exact information on the information sheet.

    Regards,

    Godwyn

  • Godwyn,

    The architecture of the the DLPC910 system is very different.  It will be dependent on the available memory on the APPS board (we used the Xilinx VC-707 board).  

    The example GUI we provide is limited to 64 patterns because the load time goes up in a non-linear way, but the source code provided can be edited and recompiled to allow more.

    Fizix

  • Hi Fizix,

    I have one more doubt. I want to display 10 images but I want to pause at one image and only display the next if it gets an trigger_in signal which I'm trying in a code to wait for a keypress, and I want to do it for all the images. Is it possible to do it with GUI or code because if i try to do it only happens for the whole sequence and not every image.

    Regards,

    Godwyn

  • Hi Godwyn,

    This should be possible, but we do not provide any reference that I know of to do this. Let me see if I can talk to Fizix if he knows of any reference designs? You can read up more about this in Section 5.5.2 of the user manual linked here if you have not yet.

  • Godwyn,

    I have sent you a friend invite to see if we can connect more directly.  I am going to go ahead and close this thread.  Depending on what we come up with I can post something back here if it is helpful to the community.

    FIzix