Simple HTTP server using GHI’s Premium Net library
GHI’s exclusive new networking library adds a highly configured way to take handle the networking interfaces on a device. Developers are able to control and to receive events from each individual interface, like a Ethernet cable was removed or WiFi connection is Lost. Then one of the interfaces can be assigned to the TCP/IP stack. This means no interface (Ethernet, WiFI…) is active by default.
This Application sets a static or dynamic IP address to “Built-in Ethernet” interface and runs a simple HttpServer. Of course this example requires a device with built in Ethernet PHY, not ENC28 Ethernet. The code can be be simply changed to use ENC28
Got a some projects moved over to the new 4.2, but what does a Cerberus with a ENC28 modules look like configuration wise for the new networking? its 5:30am here and sorry but my brain is done heavy lifting.
I have a EMX Development System with a UEXT cable to a WiFi_RS21. Can I use:
static WiFiRS9110 wifi = new WiFiRS9110(SPI.SPI_module.SPI1, chipSelect, externalInterrupt, resetPin);
If I can what would be the values:
e.g. chipSelect = EMX.pin.IO12 externalInterrupt = EMX.pin.IO3 resetPin = EMX.pin.IO4 ??? just guessing.
Can anyone help with this? KG1
I have tried to use the ENC28 with the G120HDR board.
But when assigning the Network stack (2nd line here)
Eth1 = new EthernetENC28J60(SPI.SPI_module.SPI2, G120.Pin.P1_11, G120.Pin.P0_6, G120.Pin.P0_1);
NetworkInterfaceExtension.AssignNetworkingStackTo(Eth1);
I get an exception
The thread '<No Name>' (0x2) has exited with code 0 (0x0).
#### Exception GHI.Premium.Net.NetworkInterfaceExtensionException - 0x00000000 (1) ####
#### Message:
#### GHI.Premium.Net.NetworkInterfaceExtension::SetDefaultInterface [IP: 001b] ####
#### GHI.Premium.Net.NetworkInterfaceExtension::AssignNetworkingStackTo [IP: 0026] ####
#### EmulatorApp.Program::InitEthernet [IP: 0011] ####
#### EmulatorApp.Program::Main [IP: 0003] ####
A first chance exception of type 'GHI.Premium.Net.NetworkInterfaceExtensionException' occurred in GHI.Premium.Net.dll
An unhandled exception of type 'GHI.Premium.Net.NetworkInterfaceExtensionException' occurred in GHI.Premium.Net.dll
The program '[6] Micro Framework application: Managed' has exited with code 0 (0x0).
Is it possible that I have used some wrong pins? I have connected them to one of the user ports.
Any idea?
@ Mike: I’m not trying to use the Emulator. I have an actual G120HDR (V1.1) board. I have only USB Client DP Module and ENC28 Module connected.
The ENC28 is connected to User-Port 1, and I have wired the Pins as seen in code to it (MOSI2, MISO2, SCLK2, CS, Interrupt and reset). I did not connect the ‘WOL’ PIn. I’m not sure what it is used for. When I’m back at work (on Moday) I will post my exact wireing.
I’m using SDK 0.0.6. NETMF 4.2, Firmware is updated.
Some other small program which controls an AEDog LCD Display via SPI1 is working well on this board.