Problem with com? port on Linux (Teensy 2.0 + CP2102)

Need help? Ask here and someone will help
Post Reply
Killg0reNL
Posts: 5
Joined: Wed Sep 14, 2016 8:28 pm

Problem with com? port on Linux (Teensy 2.0 + CP2102)

Post by Killg0reNL »

Hi there, i need your help.

i use.
Linux Mint 17 (64bit) Updated
Teensy 2.0

Onboard Bluetooth from my laptop. (works by coinsidence :D )
D-Sun CP2102 USB to TTL converter
i have build a DIY USB adapter, with the above mentioned products.

The programming through the teensy loader went well, it is programmed with the atmega32u4.hex firmware.
The wiring of the board should be ok (switching TX/RX makes no difference, the pins are soldered (D2, D3 and GND)
And the CP2102 works in echo mode (connecting RX to TX)

i am able to pair the DS4 with my laptop, and play Battlefield 4, with mouse and keyboard.
(Config: PS4_Battlefield4_foxy.xml)

But i want to have the DS4 controller connected to the laptop.
And the laptop through the USB-TTL --> Teensy(mini USB) connected to the PS4 (USB)

But the GIMX loader doesńt work then..
The Log shows:

Code: Select all

global option -l with value `log.txt'
global option -c with value `PS4_Battlefield4_foxy.xml'
controller #1: option -p with value `/dev/ttyUSB0'
now reading arguments for controller #2
status flag is set
subpos flag is set
force_updates flag is set
GIMX 5.9 x86_64
Linux Mint 17.1 Rebecca
Linux 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 010: ID 054c:05c4 Sony Corp. DualShock 4
Bus 007 Device 009: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 004: ID 0db0:a97a Micro Star International Bluetooth EDR Device
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
/:  Bus 08.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 07.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
    |__ Port 1: Dev 9, If 0, Class=Vendor Specific Class, Driver=cp210x, 12M
    |__ Port 2: Dev 10, If 0, Class=Human Interface Device, Driver=usbhid, 12M
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
    |__ Port 1: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
    |__ Port 1: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
can't read packet header
No controller detected.
adapter_detect failed
in the tutorial it is mentioned that it should show as a COM port.
But as you can see it is controller #1: option -p with value `/dev/ttyUSB0'

Might this be the problem, or shouldńt it matter?

Eventually i want to have the Teensy 2.0 working on a RaspberryPi2 (running Raspbian Jessie, or Ubuntu mate) on the RX/TX but i want to test this first to see that the hardware should work on a PC
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Problem with com? port on Linux (Teensy 2.0 + CP2102)

Post by Matlo »

Hi,
The naming of the serial port is just different on GNU/Linux.
There are several reasons for this error to happen:
  • console not powered on
  • bad USB cable
  • wrong wiring
  • faulty hardware
For further help, please post a clear picture showing the boards and the wiring.
GIMX creator
Killg0reNL
Posts: 5
Joined: Wed Sep 14, 2016 8:28 pm

Re: Problem with com? port on Linux (Teensy 2.0 + CP2102)

Post by Killg0reNL »

i got it working,

I placed headers, instead of soldering on to the teensy (this gcould not have been the problem)
u used connection cables, these where about15cm, the first vcable was about 40/50 cm? this might have some influence (but i think not
with the new wiring, i was able to change RX/TX easier. (Tried this allready on the TTL side, with no luck, so i gues this wasn't it either, but i must admit, it was connected the wrong way)

So be ware, on
a red D-SUN USB to TTL adapter,
Image

Label RxD is connected to D3, and
Label TxD is connected to D2)
That leaves me with the last thing i did, i reprogrammed the Teensy 2.0 again.

Then it worked on the Linux Mint laptop.

I moved it over to the Raspberry2B, and that worked straigh away.

Next step would be connecting the Teensy 2.0 to the UART of the Raspberry (GPIO 14 and GPIO15 (With voltage divider ;) )
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Problem with com? port on Linux (Teensy 2.0 + CP2102)

Post by Matlo »

The soldering may have been defective.
GIMX creator
Killg0reNL
Posts: 5
Joined: Wed Sep 14, 2016 8:28 pm

Re: Problem with com? port on Linux (Teensy 2.0 + CP2102)

Post by Killg0reNL »

i think i found the problem i have to flash: "atmega32u4.HEX" every time.

After a reboot of the system, it doesn't seem to work, when i reprogram / flash the teensy 2.0 and i swap it quick it works. (until the next powercyle)..

Now searching for into the solution.

UPDATE: The Teensy 2.0 does seem to hold the atmega32u4.HEX (tried the blink program, and removed power)
When i plug it in the RPi2, and then straight away program it in Raspbian, it does work.
But i cannot leave it connected?
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Problem with com? port on Linux (Teensy 2.0 + CP2102)

Post by Matlo »

Please post a new log file and a clear picture showing the boards and the wiring.
GIMX creator
Killg0reNL
Posts: 5
Joined: Wed Sep 14, 2016 8:28 pm

Re: Problem with com? port on Linux (Teensy 2.0 + CP2102)

Post by Killg0reNL »

i got picture's need to find a way to upload them somewhere.
i'll post the pictures and the log tomorrow.

i was able to play the whole evening without a problem, so thats good.
The solution for now is:
Raspberry should be on or turn it on.
Start gimx program
Power on PS4, when booted,
Plug in Teensy to PS4
Then load gimx configuration.

Baud rate's were 500000 in faulty and working condition.
Killg0reNL
Posts: 5
Joined: Wed Sep 14, 2016 8:28 pm

Re: Problem with com? port on Linux (Teensy 2.0 + CP2102)

Post by Killg0reNL »


Top view, build in


Top view



Bottom

http://www.tofnet.nl/RPi/RPi_setup.pdf
Schematics

Code: Select all

global option -l with value `log.txt'
global option -c with value `PS4_Battlefield4_Killg0reNL.xml'
controller #1: option -p with value `/dev/ttyAMA0'
now reading arguments for controller #2
status flag is set
subpos flag is set
force_updates flag is set
GIMX 5.9 ARMv6
Raspbian GNU/Linux 8.0 (jessie)
Linux 4.4.21-v7+ #911 SMP Thu Sep 15 14:22:38 BST 2016 unknown
Bus 001 Device 005: ID 046d:c318 Logitech, Inc. Illuminated Keyboard
Bus 001 Device 004: ID ffc0:001f  
Bus 001 Device 006: ID 054c:05c4 Sony Corp. 
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
        |__ Port 2: Dev 6, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 3: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 3: Dev 4, If 1, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 5: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 5: Dev 5, If 1, Class=Human Interface Device, Driver=usbhid, 12M
can't read packet header
No controller detected.
adapter_detect failed
to get code/log information, when it's running / working, is quite hard.
On start of gimx, i do get sometimes the message

Code: Select all

Deleted stale lock file '/home/pi/gimx-launcher_pi_guard'
And when i select text at the messages option, i can see in the black box the message:

Code: Select all

Warning: can't open macro directory /home/pi//.gimx//macros/
i am not sure if the '//' should be there (it is no type error)
Post Reply