<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Is it possible to make a connection to a certain Wi Fi network as a condition?]]></title><description><![CDATA[<p dir="auto">Is it possible to do so?<br />
if &lt;Connecting to a specific wifi network&gt;:<br />
Action</p>
<p dir="auto">I did the following on Raspberry Pi:<br />
import subprocess<br />
from time import sleep</p>
<p dir="auto">try:<br />
ssid =  subprocess.check_output(["iwgetid", "-r"]).rstrip()<br />
except subprocess.CalledProcessError:<br />
ssid = ""</p>
<p dir="auto">while True:<br />
if ssid.decode('ascii') == 'mySSID':<br />
print("connect")<br />
else:<br />
print("No connection")<br />
sleep(1)</p>
<p dir="auto">But this does not work for Omega-2</p>
]]></description><link>http://community.onion.io/topic/3003/is-it-possible-to-make-a-connection-to-a-certain-wi-fi-network-as-a-condition</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Mar 2026 08:31:11 GMT</lastBuildDate><atom:link href="http://community.onion.io/topic/3003.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 02 Jul 2018 14:31:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Mon, 02 Jul 2018 14:31:12 GMT]]></title><description><![CDATA[<p dir="auto">Is it possible to do so?<br />
if &lt;Connecting to a specific wifi network&gt;:<br />
Action</p>
<p dir="auto">I did the following on Raspberry Pi:<br />
import subprocess<br />
from time import sleep</p>
<p dir="auto">try:<br />
ssid =  subprocess.check_output(["iwgetid", "-r"]).rstrip()<br />
except subprocess.CalledProcessError:<br />
ssid = ""</p>
<p dir="auto">while True:<br />
if ssid.decode('ascii') == 'mySSID':<br />
print("connect")<br />
else:<br />
print("No connection")<br />
sleep(1)</p>
<p dir="auto">But this does not work for Omega-2</p>
]]></description><link>http://community.onion.io/post/17144</link><guid isPermaLink="true">http://community.onion.io/post/17144</guid><dc:creator><![CDATA[CAP 33]]></dc:creator><pubDate>Mon, 02 Jul 2018 14:31:12 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Mon, 02 Jul 2018 22:26:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/5369">@CAP-33</a> I typed "iwgetid" at the command line and was told "command not found".  This while running the old f/w.</p>
<p dir="auto">Ask yourself these questions:</p>
<ol>
<li>Which f/w version are you running?  Command is not supported in f/w b160.</li>
<li>Did you intend to use "iwinfo"?  If so, it doesn't have a "-r" option.</li>
<li>Is there a specific s/w package you need to install to get the command you desire?</li>
</ol>
<p dir="auto">take care!<br />
Bill</p>
]]></description><link>http://community.onion.io/post/17146</link><guid isPermaLink="true">http://community.onion.io/post/17146</guid><dc:creator><![CDATA[William Scott]]></dc:creator><pubDate>Mon, 02 Jul 2018 22:26:47 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Tue, 03 Jul 2018 13:03:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/4410">@William-Scott</a> said in <a href="/post/17146">Is it possible to make a connection to a certain Wi Fi network as a condition?</a>:</p>
<blockquote>
<p dir="auto">iwinfo</p>
</blockquote>
<p dir="auto">I entered: <code> iwinfo -h</code><br />
And received:<br />
<code>Usage:</code><br />
       <code> iwinfo &lt;device&gt; info</code><br />
       <code> iwinfo &lt;device&gt; scan</code><br />
        <code>iwinfo &lt;device&gt; txpowerlist</code><br />
        <code>iwinfo &lt;device&gt; freqlist</code><br />
        <code>iwinfo &lt;device&gt; assoclist</code><br />
       <code> iwinfo &lt;device&gt; countrylist</code><br />
        <code>iwinfo &lt;device&gt; htmodelist</code><br />
       <code> iwinfo &lt;backend&gt; phyname &lt;section&gt;</code></p>
<p dir="auto">What is &lt;device&gt;?<br />
What is f / w and s / w?</p>
]]></description><link>http://community.onion.io/post/17152</link><guid isPermaLink="true">http://community.onion.io/post/17152</guid><dc:creator><![CDATA[CAP 33]]></dc:creator><pubDate>Tue, 03 Jul 2018 13:03:33 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Tue, 03 Jul 2018 13:08:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/5369">@CAP-33</a> said in <a href="/post/17152">Is it possible to make a connection to a certain Wi Fi network as a condition?</a>:</p>
<blockquote>
<p dir="auto">What is &lt;device&gt;?</p>
</blockquote>
<p dir="auto">type ifconfig then you see all your devices.<br />
what you look for is apcli0</p>
<pre><code>iwinfo apcli0 info
</code></pre>
]]></description><link>http://community.onion.io/post/17154</link><guid isPermaLink="true">http://community.onion.io/post/17154</guid><dc:creator><![CDATA[Fabian Nydegger 0]]></dc:creator><pubDate>Tue, 03 Jul 2018 13:08:11 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Tue, 03 Jul 2018 13:15:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/5136">@Fabian-Nydegger-0</a><br />
Thank you. I wrote like this:</p>
<pre><code>import subprocess
from time import sleep

ssid = subprocess.call(["uci","get","wireless.@wifi-iface[0].ApCliSsid"])

while True:
	if ssid == 'myssid':
		print("Connect")
		print(ssid)
	else:
		print("No nonnection")
		print(ssid)
	sleep(1)
</code></pre>
<p dir="auto">But instead of <code>myssid</code>  was output <code>1</code></p>
]]></description><link>http://community.onion.io/post/17157</link><guid isPermaLink="true">http://community.onion.io/post/17157</guid><dc:creator><![CDATA[CAP 33]]></dc:creator><pubDate>Tue, 03 Jul 2018 13:15:20 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Tue, 03 Jul 2018 13:23:55 GMT]]></title><description><![CDATA[<p dir="auto">my fault<br />
you need subprocess.check_ouput()</p>
<pre><code>import subprocess
from time import sleep

ssid = subprocess.check_output(["uci","get","wireless.@wifi-iface[0].ApCliSsid"])

while True:
	if ssid == 'myssid' + '\n':
		print("Connect")
		print(ssid)
	else:
		print("No nonnection")
		print(ssid)
	sleep(1)</code></pre>
]]></description><link>http://community.onion.io/post/17158</link><guid isPermaLink="true">http://community.onion.io/post/17158</guid><dc:creator><![CDATA[Fabian Nydegger 0]]></dc:creator><pubDate>Tue, 03 Jul 2018 13:23:55 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Tue, 03 Jul 2018 13:34:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/5136">@Fabian-Nydegger-0</a><br />
Sorry, an error occurs.</p>
<pre><code>uci: Entry not found
Traceback (most recent call last):
  File "/root/Wi-fi.py", line 5, in &lt;module&gt;
 ssid = subprocess.check_output(["uci","get","wireless.@wifi-iface[0].ApCliSsid"])
  File "/usr/lib/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['uci', 'get', 'wireless.@wifi-iface[0].ApCliSsid']' returned non-zero exit status 1.
</code></pre>
]]></description><link>http://community.onion.io/post/17159</link><guid isPermaLink="true">http://community.onion.io/post/17159</guid><dc:creator><![CDATA[CAP 33]]></dc:creator><pubDate>Tue, 03 Jul 2018 13:34:29 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Tue, 03 Jul 2018 13:43:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/5369">@CAP-33</a> said in <a href="/post/17159">Is it possible to make a connection to a certain Wi Fi network as a condition?</a>:</p>
<blockquote>
<p dir="auto">uci: Entry not found</p>
</blockquote>
<p dir="auto">That means uci dind't find the enrty in the config file<br />
try</p>
<pre><code>uci show wireless
</code></pre>
<p dir="auto">look for the entry that shows your ssid, it'll have a .ApCliSsid at the end.<br />
copy that path and use it.</p>
]]></description><link>http://community.onion.io/post/17160</link><guid isPermaLink="true">http://community.onion.io/post/17160</guid><dc:creator><![CDATA[Fabian Nydegger 0]]></dc:creator><pubDate>Tue, 03 Jul 2018 13:43:51 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Tue, 03 Jul 2018 14:07:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/5136">@Fabian-Nydegger-0</a><br />
I found the line:<br />
<code>wireless.@wifi-config[0].ssid='myssid'</code><br />
But I did not find a single line that ends in <code>.ApCliSsid</code></p>
]]></description><link>http://community.onion.io/post/17162</link><guid isPermaLink="true">http://community.onion.io/post/17162</guid><dc:creator><![CDATA[CAP 33]]></dc:creator><pubDate>Tue, 03 Jul 2018 14:07:36 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Tue, 03 Jul 2018 14:47:56 GMT]]></title><description><![CDATA[<p dir="auto">It looks like <a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/5136">@Fabian-Nydegger-0</a> 's code is meant for firmware b160 and older.<br />
As of b174, the wifi configuration syntax has changed, that's likely why you're running into issues, <a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/5369">@CAP-33</a></p>
]]></description><link>http://community.onion.io/post/17163</link><guid isPermaLink="true">http://community.onion.io/post/17163</guid><dc:creator><![CDATA[Lazar Demin]]></dc:creator><pubDate>Tue, 03 Jul 2018 14:47:56 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Tue, 03 Jul 2018 15:24:05 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/95">@Lazar-Demin</a><br />
I'm using b183</p>
]]></description><link>http://community.onion.io/post/17170</link><guid isPermaLink="true">http://community.onion.io/post/17170</guid><dc:creator><![CDATA[CAP 33]]></dc:creator><pubDate>Tue, 03 Jul 2018 15:24:05 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Tue, 03 Jul 2018 16:45:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/5369">@CAP-33</a> ya, so you're on the the new wifi config syntax as well as on the new wifi warp core.<br />
The warp core works differently than the previous wifi, and actually does what you're looking for, if I've understood your posts correctly.</p>
<p dir="auto">An Omega with warp core works more like how your laptop or smartphone work with wifi networks:</p>
<ul>
<li>stores configuration data for networks you've previously configured</li>
<li>attempts to automatically connect to configured networks that are in range</li>
</ul>
<p dir="auto">All the details can be found here: <a href="https://onion.io/2bt-brand-new-os-release/" rel="nofollow">https://onion.io/2bt-brand-new-os-release/</a></p>
]]></description><link>http://community.onion.io/post/17171</link><guid isPermaLink="true">http://community.onion.io/post/17171</guid><dc:creator><![CDATA[Lazar Demin]]></dc:creator><pubDate>Tue, 03 Jul 2018 16:45:50 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Wed, 04 Jul 2018 03:19:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/5369">@CAP-33</a> I know better than to not spell out acronyms or abbreviations on first use - my bad!</p>
<p dir="auto">Firmware (f/w)<br />
Software (s/w)<br />
Hardware (h/w)</p>
<p dir="auto">take care!<br />
Bill</p>
]]></description><link>http://community.onion.io/post/17174</link><guid isPermaLink="true">http://community.onion.io/post/17174</guid><dc:creator><![CDATA[William Scott]]></dc:creator><pubDate>Wed, 04 Jul 2018 03:19:30 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Thu, 05 Jul 2018 15:23:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/95">@Lazar-Demin</a><br />
When I upgraded the firmware I encountered some problems. I had to reset the firmware to the factory settings and set everything up again. And finally, I updated my Omega to the latest version, as described in the link left by you, but still the code written above does not work for me.</p>
]]></description><link>http://community.onion.io/post/17183</link><guid isPermaLink="true">http://community.onion.io/post/17183</guid><dc:creator><![CDATA[CAP 33]]></dc:creator><pubDate>Thu, 05 Jul 2018 15:23:35 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Thu, 05 Jul 2018 19:40:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/5369">@CAP-33</a><br />
It looks like your script is meant for a system that must be explicitly told which network to connect to. You don't need to worry about that on the Omega.<br />
As I mentioned above, in the new firmware (b176 and up) the <strong>wifi driver actually automatically does what you're trying to do with a script.</strong></p>
<p dir="auto">It stores configuration data for networks you've previously configured, and <strong>automatically</strong> connects to available networks. If there's multiple configured networks in range, it will connect to the network that is listed higher in the <code>/etc/config/wireless</code> configuration file. So the list of configured networks works like a preference list (kind of like how Mac OS does their Wifi networking).</p>
<p dir="auto">If you want to manually trigger a network reconnect, just run the <code>wifi</code> command.</p>
]]></description><link>http://community.onion.io/post/17184</link><guid isPermaLink="true">http://community.onion.io/post/17184</guid><dc:creator><![CDATA[Lazar Demin]]></dc:creator><pubDate>Thu, 05 Jul 2018 19:40:46 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Thu, 05 Jul 2018 20:06:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/95">@Lazar-Demin</a><br />
Perhaps you misunderstood what I'm trying to achieve. I'm trying to achieve that when Omega connects to a particular network, it performs the specified action.</p>
]]></description><link>http://community.onion.io/post/17185</link><guid isPermaLink="true">http://community.onion.io/post/17185</guid><dc:creator><![CDATA[CAP 33]]></dc:creator><pubDate>Thu, 05 Jul 2018 20:06:38 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Thu, 05 Jul 2018 20:39:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/5369">@CAP-33</a> Lol yeah, you're right.<br />
You can use <code>iwinfo</code> to grab the name of the network to which you're currently connected:</p>
<pre><code>root@Omega-66FF:~# iwinfo apcli0 info
apcli0    ESSID: "MyNetworkName"
....
</code></pre>
<p dir="auto">If you don't feel like doing multi-line text manipulation in Python, you can isolate the network name as well:</p>
<pre><code>root@Omega-66FF:~# iwinfo apcli0 info | grep ESSID | awk '{print $3}' | sed -e 's/"//g'
MyNetworkName
</code></pre>
]]></description><link>http://community.onion.io/post/17186</link><guid isPermaLink="true">http://community.onion.io/post/17186</guid><dc:creator><![CDATA[Lazar Demin]]></dc:creator><pubDate>Thu, 05 Jul 2018 20:39:59 GMT</pubDate></item><item><title><![CDATA[Reply to Is it possible to make a connection to a certain Wi Fi network as a condition? on Sat, 07 Jul 2018 15:08:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="http://community.onion.io/uid/95">@Lazar-Demin</a><br />
Thank you. That's what I need.</p>
]]></description><link>http://community.onion.io/post/17189</link><guid isPermaLink="true">http://community.onion.io/post/17189</guid><dc:creator><![CDATA[CAP 33]]></dc:creator><pubDate>Sat, 07 Jul 2018 15:08:08 GMT</pubDate></item></channel></rss>