Ahoj,
mám po dlouhé době problém.
Vytvořil jsem si zařízení s FTDI převodníkem, ve windows připojím a funguje, i v delphi jsem si udělal soft a je to OK.
Ale připojil jsme to k linuxu Ubuntu 12.10 64x a ukáže se, přiřadí se i /dev/ttyUSB0, ale nefunguje to jak má. nemůžu dostat podrobnější info jako je serial a description, tedy když si v céčku napíšu jen na zjištění zařízení, tak mě to vypíše nalezeno 1 zařízení ale bez hodnot. Na strejdovi googlu, jsem se dočetl, že to je problém v linuxu a né v knihovně /ftd2xx.h.
lsusb:
martin@martin:~$ lsusb
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 003: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 8087:07dc Intel Corp.
Bus 001 Device 005: ID 0bda:0129 Realtek Semiconductor Corp.
Bus 002 Device 003: ID 04f2:b2e1 Chicony Electronics Co., Ltd
v Céčku program na zjištění zařízení:
/**
* SAS
* @author Martin Nakládal <nakladal@intravps.cz>
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "ftdi/WinTypes.h"
#include "ftdi/ftd2xx.h"
#define IDdeviceIndexDefault 0x1
int main() {
printf("Running SAS System by OK2UEC\n");
FT_STATUS ftStatus;
FT_HANDLE ftHandleTemp;
DWORD numDevs;
DWORD Flags;
DWORD ID;
DWORD Type;
DWORD LocId;
char SerialNumber[
16];
char Description[64];
// create the device information list
ftStatus = FT_CreateDeviceInfoList(&numDevs);
if (ftStatus == FT_OK) {
printf("Number of devices is %d\n", numDevs);
}
if (numDevs > 0) {
// get information for device 0
ftStatus = FT_GetDeviceInfoDetail(0, &Flags, &Type, &ID, &LocId, SerialNumber,
Description,
&ftHandleTemp);
if (ftStatus == FT_OK) {
printf("Dev 0:\n");
printf(" Flags=0x%x\n", Flags);
printf(" Type=0x%x\n", Type);
printf(" ID=0x%x\n", ID);
printf(" LocId = 0x % x\n", LocId);
printf(" SerialNumber=%s\n", SerialNumber);
printf(" Description=%s\n", Description);
printf(" ftHandle=0x%x\n", ftHandleTemp);
}
}
printf("finish");
return 0;
}
a výstup je:
Running SAS System by OK2UEC
Number of devices is 1
Dev 0:
Flags=0x1
Type=0x3
ID=0x0
LocId = 0x 0
SerialNumber=
Description=
ftHandle=0x0
finish
RUN FINISHED; exit value 0; real time: 110ms; user: 0ms; system: 0ms
dmesg:
martin@martin:~$ dmesg | tail
[ 846.810971] usbserial: USB Serial support registered for generic
[ 846.814087] usbcore: registered new interface driver ftdi_sio
[ 846.814109] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 846.814233] ftdi_sio 3-3:1.0: FTDI USB Serial Device converter detected
[ 846.814272] usb 3-3: Detected FT232BM
[ 846.814275] usb 3-3: Number of endpoints 2
[ 846.814277] usb 3-3: Endpoint 1 MaxPacketSize 64
[ 846.814283] usb 3-3: Endpoint 2 MaxPacketSize 64
[ 846.814285] usb 3-3: Setting MaxPacketSize 64
[ 846.814449] usb 3-3: FTDI USB Serial Device converter now attached to ttyUSB0
netušíte někdo, kterým směrem bych se měl vydat?
Díky Martin