¿Alguien sabría cómo usar el sensor InterSense Navchip con Linux?

3

Recientemente he comenzado a usar el InterSense Navchip para algunos experimentos relacionados con el INS ( Sistemas de navegación inercial ). ¿Alguien sabría cómo hacer que esto funcione con Linux? Proporcionan una herramienta de muestra para Linux como parte del SDK disponible aquí . Sin embargo, cuando trato de usarlo, simplemente falla:

[root@ankur Sample]# ./ismain
InterSense Library ver. 4.237 64-bit
Copyright 1998-2012 InterSense, LLC
http://www.intersense.com
Tel: 781-541-6330

Tue Jul 31 12:40:46 2012
Looking for InterSense tracking device number 1.
Please wait
Looking for UDP Broadcasts
  Checking UDP port 5001... NOT FOUND
  Checking UDP port 5002... NOT FOUND
  Checking UDP port 5003... NOT FOUND
  Checking UDP port 5004... NOT FOUND
  Checking UDP port 5005... NOT FOUND

InterSense tracker not present
Did not detect any InterSense tracking devices -- please verify COM ports have been created and are not in use
[root@ankur Sample]#

Mi sistema Fedora 17 detecta el HW y le asigna ttyUSB0:

[87011.097726] usb 2-1.5: new full-speed USB device number 5 using ehci_hcd
[87011.184621] usb 2-1.5: New USB device found, idVendor=10c4, idProduct=ea60
[87011.184626] usb 2-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[87011.184630] usb 2-1.5: Product: CP2102 USB to UART Bridge Controller
[87011.184633] usb 2-1.5: Manufacturer: Silicon Labs
[87011.184635] usb 2-1.5: SerialNumber: 0001
[87011.319174] usbcore: registered new interface driver cp210x
[87011.319193] USB Serial support registered for cp210x
[87011.319228] cp210x 2-1.5:1.0: cp210x converter detected
[87011.391845] usb 2-1.5: reset full-speed USB device number 5 using ehci_hcd
[87011.478744] usb 2-1.5: cp210x converter now attached to ttyUSB0

Me he dado cuenta de que busca ttyS0,1,2, .. en lugar de ttyUSB0, así que intenté hacer un enlace entre ttyUSB0 y ttyS4. Lo abrió, y luego continuó.

