{"id":1792,"date":"2017-05-05T07:52:59","date_gmt":"2017-05-05T15:52:59","guid":{"rendered":"https:\/\/chriscarey.com\/wp\/?p=1792"},"modified":"2017-05-06T08:17:45","modified_gmt":"2017-05-06T16:17:45","slug":"raspberry-pi-zero-otg-mode","status":"publish","type":"post","link":"https:\/\/chriscarey.com\/blog\/2017\/05\/05\/raspberry-pi-zero-otg-mode\/","title":{"rendered":"Raspberry Pi Zero OTG mode"},"content":{"rendered":"<p><a href=\"https:\/\/chriscarey.com\/wp\/wp-content\/uploads\/2017\/05\/zero-wireless.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1808\" data-permalink=\"https:\/\/chriscarey.com\/blog\/2017\/05\/05\/raspberry-pi-zero-otg-mode\/zero-wireless\/\" data-orig-file=\"https:\/\/chriscarey.com\/blog\/wp-content\/uploads\/2017\/05\/zero-wireless.png\" data-orig-size=\"678,356\" 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=\"zero-wireless\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/chriscarey.com\/blog\/wp-content\/uploads\/2017\/05\/zero-wireless-300x158.png\" data-large-file=\"https:\/\/chriscarey.com\/blog\/wp-content\/uploads\/2017\/05\/zero-wireless.png\" src=\"https:\/\/chriscarey.com\/wp\/wp-content\/uploads\/2017\/05\/zero-wireless.png\" alt=\"\" width=\"678\" height=\"356\" class=\"alignnone size-full wp-image-1808\" srcset=\"https:\/\/chriscarey.com\/blog\/wp-content\/uploads\/2017\/05\/zero-wireless.png 678w, https:\/\/chriscarey.com\/blog\/wp-content\/uploads\/2017\/05\/zero-wireless-300x158.png 300w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/a><\/p>\n<p>Configuring a Raspberry Pi Zero for the first time just got a lot easier.<\/p>\n<p><!--more--><\/p>\n<p>When setting up your Raspberry Pi Zero for the first time, the typical process was to<\/p>\n<ul>\n<li>Format the SD card on your computer<\/li>\n<li>Plug the SD card into the Pi<\/li>\n<li>Hook up a monitor and keyboard<\/li>\n<li>Boot up the Pi and configure your wireless card, take note of the IP address it gets<\/li>\n<li>Remove the monitor and keyboard<\/li>\n<li>SSH to the Pi<\/li>\n<li>Continue any setup on the device<\/li>\n<\/ul>\n<p>With OTG mode, the process is like this<\/p>\n<ul>\n<li>Format the SD card on your computer<\/li>\n<li>Tweak a few files on the SD card before ejecting it<\/li>\n<li>Plug the SD card into the Pi<\/li>\n<li>Plug the Raspberry Pi USB port into your computer<\/li>\n<li>SSH to the Pi<\/li>\n<li>Continue any setup on the device<\/li>\n<\/ul>\n<p>This is a huge improvement as we no longer need to plug in the HDMI monitor or keyboard for initial setup!<\/p>\n<p>When you plug the Pi into your computer in the above example, it is emulating a virtual Ethernet device. Essentially, your computer thinks you plugged a network card into it.<\/p>\n<p>On top of the benefit of making initial setup easier, the OTG mode can do so much more. Many more modes are available to make the Pi emulate a multitude of hardware devices such as:<\/p>\n<p>Serial (g_serial)<br \/>\nEthernet (g_ether)<br \/>\nMass storage (g_mass_storage)<br \/>\nMIDI (g_midi)<br \/>\nAudio (g_audio)<br \/>\nKeyboard\/Mouse (g_hid)<br \/>\nMass storage and Serial (g_acm_ms)<br \/>\nEthernet and Serial (g_cdc)<br \/>\nMulti (g_multi) &#8211; Allows you to configure 2 from Ethernet, Mass storage and Serial<br \/>\nWebcam (g_webcam)<br \/>\nPrinter (g_printer)<br \/>\nGadget tester (g_zero)<\/p>\n<p>This makes the Raspberry Pi like a hardware chameleon and opens up many possibilities for cool hacks.<\/p>\n<p>Props to Andrew Mulholland for his work with this.<\/p>\n<p>More information is at Andrew&#8217;s blog at:<\/p>\n<p><a href=\"https:\/\/gist.github.com\/gbaman\/975e2db164b3ca2b51ae11e45e8fd40a\" target=\"_blank\">https:\/\/gist.github.com\/gbaman\/975e2db164b3ca2b51ae11e45e8fd40a<\/a><br \/>\n<a href=\"http:\/\/blog.gbaman.info\/?p=699\" target=\"_blank\">http:\/\/blog.gbaman.info\/?p=699<\/a> Part 1<br \/>\n<a href=\"http:\/\/blog.gbaman.info\/?p=791\" target=\"_blank\">http:\/\/blog.gbaman.info\/?p=791<\/a> Part 2<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Configuring a Raspberry Pi Zero for the first time just got a lot easier.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[59],"tags":[],"class_list":["post-1792","post","type-post","status-publish","format-standard","hentry","category-raspberry-pi"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/prpYG-sU","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/posts\/1792","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/comments?post=1792"}],"version-history":[{"count":18,"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/posts\/1792\/revisions"}],"predecessor-version":[{"id":1811,"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/posts\/1792\/revisions\/1811"}],"wp:attachment":[{"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/media?parent=1792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/categories?post=1792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chriscarey.com\/blog\/wp-json\/wp\/v2\/tags?post=1792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}