W5100

SwordfishUser.W5100 History

Show minor edits - Show changes to output

Deleted lines 0-3:
'''UPDATED 27 March 2015'''

In this [[http://sfcompiler.co.uk/phpBB3/viewtopic.php?f=4&t=1942&p=10718#p10718| this post ]] you will find the library update W5500 with PING functionality.

Added lines 1-4:
'''UPDATED 27 March 2015'''

In this [[http://sfcompiler.co.uk/phpBB3/viewtopic.php?f=4&t=1942&p=10718#p10718| this post ]] you will find the library update W5500 with PING functionality.

Added lines 585-655:
=]

This is the request that the client sends to the web service when requesting the Command method:

=code [=
<?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:

=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>
    <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:

=code [=
<?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>
Changed lines 342-343 from:
The VS2010 VB.NET class named Service1.asmx used in example for WSDL generation
to:
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:

Changed line 396 from:
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.
to:
This is the "PIC side" source that receives, interprets and returns to the windows client app the class above:
Changed lines 338-339 from:
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.
to:
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.
Deleted line 393:
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.
Changed line 334 from:
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.
to:
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.
Added lines 340-341:
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.
Changed line 372 from:
The response class than contains returned values
to:
The response class ( composite object ) than contains returned values: four integers two boolean and two variable size arrays of integer.
Changed lines 338-339 from:
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.
to:
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.
Changed lines 392-393 from:
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. 
to:
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.
 
Added lines 95-103:
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.

=code [=
...
Public Dim
    RXBuff As String (600),
    RXBuffPointer As Word
...
=]
Changed lines 4-5 from:
[[http://sfcompiler.co.uk/wiki/uploads/coccoliso/W5100-Sources-and-VS2010-Sample.zip | WIZ811MJ/W5100 sources and VS2010 SOAP client example]]
to:
[[http://sfcompiler.co.uk/wiki/uploads/coccoliso/W5100-Sources-and-VS2010-Sample.zip | WIZ811MJ/W5100 ]]
Changed lines 56-57 from:
[[http://sfcompiler.co.uk/wiki/uploads/coccoliso/W5100-Sources-and-VS2010-Sample.zip | WIZ811MJ/W5100 sources and VS2010 SOAP client example]]
to:
[[http://sfcompiler.co.uk/wiki/uploads/coccoliso/W5100-Sources-and-VS2010-Sample.zip | WIZ811MJ/W5100 ]]
Changed line 575 from:
[[http://sfcompiler.co.uk/wiki/uploads/coccoliso/W5100-Sources-and-VS2010-Sample.zip | WIZ811MJ/W5100 sources and VS2010 SOAP client example]]
to:
[[http://sfcompiler.co.uk/wiki/uploads/coccoliso/W5100-Sources-and-VS2010-Sample.zip | WIZ811MJ/W5100 ]]
Changed lines 3-4 from:
[[http://sfcompiler.co.uk/wiki/uploads/coccoliso/W5100-Sources-and-VS2010-Sample.zip | W5100 modules and VS2010 SOAP client]]
to:
You can download modules and examples from the following link:
[[http://sfcompiler.co.uk/wiki/uploads/coccoliso/W5100-Sources-and-VS2010-Sample.zip | WIZ811MJ/W5100 sources and VS2010 SOAP client example]]
Deleted lines 37-38:
[[http://sfcompiler.co.uk/wiki/uploads/coccoliso/W5100-Sources-and-VS2010-Sample.zip | W5100 modules and VS2010 SOAP client]]
Added lines 55-57:
You can download modules and examples from the following link:
[[http://sfcompiler.co.uk/wiki/uploads/coccoliso/W5100-Sources-and-VS2010-Sample.zip | WIZ811MJ/W5100 sources and VS2010 SOAP client example]]

Changed lines 574-575 from:
[[http://sfcompiler.co.uk/wiki/uploads/coccoliso/W5100-Sources-and-VS2010-Sample.zip | W5100 modules and VS2010 SOAP client]]
to:
You can download modules and examples from the following link:
[[http://sfcompiler.co.uk/wiki/uploads/coccoliso/W5100-Sources-and-VS2010-Sample.zip | WIZ811MJ/W5100 sources and VS2010 SOAP client example]]
Added lines 3-4:
[[http://sfcompiler.co.uk/wiki/uploads/coccoliso/W5100-Sources-and-VS2010-Sample.zip | W5100 modules and VS2010 SOAP client]]
Changed lines 570-572 from:
=]
to:
=]

[[http://sfcompiler.co.uk/wiki/uploads/coccoliso/W5100-Sources-and-VS2010-Sample.zip | W5100 modules and VS2010 SOAP client]
]
Added lines 34-35:

[[http://sfcompiler.co.uk/wiki/uploads/coccoliso/W5100-Sources-and-VS2010-Sample.zip | W5100 modules and VS2010 SOAP client]]
Changed lines 59-61 from:
!!Place this module in a file called W5100-IPConfig.bas in project folder:
to:
!!W5100-IPConfig.bas
Create
this module in a file called W5100-IPConfig.bas in the folder where have created the two sample programs.
Changed lines 35-36 from:
!!!Modules
to:
!!!Modules in zip
Added lines 52-55:
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.

Changed line 57 from:
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.
to:
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.
Changed lines 33-35 from:
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:
to:
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

|| border=1
||!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:
Deleted lines 82-100:

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

|| border=1
||!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||
Changed lines 52-56 from:
   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)
to:
   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. 
Changed lines 58-59 from:
Public Const
    cHOST_NAME  = "WIZ811"
to:
Public Const
   cHOST_NAME  = "WIZ811"                           // At this time unused. 
Changed lines 29-33 from:
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.
to:
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:
=code [=
{
*****************************************************************************
*  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"

=]

Changed lines 8-9 from:
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).
to:
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).
Deleted line 27:
Changed lines 29-31 from:


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 ++.
to:
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 ++.
Changed lines 5-6 from:
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.
to:

'''
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.