{"id":447,"date":"2018-07-27T19:15:35","date_gmt":"2018-07-27T11:15:35","guid":{"rendered":"https:\/\/www.techcoil.com\/blog\/?p=447"},"modified":"2022-09-27T15:03:43","modified_gmt":"2022-09-27T07:03:43","slug":"how-to-connect-your-raspberry-pi-to-your-iphone-wifi-hotspot-via-raspbian-stretch-lite","status":"publish","type":"post","link":"https:\/\/www.techcoil.com\/blog\/how-to-connect-your-raspberry-pi-to-your-iphone-wifi-hotspot-via-raspbian-stretch-lite\/","title":{"rendered":"How to connect your Raspberry Pi to your iPhone WiFi hotspot via Raspbian Stretch Lite"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.techcoil.com\/blog\/wp-content\/uploads\/Raspberry-Pi-3-and-Raspberry-Pi-Zero-W-connecting-to-iPhone-WiFi-hotspot.jpg\" alt=\"Raspberry Pi 3 and Raspberry Pi Zero W connecting to iPhone WiFi hotspot\" \/><\/p>\n<p><a href=\"https:\/\/www.techcoil.com\/blog\/tag\/raspberry-pi\" rel=\"noopener\" target=\"_blank\">Raspberry Pis<\/a> with WiFi are very useful for building prototypes that connect to services on the Internet. <\/p>\n<p>In case you need a Raspberry Pi with in-built WiFi, you can get one of these:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.amazon.com\/Raspberry-Pi-Computer-Suitable-Workstation\/dp\/B0899VXM8F?crid=2O8GM36WC2HXB&linkCode=ll1&tag=clivsperswebs-20&linkId=bfa7dd545ba20443c067bc0e3d6e3515&language=en_US&ref_=as_li_ss_tl\" rel=\"noopener\" target=\"_blank\">Raspberry Pi 4 B<\/a><\/li>\n<li><a href=\"https:\/\/www.amazon.com\/ELEMENT-Element14-Raspberry-Pi-Motherboard\/dp\/B07BDR5PDW\/\/ref=as_li_ss_tl?ie=UTF8&linkCode=ll1&tag=clivsperswebs-20&linkId=eee243060c57ce7b0c5c804232786d36&language=en_US\" rel=\"noopener\" target=\"_blank\">Raspberry Pi 3 B+<\/a><\/li>\n<li><a href=\"https:\/\/www.amazon.com\/CanaKit-Raspberry-Wireless-Official-Supply\/dp\/B071L2ZQZX\/\/ref=as_li_ss_tl?ie=UTF8&linkCode=ll1&tag=clivsperswebs-20&linkId=f645ac695540e44a59bbdaa1a8141ef9&language=en_US\" rel=\"noopener\" target=\"_blank\">Raspberry Pi Zero W<\/a><\/li>\n<\/ul>\n<p>An operating system is needed for running your Raspberry Pi and Raspbian Stretch Lite is an ideal choice for server based applications. <\/p>\n<p>Although Raspbian Stretch Lite does not have a graphical user interface, it is not difficult to get it to connect to a WiFi hotspot. <\/p>\n<p>If you wish to use your <a href=\"https:\/\/www.amazon.com\/s\/ref=as_li_ss_tl?url=search-alias=aps&field-keywords=iPhone&linkCode=ll2&tag=clivsperswebs-20&linkId=9cb082415c599a235efa956a8620f06c&language=en_US\" rel=\"noopener\" target=\"_blank\">iPhone<\/a> as a WiFi hotspot for your Raspberry Pi prototype, read this post to find out how to connect Raspbian Stretch Lite to your iPhone hotspot.<\/p>\n<h2>Enable Personal Hotspot on your iPhone<\/h2>\n<p>First, <a href=\"https:\/\/www.techcoil.com\/blog\/how-to-turn-on-wifi-personal-hotspot-on-your-iphone-so-that-multiple-devices-can-connect-to-the-internet\/\" rel=\"noopener\" target=\"_blank\">turn on WiFi Personal hotspot on your iPhone<\/a>. Once the WiFi Personal hotspot is turned on, you will be able to connect WiFi devices to it. <\/p>\n<p>The SSID (or WiFi hotspot name) and password of your iPhone WiFi Personal hotspot will be needed to connect Raspbian Stretch Lite. You can get the SSID and password of your WiFi Personal hotspot at the <strong>Personal Hotspot<\/strong> screen.<\/p>\n<p>For example, in the sample screenshot below, the SSID is <strong>MyiPhone<\/strong> and the password is <strong>apassword<\/strong>:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.techcoil.com\/blog\/wp-content\/uploads\/Cropped-Personal-Hotspot-screen-with-Personal-Hotspot-turned-on-with-SSID-and-password-boxed.jpg\" alt=\"Cropped Personal Hotspot screen with Personal Hotspot turned on with SSID and password boxed\" \/> <\/p>\n<p>If the SSID is the default given by your iPhone, you should <a href=\"https:\/\/www.techcoil.com\/blog\/how-to-change-your-wifi-ssid-or-wifi-name-of-your-iphone-hotspot\/\" rel=\"noopener\" target=\"_blank\">change your WiFi SSID of your iPhone hotspot<\/a> to one without spaces and a-strophes.  <\/p>\n<p>For the purpose of this guide, let's assume that your iPhone WiFi hotspot's SSID is <strong>MyiPhone<\/strong> and the password is <strong>apassword<\/strong>. <\/p>\n<h2>Connecting Raspbian Stretch Lite to your iPhone hotspot<\/h2>\n<p>Here are three ways to connect Raspbian Stretch Lite to your iPhone hotspot:<\/p>\n<ol>\n<li>Including a <code>wpa_supplicant.conf<\/code> file inside the microSD card right after you had installed Raspbian Stretch Lite onto the microSD card.<\/li>\n<li>Using the <code>raspi-config<\/code> tool from a terminal session with Raspbian Stretch Lite after it boots up.<\/li>\n<li>Editing the <code>wpa_supplicant.conf<\/code> file located in the <code>\/etc\/wpa_supplicant<\/code> directory from a terminal session with Raspbian Stretch Lite after it boots up.<\/li>\n<\/ol>\n<h3>Including a <code>wpa_supplicant.conf<\/code> file inside the microSD card right after you had installed Raspbian Stretch Lite onto the microSD card<\/h3>\n<p>As I had mentioned in <a href=\"https:\/\/www.techcoil.com\/blog\/how-to-setup-raspbian-stretch-lite-with-remote-configuration-over-wifi-on-first-boot\/\" rel=\"noopener\" target=\"_blank\">how to setup Raspbian Stretch Lite with remote configuration over WiFi on first boot<\/a>, making Raspbian Stretch Lite connect to a WiFi network is useful for <a href=\"https:\/\/www.techcoil.com\/blog\/tag\/raspberry-pi-zero-w\/\" rel=\"noopener\" target=\"_blank\">projects based on Raspberry Pi Zero W<\/a>. <\/p>\n<p>You can follow the steps mentioned in that post to get Raspbian Stretch Lite to connect to your iPhone hotspot when it boots up for the first time.<\/p>\n<h3>Using the <code>raspi-config<\/code> tool from a terminal session with Raspbian Stretch Lite after it boots up<\/h3>\n<p>So what if you wanted to connect a previous installation of Raspbian Stretch Lite to your iPhone WiFi hotspot? In this situation, you can use the <strong>raspi-config<\/strong> tool from a terminal session to connect to your iPhone hotspot. <\/p>\n<p>First, run the following command to start <code>raspi-config<\/code> tool:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo raspi-config\r\n<\/pre>\n<p>After <code>raspi-config<\/code> starts, follow through the following screenshots to get Raspbian Stretch Lite to connect to your iPhone hotspot: <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.techcoil.com\/blog\/wp-content\/uploads\/Raspbian-Stretch-Lite-2018-06-27-raspi-config-with-Network-Options-selected.gif\" alt=\"Raspbian Stretch Lite 2018-06-27 raspi-config with Network Options selected\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.techcoil.com\/blog\/wp-content\/uploads\/Raspbian-Stretch-Lite-2018-06-27-raspi-config-with-N2-WiFi-selected.gif\" alt=\"Raspbian Stretch Lite 2018-06-27 raspi-config with N2 WiFi selected\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.techcoil.com\/blog\/wp-content\/uploads\/Raspbian-Stretch-Lite-2018-06-27-raspi-config-with-MyiPhone-input-as-SSID-for-connecting-WiFi.gif\" alt=\"Raspbian Stretch Lite 2018-06-27 raspi-config with MyiPhone input as SSID for connecting WiFi\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.techcoil.com\/blog\/wp-content\/uploads\/Raspbian-Stretch-Lite-2018-06-27-raspi-config-with-password-input-for-connecting-WiFi.gif\" alt=\"Raspbian Stretch Lite 2018-06-27 raspi-config with password input for connecting WiFi\" \/><\/p>\n<h3>Editing the <code>wpa_supplicant.conf<\/code> file located in the <code>\/etc\/wpa_supplicant<\/code> directory from a terminal session with Raspbian Stretch Lite after it boots up<\/h3>\n<p>The manual way to connecting an Raspbian Stretch Lite after it boots up is to edit the <code>wpa_supplicant.conf<\/code> file directly. This file is located in the <code>\/etc\/wpa_supplicant<\/code> directory. Therefore, you can run the following command to edit it:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo nano \/etc\/wpa_supplicant\/wpa_supplicant.conf\r\n<\/pre>\n<p>Once the editor loads the file, add in the following content to the end of the file:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nnetwork={\r\n        ssid=&quot;MyiPhone&quot;\r\n        psk=&quot;apassword&quot;\r\n}\r\n<\/pre>\n<p>Since Raspbian Stretch Lite can connect to different WiFi networks, there can be multiple <code>network<\/code> blocks inside <code>wpa_supplicant.conf<\/code>. <\/p>\n<p>After you had added in your iPhone WiFi details, run the following command to get Raspbian Stretch Lite to take in the new network configurations:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nwpa_cli -i wlan0 reconfigure\r\n<\/pre>\n<p>When Raspbian Stretch Lite is able to reconfigure the WiFi adapter with the new configurations, you should see <strong>OK<\/strong> after you ran the command. <\/p>\n<p>In addition, Raspbian Stretch Lite will connect to your iPhone WiFi hotspot when your iPhone and Raspberry Pi are in contactable range.<\/p>\n\n      <ul id=\"social-sharing-buttons-list\">\n        <li class=\"facebook\">\n          <a href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=https%3A%2F%2Fwp.me%2Fp245TQ-7d\" target=\"_blank\" role=\"button\" rel=\"nofollow\">\n            <img decoding=\"async\" src=\"\/ph\/img\/3rd-party\/social-icons\/Facebook.png\" alt=\"Facebook icon\"> Share\n          <\/a>\n        <\/li>\n        <li class=\"twitter\">\n          <a href=\"https:\/\/twitter.com\/intent\/tweet?text=&url=https%3A%2F%2Fwp.me%2Fp245TQ-7d&via=Techcoil_com\" target=\"_blank\" role=\"button\" rel=\"nofollow\">\n          <img decoding=\"async\" src=\"\/ph\/img\/3rd-party\/social-icons\/Twitter.png\" alt=\"Twitter icon\"> Tweet\n          <\/a>\n        <\/li>\n        <li class=\"linkedin\">\n          <a href=\"https:\/\/www.linkedin.com\/shareArticle?mini=1&title=&url=https%3A%2F%2Fwp.me%2Fp245TQ-7d&source=https:\/\/www.techcoil.com\" target=\"_blank\" role=\"button\" rel=\"nofollow\">\n          <img decoding=\"async\" src=\"\/ph\/img\/3rd-party\/social-icons\/linkedin.png\" alt=\"Linkedin icon\"> Share\n          <\/a>\n        <\/li>\n        <li class=\"pinterest\">\n          <a href=\"https:\/\/pinterest.com\/pin\/create\/button\/?url=https%3A%2F%2Fwww.techcoil.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F447&description=\" class=\"pin-it-button\" target=\"_blank\" role=\"button\" rel=\"nofollow\" count-layout=\"horizontal\">\n          <img decoding=\"async\" src=\"\/ph\/img\/3rd-party\/social-icons\/Pinterest.png\" alt=\"Pinterest icon\"> Save\n          <\/a>\n        <\/li>\n      <\/ul>\n    ","protected":false},"excerpt":{"rendered":"<p><a href=\"https:\/\/www.techcoil.com\/blog\/tag\/raspberry-pi\" rel=\"noopener\" target=\"_blank\">Raspberry Pis<\/a> with WiFi are very useful for building prototypes that connect to services on the Internet. <\/p>\n<p>In case you need a Raspberry Pi with in-built WiFi, you can get one of these:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.amazon.com\/ELEMENT-Element14-Raspberry-Pi-Motherboard\/dp\/B07BDR5PDW\/\/ref=as_li_ss_tl?ie=UTF8&#038;linkCode=ll1&#038;tag=clivsperswebs-20&#038;linkId=eee243060c57ce7b0c5c804232786d36&#038;language=en_US\" rel=\"noopener\" target=\"_blank\">Raspberry Pi 3 B+<\/a><\/li>\n<li><a href=\"https:\/\/www.amazon.com\/Raspberry-Pi-RASPBERRYPI3-MODB-1GB-Model-Motherboard\/dp\/B01CD5VC92\/\/ref=as_li_ss_tl?ie=UTF8&#038;linkCode=ll1&#038;tag=clivsperswebs-20&#038;linkId=90c07d2636b287b714c845b79849bf12&#038;language=en_US\" rel=\"noopener\" target=\"_blank\">Raspberry Pi 3 B<\/a><\/li>\n<li><a href=\"https:\/\/www.amazon.com\/CanaKit-Raspberry-Wireless-Official-Supply\/dp\/B071L2ZQZX\/\/ref=as_li_ss_tl?ie=UTF8&#038;linkCode=ll1&#038;tag=clivsperswebs-20&#038;linkId=f645ac695540e44a59bbdaa1a8141ef9&#038;language=en_US\" rel=\"noopener\" target=\"_blank\">Raspberry Pi Zero W<\/a><\/li>\n<\/ul>\n<p>An operating system is needed for running your Raspberry Pi and Raspbian Stretch Lite is an ideal choice for server based applications. <\/p>\n<p>Although Raspbian Stretch Lite does not have a graphical user interface, it is not difficult to get it to connect to a WiFi hotspot. <\/p>\n<p>If you wish to use your <a href=\"https:\/\/www.amazon.com\/s\/ref=as_li_ss_tl?url=search-alias=aps&#038;field-keywords=iPhone&#038;linkCode=ll2&#038;tag=clivsperswebs-20&#038;linkId=9cb082415c599a235efa956a8620f06c&#038;language=en_US\" rel=\"noopener\" target=\"_blank\">iPhone<\/a> as a WiFi hotspot for your Raspberry Pi prototype, read this post to find out how to connect Raspbian Stretch Lite to your iPhone hotspot.<\/p>\n","protected":false},"author":1,"featured_media":1072,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"footnotes":""},"categories":[4],"tags":[374,240,308,409,412,445,438,485,548],"jetpack_featured_media_url":"https:\/\/www.techcoil.com\/blog\/wp-content\/uploads\/Raspberry-Pi-3-and-Raspberry-Pi-Zero-W-connecting-to-iPhone-WiFi-hotspot.jpg","jetpack_shortlink":"https:\/\/wp.me\/p245TQ-7d","jetpack-related-posts":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/posts\/447"}],"collection":[{"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/comments?post=447"}],"version-history":[{"count":0,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/posts\/447\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/media\/1072"}],"wp:attachment":[{"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/media?parent=447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/categories?post=447"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/tags?post=447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}