[00000.922] InterSense Library ver. 4.237 64-bit
[00000.922] Copyright 1998-2012 InterSense, LLC
[00000.922] http://www.intersense.com
[00000.922] Tel: 781-541-6330
[00000.923]
[00000.923] Tue Jul 31 12:07:33 2012
[00000.923]
[00000.923] Looking for InterSense tracking device number 1. Please wait 
[00000.923] Looking for IS-X00 device on port 1 (0.92)
[00000.923] Opened /dev/ttyS0
[00000.923] Error Configuring Port 1
[00000.923] Failed to set speed for port /dev/ttyS0
[00000.923] Error writing to port 1: Input/output error
[00000.923] Error writing to port 1: Input/output error
[00000.923] Error writing to port 1: Input/output error
[00000.963] Error writing to port 1: Input/output error
[00001.003] Error writing to port 1: Input/output error
[00001.043] Looking for IS-X00 device on port 2 (1.04)
[00001.043] Opened /dev/ttyS1
[00001.043] Error Configuring Port 2
[00001.043] Failed to set speed for port /dev/ttyS1
[00001.043] Error writing to port 2: Input/output error
[00001.043] Error writing to port 2: Input/output error
[00001.043] Error writing to port 2: Input/output error
[00001.083] Error writing to port 2: Input/output error
[00001.123] Error writing to port 2: Input/output error
[00001.164] Looking for IS-X00 device on port 3 (1.16)
[00001.164] Opened /dev/ttyS2
[00001.164] Error Configuring Port 3
[00001.164] Failed to set speed for port /dev/ttyS2
[00001.164] Error writing to port 3: Input/output error
[00001.164] Error writing to port 3: Input/output error
[00001.164] Error writing to port 3: Input/output error
[00001.204] Error writing to port 3: Input/output error
[00001.244] Error writing to port 3: Input/output error
[00001.284] Looking for IS-X00 device on port 4 (1.28)
[00001.284] Opened /dev/ttyS3
[00001.284] Error Configuring Port 4
[00001.284] Failed to set speed for port /dev/ttyS3
[00001.284] Error writing to port 4: Input/output error
[00001.284] Error writing to port 4: Input/output error
[00001.284] Error writing to port 4: Input/output error
[00001.324] Error writing to port 4: Input/output error
[00001.364] Error writing to port 4: Input/output error
[00001.404] Looking for IS-X00 device on port 5 (1.40)
[00001.404] Failed to open /dev/ttyS4
[00001.404] Looking for IS-X00 device on port 6 (1.40)
[00001.406] Opened /dev/ttyS5
[00001.528] Looking for IS-X00 device on port 7 (1.53)
[00001.528] Failed to open /dev/ttyS6
[00001.528] Looking for IS-X00 device on port 8 (1.53)
[00001.528] Failed to open /dev/ttyS7
[00001.528] Looking for IS-X00 device on port 9 (1.53)
[00001.528] Failed to open /dev/ttyS8
[00001.528] Looking for IS-X00 device on port 10 (1.53)
[00001.528] Failed to open /dev/ttyS9
[00001.528] Looking for IS-X00 device on port 11 (1.53)
[00001.528] Failed to open /dev/ttyS10
[00001.528] Looking for IS-X00 device on port 12 (1.53)
[00001.528] Failed to open /dev/ttyS11
[00001.528] Looking for IS-X00 device on port 13 (1.53)
[00001.528] Failed to open /dev/ttyS12
[00001.528] Looking for IS-X00 device on port 14 (1.53)
[00001.528] Failed to open /dev/ttyS13
[00001.528] Looking for IS-X00 device on port 15 (1.53)
[00001.528] Failed to open /dev/ttyS14
[00001.529] Looking for IS-X00 device on port 16 (1.53)
[00001.529] Failed to open /dev/ttyS15
[00001.529] Looking for IS-X00 device on port 17 (1.53)
[00001.529] Failed to open /dev/ttyS16
[00001.529] Looking for IS-X00 device on port 18 (1.53)
[00001.529] Failed to open /dev/ttyS17
[00001.529] Looking for IS-X00 device on port 19 (1.53)
[00001.529] Failed to open /dev/ttyS18
[00001.529] Looking for IS-X00 device on port 20 (1.53)
[00001.529] Failed to open /dev/ttyS19
[00001.529] Looking for IS-X00 device on port 21 (1.53)
[00001.529] Failed to open /dev/ttyS20
[00001.529] Looking for IS-X00 device on port 22 (1.53)
[00001.529] Failed to open /dev/ttyS21
[00001.529] Looking for IS-X00 device on port 23 (1.53)
[00001.529] Failed to open /dev/ttyS22
[00001.529] Looking for IS-X00 device on port 24 (1.53)
[00001.529] Failed to open /dev/ttyS23
[00001.529] Looking for IS-X00 device on port 25 (1.53)
[00001.529] Failed to open /dev/ttyS24
[00001.529] Looking for IS-X00 device on port 26 (1.53)
[00001.530] Failed to open /dev/ttyS25
[00001.530] Looking for IS-X00 device on port 27 (1.53)
[00001.530] Failed to open /dev/ttyS26
[00001.530] Looking for IS-X00 device on port 28 (1.53)
[00001.530] Failed to open /dev/ttyS27
[00001.530] Looking for IS-X00 device on port 29 (1.53)
[00001.530] Failed to open /dev/ttyS28
[00001.530] Looking for IS-X00 device on port 30 (1.53)
[00001.530] Failed to open /dev/ttyS29
[00001.530] Looking for IS-X00 device on port 31 (1.53)
[00001.530] Failed to open /dev/ttyS30
[00001.530] Looking for IS-X00 device on port 32 (1.53)
[00001.530] Failed to open /dev/ttyS31
[00001.530]
[00001.530] Looking for SDP devices (1.53)
[00001.611] DEVWRN: Device config file not found: isradio.ini
[00001.612] Opened /dev/ttyS0
[00001.612] Error Configuring Port 1
[00001.612] Failed to set speed for port /dev/ttyS0
[00001.612] Error Getting RTS State on Port 1
[00001.612]
[00001.612] Error asserting trigger for COM1 (Error Getting RTS State on Port 1)
[00001.612] Error Getting DTR State on Port 1
[00001.612]
[00001.612] Error setting DTR for COM1 (Error Getting DTR State on Port 1)
[00001.612] Opened /dev/ttyS1
[00001.612] Error Configuring Port 2
[00001.612] Failed to set speed for port /dev/ttyS1
[00001.612] Error Getting RTS State on Port 2
[00001.612]
[00001.612] Error asserting trigger for COM2 (Error Getting RTS State on Port 2)
[00001.612] Error Getting DTR State on Port 2
[00001.612]
[00001.612] Error setting DTR for COM2 (Error Getting DTR State on Port 2)
[00001.612] Opened /dev/ttyS2
[00001.612] Error Configuring Port 3
[00001.612] Failed to set speed for port /dev/ttyS2
[00001.612] Error Getting RTS State on Port 3
[00001.612]
[00001.612] Error asserting trigger for COM3 (Error Getting RTS State on Port 3)
[00001.612] Error Getting DTR State on Port 3
[00001.612]
[00001.612] Error setting DTR for COM3 (Error Getting DTR State on Port 3)
[00001.612] Opened /dev/ttyS3
[00001.612] Error Configuring Port 4
[00001.613] Failed to set speed for port /dev/ttyS3
[00001.613] Error Getting RTS State on Port 4
[00001.613]
[00001.613] Error asserting trigger for COM4 (Error Getting RTS State on Port 4)
[00001.613] Error Getting DTR State on Port 4
[00001.613]
[00001.613] Error setting DTR for COM4 (Error Getting DTR State on Port 4)
[00001.613] Failed to open /dev/ttyS4
[00001.614] Opened /dev/ttyS5
[00002.038] Failed to open /dev/ttyS6
[00002.038] Failed to open /dev/ttyS7
[00002.038] Failed to open /dev/ttyS8
[00002.038] Failed to open /dev/ttyS9
[00002.038] Failed to open /dev/ttyS10
[00002.038] Failed to open /dev/ttyS11
[00002.038] Failed to open /dev/ttyS12
[00002.038] Failed to open /dev/ttyS13
[00002.039] Failed to open /dev/ttyS14
[00002.039] Failed to open /dev/ttyS15
[00002.039] Failed to open /dev/ttyS16
[00002.039] Failed to open /dev/ttyS17
[00002.039] Failed to open /dev/ttyS18
[00002.039] Failed to open /dev/ttyS19
[00002.039] Failed to open /dev/ttyS20
[00002.039] Failed to open /dev/ttyS21
[00002.039] Failed to open /dev/ttyS22
[00002.039] Failed to open /dev/ttyS23
[00002.039] Failed to open /dev/ttyS24
[00002.039] Failed to open /dev/ttyS25
[00002.039] Failed to open /dev/ttyS26
[00002.039] Failed to open /dev/ttyS27
[00002.039] Failed to open /dev/ttyS28
[00002.039] Failed to open /dev/ttyS29
[00002.039] Failed to open /dev/ttyS30
[00002.039] Failed to open /dev/ttyS31
[00002.039] DEVWRN: SDP initialization failed
[00002.040] DEVMSG: Failed to set device configuration
[00002.040] ERROR: Interface initialization failed
[00002.040]
[00002.040] No SDP Deviced found (2.04)
[00002.040]
[00002.040] Looking for UDP Broadcasts
[00002.240]   Checking UDP port 5001... NOT FOUND
[00002.440]   Checking UDP port 5002... NOT FOUND
[00002.641]   Checking UDP port 5003... NOT FOUND
[00002.841]   Checking UDP port 5004... NOT FOUND
[00003.041]   Checking UDP port 5005... NOT FOUND
[00003.041]
[00003.041] InterSense tracker not present
[00003.041] Finished (3.04)

