Get connected devices in WiFi access point (raspberry pi 3 & Windows IoT) c#

0

I am working in a project relating with raspberry pi 3 and windows iot. I have configured IoT on-boarding for changing it as access point. Now the access point works and i can connect with the internet through the access point.

Now i am in need of getting the connected devices from the raspberry pi 3 WiFi access point. I have tried all the mentioned tutorials and searched over every other links regarding this.

FYI, i tried manually arp -a command to get the connected devices in AP. It also works fine, but when i tried to run programmatically, it displays as "ACCESS DENIED ERROR 0x80070005"

I tried running through powershell using process launcher i get the same error. Also have given permission

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\EmbeddedMode\ProcessLauncher /v AllowedExecutableFilesList /t REG_MULTI_SZ c:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe\0

I also tried using SSH client the same error pops out. Any suggestion would be highly appreciable.

c#
uwp
wifi
raspberry-pi3
windows-iot-core-10
asked on Stack Overflow Mar 8, 2018 by RANA RAGHAV • edited Mar 9, 2018 by RANA RAGHAV

2 Answers

1

From Device portal run the following command:

reg ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\EmbeddedMode\ProcessLauncher" /f /v AllowedExecutableFilesList /t REG_MULTI_SZ /d "c:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe\0"

Like this:

enter image description here

Then get connected devices programmatically like this:

                    var result = await ProcessLauncher.RunToCompletionAsync(@"c:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe", "arp -a | findstr -i 192.168.137 | findstr /V 255 | findstr /V 192.168.137.1", options);

The result may be like this: enter image description here

For a complete sample, you can reference ExternalProcessLauncher.

answered on Stack Overflow Mar 9, 2018 by Rita Han • edited Mar 9, 2018 by Rita Han
0

I think this could be of help to you. At least when I read over it the last time it sounded like it would be able to list all conncted devices.

Enumerate devices over a network

answered on Stack Overflow Mar 8, 2018 by Daniel

User contributions licensed under CC BY-SA 3.0