question

tinkernut avatar image
tinkernut asked

How to validate ve.direct to USB cable?

Greetings,

I'm trying to connect an official ve.direct to USB cable to a RPi3 (also tried with a 4) and a SmartShunt. (Ultimately, trying to build a Venus OS Pi)

I'm trying with just the USB side connected to the Pi to rule out any ground loops

root@raspberrypi2:~# dmesg |grep tty

[ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootwait

[ 2.402322] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 114, base_baud = 0) is a PL011 rev2

[ 3.510771] printk: console [ttyAMA0] enabled

[ 3.583704] 3f215040.serial: ttyS0 at MMIO 0x3f215040 (irq = 86, base_baud = 50000000) is a 16550

no ttyUSBxx

re-plug of USB cable

[ 102.824643] usb 1-1.5: new full-speed USB device number 8 using dwc_otg

[ 102.924690] usb 1-1.5: device descriptor read/64, error -32

[ 103.144794] usb 1-1.5: device descriptor read/64, error -32

[ 103.364911] usb 1-1.5: new full-speed USB device number 9 using dwc_otg

[ 103.464954] usb 1-1.5: device descriptor read/64, error -32

[ 103.685086] usb 1-1.5: device descriptor read/64, error -32

[ 103.805353] usb 1-1-port5: attempt power cycle

[ 104.465463] usb 1-1.5: new full-speed USB device number 10 using dwc_otg

[ 104.905730] usb 1-1.5: device not accepting address 10, error -32

[ 105.005738] usb 1-1.5: new full-speed USB device number 11 using dwc_otg

[ 105.445953] usb 1-1.5: device not accepting address 11, error -32

[ 105.452229] usb 1-1-port5: unable to enumerate USB device

I'm driving the Pi with a Lab supply set and confirmed to be 5V with plenty of umph so power should not be a factor.

Any other ideas? How can I test/verify that the cable is working correctly?

Many thanks

Marcel

Raspberry PiVE.Direct
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

5 Answers
Mike Dorsett avatar image
Mike Dorsett answered ·

With the cable plugged into the USB port, you should see the serial interface listed in the /dev folder.

I use some simple python code to communicate with a smart shunt and an MPPT unit:

import serial

from serial.tools import list_ports
from serial.tools.list_ports import comports

def Find_VED():
VED_port = ["null"]*4
com_ports_list = list(comports())
for i,port in enumerate(com_ports_list):
if port[1].startswith("VE Direct"):
VED_port[i] = port[0]
return(VED_port)


This will return a list of the available USB serial ports with VE direct devices attached.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

tinkernut avatar image
tinkernut answered ·

Hi Mike,

Thanks for your answer - much apreicate it.

Unfortunately, I don't have any comports to list.... lsusb doesn't even show the adapter

root@raspberrypi2:/# lsusb

Bus 001 Device 009: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter

Bus 001 Device 008: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

/dev only contains standard devices but no ttyUSB0

I'm trying to find out if the cable is defect or if there's something else going on.

Thanks

Marcel


2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Mike Dorsett avatar image
Mike Dorsett answered ·

Unfortunately, lsusb won't give you the information that you are looking for.

debian@beaglebone:/var/lib/cloud9$ lsusb
Bus 001 Device 006: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
Bus 001 Device 005: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 001 Device 004: ID 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)
Bus 001 Device 003: ID 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)
Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

OK, so I'm now using bones in stead of pi's (can't get pi's easily).

The above is taken from my system, that has 2 active VE direct cables.

Just initiate a terminal window, use python in the interactive mode, and try the commands listed above.

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Mike Dorsett avatar image Mike Dorsett commented ·

debian@beaglebone:/var/lib/cloud9$ python3

Python 3.7.3 (default, Jun 29 2023, 18:03:57)

[GCC 8.3.0] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> import serial

>>> from serial.tools import list_ports

>>> from serial.tools.list_ports import comports

>>> com_ports_list = list(comports())

>>> print(com_ports_list[1])

/dev/ttyUSB2 - VE Direct cable - VE Direct cable

>>> for i in range(0,4):
... print(com_ports_list[i])
...
/dev/ttyUSB3 - MK2USB COM Interface - MK2USB COM Interface
/dev/ttyUSB2 - VE Direct cable - VE Direct cable
/dev/ttyUSB1 - VE Direct cable - VE Direct cable
/dev/ttyUSB0 - USB2.0-Serial


Mike.

0 Likes 0 ·
tinkernut avatar image tinkernut commented ·

Hi Mike,

In your case, lsusb shows 3 FTDI devices - but I don't see any when I run it here.

I can't query the USB cable because the OS (switched to an ubuntu PC by now - more troubleshooting capabilities) doesn't detect/recognize the cable.

lsusb should at least show the FTDI Device - python won't be able to talk to it otherwise.


marcel@ntp-ca1:~$ lsusb

Bus 002 Device 003: ID 0bda:0415 Realtek Semiconductor Corp. 2-Port USB 3.0 Hub

Bus 002 Device 002: ID 0bda:0411 Realtek Semiconductor Corp. Hub

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 001 Device 004: ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP)

Bus 001 Device 003: ID 0bda:5415 Realtek Semiconductor Corp. 2-Port USB 2.0 Hub

Bus 001 Device 005: ID 1546:01a7 U-Blox AG [u-blox 7]

Bus 001 Device 002: ID 0bda:5411 Realtek Semiconductor Corp. RTS5411 Hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub


marcel@ntp-ca1:~$ python3

Python 3.11.4 (main, Jun 9 2023, 07:59:55) [GCC 12.3.0] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> import serial

>>> from serial.tools import list_ports

>>> from serial.tools.list_ports import comports

>>> com_ports_list = list(comports())

>>> print(com_ports_list[1])

/dev/ttyACM0 - u-blox 7 - GPS/GNSS Receiver

>>>

The detected one is expected - GPS Receiver.


These are the errors in dmesg when the cable is plugged in:

[78028.121129] usb 1-3: new full-speed USB device number 11 using xhci_hcd

[78028.121317] usb 1-3: Device not responding to setup address.

[78028.329292] usb 1-3: Device not responding to setup address.

[78028.537126] usb 1-3: device not accepting address 11, error -71

[78028.537309] usb usb1-port3: unable to enumerate USB device


while unusual, I suspect the cable is broken. I've tried multiple different PCs - all with the same result. (mainly to rule out power issues - RPIs are prone to them)

Any other ideas?

Thanks

Marcel

0 Likes 0 ·
Mike Dorsett avatar image
Mike Dorsett answered ·

Then it looks like your VE direct cable is defective. FTDI do have a utility for programming the data into the FTDI device, and setting up its function / responses. Not sure where to down load this from though.

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

tinkernut avatar image tinkernut commented ·

I found this page: https://ftdichip.com/utilities/

Do you know the model of the chip used?

0 Likes 0 ·
Show more comments
tinkernut avatar image
tinkernut answered ·

Update: returned the cable for replacement.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.