Indigresso Wiki

Open Source Stuff for DASH7

User Tools

Site Tools


opentag:apps:demo_palfi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
opentag:apps:demo_palfi [2012/06/11 19:24]
jpnorair
opentag:apps:demo_palfi [2012/06/11 20:03] (current)
jpnorair
Line 28: Line 28:
 Here is a guide to compiling and running the PaLFI demo app using [[opentag:​tools:​ccs|CCSv5]] from TI.  Other toolchains are possible, too, and they will be documented in the future. Here is a guide to compiling and running the PaLFI demo app using [[opentag:​tools:​ccs|CCSv5]] from TI.  Other toolchains are possible, too, and they will be documented in the future.
  
-==== Downloading the Code ====+==== 1. Downloading the Code ====
 The PaLFI demo is part of the mainline OpenTag distribution. ​ The best way to get it is through Git, but archived packages are available occasionally. ​ See the [[opentag:​archives|Code Archive]] for more information on downloading the mainline distribution. The PaLFI demo is part of the mainline OpenTag distribution. ​ The best way to get it is through Git, but archived packages are available occasionally. ​ See the [[opentag:​archives|Code Archive]] for more information on downloading the mainline distribution.
  
-==== Project Location ====+==== 2. Project Location ====
 Once you have downloaded the codebase, put it somewhere easy to access. ​ There is a main directory called "​OpenTag_M2." ​ Inside that directory, there is a directory called "​apps/​demo_palfi/"​ which is where the PaLFI demo project is stored.  ​ Once you have downloaded the codebase, put it somewhere easy to access. ​ There is a main directory called "​OpenTag_M2." ​ Inside that directory, there is a directory called "​apps/​demo_palfi/"​ which is where the PaLFI demo project is stored.  ​
  
-=== Preparing the Project on Your System === +**//​[[opentag:​tools:​ccs#​preparing_the_project_on_your_system|Important: Preparing File Linking]]//**\\ 
-// [[opentag:​tools:​ccs#​preparing_the_project_on_your_system|Main Article on CCS Page]] //\\ +You will need to map a Drive B, or alternatively manipulate the project file to find the codebase. ​ There are instructions from the link above, which apply to all OpenTag projects in CCS.  If you do not do this, the project will not load or compile.
-You will need to map a Drive B, or alternatively manipulate the project file to find the codebase. ​ There are instructions from the link above, which apply to all OpenTag projects in CCS.+
  
-==== Loading the Programs in CCS ====+==== 3. Loading the Programs in CCS ====
 Once you map drive B (or do file-linking adjustments),​ the CCS project is ready to build and load. Once you map drive B (or do file-linking adjustments),​ the CCS project is ready to build and load.
  
-=== Building the Projects ===+=== 3a. Building the Projects ===
 Click on the Project folder you want to compile (Master or Slave), then use Project->​Build Project. ​ It should build without errors if you have done everything properly. Click on the Project folder you want to compile (Master or Slave), then use Project->​Build Project. ​ It should build without errors if you have done everything properly.
  
Line 47: Line 46:
 (Todo) (Todo)
   ​   ​
-=== Loading the Projects ===+=== 3b. Loading the Projects ===
 I will assume that you are using a [[opentag:​board:​ez430-rf5509|eZ430 wireless USB Stick]] for the Master and a [[opentag:​board:​rf430-fob|RF430 Fob]] for the Slave. ​ Both of these boards are loaded (and debugged) via SpyBiWire, using the eZ430 debugger tool.  A picture of this setup is shown below, using the RF430 Fob board, and this setup is very similar to the one used by the USB Stick. I will assume that you are using a [[opentag:​board:​ez430-rf5509|eZ430 wireless USB Stick]] for the Master and a [[opentag:​board:​rf430-fob|RF430 Fob]] for the Slave. ​ Both of these boards are loaded (and debugged) via SpyBiWire, using the eZ430 debugger tool.  A picture of this setup is shown below, using the RF430 Fob board, and this setup is very similar to the one used by the USB Stick.
  
Line 53: Line 52:
 You need to make sure that board is supplied with 3.3V or more when it is being debugged (or loaded via the debugger). ​ The battery included with these boards will quickly get drained below 3.3V, and when this happens, the debugger will not work.  The wires in all these pictures are connecting Vcc to a 3.3V source (they are also connecting an I2C bus, but I2C is not required). You need to make sure that board is supplied with 3.3V or more when it is being debugged (or loaded via the debugger). ​ The battery included with these boards will quickly get drained below 3.3V, and when this happens, the debugger will not work.  The wires in all these pictures are connecting Vcc to a 3.3V source (they are also connecting an I2C bus, but I2C is not required).
  
-==== Validating the LF Gateway ====+==== 4. Validating the LF Gateway ==== 
 +Make sure you have a suitable LF Gateway board and the RF430F5978 EVM Software (for Windows) that is made available by TI.  Without the Fob board or the master board connected, we can validate that the board is working. ​ In the WakeUp Mode tab, press the "Send Wake Pattern"​ button and verify that an LED on the LF Gateway board blinks. ​ If you select "​continuous transmission,"​ then the wakeup will be generated once per second.
  
-==== Validating the Slave ====+{{:​opentag:​apps:​demo_palfi_wakeup.png}} 
 + 
 +There is also a trimming feature, which can be used with the Fob board by holding-down the left button (during the trimming process). 
 + 
 +{{:​opentag:​apps:​demo_palfi_trimming.png}} 
 + 
 + 
 +==== 5. Validating the Slave ====
 Once you turn-on the slave, it will go into default idle runtime. ​ It should look something like this video below. ​ Each 1 second there will be a short listening event. ​ Each 4 seconds there will be a short beacon event. ​ The beacon event is helpful, because it caches (and resends) the latest application data acquired by PaLFI (more information on this later). Once you turn-on the slave, it will go into default idle runtime. ​ It should look something like this video below. ​ Each 1 second there will be a short listening event. ​ Each 4 seconds there will be a short beacon event. ​ The beacon event is helpful, because it caches (and resends) the latest application data acquired by PaLFI (more information on this later).
  
Line 68: Line 75:
 If you hookup the LF Gateway to your PC and run the PaLFI Demo App, you can send wake-up signals that the Slave will detect asynchronously. ​ This behavior is quite similar to the button-event behavior, except that there is data interaction with the PaLFI core.  Additionally,​ if you hold-down the left button, an LF Trimming process will occur. ​ One thing to note is that the communication between the PaLFI core and the MCU is quite slow.  After the PaLFI process runs, the Idle-time behavior will most likely get a little-bit out of synchronization because the PaLFI processing task is blocking the initialization of one of the Idle processes (listen or beacon). If you hookup the LF Gateway to your PC and run the PaLFI Demo App, you can send wake-up signals that the Slave will detect asynchronously. ​ This behavior is quite similar to the button-event behavior, except that there is data interaction with the PaLFI core.  Additionally,​ if you hold-down the left button, an LF Trimming process will occur. ​ One thing to note is that the communication between the PaLFI core and the MCU is quite slow.  After the PaLFI process runs, the Idle-time behavior will most likely get a little-bit out of synchronization because the PaLFI processing task is blocking the initialization of one of the Idle processes (listen or beacon).
  
-==== Validating the Master ====+==== 6. Validating the Master ==== 
 +The final step in the PaLFi demo setup is to validate the Master. ​ If the LF Gateway works, the Slave works, and the Master works, then everything is working.
  
 +=== 6a. Plug and Play (Sort-of) ===
 +The Master (USB Stick) will turn-on when you plug-it into a USB port.  It will work with Mac, Linux, or Windows, but with Windows you need to make sure to install the driver stored in ''​OT_ROOT/​otplatform/​msp430f5/​usb_cdc_driver''​. ​ Once it turns on, the LED (on the antenna side) will blink a few times, and then it will wait 5 seconds for the computer to discover it.  After the 5 seconds is over, it will go into normal runtime. ​ During normal runtime, it listens almost all the time.  Occasionally,​ it will send a beacon. ​ There is only one LED, and you can detect the beacons when the LED flashes (quickly) more brightly than when it is on for listening.
  
 +=== 6b. Using OTcom to read logs ===
 +When the Master receives a message from the Slave, it will print the message in OTcom. ​ The message will look something like below: (to do)
  
 +This message is formatted in binary when it is sent over the air, and the Master converts it into formatted text before it reported to [[opentag:​tools:​otcom|OTcom]] over MPipe. ​ OTcom can also take some types of unformatted data (and format them into text itself), but this message is NDEF-encapsulated text.  OTcom is recommended to download (it is free), but you can probably read it over other console apps as well.
  
 +The format of the message is not too difficult to understand
 +^ Label        ^ Data                         ^
 +| ID           | 8-Byte Device ID of the Slave, in hex     |
 +| Data         | 8 Bytes of data, in hex, from the PaLFI message that gets forwarded over DASH7  |
 +| Event        | **A** Wakeup Type A   |
 +| :::          | **B** Wakeup Type B   |
 +| :::          | **1-8** PaLFI button number that was pushed (only 1 and 2 supported on RF430 board) ​ |
 +| RSSI         | 3D LF RSSI from Slave, in dBm (there is a list of three values) ​ |
 +| Temp         | Temperature detected on Slave  |
 +| Volt         | Voltage detected on Slave  |
  
  
opentag/apps/demo_palfi.txt · Last modified: 2012/06/11 20:03 by jpnorair