Quantcast

Problems with some of the examples

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problems with some of the examples

Ian Carr-de Avelon
I work in a school which has some DMX lights and an AVT DMX511 USB interface:
http://sklep.avt.pl/konwerter-usb-dmx512.html
I'm trying to figure out a way to make a Python module so pupils can write programs to control the lights for discos and theatre productions and possibly also as a strobe for Physics lessons.
So far I've downloaded libftdi1-1.2 on ubuntu 14.04 LTS on a HP laptop and some of the examples work and some don't.
ian@HP-620:~/BISC/computing/lighting/libftdi1-1.2/build/examples$ sudo ./find_all
Number of FTDI devices found: 1
Checking device: 0
Manufacturer: FTDI, Description: FT232R USB UART

ian@HP-620:~/BISC/computing/lighting/libftdi1-1.2/build/examples$ sudo ./simple Initialized libftdi 1.2 (major: 1, minor: 2, micro: 0, snapshot ver: unknown)
ftdi_read_chipid: 0
FTDI chipid: 67194FCD
ian@HP-620:~/BISC/computing/lighting/libftdi1-1.2/build/examples$ sudo ./serial_test
unable to open ftdi device: -3 (device not found)
ian@HP-620:~/BISC/computing/lighting/libftdi1-1.2/build/examples$ sudo ./stream_test
Can't open ftdi device: device not found
ian@HP-620:~/BISC/computing/lighting/libftdi1-1.2/build/examples$ sudo ./baud_test
real baudrate used: 9600
this test should take 10.42 seconds
and took 41.0899 seconds, this is 2434 baud or factor 0.254

Do you have any ideas where I should start looking to solve these problems? I notice that there is a python directory in the source. Does this mean that some kind of wrapper already exists?
Yours
Ian



libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [hidden email]


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problems with some of the examples

