W5100
SwordfishUser.W5100 History
Hide minor edits - Show changes to markup
UPDATED 27 March 2015
In this this post you will find the library update W5500 with PING functionality.
UPDATED 27 March 2015
In this this post you will find the library update W5500 with PING functionality.
=]
This is the request that the client sends to the web service when requesting the Command method:
<?xml version="1.0" encoding="utf-16"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <Command xmlns="http://tempuri.org/"> <cCommand>0</cCommand> <cParm>0</cParm> </Command> </soap:Body> </soap:Envelope>
This is the PIC response at the Command method request:
ResponseCode: 200 (OK) Content-Type:text/xml; charset=utf-8 <?xml version="1.0" encoding="utf-16"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <CommandResponse xmlns="http://tempuri.org/"> <CommandResult>true</CommandResult> </CommandResponse> </soap:Body> </soap:Envelope>
This is the request that the client sends to the web service when requesting the Status method:
<?xml version="1.0" encoding="utf-16"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <Status xmlns="http://tempuri.org/" /> </soap:Body> </soap:Envelope>
This is the PIC response at the Status method request:
=code [= ResponseCode: 200 (OK) Content-Type:text/xml; charset=utf-8
<?xml version="1.0" encoding="utf-16"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body> <StatusResponse xmlns="http://tempuri.org/"> <StatusResult> <PointsNum>0</PointsNum> <Chiamate>0</Chiamate> <InAttesa>0</InAttesa> <Visore>0</Visore> <Buzzer>false</Buzzer> <Flash>false</Flash> <ListaChiamate /> <ListaAttese> <int>10</int> <int>1</int> <int>2</int> </ListaAttese> </StatusResult> </StatusResponse> </soap:Body>
</soap:Envelope>
The VS2010 VB.NET class named Service1.asmx used in example for WSDL generation
Simple test application is "WindowsApplication1.exe" from \VS2010\WindowsApplication1\bin\Debug folder. You can open the source with VisualStudio loading "WebService1.sln" solution file from \VS2010 folder that opens in the solution also the client project.
This is VS2010 VB.NET class named Service1.asmx used in example:
Simple test application is "WindowsApplication1.exe" from \VS2010\WindowsApplication1\bin\Debug folder. You can open the source with VisualStudio loading "WebService1.sln" solution file from \VS2010 folder.
This is the "PIC side" source that receives, interprets and returns to the windows client app the class above:
Use as a web service instead imposes many standards and the amount of memory MCU does not allow the use of a wsdl downloaded at the time and so you need to create it in another way .. I have implemented a SOAP ws 1.1 in VS2010 then re-imported into the client program during development allows me to do without it when using the embedded web server.
Use as a web service instead imposes many standards and the amount of memory MCU does not allow the use of a wsdl downloaded at the time and so you need to create it in another way .. I have implemented a SOAP ws 1.1 in VS2010 then re-imported into the client program during development allows me to do without it when using the embedded web server. An example of the result of this import/generation make by VisualStudio tool you can find directly in the project folder of the client \VS2010 \WindowsApplication1\Service References\ServiceReference1 that stores a copy of the generated WSDL named "Service1.wsdl", open it, this is how the web service should return as result of a "?WSDL" client request .. 10K characters are too many for every PIC. Use of this generation method is simple. Emulate the web service response with a custom "as like" web service then the client application, when a wsdl is request for generate the recv class, you point to in-solution web service.. you're done and do not need new reload it until wsdl updates. One thing you must remember is to change the url in the client app before using the application because end point is the original ws windows url.
Use of this generation method is simple. Emulate the web service response with a "as like" web service then the client application, when a wsdl is request for generate the recv class, you point to in-solution web service.. you're done and do not need new reload it until wsdl updates. One thing you must remember is to change the url of the client app before using the application because end point is the original ws url.
ASyncTXBufferInit storing the pointer of transmission buffer and after a series of entries is communicated to the device to forward the content included from initial pointer to current pointer, all overwrites are under control of W5100. The third PutInTXBuffer parameter tells the device to not process the buffer and do not close the transmission.
ASyncTXBufferInit storing the pointer of transmission buffer and after a series of entries is communicated to the device to forward the content included from initial pointer to current pointer, all internal memory overwrites and memory pointer movements are under control of W5100. The third "false" PutInTXBuffer parameter tells the device to not process the buffer and do not close the transmission.
The purpose of the application is to show in the first case how to send a request to the web service in which it took a command and a parameter and obtain a Boolean value, and in a second case which the application call the web service for message state consisting of a class ( an object ) of composite type.
The response class than contains returned values
The response class ( composite object ) than contains returned values: four integers two boolean and two variable size arrays of integer.
Use as a web service instead imposes many standards and the amount of memory MCU does not allow the use of a wsdl downloaded at the time and so you need to create it in another way .. I have implemented a SOAP ws 1.1 in VS2010 then re-imported into the client program during development allows me to do without it when using the card.
Use as a web service instead imposes many standards and the amount of memory MCU does not allow the use of a wsdl downloaded at the time and so you need to create it in another way .. I have implemented a SOAP ws 1.1 in VS2010 then re-imported into the client program during development allows me to do without it when using the embedded web server.
Use of this generation method is simple. Emulate the web service response with a "as like" web service then the client application, when a wsdl is request for generate the recv class, you point to in-solution seb service.. you're done and do not need new boots until wsdl updates. One thing you must remember is to change the url of the client app before using the application because end point is the original ws url.
Use of this generation method is simple. Emulate the web service response with a "as like" web service then the client application, when a wsdl is request for generate the recv class, you point to in-solution web service.. you're done and do not need new reload it until wsdl updates. One thing you must remember is to change the url of the client app before using the application because end point is the original ws url. Simple test application is "WindowsApplication1.exe" from \VS2010\WindowsApplication1\bin\Debug folder. You can open the source with VisualStudio loading "WebService1.sln" solution file from \VS2010 folder.
A note on the size of the RX buffer. I set the buffer to 600 bytes but in reality this size is due to the size that is used in the receiving SOAP envelope that I have used. This dimension will be adjusted as needed in "W5100-RXBuffer.bas" module.
... Public Dim RXBuff As String (600), RXBuffPointer As Word ...
WIZ811MJ/W5100 sources and VS2010 SOAP client example
WIZ811MJ/W5100
WIZ811MJ/W5100 sources and VS2010 SOAP client example
WIZ811MJ/W5100
WIZ811MJ/W5100 sources and VS2010 SOAP client example
WIZ811MJ/W5100
W5100 modules and VS2010 SOAP client
You can download modules and examples from the following link: WIZ811MJ/W5100 sources and VS2010 SOAP client example
W5100 modules and VS2010 SOAP client
You can download modules and examples from the following link: WIZ811MJ/W5100 sources and VS2010 SOAP client example
W5100 modules and VS2010 SOAP client
You can download modules and examples from the following link: WIZ811MJ/W5100 sources and VS2010 SOAP client example
W5100 modules and VS2010 SOAP client
=]
=]
W5100 modules and VS2010 SOAP client
Place this module in a file called W5100-IPConfig.bas in project folder:
W5100-IPConfig.bas
Create this module in a file called W5100-IPConfig.bas in the folder where have created the two sample programs.
Modules
Modules in zip
The zip contains two folders named \W5100 and \VS2010. Copy folder W5100 directly into your \UserLibrary folder. Folder VS2010 contains a VisualStudio 2010 project used with the SOAP example found below.
The default tcp port cTCP_PORT is set in W5100-Consts.bas and as default is the port 80. This port is used only and exclusively by the examples which I reported below and is not used in another way by the modules contained in the zip.
The default tcp port cTCP_PORT is set in "W5100-Consts.bas" and as default is the port 80. This port is used only and exclusively by the examples which I reported below and is not used in another way by the modules contained in the zip.
If you do not use DHCP the settings affecting fixed ip address, subnet mask and gw are set in the module "W5100-IPConfig.bas" where you can also set the default tcp port cTCP_PORT that however can be overridden and this module is not part of the zip and must be copied to the project folder.
Place this module in a file called W5100-IPConfig.bas in project folder:
The W5100 has a total memory of 8K transmission and 8K reception RAM and has 4 independent sockets on which you can make simultaneous connections. The memories are adaptable to the needs, and you can predefine the amount of memory allocation for the TX and RX for every socket in steps of 1K. The routine that sets the memory is the W5100_Regs.SysMemInit and have to call after a reset of the device and so you need to reset the parameters of the network (refer to W5100_DHCP.SetDHCPNetwork and the datasheet of the device).
Modules
Module | Description |
---|---|
W5100.bas | Main module with public aliases to other module |
W5100-Consts.bas | Device constants like regs and memory definitions |
W5100-DHCP.bas | DHCP module with DHCHTask main sub |
W5100-DNS.bas | DNS module with DNSResolve main sub, the DNS uses global Dns_Addr for DNS server IP address |
W5100-IPConfig.bas | Network default configuration like MAC address and IP,GW,DNS when USE_DHCP=False |
W5100-Regs.bas | Module responsible of device regs setting |
W5100-RX.bas | All sync and async RX functions |
W5100-RXBuffer.bas | RX buffer definition. Is the module that defines a memory area to be used as the buffer .. W5100 uses for each of its memories two pointers in overwrite mode, then in some cases, as in the reception of an HTTP request, it is necessary a buffer memory to extract it. The sockets are 4 but This memory must be used for the socket where this can happen |
W5100-Socket.bas | Routines for socket management |
W5100-TX.bas | All sync and async TX functions |
W5100-Utils.bas | SW transposition of C++ arrays management |
SOAP.bas | Routines for the creation of response and parameters extraction from SOAP request |
If you do not use DHCP the settings affecting fixed ip address, subnet mask and gw are set in the module "W5100-IPConfig.bas" that however can be overridden and this module is not part of the zip and must be created into project folder. The default tcp port cTCP_PORT is set in W5100-Consts.bas and as default is the port 80. This port is used only and exclusively by the examples which I reported below and is not used in another way by the modules contained in the zip.
Place this module in a file called W5100-IPConfig.bas in project folder:
The W5100 has a total memory of 8K transmission and 8K reception RAM and has 4 independent sockets on which you can make simultaneous connections. The memories are adaptable to the needs, and you can predefine the amount of memory allocation for the TX and RX for every socket in steps of 1K. The routine that sets the memory is the W5100_Regs.SysMemInit and have to call after a reset of the device and so you need to reset the parameters of the network (refer to W5100_DHCP.SetDHCPNetwork and the datasheet of the device).
Modules
Module | Description |
---|---|
W5100.bas | Main module with public aliases to other module |
W5100-Consts.bas | Device constants like regs and memory definitions |
W5100-DHCP.bas | DHCP module with DHCHTask main sub |
W5100-DNS.bas | DNS module with DNSResolve main sub, the DNS uses global Dns_Addr for DNS server IP address |
W5100-IPConfig.bas | Network default configuration like MAC address and IP,GW,DNS when USE_DHCP=False |
W5100-Regs.bas | Module responsible of device regs setting |
W5100-RX.bas | All sync and async RX functions |
W5100-RXBuffer.bas | RX buffer definition. Is the module that defines a memory area to be used as the buffer .. W5100 uses for each of its memories two pointers in overwrite mode, then in some cases, as in the reception of an HTTP request, it is necessary a buffer memory to extract it. The sockets are 4 but This memory must be used for the socket where this can happen |
W5100-Socket.bas | Routines for socket management |
W5100-TX.bas | All sync and async TX functions |
W5100-Utils.bas | SW transposition of C++ arrays management |
SOAP.bas | Routines for the creation of response and parameters extraction from SOAP request |
cMac_Addr(6) As Byte = ($00,$0E,$35,$73,$9F,$EF), cIp_Addr(4) As Byte = (192,168,1,9), cSub_Mask(4) As Byte = (255,255,255,0), cGtw_Addr(4) As Byte = (192,168,1,200), cDns_Addr(4) As Byte = (192,168,1,200)
cMac_Addr(6) As Byte = ($00,$0E,$35,$73,$9F,$EF), // Customizable MAC Address cIp_Addr(4) As Byte = (192,168,1,9), // Static IP address cSub_Mask(4) As Byte = (255,255,255,0), // Subnet mask of your network cGtw_Addr(4) As Byte = (192,168,1,200), // Gateway address cDns_Addr(4) As Byte = (192,168,1,200) // Primary DNS. Your gateway.
Public Const
cHOST_NAME = "WIZ811"
Public Const
cHOST_NAME = "WIZ811" // At this time unused.
The module in question is well-known by many Arduino fans and the only flaw it has is the lack of DHCP and DNS natives for which you must write the missing driver .. actually the WIZnet provides extensive documentation about it and they should make porting from C ++.
Porting I did include the initialization and all that allows you to use the W5100 as a server because I intend to use it as a web service even if all the routines implemented allow its use as a server / client TCP and UDP as it is, I translated the entire set of C ++ functions. In the future I intend to implement NTP and sending e-mails since there are many examples on the net.
If you do not use DHCP the settings affecting fixed ip address, subnet mask and gw are set in the module "W5100-Consts.bas" where you can also set the default tcp port cTCP_PORT that however can be overridden.
The module in question is well-known by many Arduino fans and the only flaw it has is the lack of natives DHCP and DNS for which you must write the missing driver .. actually the WIZnet provides extensive documentation about it and they should make porting from C ++.
Porting I did include the initialization and all that allows you to use the W5100 as a server because I intend to use it as a web service even if all the routines implemented allow its use as a server / client TCP and UDP as it is, I translated the entire set of C ++ functions. In the future I intend to implement NTP and sending e-mails since there are many examples on the net by Arduino libraries.
If you do not use DHCP the settings affecting fixed ip address, subnet mask and gw are set in the module "W5100-IPConfig.bas" where you can also set the default tcp port cTCP_PORT that however can be overridden and this module is not part of the zip and must be copied to the project folder.
Place this module in a file called W5100-IPConfig.bas in project folder:
{ ***************************************************************************** * Name : W5100-IPConfig.BAS * * Author : Coccoliso * * Notice : Copyright (c) 2014 [select VIEW...EDITOR OPTIONS] * * : All Rights Reserved * * Date : 02/11/2014 * * Version : 1.0 * * Notes : * * : * ***************************************************************************** } Module W5100_IPConfig Public Const cMac_Addr(6) As Byte = ($00,$0E,$35,$73,$9F,$EF), cIp_Addr(4) As Byte = (192,168,1,9), cSub_Mask(4) As Byte = (255,255,255,0), cGtw_Addr(4) As Byte = (192,168,1,200), cDns_Addr(4) As Byte = (192,168,1,200) Public Const cHOST_NAME = "WIZ811"
I used the SPI interface even if the form WIZ811MJ also has a parallel interface. It has two connectors strips with 2x10 pin of which have been connected just a dozen including power and ground. To enable the SPI interface and disable the parallel need to put a resistor pull-up 10KOhm on pin named /CS of the module (in case of WIZ811MJ is J2/7) that puts in three-state the parallel bus and the module use SPI communication enabled via pin named /SCS (in the WIZ811MJ module is the pin J2/4).
I used the SPI interface even if WIZ811MJ module also has a parallel interface. It has two connectors strips with 2x10 pin of which have been connected just a dozen including power and ground. To enable the SPI interface and disable the parallel need to put a resistor pull-up 10KOhm on pin named /CS of the module (in case of WIZ811MJ is J2/7) that puts in three-state the parallel bus and the module use SPI communication enabled via pin named /SCS (in the WIZ811MJ module is the pin J2/4).
The module in question is used by many Arduino and the only flaw it has is the lack of DHCP and DNS natives for which you must write the missing driver .. actually the WIZnet provides extensive documentation about it and they should make porting from C ++.
The module in question is well-known by many Arduino fans and the only flaw it has is the lack of DHCP and DNS natives for which you must write the missing driver .. actually the WIZnet provides extensive documentation about it and they should make porting from C ++.
Works with 3.3V only although would be driven with signals up to 5V. In my case I used with 3.3V, with a PIC18F2682 and a CAN transceiver from Texas Instruments, the SN65HVD230 who also works with 3.3V.
Works with 3.3V only although would be driven with signals up to 5V tolerance. In a prototype I used a PIC at 5V and a 3,3V translator levels but do not recommend it because then you must go down a lot with the speed of the SPI and you lose in performance. Now I used it with 3.3V, a PIC18F2682, a CAN transceiver from Texas Instruments, the SN65HVD230 who also works with 3.3V.