Bluetooth + system.getNano - distance?

Hi, not sure exactly what forum to post this in so I'll take it here...
Anyway I recently read an article about some new patents by apple, one which involved bluetooth finding lost keys and such via "hot/cold" feedback (using one device to find the other) and the other using triangulation (multiple devices) to more exactly pinpoint the lost device. I haven't looked at their patent so not sure exactly what it entails but from what I could get it worked similar to a gps but much smaller scale (it said something about atomic synced time for instance).
Anyway the reason I found the article was because a colleague of mine was wondering if it was possible to create something like this.
Now I'm most familiar with java so if possible it would be nice if I could use it... however got some questions on how plausible it is. And just cause I'm most familiar with java don't mean I'm all that good at that either ^^;
Anyway, to make it simple lets skip the triangulation bit. We have 2 devices and we would like to find the distance between them. Now I read an article about using signal strength as well to do this but their conclusion was it didn't work very well. So lets skip that as well. And since I doubt I could sync two devices atomically and then as the GPS works send the time and calculate the distance from that.
So my idea was this, since the clocks are not synced, could you use the round trip time (RTT) /2 to calculate the distance?
pseudocode of the operations
client1
OpenConnectionToOtherDevice connection;
is = connection.getInputStream();
os = connection.getOutPutStream();
start = System.getNano();
os.write(1);
is.read();
rtt = System.getNano() - start;
distance = speedoflight * (rtt/2) / 10^9  // last division to get it to secondsclient2
waitforconnection();
open inputstream is, openoutputstream os;
is.read();
os.write(1);The code above would also to improve accuracy not be allowed to be swapped out and such...
Would something like that actually work? :S From what I've read as well the getNano uses the most accurate clock on the system. "On XP the best you can get (the windows performance timer) is microsecond timing (10^6)"
Which wouldn't give high enough accuracy to calculate a distance in metres. But lets assume we get it in nanoseconds... Would something like this work or would you get a lot of delays on other parts on the code? :X
Might not be entirely clear there towards the end... I'll try to make myself more clear if you got questions.
Feedback appreciated
Christian

j2ee_ubuntu:
Yeah, it is to get a RTT, since the clocks aren't synced you cant send the the timestamp when it was sent and then compare that to the internal clock on the receiving device.
db:
Yeah I read some of that and was kinda what I was afraid of... I get an average of just below 2000 something...and since like 100ns results in ca 30m, calculating a mean and substracting that is also out of the question obviously...
Do you know if it's like possible (I think it was in some assignment way back in school in assembler) where you force a section to run, and it can't be placed on the stack before it's done it's stuff... :X
I'm guessing you'd have to go lowlvl like this for it to work properly in the first place, or anyone else got any ideas? =)

