Home

Application Note AN503 Advanced Remote Management

image

Contents

1. 15 4 DEMOCDIC TION e 18 4 REPEATER LEVEL IN REMOTE MANAGEMENT eeeeeeeeeeeee rnnt eres 18 5 R01 qc M 20 EN 0L EO REE NCU cc 20 APPLICATION NOTE 503 Green Smart Wireless enocean 1 Introduction 1 1 Notation e RPC Remote Procedure Call RMCC Remote Management Control Command is RPC that provides the basic functionality for Remote Management 1 2 Purpose This application note will explain Different implementation of TCM300 Mode 2 functionality Implementation of a task based application Implementation of a learn table The usage of Remote management concept with advanced learn functionality How to provide configuration interface of the application using DolphinStudio The usage of both serial protocols ESP2 and ESP3 The purpose is to demonstrate the concept in an actual implementation using an as simple as possible setup It s not intended as ready to be used as production software providing a full implementation for such a type of application But the demo and description should be a tutorial and suitable for further enhancements and modifications and should be a good Starting point for own Remote Management development projects For a deeper under Standing of the Remote Management concept please see
2. ke aes Us vel ceni uc as I 1 emery CE LC CIRE Chonne sew sr eue This code sets the channels according to received telegram The entry structure contains all required information that was extracted from received telegram For more information refer to id convTel function in id mod c The variable bValue contains the LSB of u8Rocker byte APPLICATION NOTE 503 Green Smart Wireless enocean 3 2 Tasks The application uses a task based approach to reduce the complexity of the implementa tion Dividing application functionality into multiple well defined tasks provides more flexi bility as well as more control over the application behaviour Following diagram shows the 3 application layers cmp Application execute execute execute execute gatew ay c Modules mod button c mod channel c EO30001_ 3 2 1 Main main c The application entry point It initializes EO3000I peripherals API modules and also all ap plication tasks Application tasks are executed periodically in main loop The main applica tion loop is the only place where radio getTelegram function is called The result of ra dio getTelegram is stored to global application context gContext This is because multi ple tasks are interested in the last received telegram Dividing application to tasks provides gr
3. 1 Remote Management specification The resulting application demonstrates how to use custom RPCs and how to build a task oriented solution NOTE The software AN503RemanESP3 which is part of this application note is provided on an AS IS basis APPLICATION NOTE 503 Green Smart Wireless enocean 2 Demo system To reproduce our demo scenario following components are required Setup EVA300 3 with a module containing GatewayCtrl firmware EVA300 3 with RemanESP3 firmware B DolphinView 3 1 1 0 or newer application on PC DolphinAPI 2 2 1 0 or newer Step by step 1 Copy the DolphinView Modules APIExamples dll to DolphinView directory 2 Download the GatewayCTRL firmware to the module A using DolphinView 3 Copy the RemanESP3 to the Example directory of the installed DolphinAPI 4 Compile the firmware and download it to module B 5 Disconnect the EVA board of module B from the programmer and provide power to the EVA using the J1 USB port 6 Start DolphinView select serial port of EVA board and pres Connect P Connect F5 coM12 EOSI4JMBA GATEWAYCTRL 2 3 0 0 7 Press a PTM200 switch several times The telegrams should appear in DolphinView telegram view window The gateway works Telegram Log View F Radio l Serial Autoselect V Clear log Lo Directi d Port Time ID Y RORG T e COMi2 17 22 19 426 00071697 RPS 10 e COMi2 17 22 1
4. 1 action 0 AI 0 AI 1 AO 0 Released 1 AO 0 no 2 action 2 BI 1 Pressed 2 BI 1 2 action valid 3 BO 3 BO The Rocker 1 action value is the only information we store in u8Rocker attribute in id table For more information about the RPS telegram data byte interpretation refer to EnOn cean Equipment Profile documentation 2 Telegram is received by our application 3 The id table is searched for all entries that match rocker choice and ID The LSB of u8Rocker byte signalizes whether a O or I on the rocker was pressed Therefore when comparing u8Rocker information a OxFE mask is used APPLICATION NOTE 503 Green Smart Wireless enocean 4 For each entry found the corresponding channel pins are set The LSB of u8Rocker specifies the pin value 0 or 1 So if we press I on the left rocker the LED on CHO is switchen ON pin is set to 1 If we press I on the right rocker the LED on CH1 is switchen ON pin is set to 1 Code snippet for converting a RPS telegram to ID ENTRY TYPE id mod c JEMEN tune tom Eich onal ede SV hecho tel raw oy so Cee ADTOTCHOTOCEER entry gt u8Rocker tel trps u8Data gt gt 5 Ie trel tips ue Id u8Pressed u8Value eel Loeb 5 Dit Dee le Code snippet for controlling the channels switch c Set all channels from id_table Eor 0 1
5. an advantage to provide a configuration interface The user can then configure selected parameters of the final product without modifying the original firmware The configuration parameters are stored in the Configuration Area The configuration struc ture is defined in configuration h For demonstration purposes we have defined following parameters in the APP_CFG_AREA structure Structure of software configuration bytes in application section of CFG arean Located in CFG Area starting address 0x80 typedef struct Prococol Contiguration Located in CFG Area 0x80 OPEN EBSP3 0x02 ESP2Z other values ESP3 Mineo ermdlrosRooot Time ms after the output pin toggles during the learn mode Located in CFG Area 0x81 n Default 1000ms all other values time in milliseconds u uintlo uloLearnTtoggleCyclus Time ms within the PTM switch has to be pressed 3 times to learn in during remote learn Located in CFG Area 0x83 Default 2000ms all other values time in milliseconds prio ulelearn lime AREA In the file configuration c position of the APP crc structure in flash is defined 77 Defrinition Ok thel application Coni guration Ob Ene application PMID IG AUR T oe cues TERADE 2160 c In order to enable the user to modify this defined structure we can use the Modul configu ration functionality provided by DolphinStudio APPLICATION N
6. 9 879 00071697 00 e COMI2 17 22 20 145 00071697 10 eb COMI2 17 22 20 348 00071697 00 8 Press QueryID to query our Advanced RemoteManagement device NOTE The vice will be automatically locked after 30 minutes APPLICATION NOTE 503 Green Smart Wireless enocean 9 Our device should respond to the QueryID and it should be visible in the Node List Select the device using left mouse click ID 00004203 anil Device 209 Q 10 00816002 Device 6DC2 10 Now we can read the ID table from the device Select the module API Example RemanESP3 and press Read ID Table API Example RemanESP3 EEP View Telegram Analyzer Telegram Transmit ed Remote Learn Example ID code Target devices CID 01008676 APPLICATION NOTE 503 Green Smart Wireless enocean Read ID Table function sends the RM_FN_IDTABLE_READ message to the selected device We already selected the device in step 4 Now you can modify the ID Table and write it back to our device Note that the Count val ue is also important as it defines how many ID entries are valid There is much more functionality of remote management embedded in the application as for instance all the remote management control commands RMCC as unlock set code lock action ping query function etc The functionality is implemented but not described in this document The func
7. APPLICATION NOTE 503 Green Smart Wireless enocean June 1 2011 Page 1 20 APPLICATION NOTE 503 Green Smart Wireless enocean Table of content 1 INIRODUC TION c O 3 1 1 H 3 1 2 RO E u M 3 ZEB TIN Ph ied On RPM ee m 4 gt DEMO APPLICATION EXPLAINED 7 3 1 Du MODEL a e T fj 22 EU 10 3 2 1 EE 6s PERES AEE EEA Tm 10 3 22 CON LOS A RII 29 0 RTT Il 3 2 3 TOOT COTO PRONTO OE RT ROREM PR 11 3 2 4 UO CB AY SWC DR Il 3 29 DUO module DUNONG DE 12 3 2 6 IDI able Management module MOG 0 vissetesisiavarcoteayessiwvinennsixieaeisacavadadaenwestasuowasneintatawisesteaws 12 327 Chamel module mod 110110727208 0 EAR NEE E 12 3 2 8 Remote anaeement IAS Creer ci est EE ETT 12 33 REMOTE COMMAND IDTABLE 12 3 4 REMOTE COMMAND EN IDTABLE 14 35 CONFIGURATION
8. EP V2 1 6 Schematics EVA300 3 7 TCM300 User Manual 8 TCM300 Data Sheet Useful web sites 9 EnOcean website http www enocean com 10 EnOcean Alliance website http www enocean alliance org 11 Wikipedia website http www wikipedia org
9. OTE 503 Green Smart Wireless enocean For this purpose we have to define the remanesp3 xml versrson 1 0 encoding Ts0 6659 1 2 gt lt CONFIGUratvoOn gt lt module name RemanESP3 gt 1 sek deck ct AIN RO EE OE kon OK OK gt lt data name General configuration type group gt data address 0x80 name Serial protocol size 01 type int default 0xFF gt lt description gt Configure the protocol for the serial communication lt description gt lt enum gt lt item value 0xFF gt ESP3 lt item gt lt item value 0x02 gt ESP2 lt item gt lt enum gt lt data gt lt data address 0x81 name Learn mode toggle time size 02 type int default 1000 formatstring d gt lt description gt Time ms after the output pin toggles during the learn mode lt description gt lt data gt data address 0x83 name Remote learn in time size 02 type int detault 2000 tormatstring 2d gt lt description gt Time window ms within the PTM switch has to be pressed 3 times to learn in during remote learn lt description gt lt dacta gt lt module gt lt configuration gt This XML reflects exactly the app crc AREA structure Additionally it adds some comments and formatting for the user To use the defined XML we have to copy the file remanESP3 xml to the DolphinStu dio Configuration directory Then we
10. an System Specification allows to press Learn button by remote command That means the TCM300 only switches to learn mode and the user has to press PTM200 switch manually To demonstrate the possibilities of remote management we introduced the Advanced Re mote Learn concept Behind the scene a custom RPC was added to allow remote access to id_table In id_table the information about learned in rockers are stored Providing remote access to the id_table enables us to remove or learn in new rocker switches without physi cally pressing the PTM200 switch buttons We can also download or upload the whole id_table per remote This way we could even backup the whole building setup In case that a TCM300 like device fails it can be easily replaced and the corresponding id_table can be uploaded in no time 3 1 Data model Before we describe the functional block of our demo application we take a look at data structures used The most important data structure is the id_table It stores all information about rockers switches learned in Code mod id h typedef struct UE u rocken eo wucoChanmne I B 2 els ID ENTRY TYPE DEN Rese PRE id table ID MAX COUNT APPLICATION NOTE 503 Green Smart Wireless enocean Example of id_table uSChannel ozas INDICATORS PTM200 EVA300 3 Switch scenario step by step 1 The PTM200 rocker is pressed and RPS telegram is sent Rocker
11. can start the DolphinStudio and check the result APPLICATION NOTE 503 Green Smart Wireless enocean fos DolphinStudio File View Tools Utilities Help EOT2NHM3 EO0300DIAPI Configuration EOPX Programmer RESET Modul Configuration Programmer Configuration E Read configuration write configuration Save CFG As Modul Information eee Reset to defaults Modul Configuration General configuration Configure the protocol Far the serial communication System Log Serial protocol ESP3 Learn mode toggle 1000 iis ms after the output pin toggles during the learn made Remote learn in 2000 Time window ms within the switch has to be pressed 3 times to learn in during remote learn Now we can easily modify the parameters and press Write configuration button to write the configuration to the module NOTE The remote learn in time of 2000ms is standard for all EnOcean products Changing this parameter is used for demonstration purposes only It is not recommended to allow the change of this parameter for final products APPLICATION NOTE 503 Green Smart Wireless enocean 4 Dem
12. eat flexibility and modularity New tasks e g Dimmer can be easily added or removed according to current requirements Each task provides custom functionality that can be enabled or disabled on runtime in main loop APPLICATION NOTE 503 Green Smart Wireless enocean Task initalialization remote_init learn_init L gateway_init Task execution switch_exec remote_exec learn_exec 3 2 2 Gateway task gateway c Handles radio to serial and serial to radio communication It supports both ESP2 and ESP3 protocol 3 2 3 Learn task learn c Handles learn in learn out of rocker switches Supports both manual and remote learn Provides a set of function to control the learn functionality These are used internally by the Learn task itself as well as by the RemoteManagement module to trigger the remote learn function 3 2 4 Switch task switch c Switches channels CHO to CH4 according to received radio telegram Searches the whole id_table and operates all channels that are learned in as described in section Switch sce nario step by step chapter 2 1 If a new telegram is received the switch module looks in APPLICATION NOTE 503 Green Smart Wireless enocearr the id table If an entry that corresponds to received telegram is found then the channel is switched on off 3 2 5 Button module mod button c The module provides structures and functions for captu
13. epeater status 5 Answer QueryID A R1 RO original telegram R1 telegram repeated once The problem with this scenario is that we actually queried also our gateway There are sev eral solutions for this problem Use gateway software without remote management possibilities When sending remote management telegrams from an application set the status byte to OxF Telegram must not be repeated This way the repeaters will not repeat the telegrams again In some scenarios this also reduces the radio traffic Filter the remote management answers with gateway ID on application side APPLICATION NOTE 503 Green Smart Wireless enocean 5 Outlook This application note demonstrated the operation of a remote managed application with TCM300 like functionality The provided software and documentation shall make it easy to get familiar with the topic and starting own development based on this Further optimizations on the software side could e g be m The structure of ID ENTRY TYPE should be reviewed to cover various rocker switch sce narios m Add dimmer task to support dimmer switch functionality 6 References Further details can be found in the following documentation 1 Remote Management specification 19 02 2010 2 EnOcean Serial Protocol 2 specification v2 5 3 EnOcean Serial Protocol 3 specification v1 4 4 gt DolphinAPI user manual EO3000I API chm 2 0 0 0 5 EnOcean Equipment Profiles E
14. function RM_FN_IDTABLE_WRITE Us ing this RPC we are able to write the whole id_table NOTE ID ENTRY is an ID ENTRY TYPE structure defined in jo_mod h This RPC s is not standardized therefore not part of the EEP2 1 specification Table 3 IDTable write command description Command RM FN IDTABLE WRITE Function code 0x208 OX OOB Datalength OO Broadcast Addressable Answer Message data description Description The count of the ID ENTRY items ID ENTRY item ID ENTRY item ENTRY item is the count of id entries in the id table Following code snipped illustrates how the remote IDTable read is implemented on EO3000I side remote c case RM FN IDTABLE READ nosa7eboegeonbesseqpetepemucsspestnnomEon c break reman ge cr rer TE Process RPC from EnOcean only ft chpeManuracruner 1D ENO SENI reman setError RETURN CODE WRONG break Read table from flash Cf At NM age tants ride babble En eomm celeb RM FN IDTABLE READ ANS FALSE OK reman setError RM RETURN CODE DATA SIZE EXCEEDED break EnOcean www enocean com Subject to modifications Jozef Hopko June 2011 Page 14 20 APPLICATION NOTE 503 Green Smart Wireless enocean 3 5 Configuration The RemanESP3 application provides a possibility of configuring several firmware parame ters In generally it is
15. o Limitations The demonstration has several limitations mainly to reduce the complexity and therefore increase the ease of understanding The remote commands RM FN IDTABLE READ and RM FN IDTABLE WRITE are not standard commands defined in EEP 2 1 It should not be used as end product solution m The rocked 2 action is not supported 4 1 Repeater level in remote management When using TCM300 as gateway the telegram repeater status should be considered Follow ing scenario shows what happens when sending QueryID telegram from PC with repeater status set to O Setup 1 PC Computer running application like DolphinView 2 Device A radio to serial gateway 3 Device B device we want to control per remote management Step by step DolphinView sends QueryID telegram over serial repeater status is O Device A receives serial telegram and forwards it to radio Device B replays with QueryID Answer telegram Device B repeats the QueryID increases repeater status bits to 1 R1 Device A receives the QueryID telegram Device A replays witch QueryID Answer telegram Device A repeats the QueryID Answer increases repeater status PC receives QueryID answer from device B and device A APPLICATION NOTE 503 Green Smart Wireless enocean lt UART gt lt Radio gt 1 QueryID RO 2 QueryID RO Answer from B 3 Answer QueryID B RO 3 QueryID R1 Answer from A 4 Answer QueryID A RO Rn r
16. ring a push button input The btn getState function is a state machine that captures input from physical pin and trans forms it into button state The state machine can filter peaks or bad contacts on the push button 3 2 6 IDTable Management module mod id c This module defines data structures required for switch and learn functionality The id table contains all information about rocker switches learned in The module also provides a set of functions to alter the id table These functions are used by Learn module 3 2 7 Channel module mod channel c Defines a hardware abstraction layer Specific I O ports like SCSEDIO 0 WSDADIO 2 are mapped to logical channels like CHO to CH3 The module defines a set of functions to con trol output channels An advantage of this abstraction is the flexibility of implementation If the hardware changes or the count of logical channels is reduced or extended the overlaying implementa tion needn t be changed 3 2 8 RemoteManagement task remote c Processes remote management messages and responds to RMCC s and RPC s Currently all standard RMCC s are supported Also following RPCs are supported RM FN REMOTE READ RM FN REMOTE WRITE RM FN REMOTE LEARN RM FN IDTABLE READ RM FN IDTABLE WRITE The remote read write and learn are standard RPCs specified in EnOcean System Specifica tion The remote IDTable read and write RM FN IDTABLE READ RM FN IDTABLE WRITE are a custom RPCs defined for
17. this example It demonstrates advanced remote learn concept as well as the remote management usage When pressing the CLR button not only the ID table will be cleared but also the REMAN code is deleted 3 3 Remote command HM FN IDTABLE HEAD For the demo purposes we have defined a custom RPC called RM FN IDTABLE READ Us ing this RPC we are able to read the whole id table NOTE ID ENTRY is an ID ENTRY TYPE structure defined in jo_mod h This RPC s is not standardized therefore not part of the EEP2 1 specification EnOcean www enocean com Subject to modifications Jozef Hopko June 2011 Page 12 20 APPLICATION NOTE 503 Green Smart Wireless Table 1 IDTable read command description Command RM FN IDTABLE READ Function code 0x207 Datalength Broadcast NO Addressable YES Answer Message data description N A the message is has no data Table 2 IDTable read command answer description Command Function code ManufacturerID Datalength Broadcast NO Addressable Answer Answer data description Offset Size Field Description The count of the ID ENTRY items ID ENTRY item ID ENTRY item 1 7 Count ID ENTRY item he is the count of id entries in the id table enocean APPLICATION NOTE 503 Green Smart Wireless 3 4 Remote command RM_FN_IDTABLE_WRITE Similarly to RM_FN_IDTABLE_READ we defined the
18. tionality can be demonstrated using the Remote Management tab in DolphinView DolphinView Basic 3 1 1 0 Expires 31 12 2011 File View Window Help cowis EOUDGKODA GATEWAYCTRL 2 3 0 0 v COM15 EOUD6KODA GATEWAYCTRL 2 3 0 0 013A7EA Q sil 2 nen AJEA LA Unassigned Count 37 00008414 Device 8414 ID 00816921 Device 6921 Q uil Oil EE ID 00816905 Q Device 6906 ID 00814C25 il Device 4C25 Firmware Download it Statistics Telegram Analyzer Transmit Target All devices OID 01004908 RPC Remote Learn v RPC Remote Read Flash v RPC Remote Read Flash Configuration area APPLICATION NOTE 503 Green Smart Wireless enocean 3 Demo application explained The demo application provides similarly functionality as TCM300 in Mode 3 However the source code is not based on TCM300 project but is completely rewritten and unlike TCM300 it uses task based approach Following features are implemented 2 channel relay Bidirectional radio to serial gateway Teach in capability for up to 30 entries Remote management Additionally to Mode 3 functionality the application also implements e Advanced RemoteLearn e ESP2 and ESP3 protocol At this point we briefly explain what the difference between standard RemoteLearn and Ad vanced RemoteLearn is RemoteLearn as specified in EnOce

Download Pdf Manuals

image

Related Search

Related Contents

ラインドレープ カーブタイプ  ベンチチェスト  取扱説明書 - ノースワン株式会社  manual de instrucoes b- 10_inmetro  DUE40028  Fleet 4.0 FAQ  CA546-2771 KM-100シリーズ 明電高圧三相誘導電動機 保護防滴  OPERATING INSTRUCTIONS MANUAL FOR “K” DOSING PUMP  594KB  Zotac E2-1800-ITX WiFi A Series  

Copyright © All rights reserved.
Failed to retrieve file