soheilsabz
Posts: 17
Joined: Mon May 20, 2019 1:56 pm

Raspberry Zero USB connection Lost and don't detected again in Linux OS As USB Devices

Fri Jun 07, 2019 9:27 pm

I was installing my [LCD 5 Inch TFT][1] files in my raspberry Zero which connected to my PC (Linux LMDE), and after a while i have a mistake pressed accidentally some keyboard bottoms and then with this results I have lost my connection to Pi zero via terminal and now my Pi don't recognized by USB port.

Code: Select all

 [email protected]:~/Desktop $ ls
    LCD-show  LCD-show.tar.gz
    [email protected]:~/Desktop $ cd LCD-show
    [email protected]:~/Desktop/LCD-show $ sudo ./LCD5-show
    this is raspberrypi kernel
    1200
    need to update touch configuration
    Selecting previously unselected package xserver-xorg-input-evdev.
    (Reading database ... 80889 files and directories currently installed.)
    Preparing to unpack xserver-xorg-input-evdev_1%3a2.10.3-1_armhf.deb ...
    Unpacking xserver-xorg-input-evdev (1:2.10.3-1) ...
    dpkg: dependency problems prevent configuration of xserver-xorg-input-evdev:
     xserver-xorg-input-evdev depends on xorg-input-abi-22; however:
      Package xorg-input-abi-22 is not installed.
    
    dpkg: error processing package xserver-xorg-input-evdev (--install):
     dependency problems - leaving unconfigured
    Processing triggers for man-db (2.7.6.1-2) ...
    ^[[B0Errors were encountered while processing:
     xserver-xorg-input-evdev
    reboot
    0000000000packet_write_wait: Connection to 192.168.7.2 port 22: Broken pipe
    [email protected]:~$ sudo ssh [email protected]  
    ^Z
    [9]+  Stopped                 sudo ssh [email protected]
    [email protected]:~$ sudo ssh [email protected]
    ssh: connect to host 192.168.7.2 port 22: Connection timed out
Image
I have another Pi zero which is new and by inserting my the previous SD card to new Pi zero this new Pi also don't recognized by my PC.

I s this problem because of my Linux OS, And if I use Window 8 OS this problem don't occurred?

**Update**:

I have done the routine to install the [LCD 5 Inch driver][3] vi new SD Rasberian OS and without any mistake in installing i have inserted this commands:

Code: Select all

git clone https://github.com/goodtft/LCD-show.git
    chmod -R 755 LCD-show
    cd LCD-show/
    sudo ./LCD5-show
And i get this error:

Code: Select all

  [email protected]:~/Desktop/LCD-show $ sudo ./LCD5-show
    this is raspberrypi kernel
    1200
    need to update touch configuration
    Selecting previously unselected package xserver-xorg-input-evdev.
    (Reading database ... 80889 files and directories currently installed.)
    Preparing to unpack xserver-xorg-input-evdev_1%3a2.10.3-1_armhf.deb ...
    Unpacking xserver-xorg-input-evdev (1:2.10.3-1) ...
    dpkg: dependency problems prevent configuration of xserver-xorg-input-evdev:
     xserver-xorg-input-evdev depends on xorg-input-abi-22; however:
      Package xorg-input-abi-22 is not installed.
    
    dpkg: error processing package xserver-xorg-input-evdev (--install):
     dependency problems - leaving unconfigured
    Processing triggers for man-db (2.7.6.1-2) ...
    Errors were encountered while processing:
     xserver-xorg-input-evdev
    reboot
    Connection to 192.168.7.2 closed by remote host.
    Connection to 192.168.7.2 closed.
and After this i could not connect to my Pi Zero Again!!!!

the boot folder of SD card hase been changed and the **config.txt** file changed to this:

Code: Select all

   # For more options and information see
    # http://www.raspberrypi.org/documentation/configuration/config-txt.md
    # Some settings may impact device functionality. See link above for details
    
    # uncomment if you get no picture on HDMI for a default "safe" mode
    #hdmi_safe=1
    
    # uncomment this if your display has a black border of unused pixels visible
    # and your display can output without overscan
    #disable_overscan=1
    
    # uncomment the following to adjust overscan. Use positive numbers if console
    # goes off screen, and negative if there is too much border
    #overscan_left=16
    #overscan_right=16
    #overscan_top=16
    #overscan_bottom=16
    
    # uncomment to force a console size. By default it will be display's size minus
    # overscan.
    #framebuffer_width=1280
    #framebuffer_height=720
    
    # uncomment if hdmi display is not detected and composite is being output
    hdmi_force_hotplug=1
    
    # uncomment to force a specific HDMI mode (this will force VGA)
    #hdmi_group=1
    #hdmi_mode=1
    
    # uncomment to force a HDMI mode rather than DVI. This can make audio work in
    # DMT (computer monitor) modes
    #hdmi_drive=2
    
    # uncomment to increase signal to HDMI, if you have interference, blanking, or
    # no display
    #config_hdmi_boost=4
    
    # uncomment for composite PAL
    #sdtv_mode=2
    
    #uncomment to overclock the arm. 700 MHz is the default.
    #arm_freq=800
    
    # Uncomment some or all of these to enable the optional hardware interfaces
    dtparam=i2c_arm=on
    #dtparam=i2s=on
    dtparam=spi=on
    enable_uart=1
    # Uncomment this to enable the lirc-rpi module
    #dtoverlay=lirc-rpi
    
    # Additional overlays and parameters are documented /boot/overlays/README
    
    # Enable audio (loads snd_bcm2835)
    dtparam=audio=on
    max_usb_current=1
    hdmi_group=2
    hdmi_mode=1
    hdmi_mode=87
    hdmi_drive=1
    hdmi_cvt 800 480 60 6 0 0 0
    dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900
And the **cmdline.txt** file changed to this:

Code: Select all

    dwc_otg.lpm_enable=0 console=tty1 console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo
As you can see the `dtoverlay=dwc2` text in **config.txt** file has been removed, and `modules-load=dwc2,g_ether` text in the **cmdline.txt** file too removed.Also the ssh file in boot folder too removed.

I have changed those files above described abased of [this instruction][4] and it's again working and detecting but i guess i must do this camand to install LCD 5 Inch driver in Raspberry Zero Via USB OTG connection:

Code: Select all

    sudo apt-get update 
     sudo apt-get upgrade 
    sudo apt-get install  xserver-xorg-input-evdev
but again i get this error:

Code: Select all

 [email protected]:~/Desktop/LCD-show $ sudo ./LCD5-show
    mkdir: cannot create directory ‘/etc/X11/xorg.conf.d’: File exists
    this is raspberrypi kernel
    1200
    need to update touch configuration
    dpkg: warning: downgrading xserver-xorg-input-evdev from 1:2.10.5-1 to 1:2.10.3-1
    (Reading database ... 80962 files and directories currently installed.)
    Preparing to unpack xserver-xorg-input-evdev_1%3a2.10.3-1_armhf.deb ...
    Unpacking xserver-xorg-input-evdev (1:2.10.3-1) over (1:2.10.5-1) ...
    dpkg: dependency problems prevent configuration of xserver-xorg-input-evdev:
     xserver-xorg-input-evdev depends on xorg-input-abi-22; however:
      Package xorg-input-abi-22 is not installed.
    
    dpkg: error processing package xserver-xorg-input-evdev (--install):
     dependency problems - leaving unconfigured
    Processing triggers for man-db (2.7.6.1-2) ...
    Errors were encountered while processing:
     xserver-xorg-input-evdev
    reboot
    Connection to 192.168.7.2 closed by remote host.
    Connection to 192.168.7.2 closed.
This question is asked vi this link too:

https://raspberrypi.stackexchange.com/q ... s-as-usb-d

[1]: https://www.google.com/url?sa=i&rct=j&q ... 9502098706
[2]: https://i.stack.imgur.com/7TDXQ.png
[3]: https://github.com/goodtft/LCD-show.git
[4]: https://mechatronicsblog.com/cross-comp ... pberry-pi/

User avatar
rpdom
Posts: 14436
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Raspberry Zero USB connection Lost and don't detected again in Linux OS As USB Devices

Sat Jun 08, 2019 5:05 am

Which version of Raspbian are you using? xserver-xorg-input-evdev 1:2.10.3-1 is from the old Raspbian Jessie. The current version is 1:2.10.5-1 in Raspbian Stretch.

Have you changed any of your sources.list files?

What do these commands report?

Code: Select all

apt policy
apt policy xserver-xorg-input-evdev
Also the ssh file in boot folder too removed.
That is supposed to happen. That file is only needed once and gets deleted when ssh has been enabled.
The ssh command does not need sudo. This is irrelevant to the problem, but using sudo for everything is a bad idea.

soheilsabz
Posts: 17
Joined: Mon May 20, 2019 1:56 pm

Re: Raspberry Zero USB connection Lost and don't detected again in Linux OS As USB Devices

Mon Jun 10, 2019 2:54 pm

my linux OS version is :

Code: Select all

[email protected]:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
[email protected]:~ $ ^C
[email protected]:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 9.8 (stretch)
Release:        9.8
Codename:       stretch
[email protected]:~ $ hostnamectl
   Static hostname: raspberrypi
         Icon name: computer
        Machine ID: 1d3e461a791545faa8436813a811703d
           Boot ID: cb7402592c914e62a67a79da9dbf93f0
  Operating System: Raspbian GNU/Linux 9 (stretch)
            Kernel: Linux 4.14.98+
      Architecture: arm
[email protected]:~ $ uname -r
4.14.98+
[email protected]:~ $ cat /proc/version
Linux version 4.14.98+ ([email protected]) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1200 Tue Feb 12 20:11:02 GMT 2019
[email protected]:~ $ 

when i insert
apt policy
i get this respond:

Code: Select all

[email protected]:~ $ apt policy
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://archive.raspberrypi.org/debian stretch/ui armhf Packages
     release o=Raspberry Pi Foundation,a=stable,n=stretch,l=Raspberry Pi Foundation,c=ui,b=armhf
     origin archive.raspberrypi.org
 500 http://archive.raspberrypi.org/debian stretch/main armhf Packages
     release o=Raspberry Pi Foundation,a=stable,n=stretch,l=Raspberry Pi Foundation,c=main,b=armhf
     origin archive.raspberrypi.org
 500 http://raspbian.raspberrypi.org/raspbian stretch/rpi armhf Packages
     release o=Raspbian,a=stable,n=stretch,l=Raspbian,c=rpi,b=armhf
     origin raspbian.raspberrypi.org
 500 http://raspbian.raspberrypi.org/raspbian stretch/non-free armhf Packages
     release o=Raspbian,a=stable,n=stretch,l=Raspbian,c=non-free,b=armhf
     origin raspbian.raspberrypi.org
 500 http://raspbian.raspberrypi.org/raspbian stretch/contrib armhf Packages
     release o=Raspbian,a=stable,n=stretch,l=Raspbian,c=contrib,b=armhf
     origin raspbian.raspberrypi.org
 500 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages
     release o=Raspbian,a=stable,n=stretch,l=Raspbian,c=main,b=armhf
     origin raspbian.raspberrypi.org
and with
apt policy xserver-xorg-input-evdev
i get this:

Code: Select all

[email protected]:~ $ apt policy xserver-xorg-input-evdev
xserver-xorg-input-evdev:
  Installed: 1:2.10.5-1
  Candidate: 1:2.10.5-1
  Version table:
 *** 1:2.10.5-1 500
        500 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages
        100 /var/lib/dpkg/status

soheilsabz
Posts: 17
Joined: Mon May 20, 2019 1:56 pm

Re: Raspberry Zero USB connection Lost and don't detected again in Linux OS As USB Devices

Mon Jun 10, 2019 3:18 pm

My be this question is related :

viewtopic.php?f=36&t=242427&p=1478680#p1478680


the LCDshow driver files needs to be hacked because of unusual USB connection. :roll: :roll: :roll:

aBUGSworstnightmare
Posts: 1357
Joined: Tue Jun 30, 2015 1:35 pm

Re: Raspberry Zero USB connection Lost and don't detected again in Linux OS As USB Devices

Fri Jun 14, 2019 10:13 am

You are using a display with touch with the touch connected to USB port; is this correct understanding?

A Pi Zero can either be Host or Device, means with the touch connected/configured you are no longer able to make use of USB gadget mode.

Return to “Interfacing (DSI, CSI, I2C, etc.)”