¿Alguna sugerencia?

    
pregunta FranciscoD

2 respuestas

2

Corrí alrededor + experimenté un poco y logré resolverlo. Esto es lo que hice:

Conecta el NavChip. Aparece como / dev / ttyUSB0 como he escrito en mi pregunta. Luego, como root, establezca la velocidad en baudios para el tty:

# stty -F /dev/ttyUSB0 921600 clocal

Para acceder a él como usuario no root, cambie los permisos como sugiere @shuckc:

# chmod 0777 /dev/ttyUSB0

Después de eso, puedes comunicarte directamente con él utilizando el formato de paquete designado. El navchip, por ejemplo, tiene todos sus datos transmitidos y recibidos en hexadecimal, por lo que algo así funcionaría:

$ cat /dev/ttyUSB0 > loggerfile.txt

$ echo -ne "\xAA\xAA\xAA" > /dev/ttyUSB0 #Whatever package you want to send to it

Tiene diferentes formatos de paquetes en su conjunto de comandos. (No puedo compartir la información sobre los comandos porque es de propiedad exclusiva: /)

Originalmente había probado tanto moserial como cutecom, pero no funcionaron de alguna manera. El sensor no respondió con moserial y cutecom no muestra ttyUSB0 en absoluto.

Le envié un correo electrónico al servicio de asistencia técnica de Intersense y, afortunadamente, me enviaron un programa C de muestra específicamente para NavChip que se puede usar para interactuar con el sensor. (También dijeron que el kit de herramientas genéricas no funciona en absoluto con el NavChip) En general, es solo un programa en C que envía y lee los comandos en hexadecimal según sus formatos de comando.

    
respondido por el FranciscoD
4

Compruebe los permisos en los dispositivos /dev/tty* . Las distribuciones de Linux a menudo requieren que usted sea miembro de los grupos "dialout" o "plugdev" para acceder a dispositivos serie:

[cshucks@desktop ~]$ ls -la /dev/tty[SU]*
crw-rw---- 1 root dialout   4, 64 Jul 19 12:25 /dev/ttyS0
crw-rw---- 1 root dialout   4, 65 Jul 19 12:25 /dev/ttyS1
crw-rw---- 1 root dialout   4, 66 Jul 19 12:25 /dev/ttyS2
crw-rw---- 1 root dialout   4, 67 Jul 19 12:25 /dev/ttyS3
crw-rw---- 1 root dialout 188,  1 Jul 31 14:58 /dev/ttyUSB1
[cshucks@desktop ~]$ groups
cshucks wheel wireshark plugdev vboxusers dialout
[cshucks@desktop ~]$

De lo contrario, intente ejecutar strace ismain para ver el código de error real del sistema operativo devuelto por la llamada open() o stat() relevante, esto puede ser iluminador.

    
respondido por el shuckc

Lea otras preguntas en las etiquetas