Ruuvi Tag - Ready To Go

The Ruuvi Tag is distributed ready to transmit environment data packets periodically in either URL or highres (raw) mode.
The (very) faint blinking of the green LED indicates URL mode while the red LED indicates raw mode.
The mode is changed by pressing the B button on the tag.

Be sure to enable Bluetooth in settings on the Phone.

Blue tooth Low Energy Header for advertising packets

Reference:TI.com , Bluetooth.com
byte
offset
 range of
  values
0 04 packetType
1 3E LE Meta Event Code plen 43
03 packetLength (?)
ADV_NONCONN_IND - Non connectable undirected advertising(31 bytes) (not ADV_IND(31 bytes) , ADV_DIRECT_IND, 6x ADV_SCAN_IND(31 bytes)) 23 ??
2 02 subEvent
3 01 numberOfReports
4 00 event type
6 01 peerAddressType
7..12 zz:yy:xx:ww:vv:uu 6 byte MAC LSB first
13 17
19  FEAA Complete service classes
21  
23  FEAA Complete service classes
25  10 Frame type
Max length for BLE 4.0 is 31, BLE 5.0 254.

Packet as seen by hcidump

04 3E 2B 02 01 03 01 C2 24 68 3C 10 C7 1F 02 01 06 03 03 AA 
FE 17 16 AA FE 10 F9 03 72 75 75 2E 76 69 2F 23 42 48 67 59 
41 4D 4C 73 47 B8 

The Ruuvi packets are embedded within an Eddystone URL frame.
Which begin at offset 25 within the packet.

ruuvi Beacon URL Data Formats for sample Application: Environment Station

(doesn't really tell [let alone predict] weather [rain,sunlight…)

The purpose for this (and other URL formats is to provide a means for users familiar with web programming, who are not familiar with C programming and the toolchain, the abliity to process the data from the tag.

Frame Specification (summary):

byte
offset
 range of
  values
0   x10   Frame Type
1  -100..+20   TX Power Calibrated Tx power at 0 meters. This allows for estimating the distance to the tag.
 Max for nordic nRF52832 is 4
200..03
¤
Encoded Scheme Prefix
¤ codes:
00 http://www. , 01 https://www., 02 http://, 03 https://
URL (17 bytes)
3..ia-z and - Domain Name (case insensitive, ie translated to lower) (Choose the shortest possible since the total length is restriceted)
i+1..j
or
.c…
Top Level Domain
codes:
00 .com  01.org   02.edu   03 .net  04 .info  05 .biz  06 .gov 
07 .com/ 08 .org/ 09 .edu/ 0a .net/ 0b .info/ 0c .biz/ 0d .gov/

     or
a..zz text characters to specify other (case insensitive) TLD, for example .fi,.us,.edu,.vi,.io,.tv,.news …  
j+1..20c…Beacon Data Characters (Application dependent)

The web server address is nearly minimal ¤ruu.vi/ Where the ¤ is the protocol code x'03' for https://

This allows only 10 characters for the beacon data which must be printable and cannot contain most special characters. (an address of the form XYZ.com/ or XYZ.info/ would allow 12 characters since a code could be used for the TLD and slash).

The beacon data is encoded using a base 64 scheme* This causes 3 bytes to expand to 4 characters; 6 bytes expands to 8 characters. When viewing the packet with a diagnostic tool or the URL in the address bar of a browser it is this string of characters which is visible.

Some URL formats are prefixed with the fragment identifier introducer (#) allowing only 9 actual beacon data characters. The # appears to immediately follow the / from the web page viewpoint. For example: ruu.vi/#BnALAMNQr
This allows the default web page, index.html, to provide the decoding algorithim and page formatting.
The data from the beacon is specified as the fragment identifier. Since the fragment is NOT transmitted, the web site cannot process any information other than the time and IP address. Fomat 8 addresses that.