Mbed library for ENC28J60 Ethernet modules. Full support for TCP/IP and UDP Server, Client and HTTP server (webserver). DHCP and DNS is included.

Dependents:   mBuino_ENC28_MQTT Nucleo_Web_ENC28J60 Nucleo_Web_ENC28J60_ADC Serial_over_Ethernet ... more

Library for ENC28J60 Ethernet modules.

/media/uploads/hudakz/enc28j60_module01.jpg

Ported to mbed from Norbert Truchsess's UIPEthernet library for Arduino. Thank you Norbert!

  • Full support for persistent (streaming) TCP/IP and UDP connections Client and Server each, ARP, ICMP, DHCP and DNS.
  • Works with both Mbed OS 2 and Mbed OS 5.

Usage:

  • Import the library into your project.
  • Add #include "UipEthernet.h" to main.cpp
  • Create one instance of the UipEthernet class initialized with the MAC address you'd like to use and SPI pins of the connected Mbed board.

Example programs:

Import programWebSwitch_ENC28J60

HTTP Server serving a simple webpage which enables to remotely turn a digital output on/off. Compile, download, run and type 'IP_address/secret/' (don't forget the last '/') into your web browser and hit ENTER.

Import programHTTPServer_Echo_ENC28J60

A simple HTTP server echoing received requests. Ethernet connection is over an ENC28J60 board. Usage: Type the server's IP address into you web browser and hit <ENTER>.

Import programTcpServer_ENC28J60

Simple TCP/IP Server using the UIPEthernet library for ENC28J60 Ethernet boards.

Import programTcpClient_ENC28J60

Simple TCP/IP Client using the UIPEthernet library for ENC28J60 Ethernet boards.

Import programUdpServer_ENC28J60

Simple UDP Server using the UIPEthernet library for ENC28J60 Ethernet boards.

Import programUdpClient_ENC28J60

Simple UDP Client using the UIPEthernet library for ENC28J60 Ethernet boards.

Import programMQTT_Hello_ENC28J60

MQTT Client example program. Ethernet connection is via an ENC28J60 module.

Committer:
hudakz
Date:
Sat Sep 07 17:42:42 2019 +0000
Revision:
15:53715cc81c63
Parent:
10:e4ddab81e6a8
Timeout parameter added for the 'connect' function, SPI speed reduced from 20 to 10 Mb/s, debug messages fixed ...

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hudakz 10:e4ddab81e6a8 1 This is UIPEthernet for Mbed OS 2 and Mbed OS 5
hudakz 0:5350a66d5279 2
hudakz 10:e4ddab81e6a8 3 Full support for persistent (streaming) TCP-connections and UDP (Client and Server each), ARP, ICMP, DHCP and DNS.
hudakz 0:5350a66d5279 4
hudakz 10:e4ddab81e6a8 5 UIPEthernet is written as a wrapper around the mature uIP Stack by Adam Dunkels, which provides the low-level implementation for all supported protocols.
hudakz 10:e4ddab81e6a8 6 To overcome the memory-constrains (a 'regular' uIP-application does all processing in RAM) the ENC28J60 internal memory is used for all stream buffers (in and out).
hudakz 0:5350a66d5279 7
hudakz 0:5350a66d5279 8 This library is written by Norbert Truchsess <norbert.truchsess@t-online.de>
hudakz 0:5350a66d5279 9
hudakz 0:5350a66d5279 10 uIP was written by Adam Dunkels of the Networked Embedded Systems group at the Swedish Institute of Computer Science.
hudakz 0:5350a66d5279 11
hudakz 0:5350a66d5279 12 This library was inspired by the SerialIP implementation by Adam Nielsen <malvineous@shikadi.net>, actually I took this code as a starting point, but in the latest versions there are very few lines left.
hudakz 0:5350a66d5279 13
hudakz 10:e4ddab81e6a8 14 This library was ported to mbed by Zoltan Hudak <hudakz@outlook.com>
hudakz 4:d774541a34da 15
hudakz 4:d774541a34da 16 Additional information can be found on the Arduino website: http://www.arduino.cc/en/Hacking/Libraries
hudakz 0:5350a66d5279 17
hudakz 0:5350a66d5279 18 Documentation
hudakz 0:5350a66d5279 19 -------------
hudakz 0:5350a66d5279 20
hudakz 0:5350a66d5279 21 For more information visit:
hudakz 0:5350a66d5279 22
hudakz 0:5350a66d5279 23 - UIPEthernet Repository on github:
hudakz 0:5350a66d5279 24 https://github.com/ntruchsess/arduino_uip
hudakz 0:5350a66d5279 25
hudakz 0:5350a66d5279 26 - Arduino Ethernet library description
hudakz 0:5350a66d5279 27 http://arduino.cc/en/Reference/Ethernet
hudakz 0:5350a66d5279 28
hudakz 0:5350a66d5279 29 - uIP API reference:
hudakz 0:5350a66d5279 30 http://www.sics.se/~adam/uip/uip-1.0-refman/
hudakz 0:5350a66d5279 31
hudakz 4:d774541a34da 32 - Arduino forums
hudakz 4:d774541a34da 33 http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl
hudakz 4:d774541a34da 34
hudakz 0:5350a66d5279 35 - uIP homepage:
hudakz 0:5350a66d5279 36 http://www.sics.se/~adam/uip/index.php/Main_Page
hudakz 0:5350a66d5279 37
hudakz 0:5350a66d5279 38 Licenses
hudakz 0:5350a66d5279 39 -------------
hudakz 0:5350a66d5279 40
hudakz 10:e4ddab81e6a8 41 UipEthernet.h
hudakz 10:e4ddab81e6a8 42 UipEthernet.cpp
hudakz 10:e4ddab81e6a8 43 UdpSocket.h
hudakz 10:e4ddab81e6a8 44 UdpSocket.cpp
hudakz 10:e4ddab81e6a8 45 TcpClient.h
hudakz 10:e4ddab81e6a8 46 TcpClient.cpp
hudakz 10:e4ddab81e6a8 47 TcpServer.h
hudakz 10:e4ddab81e6a8 48 TcpServer.cpp
hudakz 10:e4ddab81e6a8 49 utility/MemPool.h
hudakz 10:e4ddab81e6a8 50 utility/MemPool.cpp
hudakz 0:5350a66d5279 51
hudakz 0:5350a66d5279 52 Copyright (c) 2013 Norbert Truchsess <norbert.truchsess@t-online.de>
hudakz 0:5350a66d5279 53 All rights reserved.
hudakz 0:5350a66d5279 54
hudakz 10:e4ddab81e6a8 55 Modified (ported to mbed) by Zoltan Hudak <hudakz@outlook.com>
hudakz 0:5350a66d5279 56
hudakz 0:5350a66d5279 57 This program is free software: you can redistribute it and/or modify
hudakz 0:5350a66d5279 58 it under the terms of the GNU General Public License as published by
hudakz 0:5350a66d5279 59 the Free Software Foundation, either version 3 of the License, or
hudakz 0:5350a66d5279 60 (at your option) any later version.
hudakz 0:5350a66d5279 61
hudakz 0:5350a66d5279 62 This program is distributed in the hope that it will be useful,
hudakz 0:5350a66d5279 63 but WITHOUT ANY WARRANTY; without even the implied warranty of
hudakz 0:5350a66d5279 64 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
hudakz 0:5350a66d5279 65 GNU General Public License for more details.
hudakz 0:5350a66d5279 66
hudakz 0:5350a66d5279 67 You should have received a copy of the GNU General Public License
hudakz 0:5350a66d5279 68 along with this program. If not, see <http://www.gnu.org/licenses/>.
hudakz 0:5350a66d5279 69
hudakz 0:5350a66d5279 70 --------------
hudakz 0:5350a66d5279 71
hudakz 0:5350a66d5279 72 utility/enc28j60.h
hudakz 0:5350a66d5279 73
hudakz 10:e4ddab81e6a8 74 Author: Pascal Stang (c)2005
hudakz 0:5350a66d5279 75 Modified by Norbert Truchsess
hudakz 0:5350a66d5279 76 Copyright: GPL V2
hudakz 0:5350a66d5279 77
hudakz 0:5350a66d5279 78 --------------
hudakz 0:5350a66d5279 79
hudakz 10:e4ddab81e6a8 80 utility/Enc28j60Py.h
hudakz 10:e4ddab81e6a8 81 utility/Enc28j60Py.cpp
hudakz 0:5350a66d5279 82
hudakz 0:5350a66d5279 83 Copyright (c) 2013 Norbert Truchsess <norbert.truchsess@t-online.de>
hudakz 0:5350a66d5279 84 All rights reserved.
hudakz 0:5350a66d5279 85
hudakz 0:5350a66d5279 86 inspired and based on enc28j60.c file from the AVRlib library by Pascal Stang.
hudakz 0:5350a66d5279 87
hudakz 10:e4ddab81e6a8 88 Modified (ported to mbed) by Zoltan Hudak <hudakz@outlook.com>
hudakz 0:5350a66d5279 89
hudakz 0:5350a66d5279 90 This program is free software: you can redistribute it and/or modify
hudakz 0:5350a66d5279 91 it under the terms of the GNU General Public License as published by
hudakz 0:5350a66d5279 92 the Free Software Foundation, either version 3 of the License, or
hudakz 0:5350a66d5279 93 (at your option) any later version.
hudakz 0:5350a66d5279 94
hudakz 0:5350a66d5279 95 This program is distributed in the hope that it will be useful,
hudakz 0:5350a66d5279 96 but WITHOUT ANY WARRANTY; without even the implied warranty of
hudakz 0:5350a66d5279 97 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
hudakz 0:5350a66d5279 98 GNU General Public License for more details.
hudakz 0:5350a66d5279 99
hudakz 0:5350a66d5279 100 You should have received a copy of the GNU General Public License
hudakz 0:5350a66d5279 101 along with this program. If not, see <http://www.gnu.org/licenses/>.
hudakz 0:5350a66d5279 102
hudakz 0:5350a66d5279 103 --------------
hudakz 0:5350a66d5279 104
hudakz 0:5350a66d5279 105 utility/uip.c
hudakz 0:5350a66d5279 106 utility/uip_arp.h
hudakz 0:5350a66d5279 107 utility/uip_arp.c
hudakz 0:5350a66d5279 108 utility/uip_arch.h
hudakz 0:5350a66d5279 109 utility/uip.h
hudakz 0:5350a66d5279 110 utility/uipopt.h
hudakz 0:5350a66d5279 111
hudakz 0:5350a66d5279 112 Copyright (c) 2001-2003, Adam Dunkels <adam@sics.se>, <adam@dunkels.com>.
hudakz 0:5350a66d5279 113 All rights reserved.
hudakz 0:5350a66d5279 114
hudakz 0:5350a66d5279 115 Redistribution and use in source and binary forms, with or without
hudakz 0:5350a66d5279 116 modification, are permitted provided that the following conditions
hudakz 0:5350a66d5279 117 are met:
hudakz 0:5350a66d5279 118 1. Redistributions of source code must retain the above copyright
hudakz 0:5350a66d5279 119 notice, this list of conditions and the following disclaimer.
hudakz 0:5350a66d5279 120 2. Redistributions in binary form must reproduce the above copyright
hudakz 0:5350a66d5279 121 notice, this list of conditions and the following disclaimer in the
hudakz 0:5350a66d5279 122 documentation and/or other materials provided with the distribution.
hudakz 0:5350a66d5279 123 3. Neither the name of the Institute nor the names of its contributors
hudakz 0:5350a66d5279 124 may be used to endorse or promote products derived from this software
hudakz 0:5350a66d5279 125 without specific prior written permission.
hudakz 0:5350a66d5279 126
hudakz 0:5350a66d5279 127 THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
hudakz 0:5350a66d5279 128 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
hudakz 0:5350a66d5279 129 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
hudakz 0:5350a66d5279 130 ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
hudakz 0:5350a66d5279 131 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
hudakz 0:5350a66d5279 132 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
hudakz 0:5350a66d5279 133 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
hudakz 0:5350a66d5279 134 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
hudakz 0:5350a66d5279 135 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
hudakz 0:5350a66d5279 136 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
hudakz 0:5350a66d5279 137 SUCH DAMAGE.
hudakz 0:5350a66d5279 138
hudakz 0:5350a66d5279 139 --------------
hudakz 0:5350a66d5279 140
hudakz 0:5350a66d5279 141 uip-conf.h
hudakz 0:5350a66d5279 142 utility/uip-neighbor.h
hudakz 0:5350a66d5279 143 utility/uip-neighbor.c
hudakz 0:5350a66d5279 144 utility/uip_timer.h
hudakz 0:5350a66d5279 145 utility/uip_timer.c
hudakz 0:5350a66d5279 146 utility/uip_clock.h
hudakz 0:5350a66d5279 147
hudakz 0:5350a66d5279 148 Author Adam Dunkels Adam Dunkels <adam@sics.se>, <adam@dunkels.com>
hudakz 0:5350a66d5279 149 Copyright (c) 2004,2006, Swedish Institute of Computer Science.
hudakz 0:5350a66d5279 150 All rights reserved.
hudakz 0:5350a66d5279 151
hudakz 0:5350a66d5279 152 Redistribution and use in source and binary forms, with or without
hudakz 0:5350a66d5279 153 modification, are permitted provided that the following conditions
hudakz 0:5350a66d5279 154 are met:
hudakz 0:5350a66d5279 155 1. Redistributions of source code must retain the above copyright
hudakz 0:5350a66d5279 156 notice, this list of conditions and the following disclaimer.
hudakz 0:5350a66d5279 157 2. Redistributions in binary form must reproduce the above copyright
hudakz 0:5350a66d5279 158 notice, this list of conditions and the following disclaimer in the
hudakz 0:5350a66d5279 159 documentation and/or other materials provided with the distribution.
hudakz 0:5350a66d5279 160 3. Neither the name of the Institute nor the names of its contributors
hudakz 0:5350a66d5279 161 may be used to endorse or promote products derived from this software
hudakz 0:5350a66d5279 162 without specific prior written permission.
hudakz 0:5350a66d5279 163
hudakz 0:5350a66d5279 164 THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
hudakz 0:5350a66d5279 165 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
hudakz 0:5350a66d5279 166 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
hudakz 0:5350a66d5279 167 ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
hudakz 0:5350a66d5279 168 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
hudakz 0:5350a66d5279 169 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
hudakz 0:5350a66d5279 170 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
hudakz 0:5350a66d5279 171 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
hudakz 0:5350a66d5279 172 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
hudakz 0:5350a66d5279 173 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
hudakz 0:5350a66d5279 174 SUCH DAMAGE.
hudakz 0:5350a66d5279 175
hudakz 0:5350a66d5279 176 --------------
hudakz 0:5350a66d5279 177
hudakz 10:e4ddab81e6a8 178 DhcpClient.h
hudakz 10:e4ddab81e6a8 179 DhcpClient.cpp
hudakz 0:5350a66d5279 180
hudakz 0:5350a66d5279 181 DHCP Library v0.3 - April 25, 2009
hudakz 0:5350a66d5279 182 Author: Jordan Terrell - blog.jordanterrell.com
hudakz 0:5350a66d5279 183 - as included in Arduinos stock Ethernet-library, no special licence mentioned here
hudakz 0:5350a66d5279 184
hudakz 10:e4ddab81e6a8 185 Modified (ported to mbed) by Zoltan Hudak <hudakz@outlook.com>
hudakz 10:e4ddab81e6a8 186
hudakz 0:5350a66d5279 187 --------------
hudakz 0:5350a66d5279 188
hudakz 10:e4ddab81e6a8 189 DnsClient.h
hudakz 10:e4ddab81e6a8 190 DnsClient.cpp
hudakz 0:5350a66d5279 191
hudakz 0:5350a66d5279 192 (c) Copyright 2009-2010 MCQN Ltd.
hudakz 0:5350a66d5279 193 Released under Apache License, version 2.0
hudakz 0:5350a66d5279 194
hudakz 0:5350a66d5279 195 --------------
hudakz 0:5350a66d5279 196
hudakz 0:5350a66d5279 197 clock-arch.h
hudakz 0:5350a66d5279 198 clock-arch.c
hudakz 0:5350a66d5279 199
hudakz 0:5350a66d5279 200 Copyright (c) 2010 Adam Nielsen <malvineous@shikadi.net>
hudakz 0:5350a66d5279 201 All rights reserved.
hudakz 0:5350a66d5279 202
hudakz 0:5350a66d5279 203 This library is free software; you can redistribute it and/or
hudakz 0:5350a66d5279 204 modify it under the terms of the GNU Lesser General Public
hudakz 0:5350a66d5279 205 License as published by the Free Software Foundation; either
hudakz 0:5350a66d5279 206 version 2.1 of the License, or (at your option) any later version.
hudakz 0:5350a66d5279 207
hudakz 0:5350a66d5279 208 This library is distributed in the hope that it will be useful,
hudakz 0:5350a66d5279 209 but WITHOUT ANY WARRANTY; without even the implied warranty of
hudakz 0:5350a66d5279 210 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
hudakz 0:5350a66d5279 211 Lesser General Public License for more details.
hudakz 0:5350a66d5279 212
hudakz 0:5350a66d5279 213 You should have received a copy of the GNU Lesser General Public
hudakz 0:5350a66d5279 214 License along with this library; if not, write to the Free Software
hudakz 0:5350a66d5279 215 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
hudakz 0:5350a66d5279 216
hudakz 0:5350a66d5279 217 --------------
hudakz 0:5350a66d5279 218
hudakz 10:e4ddab81e6a8 219 IpAddress.h
hudakz 10:e4ddab81e6a8 220 IpAddress.cpp
hudakz 0:5350a66d5279 221 Copyright (c) 2011 Adrian McEwen. All right reserved.
hudakz 0:5350a66d5279 222
hudakz 10:e4ddab81e6a8 223 Modified (ported to mbed) by Zoltan Hudak <hudakz@outlook.com>
hudakz 0:5350a66d5279 224
hudakz 0:5350a66d5279 225 This library is free software; you can redistribute it and/or
hudakz 0:5350a66d5279 226 modify it under the terms of the GNU Lesser General Public
hudakz 0:5350a66d5279 227 License as published by the Free Software Foundation; either
hudakz 0:5350a66d5279 228 version 2.1 of the License, or (at your option) any later version.
hudakz 0:5350a66d5279 229
hudakz 0:5350a66d5279 230 This library is distributed in the hope that it will be useful,
hudakz 0:5350a66d5279 231 but WITHOUT ANY WARRANTY; without even the implied warranty of
hudakz 0:5350a66d5279 232 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
hudakz 0:5350a66d5279 233 Lesser General Public License for more details.
hudakz 0:5350a66d5279 234
hudakz 0:5350a66d5279 235 You should have received a copy of the GNU Lesser General Public
hudakz 0:5350a66d5279 236 License along with this library; if not, write to the Free Software
hudakz 0:5350a66d5279 237 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA