W5100 vs W5100S - W5100S 무엇이 달라졌을까?

by MC



Overview

WIZnet는 2018년 5월 W5100S를 출시했다.
W5100S는 그 동안 WIZnet의 대표상품인 W5100을 크게 개선한 제품으로 저발열, 저비용, 고효율을 구현한 TCP/IP Ethernet Controller 이다.

위 사진에서 보여지는 것처럼, W5100S는 Package 변경에 따른 W5100과의 PIN-to-PIN 호환성을 지원하지 않지만, LQFP48 & QFN48 2가지 Package를 제공하여 사용자의 선택의 폭을 넓혔다.

반면, W5100과의 FW 호환성을 유지하여 PPPoE를 제외한 W5100의 Use Application을 수정없이 그대로 사용할 수 있을 뿐만 아니라, 개선되거나 추가된 새로운 기능을 활용하여 보다 나은 네트워크 통신 기능을 제공한다.

W5100S은 W5100과 무슨 차별성을 있으며, 무엇이 개선되고, 무엇이 추가되었는지 W5100과 비교하며 살펴보도록 하자.

Features

다음은 W5100과 W5100S의 Feature들을 한눈에 비교할 수 있는 표이다.

  • Main Fetures

    Feautres W5100 W5100S Description
    TCP O O (PSH Flag Control) PSH flag를 선택적으로 설정한다
    UDP O O (WOL, Filtering) WOL over UDP 지원 및 Broad/Uni/Muticast Filtering
    IP O O
    MACRAW O O (Filtering) MACRAW Data를 Filtering하여 Host의 수신 부담을 줄였다.
    ICMP O O (Ping Request) SLCR Register로 Ping-Reqest 전송
    IGMP O O
    ARP O O (ARP request) SLCR Register로 ARP-Reqest 전송
    PPPoE HW SW PAP/CHAP 이외의 인증 알고리즘 사용 가능
    SOCKET # 4 4
    SOCKET TX/RX Memory 8KB/8KB 8KB/8KB
    Ethernet PHY O O
    Package LQFP80 LQFP48, QFN48 Samll Package
  • Host Interface

    Feautres W5100 W5100S Description
    Direct Bus Mode O X
    Indirect Bus Mode O O Bus Interface Logic 개선을 통한 Access time 증가
    SPI mode O(Low) O(Fast) SPI clock Speed 개선을 통한 Fast SPI 구현
  • Integrated 10Base-T/100Base-TX Ethernet PHY

    Feautres W5100 W5100S Description
    Operation Mode Configured by PIN Configured by REG or MDC/MDIO Hardware PIN을 없애고, PHYCR0 regsiter를 통하거나, 내장 MDC/MDIO controller를 통해 제어
    Auto-negotiation O O
    Auto-MDIX O O 둘다 Auto-negotiation Mode일 때만 지원
    MDC/MDIO X O
    PHY Status X O PHYSR Register 참조
    LEDs TX, RX, SPD, DUP, COL, LINK ACT, SPD, DUP, COL, LINK TX, RX를 ACT 하나로
    Power Down Mode X O Power 소모량 개선
  • Miscellaneous

    Feautres W5100 W5100S Description
    Retransmittion Configruation 모든 소켓에 적용 소켓별로 적용 가능
    Keep Alive by Command by Command or Auto
    SOCKET-Less Command X O (ARP, PING)
    Interrupt Global Interrupt / Pending Interrupt를 Enable/Disable하며, Pending한다.
    System Clock Switching 150MHz Fixed 100MHz <-> 25MHz
    CHIP Reset CORE & PHY CORE or PHY (전부 혹은 선택적으로)
    TCP RST Block X O Port Scan Attack 방어
    ICMP Unreachable Port Block X O Port Scan Attack 방어
    Configuration Lock X O

What is enhanced & What is new in W5100S.

간략한 내용은 앞서 Features를 통해 살펴 보았다.

지금부터는 W5100과 차별성이 두드러지는 기능들을 좀 더 자세히 살펴 보자.

  • Hardware

    1. PIN (Package)

      W5100S는 W5100의 ADDR[14:2], OPMODE[2:0] Siganl PIN를 제거하고, Power PIN을 Optimize하여 LQFP80 package를 LQPF48, QFN48로 Small Package를 지원한다.
      제거된 PIN들은 성능 개선이나 Register 설정으로 대체되었다. 참고로, W5100S는 Core 전압으로 1.8V 아닌 1.2V를 사용함에 주의하라.

    2. Host Interface

      • Parallel Bus Mode

        Parallel Bus Access Timing을 개선하여 Direct Bus Mode를 제거하고, Indirect Bus Mode만 지원한다. 아래 그림은 Writing Timing을 비교한 것이다.

        그림에서와 같이 W5100S과 100MHz로 동작할 경우 Bus access time은 40ns로 30ns정도 개선되었다.

      • SPI

        그림에서와 같이 W5100S는 최대 70MHz SPI Clock Speed를 지원한다. W5100의 70ns 주기를 14.3ns 주기로 개선하여 Fast SPI를 구현하였다.

        W5100S SPI 최대 Clock 사용시 T(DS) Time 7ns가 필요함에 주의바란다.
        T(DS)을 만족하는 최대 SPI Clock Speed는 14.3+7 = 21.3 ns 주기를 갖는 43MHz이다.

      • Interrupt

        W5100은 Interrupt Loss가 간혹 발생한다. 특히 RX Interrupt Clear와 동시에 발생한 중첩 Interrupt에 의해 Interrupt PIN이 Low 상태를 유지하여 Host는 더 이상 Interrupt 발생을 인지못하는 경우가 발생한다.

        W5100S는 이를 보안하기 위하여 RECV Command 수행 후 RX buffer가 남아 있는 경우 RX Interrupt를 재생산하여, 중첩 Interrupt가 발생하더라도 Interrupt Pend Timing 이후 여전히 Interrupt가 남아 있는 경우 Interrupt를 재생산하도록 구현되었다.

        자세한 내용은 wizwik를 참조하라.

  • TCP

    1. PSH Flag

      PSH flag는 TCP Data를 수신했음을 Application으로 알려 Application으로 하여금 Data를 빠르게 처리하는 기능을 가지고 있다.
      W5100과 W5100S는 모두 MSS 보다 큰 Data를 전송할 경우 MSS 단위로 나눈 마지막 데이타에 PSH flag를 설정한다.
      W5100S는 마지막 Packet이 아니라 할지라도 상대방의 Window가 zero가 되게 하는 전송 Packet에 PSH flag를 설정하여, Application을 하여금 빠른 수신을 하도록 한다.
      또한 W5100과 달리 Sn_MR2[BRDB]=’1’ 인 경우 모든 Packet에 PSH flag를 설정하여 보낼 수 있다.

    2. RST Block

      W5100의 경우는 대기하고 있는 SOCKET이 존재하지 않을 경우, RST packet을 전송한다. 이는 Port Scan Attack의 대상이 된다.

      W5100S는 MR2[NOTCPRST] = ‘1’ 인 경우 RST packet 전송 기능을 Block 할 수 있고 Port Scan Attack을 대비할 수 있다.

      또한, Web Server와 같은 Applicaton을 수행할 경우, 한정된 SOCKET 수(최대 4) 때문에, Web Browser와의 통신이 원할하지 않을 수 있다.
      이는 Web Browser가 특정 Contents를 요구했을 경우 대기하고 있는 SOCKET이 없는 없다면 RST를 수신하게 되어 더이상 재요청을 하지 않는 문제가 발생한다.
      RST packet 전송 block은 Web Browser로 하여금 재요청을 유도하여 대기 SOCKET이 생길 경우 재요청된 Content을 전송할 수 있게 해준다.

    3. Auto Keep Alive

      W5100S은 Sn_CRSEND_KEEP command를 이용하여 Keep Alive Packet을 전송할 수 있을 뿐만 아니라, Sn_KPALVTR 마다 자동으로 Keep Alive Packet을 전송할 수 있다.
      SEND_KEEP은 Sn_KPALVTR이 0인 동안만 수행이 가능하다.

  • UDP

    1. WOL

      W5100S는 UDP를 통해 수신되는 지정된 Magic packet을 분석하여 대기 중인 Host System를 wake할 수 있는 WOL을 지원한다.
      WOL magic packet을 수신할 경우 IR2[WOL] 이 설정되고 인터럽트가 발생한다.

    2. ICMP(Port Unreachable) Block

      W5100과 W5100S는 Open되어 있지 않은 Port로 UDP Packet을 수신할 경우 ICMP(Port Unreachable) Message를 전송한다. 이는 TCP와 마찬가지로, UDP 역시 Port Scan Attack의 대상이 될 수 있다.

      W5100S는 MR2[UDPURB] = ‘1’ 인 경우, ICMP(Unreacheach Port)Message 전송을 Block하여 Port Scan Attack에 대비할 수 있다.

    3. Broad/Uni/Multicast packet filtering

      W5100의 경우 Open된 UDP port로 들어 오는 Unicast 뿐만 아니라 원치 않는 Broadcast, Multicast Packet들이 수신될 수 있다. 원치 않은 Packet을 수신할 경우 사용자가 이를 직접 수신하여 Discard 해야 한다.
      그러나 W5100S의 경우, 아래와 같은 설정으로 원하지 않은 packet을 수신하지 않음으로써 사용자 처리 부담을 대폭 감소시켰다.

      UDP Filter 기능은 아래와 같이 설정될 수 있다.

  • MACRAW

    W5100은 MACRAW SOCKET을 사용할 경우 자신에게 보내진 Packet 뿐만 아니라 Broadcast,Multicast Packet을 모두 수신한다. 필요없는 패킷을 수신한 경우 이는 사용자가 직접 수신하여 Discard 하는 부담이 있다.
    W5100S는 필요없는 Broadcast, Multicast Packet 뿐만 아니라, IPv6 Packet등을 사용자의 수신 부담없이 Filtering하여 Discard한다.

  • PPPoE

    W5100의 PPPoE는 hardwired logic으로 구현되어, PPPoE 연결 설정에 대한 다양한 Option(예로 PAP/CHAP encryption)을 처리할 수 없는 문제가 있었다.
    W5100S는 이와 같이 PPPoE 연결 설정을 MACRAW SOCKET을 이용하여 software로 처리하여 Option 처리에 대한 유연성을 높혔으며, 연결 유지를 위한 반복적인 LCP-ECHO 전송 및 연결 종료 인지 기능만을 Hardware Logic으로 구현하였다.

    PPPoE 구현은 wizwiki를 참고하라.

  • Retransmission Configuration

    W5100S는 W5100과 달리 SOCKET 별로 재전송 시간을 설정할 수 있다.
    Sn_RTR & Sn_RCR Register를 통해 설정한다.
    기존의 RTR & RCR Register는 Sn_RTR & Sn_RCR의 초기값을 설정하는 용도로 변경되었다. 즉, Sn_RTR & Sn_RCR를 따로 설정하지 않을 경우, SOCKET 재전송은 RTR & RCR을 따른다.

  • SOCKET-less Command

    W5100S는 SOCKET을 사용하지 않고, ARP, PING Request를 원하는 Destination으로 전송하는 기능을 제공한다.

    이는 SLCR (SOCKET-less Command), SLIR (SOCKET-less Interrupt), SLIMR (SOCKET-less Interrupt Mask), SLIRCLR (SOCKET-less Interrupt Clear), SLDIPR (SOCKET-less Destination IP Address), SLDHAR (SOCKET-less Destination Hardware Address), PINGIDR (PING ID), PINGSEQR (PING Sequence Number) Register들을 통해 아래 그림과 같이 제어된다.

    1. ARP

      SLDIPR = {192,168,100,100}";
      SLCR[ARP] = 1;
      while(SLIR == 0x00);
      
      if(SLIR[TOUT] == 1) printf("Timeout Error");
      else if(SLIR[ARP] == 1)
      {
         printf("%02:%02:%02:%02:%02:%02",SLDHAR[0], SLDHAR[1], 
                                         ,SLDHAR[2], SLDHAR[3], 
                                         ,SLDHAR[4], SLDHAR[5])
      }
      SLIRCLR = 0xFF;
      
    2. PING

      SLDIPR = {192,168,100,100};
      PINGIDR = 0x5100;
      PINGSEQR = 0x1234;
      SLCR[PING] = 1;
      while(SLIR == 0x00);
      if(SLIR[TOUT] == 1) printf("Timeout Error");
      else if(SLIR[PING] == 1) printf("Ping Replay OK");
      SLIRCLR = 0xFF;
      
  • PHY

    1. Operation Mode

      W5100은 Hardware PIN OPMODE[2:0]을 제어하여 PHY operation mode를 설정하여, Reset 이 후 Operation Mode 설정이 불가능 하였다.
      반면에 W5100S는 PHYCR0 Regsiter를 통해 Reset 이후에도 Operation Mode 설정이 가능하다.

    2. MDC/MDIO Controller

      W5100S은 MDC/MDIO controller를 내장하여 BMCR, 와 같은 Ethernet PHY의 내부 Register를 제어할 수 있다.
      MDC/MDIO Controller는 PHYRAR (PHY Register Address), PHYDIR (PHY Data Input), PHYDOR (PHY Data Outuput), PHYACR (PHY Access Control) Register를 통해 제어된다.

      자세한 내용은 wizwiki 참조하라.

    3. Power Down Mode

      W5100S는 Ehternet PHY의 Power Down Mode를 지원한다.

      Power Down Mode 설정은 System clock이 25MHz로 변경되므로, W5100S SPI나 BUS access time이 25MHz로 조정되므로 주의하기 바란다.

  • System Clock Switching

    W5100S는 System Clock을 100MHz 혹은 25MHz로 선택으로 사용 가능하다.

    Ethernet Power Mode 설정 시 25MHz로 자동 변경됨에 주의하라.

  • Configuartion Lock

    W5100S는 의도치 않은 설정 변경을 막기 위해 아래의 3가지 설정에 대하여 Lock 기능을 제공한다.

    1. Clock Switching : MR2[CLKSEL] 설정 Lock

      CLKCLKR == 0xCE 이면 Unlock 상태, 아니면 Lock
      
    2. Network Inforamtion

      GWR, SIPR, SUBR,SHAR, SIPR 과 같은 Network Information Register 설정을 Lock한다.

      NETLCKR == 0x3A 이면 Unlock, 아니면 Lock
      
    3. PHY Control : PHYCR0, PHYCR1 설정 Lock

      PHYLCKR == 0x53 이면 Unlock, 아니면 Lock
      

맺으며

지금까지 W5100S의 특징적 차별성을 살펴 보았다.

기존의 W5100 사용자 뿐만 아니라, 새로운 W5100S 사용자에 많은 도움이 되어, W5100S가 W5100을 잇는 또 하나의 대표작이 되길 바란다.

블로그 이미지

밤소 MidnightCow

위즈네트 칩(W5300, W5200, W7100, W7500) 개발자

PlatformIO / WIZwiki-W7500

by http://platformio.org/



What is Platfrom IO

PlatformIO is an open source ecosystem for IoT development. PlatformIO supports WIZnet W7500 IoT platfrom such like WIZwiki-W7500, WIZwiki-W7500ECO, and WIZwiki-W7500P.

  • Features
    • Cross-platform IDE
    • Unified debugger
    • Remote unit testing
    • Firmware updates

Platform IO provides PlatformIO IDE, and Libarary Manager for Developing IoT Platfrom

PlatformIO IDE

PlatfromIO IDE supports three-kind IDE enviroments

PlatformIO Core

PlatformIO Core is a heart of whole PlatformIO ecosystem. This a Command Line Tool that consists of multi-platform build system, platform and library managers and other integration components.
It’s written in pure Python and works without any dependencies to host machine or third party software

PlatformIO IDE

PlatformIO IDE is the the next-generation integrated development environment for IoT. We provide official extension/plugin for the popular IDEs.

  • The Popular IDEs
    • Atom
    • VSCode
    • Cloud9
    • Codeanywhere
    • Eclipse Che
    • CLion
    • CodeBlocks
    • Eclipse
    • Emacs
    • NetBeans
    • Qt Creator
    • Sublime Text
    • VIM
    • Visual Studio

