element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Raspberry Pi Zero W: Can't connect to SSH no matter what
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 9 replies
  • Answers 4 answers
  • Subscribers 664 subscribers
  • Views 5162 views
  • Users 0 members are here
  • raspberry pi zero
  • ssh
Related

Raspberry Pi Zero W: Can't connect to SSH no matter what

pathfider1998
pathfider1998 over 7 years ago

This is a very long story, so I will try to keep it as short as possible.

 

1. I got RPi 0 W.

2. I installed Raspbian Stretch Lite, the one straight from official site.

3. I realized that mini HDMI converter hasn't arrived yet, so I decided to go headless. This is going to be a server, after all.

4. Here's where the trouble began -- no matter what I do, I couldn't get the RPi0 to connect to Wi-Fi.

5. So I tried network interface thing (involving those two lines: dtoverlay=dwc2 on config.txt and  modules-load=dwc2,g_ether on cmdline.txt, following guide from https://gist.github.com/gbaman/975e2db164b3ca2b51ae11e45e8fd40a )

6. Installed Bonjour Print Service as instructed

7. When it worked, it did show up as network device under the name Network Gadget with some more words in front of it, and it required installation of generic driver from Microsoft Corporation

8. I could ping to raspberrypi.local, but no matter what I try, it always ended up with "Connection refused" error when trying to connect to port 22 when ssh-ing.

9. Now it doesn't work at all, the device never shows up but the ACT LED is still on and flashes away as boot process continues (each tries were done after waiting longer than 90 seconds to ensure boot process is done)

 

Here's the content of each config files, including "wpa_supplicant.conf" file.

config.txt

<snip, content identical to stock file>

dtoverlay=dwc2

 

cmdline.txt:

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=37665771-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait modules-load=dwc2,g_ether

 

wpa_supplicant.conf:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

update_config=1

 

network={

    ssid="********"

    psk="********"

    scan_ssid=1

    key_mgmt=WPA-PSK

}

 

I do have "ssh" file without extension and content in the drive called root, along with config.txt and cmdline.txt as they told me to do. They were there before first boot.

What went wrong here? Please help!

  • Sign in to reply
  • Cancel
Parents
  • Robert Peter Oakes
    0 Robert Peter Oakes over 7 years ago

    I think you may find the instructions should tell you to put these files "ssh", "config.txt" and cmdline.txt" into the /boot/... folder, not the root.

    I have just done this with my PI Zero W and it worked ok with a few exceptions

     

    If I tried to pre-setup the WIFI with wps-supplicant file in /boot/...  it will not work with stretch, I tried Jessie and it worked first time

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • pathfider1998
    0 pathfider1998 over 7 years ago in reply to Robert Peter Oakes

    Wow, this is confusing! Even the official documentation said they should be put into the root folder of a drive called "boot", not a folder called "boot"

    (because Windows, in its stock state, cannot read ext2 partition, I can't check the log until the setup has been done and I have to wipe it clean and start over again anyway)

    Does wpa_supplicant.conf file have anything to do with this? When I did not include this file, RPi didn't even show up on my computer as a USB client/slave.

    I'm also confused by the full version (including the region code) of the config file. Some say it's okay not to include that line, some say it's critical, and so on...

    This is going to be a tough fight, because I can't see the live log of things happening inside this teeny tiny board yet.

    Anyway, I will try your method, followed by a combination of all the solutions given by the community (on root, /boot/, ext2 partition, /boot/ on ext2 partition, etc.)

     

    Note: if your path looks like "/dev/sda/boot/", your tutorial may not be compatible with Windows. Windows uses single alphabet drive letters instead of 3 letters or more. Again, the only partition the user on Windows will see is a small 40mb partition named "boot". 1.37GB partition will not be visible.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 7 years ago in reply to pathfider1998

    The boot folder is the one that windows will see when you put the SD card into a windows machine, yes you will also get some windows errors because of the other partitions on the SD card, dont follow the windows advice and format them, that would be bad.

    Just navigate into the boot folder using windows explorer or something, then create the files there

     

    My /boot/wpa_supplicant.conf contains only this (This is from perspactive of the windows view, not under linux, the content is the same, just the location will change under linux

     

    network={

        ssid="********"

        psk="********"

        key_mgmt=WPA-PSK

    }

     

    create an empty file in the /boot/ folder called nothing but "ssh" without the quotes of course, this will instruct linux to enable ssh at startup

     

    these are the only two files I found I needed to add before booting, but as I said earlier, this did not work for Stretch, just pixel or earlier

    note when you boot up, the filwpa... is moved to /etc/wpa_supplicant folder under linx and will dissapear from the boot folder. the ssh named file will just dissapear once ssh is turned on

     

    that's all there is to it.

     

    ewhy were you adding the other files ??

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • Robert Peter Oakes
    0 Robert Peter Oakes over 7 years ago in reply to pathfider1998

    The boot folder is the one that windows will see when you put the SD card into a windows machine, yes you will also get some windows errors because of the other partitions on the SD card, dont follow the windows advice and format them, that would be bad.

    Just navigate into the boot folder using windows explorer or something, then create the files there

     

    My /boot/wpa_supplicant.conf contains only this (This is from perspactive of the windows view, not under linux, the content is the same, just the location will change under linux

     

    network={

        ssid="********"

        psk="********"

        key_mgmt=WPA-PSK

    }

     

    create an empty file in the /boot/ folder called nothing but "ssh" without the quotes of course, this will instruct linux to enable ssh at startup

     

    these are the only two files I found I needed to add before booting, but as I said earlier, this did not work for Stretch, just pixel or earlier

    note when you boot up, the filwpa... is moved to /etc/wpa_supplicant folder under linx and will dissapear from the boot folder. the ssh named file will just dissapear once ssh is turned on

     

    that's all there is to it.

     

    ewhy were you adding the other files ??

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube