Windows iot覆盆子pi wifi以编程方式连接 [英] Windows iot raspberry pi wifi connect programmatically

查看:57
本文介绍了Windows iot覆盆子pi wifi以编程方式连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据我的经验,windows 10 iot core,17134将无法通过断电保持wifi连接。 当它恢复时,每次都需要有人点击连接按钮。 我们正试图无头,所以这是一个问题。 
我们正在使用Raspberry pi 3b。 我们已经在大约10个不同的PI和不同的网络上尝试过它。 选中"自动连接"框似乎不起作用。


我们正在使用有线网络连接并转到< ip address>:8080,选择wifi网络并将其设置为自动连接。 我们已删除所有其他个人资料,因此这是唯一的个人资料。 然后我们可以连接到< wifi
ip地址>:8080。 我们可以通过ip嗅探器看到wifi地址。 然后,当我们关闭它并再次备份时,它不会自动重新连接。


它没有出现在wifi嗅探器上,用<有线IP地址>连接:8080显示它没有连接到wifi网络而我们有点击"连接"按钮用于建立连接的按钮。


因此,我希望将wifi网络信息存储在SD卡上的文件中,然后启动,读取文件并以编程方式建立连接。 / p>

有人能指出一个关于如何做到的好C#示例吗?

解决方案

你好TimGoyette,


以下三个选项可能有助于您实现它。



    1. Microsoft已提供了有关如何列出WiFi网络以及如何连接到网络的教程。 " Windows.Devices.WiFi.WiFiAdapter "提供成员以编程方式操作UWP中的
      WiFi。请参阅
      WiFi Connect Sample
    2. 您可以使用Device Portal API连接wifi。 api参考
      这里
      。您可以将带参数的请求发布到网络。
    3. netsh wlan命令可以帮助您连接wifi



 private async Task RunProcess()
{
await CoreWindow.GetForCurrentThread()。Dispatcher .RunAsync(CoreDispatcherPriority.Normal,async()=>
{
var result = await ProcessLauncher.RunToCompletionAsync(@" C:\ Windows \ System32 \\\
etsh.exe"," wlan connect name =< profile name>");
});
}

BTW,我在17723上发现这个问题,当我通过设备门户设置wifi连接时,你可以将设备更新到17723。 


最诚挚的问候,


Michael


It is my experience that windows 10 iot core, 17134 will not hold the wifi connection over a power down.  When it comes back up it requires someone to click the connect button every time.  We are trying to run headless, so this is a problem.  We are working with Raspberry pi 3b.  We've tried it on about 10 different PIs and on different networks.  Checking the "Connect automatically" box doesn't seem to work.

We are using a wired network connection and going to <ip address>:8080, selecting the wifi network and setting it connect automatically.  We've deleted all other profiles so that this is the only one.  We are able then to conned to the <wifi ip address>:8080.  We can see the wifi address with an ip sniffer.  Then when we power it down and back up again, it doesn't automatically reconnect.

It doesn't show up on the wifi sniffer, connecting with the <wired ip address>:8080 shows that it is not connect to a wifi network and we have to click the "connect" button to make the connection.

I would therefore like to store the wifi network information in a file on the SD card and then on start up, read the file and make the connection programmatically.

Can anyone point me to a good C# example on how to do this?

解决方案

Hello TimGoyette,

The following three options maybe help you implement that.

    1. Microsoft has provided tutorial on how to list WiFi network and how you can connect to one. "Windows.Devices.WiFi.WiFiAdapter" provide members to manipulate WiFi in UWP programmatically. Please refer to WiFi Connect Sample.
    2. You can use Device Portal API to connect the wifi. The api reference here. You can post a request with parameters to network.
    3. netsh wlan command can help you to connect wifi.

 private async Task RunProcess()
        {
            await CoreWindow.GetForCurrentThread().Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () =>
            {
                    var result = await ProcessLauncher.RunToCompletionAsync(@"C:\Windows\System32\netsh.exe", "wlan connect name=<profile name>");
            });
        }

BTW, I don't find this issue on 17723 when i set the wifi connection via device portal, you can update the device to 17723. 

Best Regards,

Michael


这篇关于Windows iot覆盆子pi wifi以编程方式连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