E.S. Rosenberg
Have you looked at ola? (http://openlighting.org)

2015-02-25 23:05 GMT+02:00 Ian Carr-de Avelon <[hidden email]>:
I work in a school which has some DMX lights and an AVT DMX511 USB interface:
http://sklep.avt.pl/konwerter-usb-dmx512.html
I'm trying to figure out a way to make a Python module so pupils can write programs to control the lights for discos and theatre productions and possibly also as a strobe for Physics lessons.
So far I've downloaded libftdi1-1.2 on ubuntu 14.04 LTS on a HP laptop and some of the examples work and some don't.
ian@HP-620:~/BISC/computing/lighting/libftdi1-1.2/build/examples$ sudo ./find_all
Number of FTDI devices found: 1
Checking device: 0
Manufacturer: FTDI, Description: FT232R USB UART

ian@HP-620:~/BISC/computing/lighting/libftdi1-1.2/build/examples$ sudo ./simple Initialized libftdi 1.2 (major: 1, minor: 2, micro: 0, snapshot ver: unknown)
ftdi_read_chipid: 0
FTDI chipid: 67194FCD
ian@HP-620:~/BISC/computing/lighting/libftdi1-1.2/build/examples$ sudo ./serial_test
unable to open ftdi device: -3 (device not found)
ian@HP-620:~/BISC/computing/lighting/libftdi1-1.2/build/examples$ sudo ./stream_test
Can't open ftdi device: device not found
ian@HP-620:~/BISC/computing/lighting/libftdi1-1.2/build/examples$ sudo ./baud_test
real baudrate used: 9600
this test should take 10.42 seconds
and took 41.0899 seconds, this is 2434 baud or factor 0.254

Do you have any ideas where I should start looking to solve these problems? I notice that there is a python directory in the source. Does this mean that some kind of wrapper already exists?
Yours
Ian



libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [hidden email]





libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [hidden email]


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problems with some of the examples

Ryan Tennill
In reply to this post by Ian Carr-de Avelon
The serial test example has a default PID value of 0 which probably doesn't match a device in your system. You can get a list of USB devices with vendor ID (VID) and product ID (PID) using the command lsusb -v. The FTDI VID is 0403 in case you don't get a string description in the output. I would then try running the serial test again with the appropriate PID value.

Stream test uses a default PID of 0x6010 so you'll need to provide the proper PID at the command line for this one too.

Other examples use the default combination 0x0403/0x6001 and serial test should do this as well. A patch is attached that makes this change to serial_test.c

Also there is a udev rule in the repo that you can install to give normal users access to ftdi devices. This would let you access the device without using sudo but you may need to add a line for the PID of your device. For it to take effect you will have to unplug and reconnect your USB device.

to install the provided rule: cp  libftdi/packages/99-libftdi.rules  /etc/udev/rules.d/

Ryan


On 02/25/2015 03:05 PM, Ian Carr-de Avelon wrote:
I work in a school which has some DMX lights and an AVT DMX511 USB interface:
http://sklep.avt.pl/konwerter-usb-dmx512.html
I'm trying to figure out a way to make a Python module so pupils can write programs to control the lights for discos and theatre productions and possibly also as a strobe for Physics lessons.
So far I've downloaded libftdi1-1.2 on ubuntu 14.04 LTS on a HP laptop and some of the examples work and some don't.
[hidden email] sudo ./find_all
Number of FTDI devices found: 1
Checking device: 0
Manufacturer: FTDI, Description: FT232R USB UART

[hidden email] sudo ./simple Initialized libftdi 1.2 (major: 1, minor: 2, micro: 0, snapshot ver: unknown)
ftdi_read_chipid: 0
FTDI chipid: 67194FCD
[hidden email] sudo ./serial_test
unable to open ftdi device: -3 (device not found)
[hidden email] sudo ./stream_test
Can't open ftdi device: device not found
[hidden email] sudo ./baud_test
real baudrate used: 9600
this test should take 10.42 seconds
and took 41.0899 seconds, this is 2434 baud or factor 0.254

Do you have any ideas where I should start looking to solve these problems? I notice that there is a python directory in the source. Does this mean that some kind of wrapper already exists?
Yours
Ian



libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [hidden email]



-- 

217-351-2655 ext. 126
Distant Focus Corporation
4114B Fieldstone Rd
Champaign, IL 61822
http://jupiter.distantfocus.com/projects/


libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [hidden email]



0001-serial-test-change-default-PID-to-0x6001-instead-of-.patch (747 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problems with some of the examples

Ian Carr-de Avelon
I'd first like to thank both E.S. Rosenberg and Ryan Tennill for coming back to me. I'd seen OLA while skimming for solutions and the Python API looks good. It would be a sledge hammer to crack a nut, but one of the nice thing about open source is you never have to take second best because it's cheaper. I'd found it a problem because I'm in Ubuntu 14 and support does not seem to have got beyond 12. On the recommendation I fired up an older system, but could not get it to work with the interface I have.

I think that my way to go is pylibftdi as a wrapper to libftdi and I think I'm just 2 steps (maybe only one!) away from home.

I'm attaching 2 scope traces:

One is of the interface running under vendor supplied  windows software (which says it's an Enttec Open DMX USB)  and it controls a DMX light ok.

The second is of me controlling it with python. It is what I would call CW, like an old style morse code key switching on a sinusoid. Does anyone look at that and immediately know what is going on? Is it a function available of the ftdi chip or something else. I may have to take a screw driver to it and void the guarantee.
It looks to me like if I can swap it from the CW mode, I may be able to generate the initial DMX break and MAB by switching to serial with no stop bits and sending 0x00,0x00,0x00,0x0F then switching the stop bits on for the data. Otherwise, I'll have to sort out which line is which in bit-bang mode and add micro-sleeps.

Yours
Ian


libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [hidden email]



DMXwindows.jpg (205K) Download Attachment
DMXlinux.png (310K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problems with some of the examples

E.S. Rosenberg
Hi Ian,
I am running ola on ubuntu gnome 14.10, may switch to 15.04 soon, no problems (at the moment I run from git, but I recall successfully installing debs too).
Rui who is also on this list afaik and me have worked on the OLA plugin to control ftdi chips.

In ola the MAB is done with a libftdi call, my guess as far as your python stuff goes is that you are suffering from timing issues since at least as far as I understand so far you have to do timings....

Have a look at the implementation of FtdiInterface here:
https://github.com/Keeper-of-the-Keys/ola/blob/ftdi_scratch/plugins/ftdidmx/FtdiWidget-libftdi.cpp#L314

They recently pulled my changes and now I need to do cleanup when I have time.... (which is being problematic).

HTH,
Eli

2015-03-02 21:59 GMT+02:00 Ian Carr-de Avelon <[hidden email]>:
I'd first like to thank both E.S. Rosenberg and Ryan Tennill for coming back to me. I'd seen OLA while skimming for solutions and the Python API looks good. It would be a sledge hammer to crack a nut, but one of the nice thing about open source is you never have to take second best because it's cheaper. I'd found it a problem because I'm in Ubuntu 14 and support does not seem to have got beyond 12. On the recommendation I fired up an older system, but could not get it to work with the interface I have.

I think that my way to go is pylibftdi as a wrapper to libftdi and I think I'm just 2 steps (maybe only one!) away from home.

I'm attaching 2 scope traces:

One is of the interface running under vendor supplied  windows software (which says it's an Enttec Open DMX USB)  and it controls a DMX light ok.

The second is of me controlling it with python. It is what I would call CW, like an old style morse code key switching on a sinusoid. Does anyone look at that and immediately know what is going on? Is it a function available of the ftdi chip or something else. I may have to take a screw driver to it and void the guarantee.
It looks to me like if I can swap it from the CW mode, I may be able to generate the initial DMX break and MAB by switching to serial with no stop bits and sending 0x00,0x00,0x00,0x0F then switching the stop bits on for the data. Otherwise, I'll have to sort out which line is which in bit-bang mode and add micro-sleeps.

Yours
Ian


libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [hidden email]





libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [hidden email]


Loading...