It’s built on top of PlatformIO Core. You no need to install PIO Core separately, our IDE already contains it and you can use it later via PlatformIO IDE Terminal.

Integration

Find out how to integrate PlatformIO with the popular Cloud & Standalone IDEs and Continuous Integration (CI) systems.
Extend your favourite environment with professional instruments.

Supported Embedded Boards (+400)

PlatformIO currently supports over 400 boards from leading manufacturers, and we are constantly adding new ones.

You can be part of the process by letting us know what board you wish to see supported next, by submitting a feature request.

WIZnet W7500

The IOP (Internet Offload Processor) W7500 is the one-chip solution which integrates an ARM Cortex-M0, 128KB Flash and hardwired TCP/IP core for various embedded application platform especially requiring Internet of things

For more detailed information please visit vendor site


Learn More

Goto Original

블로그 이미지

밤소 MidnightCow

위즈네트 칩(W5300, W5200, W7100, W7500) 개발자

How to use WIZnet Chip set such as W5100, W5200, W5300, and W5500 with Basic source code

by MCS electronics



Overview

This post introduces how to use WIZnet chip solution such like as W3100A, W5100, W5200, W5300, and W5500 with BASIC source code on BASCOM-AVR & BASCOM-8051.
BASCOM-AVR & BASCOM-8051 are BASIC complier & IDE development tools. These can implement with BASIC source code on WIZnet chip solutions.

CONFIG TCPIP

  • Syntax W3100A

    CONFIG TCPIP = int , MAC = mac , IP = ip, SUBMASK = mask, GATEWAY = gateway, LOCALPORT= port, TX= tx, RX= rx , NOINIT= 0|1 [, TWI=address] [, Clock = speed] [, baseaddress = address] [,TimeOut=tmOut] [,CHIP=W3100A] 
    
  • Syntax W5100

    CONFIG TCPIP = int , MAC = mac , IP = ip, SUBMASK = mask, GATEWAY = gateway, LOCALPORT= port, TX= tx, RX= rx , NOINIT= 0|1 [, baseaddress = address] [,TimeOut=tmOut] [,CHIP=5100] [,SPI=spi] [,INT=imsg] [,CS=cs] [,NOUDP=noudp] 
    
  • Syntax W5200

    CONFIG TCPIP = int , MAC = mac , IP = ip, SUBMASK = mask, GATEWAY = gateway, LOCALPORT= port, NOINIT= 0|1 [,TimeOut=tmOut] [,CHIP=W5200] [,SPI=spi] [,INT=imsg] [,CS=cs] [,NOUDP=noudp] [TXn= tx] [, RXn= rx] 
    
  • Syntax W5300

    CONFIG TCPIP = int , MAC = mac , IP = ip, SUBMASK = mask, GATEWAY = gateway, LOCALPORT= port, NOINIT= 0|1 [, baseaddress = address] [,TimeOut=tmOut] [,CHIP=W5300] [,INT=imsg] [,NOUDP=noudp] [align=align] [TXn= tx] [, RXn= rx] [SOCKMEM=sockmem] 
    
  • Syntax W5500

    CONFIG TCPIP = NOINT , MAC = mac , IP = ip, SUBMASK = mask, GATEWAY = gateway, LOCALPORT= port, NOINIT= 0|1 [,TimeOut=tmOut] [,CHIP=W5500] [,SPI=spi] [,INT=imsg] [,CS=cs] [,NOUDP=noudp] [TXn= tx] [, RXn= rx] 
    

Learn More

Goto Original

블로그 이미지

밤소 MidnightCow

위즈네트 칩(W5300, W5200, W7100, W7500) 개발자

Cathodic Dis-bonding Tester - webbased

by Ben



Overview

This is a Cathodic Dis-bonding Tester. This device, during a month during test, tests the quality of paint. Two probes. Through the display and three keys the parameters can be filled in, voltage to put on the probes. But it is also web based and can be configured through the Intra/Internet.

WIZ810MJ for WEB monitoring through Intra/Internet

WIZ810MJ is used for WEB-based Monitoring functions.
The result of two probe measure wiht the “Cathodic dis-bonding Tester” shows on the WEB pages.

  • WIZ810MJ

  • Webbased IO-tester

Learn More

Goto Original


블로그 이미지

밤소 MidnightCow

위즈네트 칩(W5300, W5200, W7100, W7500) 개발자

NET7026 : ARM7TMDI with W5300 Module

by MCT



