I'm following the sample application of a Webserver, handling incoming requests through TCP with a Port.
Sample application with code: https://incredibits.io/project/windows-10-iot-internet-of-things-tips/windows-10-iot-raspberry-pi-web-server
When debugging the UWP application on my Windows 10 machine, and try to access the the local IP (192.168.x.x <- Ofcourse I've entered my actual local IP) I get what I'm supposed to. The application get's an incoming request and returns some data back to me (The client) on another computer of mine.
The issues I'm facing is when I deploy this to my Raspberry Pi 3 running Windows 10 IoT Core (The newest from Insider), I can't access the application from my client computer at all. Is this a thing with the Pi's firewall or something else preventing this?
I CAN access the IoT Core's Web interface on port 8080, but I cannot access my application running on port 80. (I've tried switching the port to another one aswell, works locally on my Windows 10 but not on the Pi)
Does anyone know a solution, or have faced a similar issue?
Note:
I've also tried examples like (https://ms-iot.github.io/content/en-US/win10/samples/BlinkyWebServer.htm) which again, works on my Windows 10 pc, and can be accessed by my other PC if their on the same network, but not on my Pi)
I found the solution to my problem.
The port I was using, wasn't opened up in the Raspberry Pi's Firewall. I couldn't find how to add a rule to the Firewall but after some help on Freenode C# Chat forum, I found the following snippet:
First I log into the Pi through PowerShell
Enter-PsSession -ComputerName MyRaspberryPi-Credential MyRaspberryPi\Administrator
Then I manually add the Firewall opening of the port I'm using. In this case port 8080.
netsh advfirewall firewall add rule name="Raspberry Pi Webserver" dir=in action=allow protocol=TCP localport=8080
After that, everything worked as expected. I could access the port on my Raspberry Pi! All good!
Thanks to #canton7 and #taylor-kidd in the comments, for coming with suggestions that in the end helped me!
EDIT 12th of April:
It seems like this issue with the Firewall not being opened, was actually a known issue by Microsoft already. They write that in their Relase notes for the Insider Preview version 14295 (Which I am using) here http://ms-iot.github.io/content/en-US/win10/ReleaseNotesInsiderPreview.htm
Related
I’m developing an app that connects on port 9050 through the public ip of my server. It works fine on lan but if I’m connected on a different network it fails what can I do to fix this?
first try from Command Prompt this command: telnet ip 9050
if it working means the port 9050 between your pc and the server already opened , otherwise you should check why and where the port is blocked (may be firewall in this case you need to create rule in firewall to pass ).
I don't have any code to go by and I know nothing about your network configuration, but I'll tell you what I generally do when debugging a network-enabled app. First, look at your firewall rules. This will obviously vary depending on what OS you're using but on Windows 10 application-specific permissions are located in Control Panel > System and Security > Windows Defender Firewall > Advanced Settings.
After making sure your app can get through your devices' firewall, check the router settings next. Your packets may not getting by whatever inbuilt security protocols are in place. Since your program works with LAN but not over the Internet, this is a distinct possibility. Also, depending on your network configuration, port forwarding may be necessary; if you're sending data via a public IP address, the router needs some way to know which device on the local network needs to be receiving it. Additionally, if you're trying to connect to your server from the same network you're hosting it on, make sure you use the IP loopback address, which I believe is always 127.0.0.1, or in C# IPAddress.Loopback. Public addresses often won't work when connecting to a local host.
If you're still having problems, I recommend using Wireshark. It's an advanced diagnostics tool that tells you exactly what is being sent and received over your network, and can help pinpoint otherwise hard to spot issues.
I have a C#.NET web app that runs in IIS 7 on Server 2008 R2, .NET v4, MVC 3, SQL Server 2012. The app works on a bunch of machines already, but we've just got a new computer and the behaviour on this machine is slightly different.
In particular, when the app opens the System.IO.Ports.SerialPort and writes, no data is actually transmitted on COM1. No exception seems to be thrown either. The app goes on to wait for a response, and times out.
If I close my app, and use Termite (a terminal program) to check that the COM port is working, data comes out the serial port just fine. So the serial port, drivers, etc seem to be ok.
If I have Termite connected to COM1 when my app tries to open the port, I get an Access Denied exception (as I expect). So my application does seem to be trying to access the correct port.
But if there's nothing else using COM1, my application gets no exceptions - but nothing comes out the serial port.
Does anyone have any suggestions about how to debug this situation?
I had the same problem - C# SerialPort couldn't connect to my serial device but Termite could despite following the device manual.
I compared the SerialPort properties with my Termite settings and found that there's some terminology difference between the two. For example, Termite has an option for "DTR/DTS" (which I needed) while SerialPort doesn't have anything called "DTS". Setting these properties of the SerialPort object worked for me:
DtrEnable = true;
RtsEnable = true;
How can I exchange data between my WP8 app and my desktop Windows app running on the PC that has the phone connected with a USB cable? On WP7, there was TCP/IP networking over USB connection. On WP8, it seems it no longer works.
On the device side, NetworkInterfaceList class lists the Ethernet adapter, however NetworkInformation.GetHostNames method says there is no IP address assigned to that NIC. Is there a way to assign an IP address to that NIC, and use it for phone-to-pc communication over the USB cable?
On the PC side, looks like the connectivity DLLs implement Smart Device Connectivity API. Where can I find Microsoft.Smartdevice.DeviceAgentTransport.dll for Windows Phone 8 platform?
Are there some other options?
P.S. I am not submitting anything to the marketplace, so private or undocumented APIs are OK for me.
I was just looking for this one myself and found a good resource over at msdn,
IP over USB. As long as you have the windows phone SDK installed you have everything.
Edit: A small update, it seems that the server code must be running on the device and the client on the host, but apart from that everything worked as expected.
Used regedit to add a new entry under HKEY_LOCAL_MACHINE\Software\Microsoft\IpOverUsbSDK and created values similar to other entries, just different ports.
It took a few seconds and a refresh of regedit for IpOverUsbEnum.exe to display the new service.
Is there any way to code my own console client for hyper-v guest machines ?
I don't want to connect to guest using RDP. I would like to do it in same way Microsoft is doing it.
What I've found so far is (correct me if I am wrong):
Their client connects to the host on port 2179. Then some handshaking, metadata exchange happens on port 2179 and client gets data on some 49xxx port.
What I don't understand is what happens on port 2179 ? Is there any protocol specification I should look for ?
Thanks
A little bit of Googling on Hyper-V and 2179 led me to vmconnect.exe, a program used to connect to virtual machines running on Hyper-V servers.
This tool is stated to use the Remote Desktop Protocol.
So I guess you can connect using the RDP API itself (mstscax.dll), the Cassia library (as suggested in this answer) or the ActiveX control AxMSTSCLib.
We have a server application (developed using .Net 1.1, C#) which listen the port 8086 and the client application, before starting will handshake with this server using remoting.
The application is working fine in almost all environments - Windows 2000/2003/2008/XP/Vista.
Now we are facing an issue with Windows 7.
When we are staring the server, it’s opening the port and will be listening to clients, but when try to send a request from a client who is running in other OS, it gives a message that server is not running.
We disabled the proxy, gave the exceptions for proxy but all went in vain. On further analysis we found that the system is having multiple connectivity (LAN, Bluetooth &WIFI).
When we checked the TCP port using netstat –a it showed the Local Address as 0.0.0.0:8086. So we disabled/removed the Bluetooth & WiFi option and tried again then also netstat is showing LocalAddress 0.0.0.0:8086.
How to go ahead in this situation?
Thanks in advance.
Do a network capture using Microsoft Network Monitor or Wireshark to better understand the underlying TCP/IP packets. That can show what's up easily.