IQRF DP2P getting started

IQRF introduces DP2P technology which enables to connect every particular IQRF end node directly from another node. In this way you can connect your laptop directly to specific IQRF end node and send it DPA commands.

Examples how to use DP2P. It stands for DPA Peer-to-Peer. This is a new feature introduced for DPA 4.10, see documentation https://www.iqrf.org/DpaTechGuide/410/pages/dpa-peer-to-peer.html

Play with IQRF IDE

Install IDE version supporting DP2P. It was introduced at 4.54 version. The best way to get it is to download actual startup package at the time of writing this text accessible at https://www.iqrf.org/support/download&kat=34&ids=82 . Unzip the package and install IDE from …\IQRF IDE4\IQRF_Startup_Package_OS403D_TR-7xD_191016\IQRF_OS403_7xD\IQRF_IDE\iqrf_ide_454_setup.exe

Prepare network

We will prepare network with IQRF eval boards. This has been described here https://logimic.org/how-to-start-with-iqrf/ . You can follow those steps, but change this:

Choose these versions of plug-ins DPA-Coordinator-SPI-7xD-V410-191009.iqrf and DPA-Node-STD-7xD-V410-191009.iqrf.

In DPA tab check Custom DPA Handler – this is necessary for allowing DP2P. The rest of the options depends on the nodes. For example if a node uses the Custom Handler, it must be checked indeed.

Set access password in Security tab.

Prepare DP2P transceiver

To use DP2P feature we need to prepare a new TR module with appropriate node plug-in DPA-Node-STD-7xD-V410-191009.iqrf. and custom handler using DP2P functionality. The custom handler may implement its own logic when and what shall be sent over DP2P.

For a demonstration we use published example from startup package. You can find it at …/IQRF_Startup_Package_OS403D_TR-7xD_191016/IQRF_OS403_7xD/Examples/DPA/CustomDpaHandlerExamples/DP2Papp.c It listens SPI interface to get commands invoking DP2P transmit (you can find there examples of command in the comments)

Include this file into project – right click on Source in Project window and select file.

Build the custom handler – right click on the file DP2Papp.c and select Build. If everything goes well you should see below in Output HEX compiled hex file. If you get include errors during building just double click on .c file, correct includes, save and build again.

Then upload .hex file by right click on the file and choice Upload.

Send DP2P via IDE terminal

Now you can test it via Terminal in IDE. Click Terminal tab and also Terminal Log.

First send configuration command via terminal to transceiver initiating DP2P in your programmer CK-USB-04. Terminal uses hexadecimal shape of numbers. Below you can see a configuration message:

$DD$DD$00$01$34$07$05$74$65$73$74$65$72$31$32$33$00$00$00$00$00$00$00

The items of the message has following meaning:


    /* IQRF IDE Terminal example
     
       STD+LP network = $01
       channel 52 = $34
       Request RF power 7 = $07
       RX filter 5 = $05
       AccessPassword = 16 x $00 
       (i.e. tester123 = $74$65$72$31$32$33$00$00$00$00$00$00$00)
    */

These parameters of the message you can get from IDE. Double click on DPA-config.xml file.

In OS tab you can see channel.

In DPA you can see TX power and RX filter.

In Security you can see your access password directly in HEX form.

So then from parameters above in the pictures these parameters are:


    /* IQRF IDE Terminal example
     
       STD+LP network = $01
       channel 52 = $34
       Request RF power 7 = $07
       RX filter 5 = $05
       AccessPassword = 16 x $00 
       (i.e. tester123 = $74$65$72$31$32$33$00$00$00$00$00$00$00)
    */

And final message is:

$DD$DD$00$01$34$07$05$74$65$73$74$65$72$31$32$33$00$00$00$00$00$00$00

Put the message into IDE Termianl and click Send.

The TR DP2P transciever is now configured, so let’s try to send directly to all accessible IQRF ned nodes command to flash green diod. The DPA parameters are:

  /* IQRF IDE Terminal example

     PNUM = PNUM_LEDG = $07
     PCMD = CMD_LED_PULSE = $03
     Nodes #1-7 = $FE + 29 x $00
     SlotLength = 0x00 (default values)
     Response RF power = $07
     HWPID 0xFFFF = $FF$FF
  */

This makes following message:

$07$03$00$FE$00$00$00$00$00$00$00$00$00$00$00$00$00$00$00$00$00$00$00$00$00$00$00$00$00$00$00$00$00$00$07$00$FF$FF

Put the message again to Terminal and click send. Watch your IQRF transceivers, they should flash green LED. In Terminal Log you can see their answer.