Features

  • 59mm x 60mm, multilayer PCB
  • ARM7TDMI (ADuC7026, analog devices)
  • 41.78 MHz clock using PLL set
  • 62KB Flash 8KB RAM (ISP)
  • 1 MByte Serial Flash
  • 1MByte less RAM
  • UART, SPI, I2C
  • W5300 plus RJ45 Ethernet controller
  • 10 x 12 bit A/D converter (1Megasample)
  • 4 x 12 bit D/A converter (10us)
  • Comparator, voltage reference, temperature sensor, PLA
  • Max 13 free parallel I/o lines
  • 2 x timer 16 bit, 6 x PWM
  • Wake-up timer 16 bit
  • RTC DS1629
  • Watchdog
  • 10pol. connector for RS232 level converter IF232LP
  • Supply voltage 3, 3V
  • Power consumption typical 270mA
  • Weight only 23 g
  • Temperature range -40 ° C to + 85 ° C
  • Markings UL, CE, RoHS

Technial Data

Layout1
Layout2
Schematic

Learn More

Goto Original


블로그 이미지

밤소 MidnightCow

위즈네트 칩(W5300, W5200, W7100, W7500) 개발자

W5300 evaluation board - HS-EVB-W5300/C8051F340 & HS-EVB-W5300/Mega64

by AXC


Evaluation Board “Board +HS-NM5300 module +CPU sub Board” structure, all Board and HS-NM5300 module for evaluation boards are the same, different CPU daughter Board, composed of different assessment boards.


1. HS-EVB-W5300/C8051F340

Main features:

  • CPU C8051F340 microcontroller, the user can very easily on porting software to any C8051Fxxx SCM; * Monolithic integrated circuit with direct bus and W5300 interfaces;
  • The C2 interface for single-chip software debugging;
  • CPU and W5100 3.3V voltage supply;
  • Provide a standard serial interface RS-232C.

2. HS-EVB-W5300/Mega64

Main features:

  • CPU with ATMega64 single-chip, users can easily transplant software on any AVR Microcontroller;
  • Monolithic integrated circuit with direct bus and W5300 interfaces;
  • JTAG interface provided for Mega64 software debugging, provided ISP interface is used for program downloads;
  • CPU and W5300 3.3V voltage supply;
  • Provide a standard serial interface RS-232C.

Learn more

Goto Original


블로그 이미지

밤소 MidnightCow

위즈네트 칩(W5300, W5200, W7100, W7500) 개발자

Mini Module WIZnet W5300 - MMwiznet5300

by Propox



Overview

It was created with the idea of facilitating the communication of microprocessor systems through the Internet/Ethernet networks.
The heart of the module is the RISC Atmega128 microcontroller with 128kB of program memory and 64kB of (external) RAM memory, co-operating with the Ethernet controller, WizNET W5300.
The minimodule has an 512kB DataFlash serial memory for storage of WWW pages and of any files e.g. with measurement data. The memory is connected to a fast SPI bus with 8 Mb/s transmission speed.

Features

  • Fast RISC microcontroller ATmega128 with up to 16 MIPS throughput
  • Ethernet controller10/100Mb/s W5300 with hardware TCP/IP stack
  • 128kB of in circuit programmable FLASH program memory
  • 64KB of RAM memory
  • 4kB of EEPROM memory
  • Serial DataFlash memory 4Mbits (512kBytes)
  • Reliable reset circuit
  • Crystal resonator 14.7456 or 16 MHz
  • 4 LED diodes indicating: power, LAN activity, DataFlash activity
  • Fully SMD made on 4-layer PCB
  • 1 x 20 terminals with 0.1” (2.54mm) pitch fitting every prototype board
  • Available free operating system with TCP/IP stack supporting many protocols
  • Available evaluation board and sample applications
  • Small dimensions: 56mm x 30.5mm

Applications

The MMwiznet5300 minimodule can be used as a design base for electronic circuits co-operating from the
Ethernet/Internet network, covering the following areas of interest:

  • Industrial remote controlling and monitoring systems
  • Telemetry
  • Intelligent buildings
  • Alarm systems
  • Weather stations and environment monitoring
  • Medical electronicsHeating and air-conditioning systems
  • Telecommunication
  • Road traffic monitoring
  • Remote data logging
  • Home automation

The MMwiznet5300 minimodule can be also used in didactic workshops of information and electronic schools, illustrating the aspects of co-operation of electronic circuits from the Ethernet/Internet network, as well as be used to construct thesis circuits.

Learn More

Manual
Goto Original
The related

블로그 이미지

밤소 MidnightCow

위즈네트 칩(W5300, W5200, W7100, W7500) 개발자

New Ethernet Master Extension V1.1

by TinkerForge



TinkerFoger made the new Two Ethernet Master Extension Modules with WIZnet W5200 Ethernet control chip. One is with POE. Two is without POE.

Description

With this Ethernet Extension you can control Bricks and Bricklets and integrate them into a LAN. 10BaseT/100BaseTX Ethernet is supported and the module is 1000BaseTX compatible. The Extension is available in two variants: The PoE variant features a integrated PoE power supply. It allows to power the connected modules over industry standard IEEE 802.3af, such that a PoE injector as well as PoE switches can be used to power stacks. Additionally a variant without PoE is available.

Features

  • Communicate directly with Bricks/Bricklets without Brickd
  • Supports 10/100 Mbit/s Ethernet (1000 Mbit/s compatible)
  • Integrated PoE Power Supply (PD Class 0 for IEEE 802.3af)
  • Can power a Stack via Ethernet Cable

