Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 121 users online: 5 members, 84 guests and 32 bots. Members: Art_of_camelot, CalebHansberry, tr1p1ea. Bots: VoilaBot (1), Spinn3r (1), Magpie Crawler (4), VoilaBot (7), Googlebot (19).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
|
| Author |
Message |
|
Netham
Advanced Newbie

Joined: 30 Dec 2006 Posts: 60
|
Posted: 09 Aug 2012 10:32:18 pm Post subject: Medium-range unconnected messages from an Android Phone |
|
|
I've got a Raspberry Pi in my car I'm planning to make control the locks. I'd like to get it to get a message from my phone, preferably over BT though Wifi would be do-able, to unlock the door.
What I've tried so far:
Establish connection from Phone to RPi - Takes too long (Around 20 seconds for the first message)
Use hcidump on RPi to log incoming messages from phone and act based off of phones device name (name + MAC is in the first packet, I changed the name to LOCK and UNLOCK for the commands) - Too slow still, the phone does a scan then attempts to connect. It also just feels far too hackish and cheap.
Check signal strength/ping time to approximate distance - Signal strength doesn't drop from 100% until I'm nearly 150 feet away from my car in the open, ping jitters far too much to be reliable
Alternatives I see: NFC -- I don't know the operating range of NFC, but if it'd work over ~2 feet I could put a sensor in the driver-side door to check for it, but I don't believe it goes far enough
Unconnected wi-fi message - I think this would be the best, but I have no idea how to do it, or if it's even possible.
When it's done, I'd like to be able to do something like this:
Phone sends RPi a private-public key encoded message including timestamp + a command
RPi decodes and checks if timestamp is within a range, then operates based off of the command
Obviously the RPi will be left on all the time to keep the clock set |
|
| Back to top |
|
|
graphmastur
Power User

Joined: 27 Jul 2010 Posts: 464
|
Posted: 09 Aug 2012 11:12:13 pm Post subject: |
|
|
If you had another cheap cell phone, you could use a text message.
Failing that, rfid might work. You don't have to put the RPi right by the sensor, but rather have the sensor in the door, and the RPi somewhere else.
Some questions:
Wouldn't your RPi drain your battery? I can't see leaving it on all the time being a good thing?
Also, how hot does your car get. It'd be bad if one day you couldn't unlock your car because it was too hot, and something melted.
Cool idea. I've always wanted something where I just walk up, and it unlocks when I grab the handle of the car. |
|
| Back to top |
|
|
Netham
Advanced Newbie

Joined: 30 Dec 2006 Posts: 60
|
Posted: 09 Aug 2012 11:19:03 pm Post subject: |
|
|
A txt message would be too slow, and yea, I know I could have the sensor on a cable and not put the RPi in the door.
I've been running a netbook inside it for quite a while without any issue from heat, and I'm sure that puts out more than the RPi will. I put it in standby when I go inside for long times, and I haven't had it kill my battery yet, though it does in about two days if I leave it on. |
|
| Back to top |
|
|
comicIDIOT

Guru

Joined: 01 May 2006 Posts: 5140 Location: SFBA, California
|
Posted: 09 Aug 2012 11:22:57 pm Post subject: |
|
|
Creating a AdHoc WiFi network isn't all that hard. Heck, even an SD card can do it. Sadly, the SD card won't enable communications between the RPi and the Phone.
Just setup a network password and make sure your phone remembers it, write two apps - one for the RPi and the Phone - and you're set. The only hiccup I can see is that you're within range of a previous WiFi network so you'll have to manually switch to your cars AdHoc. _________________
-Alex |
|
| Back to top |
|
|
Netham
Advanced Newbie

Joined: 30 Dec 2006 Posts: 60
|
Posted: 09 Aug 2012 11:38:51 pm Post subject: |
|
|
The issue with that is that it takes a significantly long time to switch to an AdHoc network on an Android phone. I'd really like to just send a message out without establishing a connection.
Edit: If anyone is curious, here's what else I'm going to be using the RPi for:
Touchscreen, by the way. |
|
| Back to top |
|
|
KermMartian

Site Admin

Joined: 14 Mar 2005 Posts: 55886 Location: Earth, Sol, Milky Way
|
Posted: 10 Aug 2012 02:31:10 pm Post subject: |
|
|
What touchscreen is that, how much is/was it, and how hard is/was it to interface with the Pi? I liked the idea you posted on IRC, wherein you use a high-frequency tone emitted by your phone and identified by the Raspberry Pi, but I'd additionally suggest modulating that tone in some way. Even better, with a speaker-mic pair on both the car and the phone, you could do a challenge response:
1. Phone emits "I am here" tone.
2. Car emits challenge signed with its private key, assuming previous key-pair exchange.
3. Phone verifies challenge, re-signs challenge, and emits the result.
4. Car checks challenge response, unlocks the car if valid.
Public-key crypto! _________________
 |
|
| Back to top |
|
|
Netham
Advanced Newbie

Joined: 30 Dec 2006 Posts: 60
|
Posted: 13 Aug 2012 03:38:15 pm Post subject: |
|
|
| KermMartian wrote: | What touchscreen is that, how much is/was it, and how hard is/was it to interface with the Pi? I liked the idea you posted on IRC, wherein you use a high-frequency tone emitted by your phone and identified by the Raspberry Pi, but I'd additionally suggest modulating that tone in some way. Even better, with a speaker-mic pair on both the car and the phone, you could do a challenge response:
1. Phone emits "I am here" tone.
2. Car emits challenge signed with its private key, assuming previous key-pair exchange.
3. Phone verifies challenge, re-signs challenge, and emits the result.
4. Car checks challenge response, unlocks the car if valid.
Public-key crypto! |
Sorry for the delayed response, I forgot I posted this.
The touchscreen I'm using is this (though mine only cost $17), the display is one I ripped out of some portable movie player and found a controller board for on eBay
It was pretty much plug-n-play with Linux (I might have had to install drivers, I can't recall.) It showed up as a standard HID device once it was set up, though. Windows had to have some poorly-written driver to work right with it.
As far as communication goes, I'm still at a complete blank. I don't think that my phone could emit a high enough frequency pitch (Seems to peak out at around 14-16KHz, and that's audible)
Right now the only solution that I think would work is an NFC reader in the door and holding my phone to unlock it, which wouldn't have much any advantage over just using the key to get in. |
|
| Back to top |
|
|
Kllrnohj

PH34R |\/|3

Joined: 24 May 2005 Posts: 8189
|
Posted: 13 Aug 2012 10:55:28 pm Post subject: |
|
|
Bluetooth is your only real option for medium distance wireless. Establishing a connection between two already paired devices is pretty fast, it should be good enough. _________________ There are only two kinds of programming languages: those people always bitch about and those nobody uses. (Bjarne Stroustrup) |
|
| Back to top |
|
|
|
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.031611 seconds.
|