{"id":326,"date":"2011-09-15T18:25:35","date_gmt":"2011-09-15T23:25:35","guid":{"rendered":"http:\/\/ebixio.com\/blog\/?p=326"},"modified":"2011-09-15T18:25:35","modified_gmt":"2011-09-15T23:25:35","slug":"how-to-make-wpa_cli-talk-to-wpa_supplicant-in-ubuntu","status":"publish","type":"post","link":"http:\/\/ebixio.com\/blog\/2011\/09\/15\/how-to-make-wpa_cli-talk-to-wpa_supplicant-in-ubuntu\/","title":{"rendered":"How to make wpa_cli talk to wpa_supplicant in Ubuntu"},"content":{"rendered":"<p>On a stock Ubuntu 11.04 distribution, <strong>wpa_cli<\/strong> can not talk to <strong>wpa_supplicant<\/strong>. Regardless of the options used, <strong>wpa_cli<\/strong> will always report:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nCould not connect to wpa_supplicant - re-trying\n<\/pre>\n<p>That&#8217;s because <strong>wpa_cli<\/strong> expects to talk to <strong>wpa_supplicant<\/strong> over a control socket, but the default <strong>wpa_supplicant<\/strong> command line options don&#8217;t create a control socket (only the D-Bus interface is activated).<\/p>\n<p>The fix is fairly easy. Modify the following file:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\/usr\/share\/dbus-1\/system-services\/fi.epitest.hostap.WPASupplicant.service\n<\/pre>\n<p>and pass the -O option to wpa_supplicant by replacing the<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nExec=\/sbin\/wpa_supplicant -u -s\n<\/pre>\n<p>line with<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nExec=\/sbin\/wpa_supplicant -u -s -O \/var\/run\/wpa_supplicant\n<\/pre>\n<p>Notice, that&#8217;s a capital-o, not a zero in the command line.<\/p>\n<p>Restart the supplicant with: <code lang=\"bash\" inline=\"on\">sudo killall wpa_supplicant<\/code> and run <code lang=\"bash\" inline=\"on\">ps auxww | grep wpa_supplicant<\/code> to verify that the new options are being used.<\/p>\n<p>If you notice that your changes are ignored, try making the same changes to:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\/usr\/share\/dbus-1\/system-services\/fi.w1.wpa_supplicant1.service\n<\/pre>\n<p>You should now be able to run <strong>wpa_cli<\/strong> without any command line options (or with <code lang=\"bash\" inline=\"on\">wpa_cli -p \/var\/run\/wpa_supplicant<\/code>) and talk to <strong>wpa_supplicant<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On a stock Ubuntu 11.04 distribution, wpa_cli can not talk to wpa_supplicant. Regardless of the options used, wpa_cli will always report: Could not connect to wpa_supplicant &#8211; re-trying That&#8217;s because wpa_cli expects to talk to wpa_supplicant over a control socket, but the default wpa_supplicant command line options don&#8217;t create a control socket (only the D-Bus [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[12],"class_list":["post-326","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-linux"],"_links":{"self":[{"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/posts\/326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/comments?post=326"}],"version-history":[{"count":0,"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/posts\/326\/revisions"}],"wp:attachment":[{"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/media?parent=326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/categories?post=326"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ebixio.com\/blog\/wp-json\/wp\/v2\/tags?post=326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}