Ethernet Configuration

The Ethernet Extension can be configured in two different modes: DHCP or static IP. If you use a static IP you have to enter IP, Subnet Mask and Gateway.

The MAC address of the Ethernet Extension is not fixed in hardware, it will be allocated by Tinkerforge. If it is lost in the EEPROM it can be found on the sticker of the Ethernet Extension.

After configuring the Ethernet Extension you have to press the button “Save Ethernet Configuration” and restart the Master Brick


Learn more

Goto Original
Goto Old Version V1.0


블로그 이미지

밤소 MidnightCow

위즈네트 칩(W5300, W5200, W7100, W7500) 개발자

Zone Beacon

위즈네트/ETC 2015.11.11 09:43

Zone Beacon

By Zone Beacon


Zone Beacon은 Centralite사의 시리얼 기반 홈제어 제품에 WIZnet의 Serial-2-Ethernet 제품인 WIZ110SR를 연결하여 원격에서도 가전기기를 제어할 수 있도록 구성된 제품이다.


Setup

  • Part 1: Getting your devices connected.
  • Part 2: Getting the Gateway ready communicate with Zone Beacon.
  • Part 3: Setting up your first Zone from start to finish in Zone Beacon.

Demo

데모는 http://zonebeacon.com/demo.php 확인할 수 있다.

Learn More

Goto original site
Download App

 

블로그 이미지

밤소 MidnightCow

위즈네트 칩(W5300, W5200, W7100, W7500) 개발자

mbed WIZwiki-W7500 platform with Smart IoT Cloud Server Thinger.io


This project is based on mbed WIZwiki-W7500 platform launced by WIZnet. WIZwiki-W7500 can connect to the smart IoT cloud server called thinger.io.

Overview

This project started from my finding an easy & optimized smart IoT cloud services for easy to work with WIZwiki-W7500 platform. I found a cloud server called as thinger.io. But, thinger.io cloud server supports just only the device APIs based on Arduino IDE. But I need a device APIs based on mbed. Fortunately, thinger.io supports the Ardunio Ethernet device APIs, and I can port these APIs to mbed ethernet device API for WIZwiki-W7500.

In porting, The developer of thinger.io give me so much help & support.

Thru this post, I thank him server soooo much.

I tested my thinger.io device API for mbed with YuRobot Easy module shiled v1 have many sensors and LEDs.

WIZwiki-W7500

This IoT platform made by WIZnet and lauched on mbed as silicon parter.

There are many example on mbed. For more detail, Refer to Wiki site or mbed.

This is compatible with Arduino PIN map.

Thinger.io

Thinger.io is a platform that allows connecting things to the Internet.

And what’s new?

  • Hardware agnostic: Connect anything! from basic Arduinos with very limited resources, to more complex embedded systems running linux like Raspberry Pi.

  • It is Open Source, so you can take the code an build your own cloud if you want. It provides thing API discovery right out of the box, so you can code your things and interact easily from the web. Turning a led on from the Internet just take one line of code in the device, seriously!. It has been designed with developers in mind, so any developer will love to work with this platform.

For more detail, Refer to thinger.io.

<NOTICE> This site povids beta sevice. If you want to test your device on thinger.io, You should get a beta access keys.

YuRobot Easy shiled V1

YoRobot Shield provide many sensor such as light, temperature, humidity, IR and etc.


What I do

Compatible Client Class for Arduino

This class - TCPSocketConnectionArdu - need to minimize modification to Arduino Ethernet Device API of thinger.io.

class TCPSocketConnectionArdu : public TCPSocketConnection {

    public:

    /** TCP socket connection **/
    TCPSocketConnectionArdu() {};
    virtual ~TCPSocketConnectionArdu() { TCPSocketConnection::close(); };

    ssize_t write(uint8_t);

    /** Send data to the remote host.
    \param data The buffer to send to the host.
    \param length The length of the buffer to send.
    \return the number of written bytes on success (>=0) or -1 on failure
     */
    virtual ssize_t write(const void *buf, size_t size);
    virtual int available();
    ssize_t read();    
    virtual ssize_t read(void *buf, size_t size);    
    virtual ssize_t readBytes(uint8_t* buf, size_t size);
    virtual ssize_t peek();
    virtual void flush();
    virtual void stop();

    /** Check if the socket is connected
    \return true if connected, false otherwise.
    */
    virtual uint8_t connected();
    virtual operator bool(); 

    friend class TCPSocketServer;
};

Ethernet & TCP Client API for mbed : ThingerMBedEthernet, ThingerMBedClient

This is ported from ThingerEthernet & ThingerClient.h in Arduino Ethernet Library of thinger.io

  • ThingerClient
#ifndef _DHCP_   // You should be define your network if no DHCP
    #define DEV_IP_ADDRESS "xxx.xxx.xxx.xxx"
    #define DEV_GW_ADDRESS "xxx.xxx.xxx.xxx"
    #define DEV_SN_ADDRESS "255.255.255.0"
#endif    

class ThingerEthernet : public ThingerClient {
public:

    ThingerEthernet(const char* user, const char* device, const char* device_credential) :
            ThingerClient(client_, user, device, device_credential), connected_(false)
    {}
    ~ThingerEthernet(){
    }

protected:
    virtual bool network_connected(){
        return connected_;
    }

    virtual bool connect_network(){
        if(connected_) return true;
        uint8_t mac[6] = { 0x1D, 0xdc, 0x08, 0x00, 0x62, 0x11 };
        unsigned long ethernet_timeout = millis();

#ifdef _DHCP_        
    #ifdef _DEBUG_
        printf("[NETWORK] Getting DHCP IP Address...\r\n");
    #endif
        ((EthernetInterface*)WIZnet_Chip::getInstance()).init(mac);
#else
        ((EthernetInterface*)WIZnet_Chip::getInstance())->init(mac,DEV_IP_ADDRESS,DEV_SN_ADDRESS,DEV_GW_ADDRESS);
#endif
        ((EthernetInterface*)WIZnet_Chip::getInstance())->ethernet_link();
        delay(3000);
    #ifdef _DEBUG_
        #ifdef _DHCP_
            printf("[NETWORK] Waiting for IP...\r\n");
        #endif
    #endif
        connected_ = true;    
        if(((EthernetInterface*)WIZnet_Chip::getInstance())->connect() > 0) connected_ = false;
#ifdef _DEBUG_
        printf("[NETWORK] Got Ip Address: %s\r\n",((EthernetInterface*)WIZnet_Chip::getInstance())->getIPAddress());
#endif
        delay(1000);
        return connected_;
    }

private:
    bool connected_;
    TCPSocketConnectionArdu  client_;
};
  • ThingerClient
//---For MBED---//

#ifndef Client
    #define Client              TCPSocketConnectionArdu
#endif

#ifndef millis
    #define millis()        us_ticker_read()/1000
#endif

#ifndef delay    
    #define delay               wait_ms
#endif    

class ThingerClient : public thinger::thinger {
public:

    ThingerClient(Client& client, const char* user, const char* device, const char* device_credential) : client_(client), username_(user), device_id_(device), device_password_(device_credential),
            temp_data_(NULL), out_size_(0)
    {
    }
    ~ThingerClient()
    {
    }

protected:
    virtual bool read(char* buffer, size_t size)
    {
        size_t total_read = 0;
        while(total_read<size){
            int read = client_.readBytes((uint8_t*)buffer, size-total_read);
            if(read<0) return false;
            total_read += read;
        }
        return total_read == size;
    }

    // TODO Allow removing this Nagle's algorithm implementation if the underlying device already implements it
    virtual bool write(const char* buffer, size_t size, bool flush=false){
        if(size>0){
            temp_data_ = (uint8_t*) realloc(temp_data_, out_size_ + size);
            memcpy(&temp_data_[out_size_], buffer, size);
            out_size_ += size;
        }

        if(flush && out_size_>0){
            #ifdef _DEBUG_
                printf("[THINGER] Writing bytes: %d", out_size_);
            #endif
            size_t written = client_.write(temp_data_, out_size_);
            bool success = written == out_size_;
            free(temp_data_);
            temp_data_ = NULL;
            out_size_ = 0;

            #ifdef _DEBUG_
                printf(" [%s]\r\n",success ? "OK" : "FAIL");
            #endif

            //FIXME Without this small delay or activating the debug (which takes time), the CC3200 does not work well. Why?
            #ifdef __CC3200R1M1RGC__
                delay(1);
            #endif
            return success;
        }
        return true;
    }

    virtual void disconnected(){
        thinger_state_listener(SOCKET_TIMEOUT);
        client_.stop();
        thinger_state_listener(SOCKET_DISCONNECTED);
    }
    virtual bool connect_network(){
        return true;
    }
    virtual bool network_connected(){
        return true;
    }

    enum THINGER_STATE{
        NETWORK_CONNECTING,
        NETWORK_CONNECTED,
        NETWORK_CONNECT_ERROR,
        SOCKET_CONNECTING,
        SOCKET_CONNECTED,
        SOCKET_CONNECTION_ERROR,
        SOCKET_DISCONNECTED,
        SOCKET_TIMEOUT,
        THINGER_AUTHENTICATING,
        THINGER_AUTHENTICATED,
        THINGER_AUTH_FAILED
    };

    virtual void thinger_state_listener(THINGER_STATE state){
        #ifdef _DEBUG_
        switch(state){
            case NETWORK_CONNECTING:
                printf("[NETWORK] Starting connection...\r\n");
                break;
            case NETWORK_CONNECTED:
                printf("[NETWORK] Connected!\r\n");
                break;
            case NETWORK_CONNECT_ERROR:
                printf("[NETWORK] Cannot connect!\r\n");
                break;
            case SOCKET_CONNECTING:
                printf("[_SOCKET] Connecting to %s : %d ...", THINGER_SERVER,THINGER_PORT);   
                break;
            case SOCKET_CONNECTED:
                printf("[_SOCKET] Connected!\r\n");
                break;
            case SOCKET_CONNECTION_ERROR:
                printf("[_SOCKET] Error while connecting!\r\n");
                break;
            case SOCKET_DISCONNECTED:
                printf("[_SOCKET] Is now closed!\r\n");
                break;
            case SOCKET_TIMEOUT:
                printf("[_SOCKET] Timeout!\r\n");
                break;
            case THINGER_AUTHENTICATING:
                printf("[THINGER] Authenticating. User: %s Device: %s\r\n",username_,device_id_);
                break;
            case THINGER_AUTHENTICATED:
                printf("[THINGER] Authenticated!\r\n");
                break;
            case THINGER_AUTH_FAILED:
                printf("[THINGER] Auth Failed! Check username, device id, or device credentials.\r\n");
                break;
        }
        #endif
    }
    bool handle_connection()
    {
        bool network = network_connected();
        if(!network){
            thinger_state_listener(NETWORK_CONNECTING);
            network = connect_network();
            if(!network){
                thinger_state_listener(NETWORK_CONNECT_ERROR);
                return false;
            }
            thinger_state_listener(NETWORK_CONNECTED);
        }
        bool client = client_.connected();
        if(!client){
            client = connect_client();
            if(!client){
                return false;
            }
        }
        return network && client;
    }
    bool connect_client(){
        bool connected = false;
        client_.stop(); // cleanup previous socket
        thinger_state_listener(SOCKET_CONNECTING);
        if (client_.connect(THINGER_SERVER, THINGER_PORT) == 0) {
            delay(3000);
            thinger_state_listener(SOCKET_CONNECTED);
            thinger_state_listener(THINGER_AUTHENTICATING);
            connected = thinger::thinger::connect(username_, device_id_, device_password_);
            if(!connected){
                thinger_state_listener(THINGER_AUTH_FAILED);
                client_.stop();
                thinger_state_listener(SOCKET_DISCONNECTED);
            }
            else{
                thinger_state_listener(THINGER_AUTHENTICATED);
            }
        }
        else{
            thinger_state_listener(SOCKET_CONNECTION_ERROR);
        }
        return connected;
    }

public:
    void handle(){
        if(handle_connection()){
            #ifdef _DEBUG_
            if(client_.available()>0){
                printf("[THINGER] Available bytes: %d", client_.available());
            }
            #endif
            thinger::thinger::handle(millis(), client_.available()>0);
        }else{
            delay(RECONNECTION_TIMEOUT); // get some delay for a connection retry
        }
    }
private:
    Client& client_;
    const char* username_;
    const char* device_id_;
    const char* device_password_;
    uint8_t * temp_data_;
    size_t out_size_;
};

Registration WIZwiki-W7500 to thinger.io

<NOTICE> You should remmber your DEvice credentials becase the credentials can't be shown after add device.
  • You’re ready to work WIZwiki-W7500 with thinger.io Cloud Service.

Add to your main

#include "mbed.h"
#include "EthernetInterface.h"
#include "DHT.h"
#include "TCPSocketConnectionArdu.h"
#include "ThingerMBedEthernet.h"
#include "ThingerMBedClient.h"

/* ThingerIO Define */
#define USERNAME "MidnightCow"
#define DEVICE_ID "WIZwiki_W7500_mbed_01"
#define DEVICE_CREDENTIAL "your access key" // Should be your access key.

/* YUROBOT SHILED1 PIN Define*/
#define myLED1      D13
#define myLED2      D12

#define myRLED      D9
#define myGLED      D10
#define myBLED      D11

#define myBUZZ      D5

#define myTEMPHUMM  D4

#define myLIGHT     A1

//using namespace std;
DigitalOut myled1(myLED1);
DigitalOut myled2(myLED2);

DigitalOut myrled(myRLED);
DigitalOut mygled(myGLED);
DigitalOut mybled(myBLED);

DigitalOut myBuzz(myBUZZ);

AnalogIn   mylight(myLIGHT);

DHT myTempHumm(myTEMPHUMM, DHT11);

void my_led1(pson& in)
{
    myled1 = (in) ? 1 : 0;
}
void my_led2(pson& in)
{
    myled2 = (in) ? 1 : 0;
}

void my_TempHumm(pson& out)
{
    if(myTempHumm.readData() == 0)
    {
        out["Cecelcius"] = myTempHumm.ReadTemperature(CELCIUS);
        out["Humidity"]  = myTempHumm.ReadHumidity();        
    }
    else
    {
        out["Cecelcius"] = 65535;
        out["Humidity"]  = 65535;
    }
}

/*
void my_rgbled(pson& in)
{
    myrled = (in["Red"])   ?  1 : 0;
    mygled = (in["Green"]) ?  1 : 0;
    mybled = (in["Blue"])  ?  1 : 0;    
}
*/

int main() {
    EthernetInterface eth;
    ThingerEthernet thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);
    myled1 = 1;
    myled2 = 1;

    // resource input example (i.e. turning on/off a light, a relay, configuring a parameter, etc)
    thing["myled1"] << my_led1;
    thing["myled2"] << my_led2;
    thing["mySensor"] >> my_TempHumm;
    //thing["myRGB"] << my_rgbled;

    while(1)
    {
        thing.handle();
    }
}

Demo Movie

WIZwiki-W7500 with ThingerIO from MidnightCow on Vimeo.

Conclusion

Thinger.io cloud sevice is very powerful for small IoT Device, becase This service support a small encoded packet called as Protoson.

So, WIZwiki-W7500 platform is suitable for thinger.io.

Thank you and enjoy them.


You can import my thinger.io mbed example here.

https://developer.mbed.org/users/MidnightCow/code/ThingerIO/

블로그 이미지

밤소 MidnightCow

위즈네트 칩(W5300, W5200, W7100, W7500) 개발자