ZigBee and POE Ethernet

Institute of Embedded Systems InES A simple and low cost approach to bridge IEEE 802.15.4 /ZigBee and POE Ethernet Marcel Meli, Martin Gysel Zurich ...
1 downloads 0 Views 5MB Size
Institute of Embedded Systems InES

A simple and low cost approach to bridge IEEE 802.15.4 /ZigBee and POE Ethernet

Marcel Meli, Martin Gysel Zurich University of Applied Science

Zürcher Fachhochschule

1

Outline • Introduction • Problem and proposal • Comparison of different approaches • Hardware of the bridge • Software of the bridge • Applications • Future work

Zürcher Fachhochschule

2

Who we are • University of applied sciences at Winterthur (Kanton Zuerich) - Largest of that type in Switzerland - Interdisciplinary • Institute of embedded Systems (teaching + research) - Active in Industrial communications (wired and wireless) - Real time communication using Ethernet - More than 7 Lecturers and 20 engineers - Projects with industry

Zürcher Fachhochschule

3

Who we are Wireless System Group of InES •

Microcontrollers (Atmel, CoolRisc, Microchip, Propeller, PSoC/PRoC, ...)



Wireless PAN systems (BT, 802.15.4, ZigBee)



WirelessUSB, ANTS, Nanotron…



RFID (125 KHz…UHF), RFID radar, pairing



Activities in Low Power, use of Energy Harvesting, positioning

32x16 mm, 32-bit micro+radio 802.15.4 / ZigBee compatible

Portable RFID reader with Wireless link Single chip (PRoC) Zürcher Fachhochschule

4

Who we are Wireless Battery-less switch •

Very Low Power microcontroller + Radio, Use of electro-dynamic EH module



Compatible with 802.15.4 / ZigBee

No Batteries, No maintenance Zürcher Fachhochschule

5

Who we are Multichannel sniffer •

Sniff all ZigBee / 802.15.4 channels (adaptable to all bands 2.4 GHz, 868 MHz, ...)



Linked to PC using Ethernet or USB



Modular. Adapt to your needs. Better than 1 microsecond resolution

Zürcher Fachhochschule

Can sniff all 802.15.4 / ZigBee channels

6

Introduction The wireBee •

Is a multifunction flexible gateway



Can be used to: link Ethernet and 802.15.4



link several 802.15.4 networks



Several power sources are possible:

• ●

local power source (DC adapter)



PoE (Install and Forget)



Batteries (?)



It remains compact



The concept can be adapted for other processors/wireless systems

Zürcher Fachhochschule

Install And Forget

7

Introduction • What goes up must come down - What goes wireless must go into wires at some points. • There is a proliferation of wireless systems - This is justified since wires are not welcome everywhere - However, collected must often be processed - Data collected will normally find its way to a normal wirebound network where it can be used for decision making. - Given the present infrastructure, Ethernet is a natural choice - A gateway between Ethernet and wireless systems is unavoidable Zürcher Fachhochschule

8

The problem stated • How is 802.15.4 data brought into Ethernet networks today? • Most solutions are based on coupling existing Ethernet modules with a ZigBee board - Problems of costs - Problem of place - Problem of interfacing interface between the modules o ZigBee can be quite demanding in terms of resources (often 8-Bit microcontrollers). Strain on resources to communicate with Ethernet module

Zürcher Fachhochschule

9

Proposal • Unify the wireless and wired platforms by using a device with enough resources and an Ethernet coprocessor - Optimization of communication interfaces - Use a CPU with enough CPU power - A popular but sufficient Ethernet interface device - Take advantage of the large Open Source software base for microcontrollers - Use PoE when possible • Benefits - Low cost, space saving, - Flexibility in mixing protocols

Zürcher Fachhochschule

10

Details - Martin Gysel will now put more flesh on the bones of what I have just said. - He will show different solutions and details of the design made in InES the last 2 years, by students and engineers.

Zürcher Fachhochschule

11

Comparison of different Approaches

Ethernet

Zürcher Fachhochschule

?

IEEE 802.15.4 ZigBee

12

Comparison of different Approaches

Phy

Mac

TCP/IP Stack

ARM (7/9/M3) Microchip ... +++ Ethernet part easy replaceable Radio easy replaceable Power/Recourses

Zürcher Fachhochschule

Serial

ZigBee Stack ATmega MSP430 PIC ...

SPI

Radio

AT86RF230 CC2520 ...

--Expensive Two codebases/arch Inflexible (sw) mostly oversized

13

Comparison of different Approaches

Phy

Mac

TCP/IP Stack

Serial

Zürcher Fachhochschule

Radio

JN5139 CC2430 ...

ARM (7/9/M3) Microchip ... +++ Ethernet part easy replaceable Power/Recourses

ZigBee Stack

--Expensive Two codebases/arch Inflexible (sw)

14

Comparison of different Approaches

Phy

Mac

TCP/IP Stack

ZigBee Stack

SPI

AT86RF230 CC2520 ...

ARM (7/9/M3) Microchip ... +++ Radio easy replaceable Flexible (sw) Low cost

Zürcher Fachhochschule

Radio

--Availability of ZigBee stack

15

Comparison of different Approaches

Phy

Mac

Microchip ...

+++ Flexible (sw) Low cost vs. cpu power ZigBee stack

Zürcher Fachhochschule

SPI

TCP/IP Stack

ZigBee Stack

Radio

JN5139 ...

--Limited program memory

16

Comparison of different Approaches JN5139 MC1322x CC2430

Bit 32 32 8

AT86RF230 MRF24J40 MC13202 CC2520

Distributor Vol Price Var 1 Digikey 1000 4.90 Freescale 1000 4.99 Mouser 1000 4.50 Mouser Digikey Digikey Mouser

500 1600 2500 1000

4.35 2.73 2.68 3.44

x x x x

ATMega1281 (Meshnetics) PIC18F4620 (PICDEMZ) MSP430FG4618 (TI Eval Kit) MC9S08GT (60KB Flash)

8 8 16

Mouser Digikey Digikey Mouser

500 9.47 1200 4.90 1000 12.80 1000 4.50

x x x x

LM3S6911 (Ethernet, 256KB Flash) PIC18F67J60 (Ethernet, 128KB Flash)

32 8

Mouser Digikey

500 1200

7.87 4.42

x x

Mouser

100

2.81

ENC28J60

11.60 Zürcher Fachhochschule

Var 2 Var 3 Var 4 x x x x x x x x x x

x x

8.92

x x

7.10

x 7.31 7.71 17

ZigBee - Ethernet Bridge • Jennic JN5139 module, 32bit RISC CPU, 16MHz (32MHz in clock doubling mode) • Microchip ENC28J60, SPI to Ethernet (MAC/PHY) • Modified uIP TCP/IP stack, DHCP client, etc. • Silabs SI3400, Power Over Ethernet Phy

Mac

Microchip ...

SPI

TCP/IP ZigBee Radio Stack Stack JN5139 ...

At time as development started, this approach provided most performance/flexibility at lowest prices! Zürcher Fachhochschule

18

ZigBee - Ethernet Bridge

Silabs Si3400

MagJack

Microchip ENC28J60 SPI

INT

Switch/LED Jennic JN5139

FRAM/Flash

SPI/I2C/GPIO ADC/DAC

Power over Ethernet, galvanic isolated Zürcher Fachhochschule

19

ZigBee - Ethernet Bridge

PoE Controller

JN5139 ZigBee (High-Power) Module

Ethernet MAC/PHY

Zürcher Fachhochschule

20

Hardware Jennic JN5139 • Complete system-on-chip – 2.4GHz radio transceiver – 32-bit RISC CPU (16/32MHz) – Rich application peripherals • Secure networking with 128-bit AES encryption • Low power technology, Highly integrated solution • Support for IEEE802.15.4 and ZigBee • GNU toolchain (no additional cost!) Zürcher Fachhochschule

21

Hardware Microchip ENC28J60 • IEEE 802.3 Compatible Ethernet Controller • Integrated MAC and 10Base-T PHY • Automatic Polarity Detection and Correction • Supports Full and Half-Duplex modes • Programmable Automatic Retransmit on Collision • Programmable Padding and CRC Generation • Programmable Automatic Rejection of ErroneousPackets • SPI Interface with Clock Speeds Up to 20 MHz Zürcher Fachhochschule

22

Hardware Microchip ENC28J60 • 8-Kbyte Transmit/Receive Packet Dual Port SRAM • Supports Unicast, Multicast and Broadcast Packets • Programmable Receive Packet Filtering and Wake-up Host on Logical AND or OR of the Following: – Unicast, Multicast, Broadcast address – Magic Packet – Group destination addresses as defined by 64-bit Hash Table – Programmable Pattern Matching of up to 64 bytes at userdefined offset Zürcher Fachhochschule

23

Hardware Silabs SI3400 • IEEE 802.3 standard-compliant solution, including pre-standard • (legacy) PoE support • Highly-integrated IC enables compact solution footprints – Minimal external components – Integrated diode bridges and transient surge suppressor – Integrated switching regulator controller with on-chip power FET – Integrated dual current-limited hotswap switch Zürcher Fachhochschule

24

Hardware Silabs SI3400 • Support non-isolated and isolated switching topologies • Comprehensive protection circuitry – Transient overvoltage protection – Undervoltage lockout – Early power-loss indicator – Thermal shutdown protection – Foldback current limiting • Programmable classification circuit Zürcher Fachhochschule

25

Hardware Bill of Material • IEEE 802.15.4 / Ethernet part – ~40 components -> ~35$ @ 1 (radio module is about 20$ but avoids regulation tests) • Power over Ethernet part – ~30 components -> ~20$ @ 1 (isolated design, non-isolated cheaper)

Zürcher Fachhochschule

26

Software uIP TCP/IP Stack • Very small code size • Very low RAM usage, configurable at compile time • ARP, SLIP, IP, UDP, ICMP (ping) and TCP protocols • Any number of concurrently active TCP connections, maximum amount configurable at compile time

Zürcher Fachhochschule

27

Software uIP TCP/IP Stack • Any number of passively listening (server) TCP connections, maximum amount configurable at compile time. • Free for both commercial and non-commercial use. • RFC compliant TCP and IP protocol implementations, including flow control, fragment reassembly and retransmission time-out estimation.

Zürcher Fachhochschule

28

Software Jennic ZigBee Stack Size • EndDevice

~55kBytes

• Router

~75kBytes

• Coordinator

~77kBytes

uIP TCP/IP Stack Size • 'minimal' (TCP, ARP, pSocket)

~18kBytes

• 'common' (TCP, UDP, ARP, DHCP, pSocket, Telnet) ~50kBytes

Zürcher Fachhochschule

29

Software Full ZigBee Coordinator or Router will not fit together with TCP/IP Stack in 96kByte RAM (designed for 802.15.4 only at the beginning)

Code size will get smaller in further releases • 32bit -> 16bit instructions (improved core) • ZigBee stack implemented in ROM

Zürcher Fachhochschule

30

Software Do we need ZigBee? It depends on the application... • As soon as we need proper interoperability, yes we do! • If we want to build large mesh networks, it is definitely an advantage! (could also be done with other mesh protocol) • For point to point, point to multipoint and other small networks, there's no need! Especially if we need a deterministic timing it's better to use a proprietary solution

Zürcher Fachhochschule

31

Software IEEE 802.15.4 / TCP/IP only implementation Delay for relaying 802.15.4 packets • Processing time on microcontroller and Ethernet chip (incoming packet interrupt to outgoing Ethernet frame on dedicated chip) 802.15.4 MAC Frame 8 bytes 26 bytes 106 bytes

Zürcher Fachhochschule

Ethernet Frame 63 bytes 81 bytes 161 bytes

Delay 4.8 ms 5.5 ms 6.9 ms

32

Weakness • Memory limitation • 10Base-T Ethernet (well do we really need something faster...) • External Ethernet co-processor Solutions: • Wait till new hw release • Implement all sw in an Ethernet capable uC

Zürcher Fachhochschule

33

Bridging What kind of devices do we want to bridge and for which purpose? • Remote monitoring and configuration • Sniffer • Add a simple (wireless) Enddevice • Combine various types of networks • Extend the network • Ensure transmission on critical paths (especially for wireless networks)

Zürcher Fachhochschule

34

Bridging On which software of protocol level do we want to do this? • Every Network has its own protocol (Bridging on application level) • Use one protocol as a lower layer of the other (advantage of a layered stack) – e.g. Ethernet over IEEE 802.15.4, ZigBee over Ethernet, 6LoWPAN (IPv6 low power PAN)

Zürcher Fachhochschule

35

ZigBee over Ethernet ZigBee stack use either the IEEE802.15.4 MAC/PHY or Ethernet

IEEE 802.15.4

Zürcher Fachhochschule

36

ZigBee over Ethernet What are the benefits of such systems: • Every node of the ZigBee network is accessible over the ZigBee protocol • The application developer does not need to care about gateway logic nor about other protocols • Easy to debug because every message sent though a MCPSSAP can be transmitted as it is • Still possible to use the other medium from application (e.g. for a webserver or config interface) • Routing is mainly done by ZigBee NWK layer Zürcher Fachhochschule

37

ZigBee over Ethernet Very simple network topology, alternative link just between two defined nodes (point-to-point) • All packets just gets forwarded

Zürcher Fachhochschule

38

ZigBee over Ethernet Alternative link in mesh network (point-to-point) • Decision how to send a packet must be made

Zürcher Fachhochschule

39

ZigBee over Ethernet More than two routers communicate over a Alternative link, which is part of a switched network • Other gateways must be discovered or they locations must be known

Zürcher Fachhochschule

40

Future Work • Create codebase which allows us to implement the bridge on various platforms • ZigBee over Ethernet with self-configured nodes • Wireless time-synchronization? Timestamp IEEE1588 Phy

Mac

TCP/IP ZigBee Stack Stack

SPI

Radio

Timestamp Radio

Zürcher Fachhochschule

41

Future Work • To overcome current limitations and to reduced the number of external components, use a ethernet capable micro (e.g. Cortex-M3 from Luminary) and a IEEE 802.15.4 radio. • This will give us 50MHz, 1.25DMIPS and 256kByte of program memory • Still low cost!

Zürcher Fachhochschule

42

Contact • Dr. Marcel Meli, dipl. El.-Ing. (Head of Wireless Group) [email protected] • Martin Gysel, dipl. El.-Ing. FH [email protected] Zurich University of Applied Sciences (ZHAW) Institute of Embedded Systems (InES) Technikumstr. 22 CH-8401 Winterthur Phone: +41 58 934 75 25 Fax: +41 58 935 75 25 [email protected] Zürcher Fachhochschule

43