Similar Messages

  • Can't connect to iTunes nor to car Bluetooth system

    Up through yesterday, my iPhone showed up in iTunes on my iMac, but no longer. Also, it automatically connected to my Toyota Camry Bluetooth system...but no longer. (I just upgraded to iOS 6.1)

    try holding the sleep and home button at the same time until you see the apple logo. then make sure you're logged in your apple ID. if it still doesn't. you may need to restore your ipod. hope this helps

  • My bluetooth system can't read or detect my bluetooth device, any help?

    My bluetooth system can't read or detect my bluetooth device, any help?

    What bluetooth system?
    What bluetooth device?
    Please explain

  • Why are my notifications silent when I use my 4s on Toyota Fortuner bluetooth system, Why are my notifications silent when I use my 4s on Toyota Fortuner bluetooth system

    Why are my notifications silent when I connect my 4s to my Toyota Fortuner Bluetooth system ?

    Hi,
    The 'features' you refer to are not anything that a customer should really care about, so why don't you just turn them off.
    Do you really care about "Location-based iAds" - I've hardly ever even seen iAds!
    Do you really care about the time-zone updating based upon your international location - unless you are a very frequent traveller, this 'feature' is pretty useless and can be turned off without losing functionality that matters.
    The specific features to turn off are indicated in my post above - they are all in one place, they can all be turned off in about 20 seconds, and your problem will go away, and you will not lose any important functionality.
    Obviously I would agree with your point if you had to refrain from using the phone or making text messages, or playing games, or taking photos... all of which are genuinely useful features of a phone.
    But I disagree with you that you should deny yourself reasonable battery life on the basis that you need the specific features that made you buy this "Apple product and not an Android one" when these features are in fact not first-line, or even-second line features... they are just 'things' that make very little difference to how a person would use their iPhone at all.
    Anyway, that's my thoughts on it. Yes of course it would be great if Apple could fix the bug but as it isn't showstopping, I find it hard to get worked up about it

  • 2.1 update  reduces sound quality and volume on Lexus Bluetooth system

    I have a Lexus IS250 with a built-in Bluetooth system. Ever since I upgraded to 2.1, I've had to always switch to speakerphone whenever talking in the car, because people are always saying I'm either breaking up, or extremely faint.
    I know there's probably not a whole lot that can be done about this issue on my phone, but I just wanted to make it known that I'm having this problem so that Apple is aware of it.
    Thanks!

    The first thing I would suggest trying is to delete and re-pair the iPhone with your CRV system. (Unless of course, "...restored the system..." means you already did this?) After that, assuming the problem is not cleared, I would perform a test and take a look at the iPhone screen during an incoming call. I'm curious if the display has the CRV selected as source audio.

  • Bluetooth system in my car showing 'audio track'

    When I pair my iPhone 4S with my car Bluetooth, the music is listed only as 'audio track'. Is there something I can do to display the track or is it just down to the Bluetooth system in my car?

    I too have the Dual receiver XHD6425 and I am wondering if the BTM60 would work with my BB 8830.
    Did you get the BTM60 working with your BB?
    Nice receiver but seems like the support for the  Bluetooth is lacking.

  • IPhone 5 and iPad 2 Bluetooth not working since IOS8.0 update unable to make calls through Bluetooth system in Mazda 3 and unable to connect iPad to wifi printer

    Since recent  IOS 8.0 updates Bluetooth on my iPhone 5 and iPad 2 is not working cannot make calls through car Bluetooth system and cannot use Bluetooth  to connect to other devices on my iPad

    Hi there Annapana,
    You may find the troubleshooting steps for bluetooth connections in the article below helpful.
    If you can’t use a Bluetooth accessory or car kit 
    -Griff W.  

  • Q10 contacts not available to BMW Bluetooth system....​..........

    I have a (roughly) four month old Q10.  When I originally paired it to my MINI Bluetooth system, it worked fine and my contacts were available in the MINI's display dialog.
    A couple weeks ago, I added a Microsoft Hosted Exchange Server email account to the Q10's account list.  From that point forward (give or take) the only data displayed in the MINI's phone book display was the corresponding phone number for the contact.  No other data.
    A couple days ago, I acquired a new BMW X5.  The MINI and BMW Bluetooth systems are very similar (both BMW systems) and I'm still experiencing the same problems.  Nothing but the phone number is displayed in the X5 dialog.
    Anyone else have a similar experience?
    Thanks

    I have made progress on my original issue, but it took some time to figure things out.
    The problem on my Q10 started while it was still connected to the MINI that I was driving at the time.  After the software update that was downloaded to the device, around early September sometime, the MINI Bluetooth display began showing only numbers, no associated names.  Since I was about to trade the car, I ignored the problem.
    I did try syncing the phone with BB Link on two different computers (one office, one home office), but only wound up with two duplicate contact lists on the device.
    When I acquired the X5 on October 1st and paired the phone, same display issues.  So I contacted RIM tech support and spent about an hour sitting in the vehicle, trying different actions, to no avail.
    Being kind of fed up with the problem, and all the time it was using up, I responded with the usual email message to the open case log with my usual "since you can't fix the problem, thanks for the brick" dialog.
    RIM responded with a detailed message advising me to do a security wipe (after backing up of course) on the Q10, then add back my Microsoft Hosted Exchange email account credentials.
    This fixed the problem.  I have not reentered some of my other email accounts, which I thought might have a negative effect.  Since most of my correspondence and calendar are on the Hosted Exchange account, I'm in pretty good shape and don't want to do anything to screw it up again.

  • IOS 8.1 will not let me make calls via car Bluetooth system , i can only receive calls , making calls i have to select handsfree manually each time , no problem before , 2013 mitsubishi outlander

    iOS 8.1 will not let me make calls via car Bluetooth system , i can only receive calls , making calls i have to select handsfree manually each time ,  i had no problem before iOS 8 , 2013 mitsubishi outlander , I'm based in South Africa and support of any type really ***** here , would really appreciate any help , i have unpaired , deleted , repaired and so forth , nothing works

    Hi
    i have a honda crv, 9 month old. I have before an iphone 5 s, it was perfect./ios7.1.2/
    after soft update 8.0 disconected from hands free system, every 5-6 second, over 2-3 second back into connection automatically.
    After i changed into iphone 6 / only 8.X/
    It was an update. i think 8.0.2 for this problem, that this update was bad.
    This problem is by lexus, VW, and another 2 Honda CRV, 1 civic / 2024 /
    ONLY 8.0 or higher soft
    this time 8.1.2
    Today was 1 minutes call, by calling was 4-5 disconnect episodes
    i probe with another iphone 5s/7.1.2/, motorola x 2014, galaxy s5 - there are perfectly
    IT'S a  SOFTWARE PROBLEM!!!!

  • Cannot Connect to 2011 Chevrolet Traverse Bluetooth System

    I recently purchased a 2011 Chevrolet Traverse with a Bluetooth system.  When I try to pair to the system the 4S shows discoverable but I do not see the car on the phone.  Any ideas on how to fix this if it is possible?
    Thanks

    I have a 2011 Chev Avalanche LS; was able to pair my iPhone 4 and then the iPhone 4S without any issues; worked great. (Yes, unfortunately past tense!)
    A couple weeks ago, all of a sudden it started acting up on me.  The handsfree wouldn't work - it started with a call coming through the iPhone only.  I couldn't get iPhone to put the call through the vehicle's system.  "General Motors" selection was available, but wasn't clickable.
    I had already had a battery problem with the iPhone 4S and was having it replaced.  New replacement iPhone 4S arrived a few days ago.  Tried to pair it to Avalanche's Bluetooth.  iPhone won't discover Avalanche's Bluetooth.
    Tried connection with Blackberry Bluetooth earphone device - iPhone wouldn't discover it.
    Tried to pair Motorola cellphone to Avalanches' Bluetooth - discovered once, but Motorola phone wouldn't allow input of 'passkey', so it didn't pair with Avalanche's Bluetooth.  After that close connection, the Motorola wouldn't discover the Avalanche's Bluetooth.
    The original iPhone 4S had the latest IOS 5.1.1 installed and worked great - but, it was paired back in Nov 2011, so the iOS would have been a earlier version.
    Apple has offered to replace the replacement, though.
    But, if we don't know where the problem is - then, I'll probably have the same issue with the new New Replacement!!!
    I'll keep you posted!

  • Bluetooth system on Droid2 Global dead?

    Anyone else having issue with their bluetooth system since the GB update? Nothing can see my phone anymore and my phone no longer sees anything else.

    Sounds like there will be a soak test starting this week.
    http://www.droid-life.com/2011/06/13/droid2-global-gingerbread-update-is-ready-soak-test-begins-this-week/

  • Bluetooth System Preference

    My bluetooth system preference won't load anymore... it always stops responding.
    Any ideas? I know thats really not specific...if there's any info I can find out for you to help just let me know...

    Same thing hapened to my Macbook overnight. I leave the computer on all night. When I left my Macbook, I know my Bluetooth keyboard and Mighty Mouse were working, but now all I get is Bluetooth: Not Available. I've restarted several times and nothing changes. I appreciate any help.

  • Phone Book not working on UHP bluetooth system

    Hi.
    I want to use my iPhone 2G with the UHP bluetooth system in my Opel Astra H. The pairing works fine, I can do and accept phone calls, but when I select the phone book the display (in the car, not the iPhone) says "loading contacts..." but it never finishes. The last called contact are almost instantly synchronized and can be used for calls.
    How can I get the contact list/phonebook working via bluetooth to be able to call all of my contacts and not only the most recently ones?

    I have just got a Nokia 2760 and BlueSoleil BT with a USB dongle. Same diagnosis, I can perform certain functions including:
    - adding contacts using Phone Browser
    - seeing and adding files using the BlueSolei SW, but I cannot see (and edit) the contacts folder.
    Same diagnosis from PC Suite, that connection to the phone cannot be established, but it is obvious that it is connected!
    Very annoying fault!
    Hope to find a solution fast!
    Hans-Henrik
    Hans-Henrik
    Nokia Novice

  • TS1398 Update iPhone 4s to 6.1.3 (10B329) now I can't connect to any wifi networks at home or at work and all car Bluetooth systems will not connect either. Help! Extremely annoyed at apple for putting out software that causes such mayhem.

    My iPhone 4s has been update as I said in subject bar.. Now can't connect to any of my cars Bluetooth systems. Also even more frustratingly can't connect to any wifi networks at home or work!!
    How can apple put out such an update that causes so much grief and inconvenience to hundreds of people. Not to mention risking lives with Bluetooth kits not working...outraged!!!!!!

    First, grow up.  Just because YOUR phone isn't working, doesn't mean Apple put out bad software.  I've not had any difficulty, nor has anyone else I know.  And just how is Apple risking lives with Bluetooth kits not working?  It's YOUR decision to talk on the phone or text and drive.  Not Apple's.
    We're users here, volunteering our time to help others.  Posts like yours, which are whiny and ranting, simply means we're likely to ignore you and not provide you with any help.  Not to mention, it makes you look absolutely foolish.
    Further making you look foolish is the fact that you haven't even asked a technical support question, nor have you provided anyone here with any troubleshooting steps you might have taken, including those recommended in the user guide.
    Good luck getting help.
    GDG

  • Saab 9.3 BPIS Bluetooth System and Nokia

    Hello,
    I Have a Saab 9.3 equipped with Saab's own bluetooth system named Bluetooth Phone Integration System. I works quiet well with my old Nokia 6310i. But at this time it needs replacement. I tried a Nokia E90 and E61, they connect but it is impossible to import phone numbers and contacts to the system. My question is which RECENT Nokia phone can be recommended so I can use or transfer the phonebook.
    Thanks very much
    Ljad
    Belgium

    Have you tried the 810 contact downloader mentioned earlier and installed it correctly?
    /discussions/board/message?board.id=topfaq&thread.id=97
    That Pool of Knowledge thread details exactly how to install the 810 downloader and in most cases to get it to work.
    The Nokia E71 that I have has the PBAP profile installed which allows the phone to download the contacts into the car when it is connected in Handsfree profile mode. When you connect the phone to the car in SIM Access Profile mode the handset shuts down most of the functionality, including the ability to send the contacts into the car.
    By correctly installing the 810 downloader the phonebook will then be copied in to the car in most cases. When I connect my E71 to my Audi S4, each time it connects it takes a minute or two to copy over the contacts and then functionality is available. However the Missed Dialled and Recieved calls will not be copied from the handset in SIM access mode, where upon the 810 downloaded comes into service and does that function.
    The S40 handsets generally do not carry the SIM access mode, and whilst you get the phone connectivity with hands free profile and also the full phone book connectivity, you do not get the better reception that the SIM access car phone provides.
    Shunts...
    I will mostly be communicating with a Nokia E72 Zodium Black
    Nokia E72-1 with Vr 051.018.207.04 Software
    If this post helped... Add some kudos!!

Maybe you are looking for