{"id":4191,"date":"2020-11-30T17:54:25","date_gmt":"2020-11-30T09:54:25","guid":{"rendered":"https:\/\/www.janleow.com\/life\/?p=4191"},"modified":"2021-03-10T18:53:40","modified_gmt":"2021-03-10T10:53:40","slug":"ssh-from-pc-to-raspberry-pi0-project","status":"publish","type":"post","link":"https:\/\/www.janleow.com\/life\/ssh-from-pc-to-raspberry-pi0-project.html","title":{"rendered":"SSH from PC to Raspberry Pi0 Project"},"content":{"rendered":"\n<p>I came across this project to SSH from the computer to the Raspberry Pi Zero using the USB RNDIS ethernet gadget with a self made USB addon board. From the various videos, it looked easy and I decided to give it a go. However I\u2019m still not able to do any wire soldering just yet, and decided to purchase a professionally made Pi0 USB-A addon board by Cytron.io. With all my devices in hand I started to proceed with this SSH project.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"330\" data-attachment-id=\"4193\" data-permalink=\"https:\/\/www.janleow.com\/life\/ssh-from-pc-to-raspberry-pi0-project.html\/2020-11-29_rpi0_addon_board\" data-orig-file=\"https:\/\/www.janleow.com\/imgs\/wp\/2020-11-29_rpi0_addon_board.jpg\" data-orig-size=\"889,586\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"2020-11-29_rpi0_addon_board\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.janleow.com\/imgs\/wp\/2020-11-29_rpi0_addon_board-250x165.jpg\" data-large-file=\"https:\/\/www.janleow.com\/imgs\/wp\/2020-11-29_rpi0_addon_board-500x330.jpg\" src=\"https:\/\/www.janleow.com\/imgs\/wp\/2020-11-29_rpi0_addon_board-500x330.jpg\" alt=\"Raspberry Pi Zero and USB addon board for SSH ethernet RNDIS gadget\" class=\"wp-image-4193\" srcset=\"https:\/\/www.janleow.com\/imgs\/wp\/2020-11-29_rpi0_addon_board-500x330.jpg 500w, https:\/\/www.janleow.com\/imgs\/wp\/2020-11-29_rpi0_addon_board-250x165.jpg 250w, https:\/\/www.janleow.com\/imgs\/wp\/2020-11-29_rpi0_addon_board-768x506.jpg 768w, https:\/\/www.janleow.com\/imgs\/wp\/2020-11-29_rpi0_addon_board.jpg 889w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/figure>\n\n\n\n<!--more-->\n\n\n\n<p>\nTo SSH from my PC to the Raspberry Pi, I prepared the following hardware &amp; software:<br>\na) Raspberry Pi Zero<br>\nb) USB-A addon board (optional, as I found out later it wasn\u2019t necessary to have this)<br>\nc) USB HUB with microUSB OTG<br>\nd) USB LAN or USB WIFI (if just plain old Pi0. Pi0-W or WH has built-in WiFi)<br>\ne) Mouse &amp; Keyboard<br>\nf) Putty (https:\/\/www.putty.org)<br>\ng) VNC Viewer (https:\/\/www.realvnc.com)<br>\n<\/p>\n\n\n\n<p>\nThe steps seemed simple enough.\n<\/p>\n\n\n\n<p>\n1) Install a fresh Rasbian OS onto a microSD card\n<\/p>\n\n\n\n<p> 2) Edit the config.txt file in the boot partition,<br> add the following line at the end of the file: <\/p>\n\n\n\n<pre>dtoverlay=dwc2<\/pre>\n\n\n\n<p>\n3) Edit the cmdline.txt file and add the following between the rootwait and quiet\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">modules-load=dwc2,g_ether<\/pre>\n\n\n\n<p>\n4) Some videos &amp; blogs added this SSH file, some didn\u2019t. Since it was just a simple file, I decided to add it whether it was required or not. Create an empty text file without any extension and name it:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">SSH\n<\/pre>\n\n\n\n<p>\n5) Boot up Raspberry Pi0 and run the Raspberry Pi Configuration:\n<\/p>\n\n\n\n<ul><li>enable SSH<\/li><li>enable VNC<\/li><\/ul>\n\n\n\n<p>\nAnd shutdown Raspbian<\/p>\n\n\n\n<p>\n6) Remove all connections from the RPi0, and with the USB addon board, connect to the PC. RPi0 will boot and the PC should detect it and install the required device drivers. If you are lucky, a pop up in Windows 10 will show \u201csetting up USB Ethernet\/RNDIS Gadget\u201d. It took me several tries before this pop up appeared.\n<\/p>\n\n\n\n<p>\nThis was where the trouble started. On many videos and blogs, if you check your PC Device Manager under the Network adapters, a USB Ethernet\/RNDIS Gadget would show up. Unfortunately it didn\u2019t work for me, and no matter what I changed, it still won\u2019t detect as that. So that was the end of my attempt for a USB SSH connection. \n<\/p>\n\n\n\n<p>\nThis was what I tried to fix it:\n<\/p>\n\n\n\n<p>\nReinstall the RNDIS driver. All Windows since XP has this driver, but just in case it wasn\u2019t installed properly, head on to Microsoft and create the inf for RNDIS driver installation.\n<\/p>\n\n\n\n<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/windows-hardware\/drivers\/network\/remote-ndis-inf-template\" target=\"_blank\" ref=\"nofollow\" rel=\"noopener noreferrer\">https:\/\/docs.microsoft.com\/en-us\/windows-hardware\/drivers\/network\/remote-ndis-inf-template<\/a><\/p>\n\n\n\n<p>\nCopy the appropriate Windows version inf code, create a text file with inf extension and paste the inf code. Right click inf and select install. Reboot the PC and insert the RPi0 once more. \n<\/p>\n\n\n\n<p> If Windows still failed to connect as a USB Ethernet\/RNDIS Gadget then that is the end for direct USB SSH connection attempt. You could still try connecting via LAN network though it would be less elegant.  <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"357\" data-attachment-id=\"4194\" data-permalink=\"https:\/\/www.janleow.com\/life\/ssh-from-pc-to-raspberry-pi0-project.html\/2020-11-30_putty_vnc_viewer\" data-orig-file=\"https:\/\/www.janleow.com\/imgs\/wp\/2020-11-30_putty_vnc_viewer.jpg\" data-orig-size=\"1049,749\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"2020-11-30_putty_vnc_viewer\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.janleow.com\/imgs\/wp\/2020-11-30_putty_vnc_viewer-250x179.jpg\" data-large-file=\"https:\/\/www.janleow.com\/imgs\/wp\/2020-11-30_putty_vnc_viewer-500x357.jpg\" src=\"https:\/\/www.janleow.com\/imgs\/wp\/2020-11-30_putty_vnc_viewer-500x357.jpg\" alt=\"Putty and VNC Viewer\" class=\"wp-image-4194\" srcset=\"https:\/\/www.janleow.com\/imgs\/wp\/2020-11-30_putty_vnc_viewer-500x357.jpg 500w, https:\/\/www.janleow.com\/imgs\/wp\/2020-11-30_putty_vnc_viewer-250x179.jpg 250w, https:\/\/www.janleow.com\/imgs\/wp\/2020-11-30_putty_vnc_viewer-768x548.jpg 768w, https:\/\/www.janleow.com\/imgs\/wp\/2020-11-30_putty_vnc_viewer.jpg 1049w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/figure>\n\n\n\n<p>\n7) Install Putty and VNC Viewer in your Windows PC and start up your RPi normally.\n<\/p>\n\n\n\n<p>\nPutty will connect as a terminal to your Raspberry Pi0 and you can key in your linux commands from your Windows PC. While VNC Viewer will mirror your Raspberry Pi0 and you could control all functions of your RPi0.\n<\/p>\n\n\n\n<p>\nMake sure your RPi0 is connected via LAN or WiFi to your network or via your USB Ethernet\/RNDIS gadget. Then running either software, you will connect by typing raspberrypi.local\n<\/p>\n\n\n\n<p> Once you are connected, type \u201cpi\u201d as your user ID and \u201craspberry\u201d, the default password if you haven\u2019t changed it to your own password yet. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"258\" data-attachment-id=\"4201\" data-permalink=\"https:\/\/www.janleow.com\/life\/ssh-from-pc-to-raspberry-pi0-project.html\/2020-11-30_rpi0_microusb_ssh_connect\" data-orig-file=\"https:\/\/www.janleow.com\/imgs\/wp\/2020-11-30_rpi0_microusb_ssh_connect.jpg\" data-orig-size=\"902,466\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"2020-11-30_rpi0_microusb_ssh_connect\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.janleow.com\/imgs\/wp\/2020-11-30_rpi0_microusb_ssh_connect-250x129.jpg\" data-large-file=\"https:\/\/www.janleow.com\/imgs\/wp\/2020-11-30_rpi0_microusb_ssh_connect-500x258.jpg\" src=\"https:\/\/www.janleow.com\/imgs\/wp\/2020-11-30_rpi0_microusb_ssh_connect-500x258.jpg\" alt=\"Direct microUSB connection to PC for SSH\" class=\"wp-image-4201\" srcset=\"https:\/\/www.janleow.com\/imgs\/wp\/2020-11-30_rpi0_microusb_ssh_connect-500x258.jpg 500w, https:\/\/www.janleow.com\/imgs\/wp\/2020-11-30_rpi0_microusb_ssh_connect-250x129.jpg 250w, https:\/\/www.janleow.com\/imgs\/wp\/2020-11-30_rpi0_microusb_ssh_connect-768x397.jpg 768w, https:\/\/www.janleow.com\/imgs\/wp\/2020-11-30_rpi0_microusb_ssh_connect.jpg 902w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/figure>\n\n\n\n<p>\nTrying out this project, I found out that there is no need for the USB-A addon board. You could just as easily connect using a USB-microUSB cable from your PC to the RPi0. However due to my failure to get it to recognize as a USB ethernet RNDIS Gadget, I had to connect via the LAN network, which was still rather interesting. I could remote control my Raspberry Pi as long as it is within the same network infrastructure.\n<\/p>\n\n\n\n<p>\nHope you have better luck with this SSH project!\n<\/p>\n\n\n\n<p>30-Nov-2020<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I came across this project to SSH from the computer to the Raspberry Pi Zero using the USB RNDIS ethernet gadget with a self made USB addon board. From the various videos, it looked easy and I decided to give it a go. However I\u2019m still not able to do any wire soldering just yet, &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.janleow.com\/life\/ssh-from-pc-to-raspberry-pi0-project.html\"> <span class=\"screen-reader-text\">SSH from PC to Raspberry Pi0 Project<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[6,197],"tags":[50,51,115,116,198,163],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1bS5F-15B","jetpack-related-posts":[{"id":4255,"url":"https:\/\/www.janleow.com\/life\/argon-one-m-2-for-raspberry-pi-4.html","url_meta":{"origin":4191,"position":0},"title":"Argon One M.2 for Raspberry Pi 4","author":"Jan","date":"10 August 2023","format":false,"excerpt":"Finally, I have decided to get my hands on one of the most popular cases, the Argon One for Raspberry Pi 4; it also has one of the highest price tags in comparison with other casing in the market. What tipped me over to get it was the new base\u2026","rel":"","context":"In &quot;Computer Devices&quot;","block_context":{"text":"Computer Devices","link":"https:\/\/www.janleow.com\/life\/category\/computer-devices"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4180,"url":"https:\/\/www.janleow.com\/life\/how-to-usb-boot-in-raspberry-pi4.html","url_meta":{"origin":4191,"position":1},"title":"How to USB Boot in Raspberry Pi4","author":"Jan","date":"2 November 2020","format":false,"excerpt":"One of the features of Raspberry Pi4 is the ability to have USB boot. One of the good reasons why you might want to boot up via USB is the faster read writes by using SSD external drives and alternate options to boot up your OS. This option was not\u2026","rel":"","context":"In &quot;Computer Devices&quot;","block_context":{"text":"Computer Devices","link":"https:\/\/www.janleow.com\/life\/category\/computer-devices"},"img":{"alt_text":"Raspberry Pi 4 bootloader message","src":"https:\/\/i0.wp.com\/www.janleow.com\/imgs\/wp\/2020-11-02_rpi4_bootloader.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.janleow.com\/imgs\/wp\/2020-11-02_rpi4_bootloader.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.janleow.com\/imgs\/wp\/2020-11-02_rpi4_bootloader.jpg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.janleow.com\/imgs\/wp\/2020-11-02_rpi4_bootloader.jpg?resize=700%2C400 2x"},"classes":[]},{"id":4187,"url":"https:\/\/www.janleow.com\/life\/my-raspberry-pi-400-keyboard-computer.html","url_meta":{"origin":4191,"position":2},"title":"My Raspberry Pi 400 Overview","author":"Jan","date":"6 November 2020","format":false,"excerpt":"Raspberry Pi 400 was recently launched and I couldn\u2019t overcome my enthusiasm and decided to jump right in and got myself one! It has a more powerful processor (BCM2711CO) clocking in at 1.8GHz and purpose built keyboard enclosing the Raspberry Pi board and some nifty built-in heatsink. So after getting,\u2026","rel":"","context":"In &quot;Computer Devices&quot;","block_context":{"text":"Computer Devices","link":"https:\/\/www.janleow.com\/life\/category\/computer-devices"},"img":{"alt_text":"Raspberry Pi 400 computer keyboard","src":"https:\/\/i0.wp.com\/www.janleow.com\/imgs\/wp\/2020-11-06_raspberry_pi_400.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.janleow.com\/imgs\/wp\/2020-11-06_raspberry_pi_400.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.janleow.com\/imgs\/wp\/2020-11-06_raspberry_pi_400.jpg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.janleow.com\/imgs\/wp\/2020-11-06_raspberry_pi_400.jpg?resize=700%2C400 2x"},"classes":[]},{"id":4174,"url":"https:\/\/www.janleow.com\/life\/raspberry-pi-getting-started.html","url_meta":{"origin":4191,"position":3},"title":"Raspberry Pi Getting Started","author":"Jan","date":"1 November 2020","format":false,"excerpt":"Raspberry Pi is a nifty little single board computer (SBC) introduced many years back. I started to have an interest in this palm sized computer last year while looking for some PC tinkering projects. It was the time when Raspberry Pi4 model B was launched with much advancement over its\u2026","rel":"","context":"In &quot;Computer Devices&quot;","block_context":{"text":"Computer Devices","link":"https:\/\/www.janleow.com\/life\/category\/computer-devices"},"img":{"alt_text":"Raspberry Pi 4 model B","src":"https:\/\/i0.wp.com\/www.janleow.com\/imgs\/wp\/2019-08-17_rpi_JL1.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.janleow.com\/imgs\/wp\/2019-08-17_rpi_JL1.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.janleow.com\/imgs\/wp\/2019-08-17_rpi_JL1.jpg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.janleow.com\/imgs\/wp\/2019-08-17_rpi_JL1.jpg?resize=700%2C400 2x"},"classes":[]},{"id":1023,"url":"https:\/\/www.janleow.com\/life\/usb-fan.html","url_meta":{"origin":4191,"position":4},"title":"USB Fan","author":"Jan","date":"17 March 2009","format":false,"excerpt":"Lena said that her office always shuts off the air-con after office hours and the environment gets a little warm afterwards. Perhaps this little nifty little gadget might help some. It is a USB powered fan. Really cheapo! Going for RM8.80 as sold in All IT computer store. It sounded\u2026","rel":"","context":"In &quot;Computer Devices&quot;","block_context":{"text":"Computer Devices","link":"https:\/\/www.janleow.com\/life\/category\/computer-devices"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.janleow.com\/imgs\/wp\/usb_fan.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2876,"url":"https:\/\/www.janleow.com\/life\/micro-usb-data-cable.html","url_meta":{"origin":4191,"position":5},"title":"Micro USB Data Cable","author":"Jan","date":"11 December 2010","format":false,"excerpt":"Micro USB data cable is the current standard data cable for mobile phone connection to the PC. Each new computer device will come out with new kind of USB data connector. And so I have amassed quite a collection of USB data cable starting from the standard USB-A, to USB\u2026","rel":"","context":"In &quot;Computer Devices&quot;","block_context":{"text":"Computer Devices","link":"https:\/\/www.janleow.com\/life\/category\/computer-devices"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.janleow.com\/life\/wp-json\/wp\/v2\/posts\/4191"}],"collection":[{"href":"https:\/\/www.janleow.com\/life\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.janleow.com\/life\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.janleow.com\/life\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.janleow.com\/life\/wp-json\/wp\/v2\/comments?post=4191"}],"version-history":[{"count":8,"href":"https:\/\/www.janleow.com\/life\/wp-json\/wp\/v2\/posts\/4191\/revisions"}],"predecessor-version":[{"id":4222,"href":"https:\/\/www.janleow.com\/life\/wp-json\/wp\/v2\/posts\/4191\/revisions\/4222"}],"wp:attachment":[{"href":"https:\/\/www.janleow.com\/life\/wp-json\/wp\/v2\/media?parent=4191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.janleow.com\/life\/wp-json\/wp\/v2\/categories?post=4191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.janleow.com\/life\/wp-json\/wp\/v2\/tags?post=4191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}