HelloWorldServer_MF Project

I knew someone would reply regarding that. :smiley:
I had not done this yet, indeed. But it has been set after creating the screenshot. :slight_smile:

Hello all,

Thanks for all the help.

Even though I could successfully execute a network ping to the FEZ Cobra, it wasnt until I added the default gateway and primary DNS primary address before the HelloWorldServer_MF sample project would execute without error.

Any ideas why?

Thanks again.

Gateway/DNs are required for getting out on the internet. Just because a device returns ping doesn’t mean that it has full connectivity.

EDIT: You can still get out on the internet without DNS, but you’ll lose the ability to resolve domain names, ie, you’ll have to hard code website IPs.

In my case I don’t want my device to get out on the internet. I have it connected to other machines using a network switch. I want to use DPWS between different devices on the same local network.

It used to work with previous versions, the problem started when I installed v4.1 firmware to my device.

Well, then leave out Gateway. DNS doesn’t matter at that point. Also, don’t use DHCP.

I post the schema of my network, if someone could tell my which should be the network settings in my Embedded Master module.

Thanks!

I don’t think we can answer this in absolutes for you, but here’s some more details…

For IP communication to work between three active devices (and one switch) like you have shown then you ONLY need an IP address and a subnet mask.

A default gateway is only needed when your device needs to understand where another device is, that is not on the same “network” as defined by the subnet mask you have defined.

A DNS setting is only needed when your device needs to “look up” a mapping between a friendly name (like www.tinyclr.com) and translate that into an IP address that it can use to then transmit data.

The complexity here is that, depending on EXACTLY what your code does, it may need more than just an IP address and subnet mask - you need to be sure that it does not need a DNS and default gateway (use the same IP address as your PC) setting, or you need to set them just in case it might.

So, in the case where you need to do an IP PING from one of your laptops to your device, and assuming your device will respond to IP PING commands, you should only need to have an IP address and subnet mask.

Here’s the other point I’ve picked up from your post. “It used to work” and “the problem started when I installed v4.1 firmware”. When you did that, did you explicitly start a NEW PROJECT, or rip out all the 4.0 references and replace with the correct 4.1 references and redeploy? That’s a mandatory step. To me that sounds like the real problem here.

Having said that, you have great debugging capability here with Visual Studio, step through the code, add breakpoints, look what the code is doing, that’ll help you diagnose it if the reference replacements weren’t the issue.

Setting the IP of my PC as default gateway instead of 0.0.0.0 worked.

I had started a new project, and as mentioned before, the sample provided with the MF 4.1 SDK neither worked. I think that it can be because the DPWS stack in the 4.1 version needs default gateway information, while the stack in 4.0 didn’t. (Since DPWS is supposed to work only with devices in the same subnet, does it make any sense?)

Thanks for the help!

That’s strange since you were able to get it to work in that way. Do you have ICS running on your desktop or something?

Brett’s networking supposition:

The NetMF in 4.1 checks for a valid gateway. Without it, it barfs. With it, it’s happy.

So for what aZubi has done, setting the default gateway to a PC’s IP address, the software is happy and will run; if it needed to get to a device outside the network, then it would attempt to forward the IP packet to the default gateway, and the “default gateway” will essentially discard it since it has no idea that it is meant to route the packet.

Setting it to an arbitrary address on the same network that is currently unused would have the same effect - packet would go nowhere.

Remember, all bets are off now if you need to look up a DNS address like try to sync to an external timesource. Honestly, I suspect you are better off using your actual IP gateway so there’s no confusion.

One thing that you may not be protecting against (but think you are) is inbound communication. If your inbound router/gateway allowed it, or you configured it to do so, you could still have an inbound HTTP request hit the Cobra and it would respond correctly to the request since the IP packet would have the MAC address of the router - again if the router was configured to do so it would then respond ot the internet client. Not saying that this is bad or anything, just saying that you may not be protecting from something you assume you are.

xml files often have a url in them. Is it possible that it was trying to retrieve a schema?

Hmm I’m having exactly 100% this same issue. :’(

Ok I set the gateway and all that stuff. It doesn’t throw the error now, which is sort of cool… but I can’t connect to it. Tried using a browser… no go… tried wcfclient… no go :frowning:

Are there any known updates about this issue?

I currently have an Ipac-9302 from sjj-micro running .netmf, but i can’t get any dpws-sample running neither.

I tried my own written service, plus the default HelloWorldServer_MF testproject from the 4.1 sdk, but it keeps throwing an error at startup:

    #### Exception System.Net.Sockets.SocketException - CLR_E_FAIL (1) ####
    #### Message: 
    #### Microsoft.SPOT.Net.SocketNative::setsockopt [IP: 0000] ####
    #### System.Net.Sockets.Socket::SetSocketOption [IP: 0012] ####
    #### Ws.Services.Binding.UdpTransportBindingElement::OnOpen [IP: 007a] ####
    #### Ws.Services.Binding.BindingElement::Open [IP: 0015] ####
    #### Ws.Services.Binding.BindingElement::Open [IP: 000f] ####
    #### Ws.Services.Binding.ReplyChannel::Open [IP: 0012] ####
    #### Ws.Services.Transport.UDP.WsUdpServiceHost::Start [IP: 0022] ####
    #### Dpws.Device.Device::Start [IP: 0027] ####
    #### MFDmxController.Program::Run [IP: 005e] ####
    #### MFDmxController.Program::Main [IP: 0009] ####
    #### SocketException ErrorCode = 10057

I’ve read an bug-issue @ .netmf.com (http://netmf.codeplex.com/workitem/97) regarding some strange behaviour of the get/set socketoption on big-endian controllers, but i don’t know if that has anything to do with it. (as far as i know the ipac is little-endian.)

Since i’ve got some more issues with the ipac like features that i miss etc, i would like to swap to the fez-cobra as a replacement. Has anyone succesfully ran a dpws-service at the cobra/emx?
I’m really stuck with this issue at the ipac (it is working on the emulator), and its one of my keypoints for switching to the fez-cobra.

Thnx, Sander

I suggest you post on the ssj-micro site. I don’t think you will find anyone here with sjj experience.

Yeah I know, but the lack of communication/community is one of the reasons why i’m now looking to buy a fez/ghi product. But my question was if anyone has run the helloworldserver_mf sample project succesfully in the FEZ-Cobra…

i’ve experienced this problem at the sjj-micro product and expected it to be somekind of problem related to their port or something like that, but after reading this topic it seems like there are some problems with a dpws-server on a cobra too?

so i was just wondering if anyone here has ran any dpws server, or the sample helloworldserver, succesfully on the cobra … :slight_smile:

Sander, what about GHI helping you to get FEZ Cobra so you can try it yourself? Not many users are getting into DPWS and would be great to have more users doing that.

I have sent you a private email.