Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capturing/Recognizing USB ports #3

Open
mudgw2 opened this issue May 23, 2020 · 14 comments
Open

Capturing/Recognizing USB ports #3

mudgw2 opened this issue May 23, 2020 · 14 comments

Comments

@mudgw2
Copy link

mudgw2 commented May 23, 2020

Greetings, I got your script working and ECMLink boots up and runs, it however cannot seem to recognize any USB traffic so I'm unable to capture.

However, if I just plug the USB into a windows laptop it works instantly.

Any suggestions as to how to set the linux version to pick up on USB ports?

@kami-nashi
Copy link
Owner

Interesting. With the ecmlink cabled plugged into the pi, can you run the following command and paste the output here?

lsusb -v | grep -E '\<(Bus|iProduct|bDeviceClass|bDeviceProtocol)' 2>/dev/null

@mudgw2
Copy link
Author

mudgw2 commented May 23, 2020 via email

@kami-nashi
Copy link
Owner

kami-nashi commented May 23, 2020

sudo apt-get update sudo apt-get install usbutils

That should install it

via: https://discourse.osmc.tv/t/lsusb-command-not-found-solved/7731/8

@mudgw2
Copy link
Author

mudgw2 commented May 24, 2020 via email

@mudgw2
Copy link
Author

mudgw2 commented May 26, 2020

Found some more info at these URLs:
https://technicalustad.com/fix-usb-device-not-recognized-in-raspberry-pi/
https://stackoverflow.com/questions/9183880/how-to-find-out-which-usb-rs232-device-is-on-which-tty

Will continue to investigate...looks like there needs to be a driver for DMSLink USB to talk to Raspbian OS?

@kami-nashi
Copy link
Owner

I agree, it looks like it might be a driver issue might also be a cable issue (maybe), here is the output from my CentOS7 laptop:

Bus 001 Device 042: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
  bDeviceClass            0 (Defined at Interface level)
  bDeviceProtocol         0 
  iProduct                2 ECMLink adapter
      (Bus Powered)
  (Bus Powered)

vs your

Bus 001 Device 005: ID 0403:6001 Future Technology Devices International,
Ltd FT232 Serial (UART) IC
  bDeviceClass            0
  bDeviceProtocol         0
      (Bus Powered)
  (Bus Powered)

The bus and device numbers only specify what USB port its attached to; so that is okay to be different. They are both recognized as serial devices (232/uart), that is also good. I don't see a product id for you though.

What version of Pi are you running? (?2/3/4?).

@kami-nashi
Copy link
Owner

On my Pi 3, this is what i get for a brand new, never used cable and also one that I know is crap:

Bus 001 Device 006: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
  bDeviceClass            0 
  bDeviceProtocol         0 
  iProduct                2 ECMLink adapter
      (Bus Powered)
  (Bus Powered)
Bus 001 Device 005: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
  bDeviceClass            0 
  bDeviceProtocol         0 
  iProduct                2 ECMLink adapter
      (Bus Powered)
  (Bus Powered)

Hopefully, that means we can rule out the cable, because those things are expensive. You can get the OS and hardware version by running cat /etc/os-release | grep PRETTY; awk '/^Revision/ {sub("^1000", "", $3); print $3}' /proc/cpuinfo and copying the results here (via https://elinux.org/RPi_HardwareHistory)

After that, we can dig a little deeper.

@mudgw2
Copy link
Author

mudgw2 commented May 27, 2020 via email

@kami-nashi
Copy link
Owner

Cool deal. I thought I had the driver included in the set up script.... it could be that it failed for some reason. Hard to say with what we have so far. I'll be on the look out for your post. Hopefully we get to close this with you learning something :)

@mudgw2
Copy link
Author

mudgw2 commented May 27, 2020 via email

@mudgw2
Copy link
Author

mudgw2 commented May 28, 2020

Okay, I found the solution (at least for me). The above URL was a bust as their instructions are out of date...(linux is only worthwhile if you dont value your time...).

So the driver is NOT the issue... this document I had sitting on my desktop this year has a piece that I think is missing from your script?
https://www.dsmtuners.com/threads/raspberry-pi-running-ecmlink-on-headunit.476635/
They have a document called "How to Raspberry Pi ECMlink".

In there i went over it to see if there was something that I could try that perhaps wasn't in your setup.

There are some additional programs that detail auto booting into ECMLink so you dont have to manually choose the program, also I did notice some permission issues when ECMLink tried to record data...but I was able to get live feed working.

I had to enter in this command, which already is supported by the software you install (I think).
setserial /dev/ttyUSB0 baud_base 3000000 divisor 192 spd_cust

This has to be run every time the program launches (or at least every time the pi is turned on...

I have also hosted the entire document as well off my google drive:
https://docs.google.com/document/d/1H8yIj0vYoCC24Mivh9ROLCiDefgHEzpsugsyEhslzow/edit?usp=sharing

So, using your script and some bits from the document, you can get this to autoload and run automatically ECMLink on a Raspberry pi2 (which is what I'm using). Believe 3 is the same..however Raspberry pi4 has a different CPU and is probably less of a problem to use as I think it can run standard debian at that point...

@kami-nashi
Copy link
Owner

Ah, okay, so some feedback based on my expectations vs what I think yours are:

My implementation does not provide an auto-logging nor auto-launch feature - and i didn't realize that is what you were looking for.

The way I have this set up is a bit different. On the spi bus, I have a pwm module with 2 basic LED's attached. Basically, the red led blinks if the ECMLink process is not found, the green light remains off. Once the link process is found, the red light turns solid, and the green light blinks until 'f12' is pushed. onve that 'f12' is pushed, both lights are solid = indicating that link is running and is recording. Now, this is headless-friendly, meaning that no keyboard is required. The f12 and link-luanching happens via one of two push buttons on the gpio pins.

This allows for a very small install of 2 indicators and buttons, of user's choice, in user's location, to launch, log, and get a visual of status at the track with out having to navigate through a UI and also have some visual feedback that something is working. for some one who has this on a daily driver, they may not want to log every time the key is on - and this compliments that mentality.

The 'f12', handled by gpio, does have the setserial command, because that was a concern. I'm still concerned as to why your cable doesn't show ECMLink in the product, but it could be that you just dont have the same version of cable that I do.

Now, I haven't tested this on my pi2, though i will be doing so this weekend. I have run link on it in the past. I do know it works, but the results are much better on the 3 and i highly recommend that. I don't have a version 4 yet - so i can only say it should perform just as well or better than the 3.... but may also require some tweaking as i think the cpu arch is slightly different. when I get one, i may have to put in an arch/hardware type detection 'thing' into the script to accommodate it.

I want to keep this open until I test on my pi2.

@mudgw2
Copy link
Author

mudgw2 commented May 29, 2020 via email

@kami-nashi
Copy link
Owner

Switching mappings is something i've considered, but I'm not sure is going to be possible. It should be super easy to take the setup i have and apply it to a touch screen - so that you can see whats on the screen but not have to fiddle with touch area. Not to mention, if you're wearing gloves, itll be that much harder. I'll try to do a video of this, so you can see it in action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants