Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revisionLast revisionBoth sides next revision | ||
livebox:hah_hahnode:bluenode [2014/01/06 22:05] – [Usage] brett | livebox:hah_hahnode:bluenode [2014/02/18 10:40] – [Data Flow] minerva9 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== BlueNode ====== | ====== BlueNode ====== | ||
- | Integration of a BlueTooth | + | Integration of a Bluetooth |
- | {{: | + | {{: |
===== Theory of operation ===== | ===== Theory of operation ===== | ||
- | The BlueTooth | + | The Bluetooth |
On the receiver side the RF is decoded and transmitted as an ASCII string out the serial port for decoding. | On the receiver side the RF is decoded and transmitted as an ASCII string out the serial port for decoding. | ||
Line 14: | Line 14: | ||
[[livebox/ | [[livebox/ | ||
- | The decoder is an Lua applet that creates a BSC endpoint dynamically sending a xAPBSC ON event when the device is first registered. | + | The decoder is a Lua applet that creates a BSC endpoint dynamically sending a xAPBSC ON event when the device is first registered. |
These on/off events can then be used by other scripts to drive an action. | These on/off events can then be used by other scripts to drive an action. | ||
Line 22: | Line 22: | ||
===== Data Flow ===== | ===== Data Flow ===== | ||
- | A packet will arrive on the Receiver. | + | With Serial debugging enabled on the bluenode sketch this is the sample output. |
+ | < | ||
+ | [BlueNode.1] - RF disabled | ||
+ | SYNC> AT | ||
+ | OK | ||
+ | SYNC> AT+NAME=blueNode | ||
+ | OK | ||
+ | SYNC> AT+ROLE=1 | ||
+ | OK | ||
+ | SYNC> AT+INIT | ||
+ | ERROR: | ||
+ | SYNC> AT+INQM=0, | ||
+ | OK | ||
+ | ASYNC> AT+INQ | ||
+ | OK | ||
+ | +INQ: | ||
+ | device=12: | ||
+ | OK | ||
+ | </ | ||
+ | The ERROR:(17) can be safely ignored. That just means the SPP profile lib has already been initialized. | ||
+ | You will notice the RF module is disabled, that's due to me running the bluetooth device attached to my Arduino which does not have any RF device on it, so I disabled that code whilst testing. | ||
+ | |||
+ | A packet will arrive on the Receiver. | ||
< | < | ||
[HAHCentral.1]1 g212 @ 868Mhz | [HAHCentral.1]1 g212 @ 868Mhz | ||
Line 45: | Line 67: | ||
</ | </ | ||
- | That something doing the decoding is an applet running inside [[livebox/ | + | That 'something' |
We are running the Lua decoder in debug mode so the lifecycle of an endpoint can be seen. | We are running the Lua decoder in debug mode so the lifecycle of an endpoint can be seen. | ||
Line 88: | Line 110: | ||
</ | </ | ||
- | All going well you should see an endpoint dynamically appear in xFXViewer when your Bluetooth device comes into range. | + | All going well, you should see an endpoint dynamically appear in xFXViewer when your Bluetooth device comes into range. |
===== Wiring / Source ===== | ===== Wiring / Source ===== | ||
Line 104: | Line 126: | ||
We don't connect the 5v pins together, 3.3v is sufficient. | We don't connect the 5v pins together, 3.3v is sufficient. | ||
- | The source code for the SKETCH is call BlueNode | + | The source code for the SKETCH is called |
* http:// | * http:// | ||
- | The LUA decoder logic is found in bluenode.lua or on your HAH system in / | + | The Lua decoder logic is found in bluenode.lua or on your HAH system in / |
* http:// | * http:// | ||
- | ===== Usage ===== | + | ===== Configuration |
The decoder can operate in two modes; named device endpoints or dynamically created. | The decoder can operate in two modes; named device endpoints or dynamically created. | ||
Line 118: | Line 140: | ||
module(..., | module(..., | ||
local monitor = require(" | local monitor = require(" | ||
- | RoomNode = require(" | + | RoomNode = require(" |
- | BlueNode = require(" | + | BlueNode = require(" |
</ | </ | ||
Line 145: | Line 167: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | ===== Observations ===== | ||
+ | |||
+ | This code has been tested with the following bluetooth devices and the following has been observed. | ||
+ | |||
+ | In general "Smart phones" | ||
+ | |||
+ | ^ Device ^ Year ^ Observation ^ | ||
+ | | Nokia 6230i | 2005 | everything works perfectly. | | ||
+ | | Palm Pre | 2010 | the device only responds to AT+INQ command when its awake, once its goes to sleep it won't respond. | | ||
+ | | iPhone | ? | the device only responds when awake and paired (verify) | | ||
+ | |||
+ | Ed. Sure smarts phones with all their apps are cool but they have taken their eye off the most important thing, in my opinion, which a phone should have; a long battery life and being able to make phone calls. | ||
+ | |||
+ | Until I can go a week on one charge I'm sticking to my trusty Nokia, where I can leave bluetooth on permanently without causing me duress. | ||
+ |