Was messing around with PL/Python which allows me to write python code in PL/SQL... but it soon got messy(trying to access all the result columns and naming) and I checked out PL/PGSQL, which is basically Oracle' PL/SQL for postgres. But not really familiar with it, so I kept on making stupid mistakes... you cant name/alias results from a table as 'a'(it works fine in an SQL statement, but not in PL/PGSQL) - took me probably nearly an hour to chase down.
Didn't made much progress on this today and yesterday... I got another full planned day on trying to figure this out on Wednesday.
It turns out that the Visualizing Data book order was canceled because they could not fulfill the order at the current time... So I ordered it from amazon.
RSSI
Spent some of yesterday looking at RSSI for bluetooth devices, but didn't feel to great and got distracted to easy.
What I managed to get done is to display values using the example in pybluez. but I'm not to sure it works correctly:
- The values where high -30 for all the devices, no matter what the distance.
I can't understand the code, it seems to just to listen for the RSSI event somewhere inside the bluez internals, and format it somehow with the ba2str function... my guess it means bluetooth address to string. - I looked at the code of previously mentioned BlueProximity and it has a comment about pretty much exactly the same function as in the example in pybluez that it doesn't work... The way BlueProximity gets the RSSI value is by parsing the output of 'hcitool' command. I'm not sure how slower/use more power would this be if I implemented it searching for it every minute or less.
- Out of date name if used for a long time
- Sometimes the name reported is the name for a different device.
I see this fairly often with my Bluetooth GPS receiver... other devices showing up with its name.
No comments:
Post a Comment