FEZ Cerberus + WebServer

Hi guys,

I’d like to know if I can use the WebServer (dll Gadgeteer.WebServer) class with FEZ Cerberus because when I try to start a web server it doesn’t run correctly.

This is the code I run:


NetworkInterface.GetAllNetworkInterfaces()(0).EnableDhcp()
WebServer.StartLocalServer(NetworkInterface.GetAllNetworkInterfaces()(0).IPAddress, 80)

I try to ping the FEZ cerberus but it responses only 1 time on about 10-15 attempts…

What do you suggest?

Thanks in advance.

If you are running a Cerberus with Ethernet firmware, this should not be a problem as I believe the WebServer uses system.net sockets. Firstly, I would await a valid IP address before attempting to start the webserver. Secondly, are you able to ping it normally before the WebServer is executed or are the results the same?

1 Like

Hi James, thanks for reply.

  1. Yes, I cycle until IP Address changes from “0.0.0.0” to the granted IP address.
  2. Ping doesn’t work also if I don’t execute WebServer.

As you can see in the attached image, ping responds only the first time and then it fails always.

What do you suggest?

To me, ping failing shows you have a code/logic issue that’s blocking the IP stack from doing it’s thing.

Use one of the bare minimum code snippets from the GHI team’s posts in the threads here (like this one https://www.ghielectronics.com/community/forum/topic?id=12157&page=3#msg140286 ) and see what the behaviour is. I don’t have a Cerb at the moment so can’t test anything for you.

What James may have been hinting at is something like starting the web server on say something like a button press event, and seeing whether ping works before that in the same way, or if there’s any change in behaviour after you start the web server - is that like what you did?

Thanks Brett.
I checked my LAN and I discovered that the DHCP server was in fault.
After a power cycle of the DHCP server ping at the FEZ Cerberus has worked correctly.

Now I’ve a new strange issue always on FEZ Cerberus: I can’t deploy the project because the debugger can’t find aUSB device.
This is the VS2012 “output” window content:

 
Looking for a device on transport 'USB'
Starting device deployment...
Iteration 0
Iteration 1
Iteration 2
Iteration 3
Iteration 4
Iteration 5
Iteration 6
Iteration 7
Iteration 8
Iteration 9
Iteration 10
...
Iteration 50
Iteration 51
Iteration 52
Iteration 53
Iteration 54
Iteration 55
Iteration 56
Iteration 57
Iteration 58
Iteration 59

I can’t find information about this issue googling… can you help me?

Hit reset button on your board…
And make sure you don’t have a tight loop blocking your board…

it’s almost positively a tight loop in your code that doesn’t allow the debugger to attach to the board. a quick reset before you deploy (or while you are doing the deploy - but that can cause a PC crash in certain circumstances that you may not want to risk). Often all you need is a sleep(1) in your tight loop so that it allows it to give a slice to the debugger…