Shop Learn
Android android - Linking a mobile phone and Propeller. - Page 3 — Parallax Forums

Android android - Linking a mobile phone and Propeller.

135

Comments

  • bill190bill190 Posts: 769
    edited 2010-07-21 06:40
    Well let's say installing the Basic Stamp software is easy...

    MPLAB for Pic software difficult...

    And the Android software *very* difficult. (In my opinion.)

    Or in other words, I would bet that a WHOLE lot more people would be able to install the Basic Stamp software and get it working than the Android software.

    Anyway I tried this on my faster XP Pro PC (P4 3.2 GHZ) and I did not need any PATH entries to get it to work. And it takes the virtual cell phone only about 2 minutes to boot when·run from Eclipse.

    Seems to boot a bit faster·when the emulator is run as a stand alone application...
  • soshimososhimo Posts: 215
    edited 2010-07-21 07:12
    bill190 said...
    Well let's say installing the Basic Stamp software is easy...

    MPLAB for Pic software difficult...

    And the Android software *very* difficult. (In my opinion.)

    Or in other words, I would bet that a WHOLE lot more people would be able to install the Basic Stamp software and get it working than the Android software.

    Anyway I tried this on my faster XP Pro PC (P4 3.2 GHZ) and I did not need any PATH entries to get it to work. And it takes the virtual cell phone only about 2 minutes to boot when run from Eclipse.

    Seems to boot a bit faster when the emulator is run as a stand alone application...

    I keep forgetting that people use that "other" version of windows [noparse]:)[/noparse]. It could very well be difficult for win7, I wouldn't know. I was so disappointed with Vista that I'm not migrating until XP support ends - 2013 I believe.

    I'm also running on a quad core with a ton of RAM.
  • heaterheater Posts: 3,370
    edited 2010-07-21 07:57
    Odd, as I said, this is the first time I got Eclipse anywhere near working and the Android plug in was a breeze to.

    Eclipse on my old slow machine was so painfully slow, I decided that is that what Java can do for us why on earth does anyone in the world want to use it.

    This started me thinking that this Java business on the phone was going to be slow as molasses as well. I pleasantly surprised that everything goes a long a quite a reasonable pace. In fact I down loaded the NeHe Open GL demos for Android and I swear they run faster there than on this PC I'm using.

    So now I have my "Andy Cap" logo plus bush button app on the Phone and I'm wondering what is the next step toward the Propeller connection for me.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • RinksCustomsRinksCustoms Posts: 531
    edited 2010-07-22 06:08
    i just might be beating a dead horse here with the audio based link but i had a thought experiment earlier today and had this thought..

    Attached is my idea, not particularly pretty, but i was wondering if it would be possible to output a steady sine or triangle wave on one channel and use the other channel to trigger like an 8bit parallel out ADC spitting out raw data to a propeller programed to transfer the bytes received from the phone to the propeller being programmed. The idea is to transfer a byte at a time of your code in the phone each trigger from the trigger ch. Since a byte can only contain $00-$FF any given byte in your code can be replicated with an 8 bit ADC triggered at the exact value of the byte within the program while the ADC monitors the waveform waiting for the trigger to capture the byte..

    As far as the input side goes, most of the mic's can respond to frequencies from about 60Hz to roughly 20KHz. So why not instead of being confined to the standard old school modem which does two frequencies for 1 & 0 in serial form, take that idea and spread it across the audio frequency spectrum on 8 or 16 different bands each with a sideband slightly lower than the main band for each bit. Pulse the whole word at a time using the PLLA's and counter modules and within the Android phone sits your program processing the detection of the set frequencies. An alternate to this would be to eliminate the sidebands and just concentrate on processing the audio amplitude of specific, set frequencies, as the set frequencies exceed a certain threshold value, it counts as a 1 and if it doesn't, it counts as a 0.

    just a thought.. why not utilize the wifi radio built into most of these phones? can the signal it puts out be modified by a user program to act as a transceiver for your propeller project? much higher bandwidth and data rate i would think... ill be watching this thread for updates, hope you guys figure it all out. I dont like the idea of having to root my phone and possibly bricking it to get that level of control.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quicker answers in the #propeller chat channel on freenode.net. Don't know squat about IRC? Download Pigin! So easy a caveman could do it...
    http://folding.stanford.edu/ - Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
  • LeonLeon Posts: 7,620
    edited 2010-07-22 10:34
    bill190 said...
    Well let's say installing the Basic Stamp software is easy...

    MPLAB for Pic software difficult...

    And the Android software *very* difficult. (In my opinion.)

    Or in other words, I would bet that a WHOLE lot more people would be able to install the Basic Stamp software and get it working than the Android software.

    Anyway I tried this on my faster XP Pro PC (P4 3.2 GHZ) and I did not need any PATH entries to get it to work. And it takes the virtual cell phone only about 2 minutes to boot when run from Eclipse.

    Seems to boot a bit faster when the emulator is run as a stand alone application...

    MPLAB installation difficult? It's very easy to install, I've hardly ever seen anyone report problems on the Microchip forum.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • bill190bill190 Posts: 769
    edited 2010-07-22 17:31
    Leon said...

    MPLAB installation difficult? It's very easy to install, I've hardly ever seen anyone report problems on the Microchip forum.
    The C18 C compiler needs to be installed close to the C:\ directory because·it will choke on long file names.

    Then you also need to specify the libraries and includes for each project which change depending on which chip/compiler you are using.

    Search google for MPLAB "Error - could not find file 'c018i.o'"

    (A basic set-up issue...)

    Then I spent about an hour last night getting Pic 32 debug DBPRINTF's to work. The documentation said to use db_utils.h for this which I learned has been depreciated and now works with plib.h and using the Pic32 C compiler preprocessor·setting -D"PIC32_STARTER_KIT".

    So things like that I would call difficult as opposed to something like the Basic Stamp which is *very* plug and play - the documentation is short and up to date. EZ for most people.

    People these days are used to clicking on Setup.exe, then everything loads and everything works. When the user starts needing to set configuration settings to get something to work, read 300 page documents, etc. Then the number of people who can do that will drop off significantly.
  • heaterheater Posts: 3,370
    edited 2010-07-22 18:49
    bill190 and Leon:

    Strangely enough your talk about PICs, MPLAB (How did we get to that on a Prop-Android thread?) and installing stuff turns out to be slightly on topic.

    Get this, out of the box a Samsung Galaxy S mobile phone does not actually function as a mobile phone!

    Oh no, if someone calls you, you hit the green button to answer, it will not answer the call. What you have to do is configure it to enable call answering. Go to Applications-Settings->Call Settings->Answering Call and check the Answering Mode item.

    Is it me or is that just a bit weird?

    Anyway, as I said my installation of the Android tools has been a doodle so far. Provided you are up to understanding a few simple things like what files and directories are and how to set a PATH. Which I have to say anyone creating computer programs should be aware of. It's not exactly hard and we have had such things in common use for 30 years now.

    My next step is to install the Android native development kit which will enable using native C/C++ for the Android instead of Java. It actually looks like Google have gone to the trouble of making this easy. A "hello world" in C called from a Java wrapper can be as simple as this:

    jstring
    Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env,
                                                      jobject thiz )
    {
        return (*env)->NewStringUTF(env, "Hello from JNI !");
    }
    
    




    BradC, BradC, we need you. We talked a while back about a version of BST for ARM platforms. Whilst I don't think that's possible on Android until we get a means of running all the Pascal graphical stiff on there, it looks like BSTC and the loader could be compiled as libraries and wrapped up in little bit of Java.

    Given that the world soon be will be full of Android tablets and Net Books soon perhaps it's time to look into this.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • bill190bill190 Posts: 769
    edited 2010-07-24 00:58
    FYI - Here is some existing Android Bluetooth open source software...
    (Android meets Arduino)

    http://www.amarino-toolkit.net/index.php/download.html
  • simonlsimonl Posts: 866
    edited 2010-08-11 18:15
    How are you getting on with this heater? I'm on the verge of getting a new Android phone (maybe Galaxy S or htc Desire, dunno yet). My idea is to use it as a ground station for a UAV I'm building :-)
  • TimmooreTimmoore Posts: 1,023
    edited 2010-08-11 23:32
    If you want a cheap bluetooth for prop with an easy interface take a look at http://www.mdfly.com/index.php?main_page=product_info&cPath=8_47&products_id=63&zenid=utk4vd4i514a1nn5ofhlacbgo3
    serial port over bluetooth for $9.95, needs 4 pins 3.3V, gnd, tx, rx. shows up on a PC as a serial port, took couples of minutes to solder, used fullduplexserial (or the 4 port version) on the prop and standard serial bluetooth profile, 30sec on the PC. If android supports the serial profile this is a cheap and easy solution.
  • Heater.Heater. Posts: 21,233
    edited 2010-08-12 00:04
    Not much progress I'm afraid.

    I have managed to get the Android SDK up and running and have been playing around with making some simple "Hello World" Apps.

    I could not resist getting root access to the phone, now I can get a root shell but getting USB host mode working remains elusive.

    I have installed the Amarino package used for the Arduino Bluetooth link, seems that project has most of what we had in mind for the Prop already. But so far I can't even get a regular Bluetooth connection to my PC or laptop working.

    Plan would be to get Mica Dowty's USB host + Bluetooth stack working on the Prop with Amarino on the phone.

    I have to say the Galaxy S is one great device. Probably about the best gadget I ever bought. The screen is fantastic. Sometimes I have difficulty comprehending that in my shirt pocket is a computer with orders of magnitude more performance and storage space than that huge PC that was on my desk less than 10 years ago. It's just that thing I wanted after watching Star Trek as a kid:)

    But, it also works as a phone and so...

    When I started pondering Android and Prop projects with this thread I said the world will soon be full of dirt cheap Android devices which would make excellent user interfaces and communication links for embedded projects.

    Almost immediately I see advertised here in Finland this: http://www.a-link.com/fi/PAD.html Not a phone just an Android tablet. Only 160 Euro's.

    Now those cheap Android gadgets have been slagged of in the press. But I don't care if they don't stack up against an iPad in quality. For our purposes they seem to be perfect. Cheap enough to dedicate permanently to a Prop robot or whatever project. Hackable. And guess what? That USB works in host mode out of the box, so that USB serial link to the Prop should be a doddle.

    I'll keep you posted.
  • Heater.Heater. Posts: 21,233
    edited 2010-08-12 00:06
    Timmoore: That's a great find.
  • John AbshierJohn Abshier Posts: 1,115
    edited 2010-08-12 07:39
    You may want to look at Scripting Layer for Android http://code.google.com/p/android-scripting/wiki/ApiReference or http://code.google.com/p/android-scripting/ It works with Python, Perl, Lua, Jruby, and beanshell. It has an API to readn and write over bluetooth.

    I don't have an Android device, so I cannot test. I am waiting for a tablet, not phone, at a reasonable price.

    John Abshier
  • Heater.Heater. Posts: 21,233
    edited 2010-08-12 07:56
    Thanks John for that link.

    It also lead me to this: http://www.cellbots.com/
  • Bill HenningBill Henning Posts: 6,445
    edited 2010-08-12 08:15
    Canada Customs is still playing with my cheap Android tablet - they have had it for six days now...

    It was only $99US, including free shipping! (from Fleabay, search for Android 1.7)

    Ok, it's only Android 1.7, but it should be enough for me to get a (cheap) taste of Android.
    Heater. wrote: »
    Not much progress I'm afraid.

    I have managed to get the Android SDK up and running and have been playing around with making some simple "Hello World" Apps.

    I could not resist getting root access to the phone, now I can get a root shell but getting USB host mode working remains elusive.

    I have installed the Amarino package used for the Arduino Bluetooth link, seems that project has most of what we had in mind for the Prop already. But so far I can't even get a regular Bluetooth connection to my PC or laptop working.

    Plan would be to get Mica Dowty's USB host + Bluetooth stack working on the Prop with Amarino on the phone.

    I have to say the Galaxy S is one great device. Probably about the best gadget I ever bought. The screen is fantastic. Sometimes I have difficulty comprehending that in my shirt pocket is a computer with orders of magnitude more performance and storage space than that huge PC that was on my desk less than 10 years ago. It's just that thing I wanted after watching Star Trek as a kid:)

    But, it also works as a phone and so...

    When I started pondering Android and Prop projects with this thread I said the world will soon be full of dirt cheap Android devices which would make excellent user interfaces and communication links for embedded projects.

    Almost immediately I see advertised here in Finland this: http://www.a-link.com/fi/PAD.html Not a phone just an Android tablet. Only 160 Euro's.

    Now those cheap Android gadgets have been slagged of in the press. But I don't care if they don't stack up against an iPad in quality. For our purposes they seem to be perfect. Cheap enough to dedicate permanently to a Prop robot or whatever project. Hackable. And guess what? That USB works in host mode out of the box, so that USB serial link to the Prop should be a doddle.

    I'll keep you posted.
  • BeanBean Posts: 8,122
    edited 2010-08-12 08:28
    I recently got a Nook ebook reader.
    It uses the Android operating system and can be rooted.
    It's only $150 and I think it would make a pretty good platform.

    Bean
  • coolgreenguycoolgreenguy Posts: 3
    edited 2010-09-07 00:08
    Has someone manage to interface the Android with the Propeller over bluetooth?
    Please share!!

    Thanks !
  • Heater.Heater. Posts: 21,233
    edited 2010-09-07 00:22
    coolgreenguy,

    Not yet.

    Strangely enough I just found a local source of 1 Euro bluetooth modules and I'm just going there this morning to get some.

    They are Samsung BlueSEM-CII Bluetooth V1.1 Modules.

    Anyone have any idea how to get such things working?

    As for the phone end: I'm thinking we can make use of the work already done for Arduino/Android links with the Amarino Android App project.
  • hornerfhornerf Posts: 1
    edited 2010-09-11 10:48
    Howdy,
    somebody has a nice demo of linking a propeller to the PC via bluetooth.

    View the following youtube link

    http://www.youtube.com/watch?v=xlXfVVQT6KM

    Should not be that huge a leap to send data through the bluetooth to Android. Would need to write an Android app that picks up the bluetooth and display/handle the data...

    4est
  • M. K. BorriM. K. Borri Posts: 278
    edited 2010-09-11 13:17
    Hey guys, I've done this since February semi-commercially :)


    search for spiritplumber on youtube to see the videos of the robots, they were even at Google I/O Conference.

    The firmware and schematics are at http://www.robots-everywhere.com/re_wiki/ have a ball they are obviously free to download :) or you can buy the board from me.

    http://www.youtube.com/watch?v=XX49fATmlxg The Prop sits under the lucite block. This also works with the NAVCOM system for autonomous vehicles already!
  • Heater.Heater. Posts: 21,233
    edited 2010-09-11 13:35
    Brilliant,

    Let me get this straight, communication is:

    phone in hand <==> Server on PC - via 3G
    Server on PC <==> Phone on Bot - via 3G
    Phone on Bot <==> Bot - via Bluetooth.

    Any chance of that working with Samsung Galaxy S and Samsung Bluetooth modules which I happen to have 4 of.

    Wait a minute, I only have one phone....
  • M. K. BorriM. K. Borri Posts: 278
    edited 2010-09-11 13:59
    phone in hand <==> Server on PC - via 3G
    Server on PC <==> Phone on Bot - via 3G
    Phone on Bot <==> Bot - via Bluetooth.


    Yes, this will work with any android phone that has bluetooth (I guess all of them). SOME android phones let you use a serial port off the audio jack pins, and I recommend doing that for airplanes because you want as little latency as possible.

    Did you find the source code OK?
  • Bill HenningBill Henning Posts: 6,445
    edited 2010-09-17 13:33
    Note to self ... buy USB Bluetooth dongle.

    My Flytouch 7" Android tablet arrived about two weeks ago, and I really like it - after I upgraded the OS to 1.9.88 ... other than the normal resistive panel issues and only approx. 2h battery life, it is great, and at $100 including shipping from ebay I can hardly complain!

    I'll be researching getting a better tablet in a month or two.

    I can't wait to use it to control my bots too!
    phone in hand <==> Server on PC - via 3G
    Server on PC <==> Phone on Bot - via 3G
    Phone on Bot <==> Bot - via Bluetooth.


    Yes, this will work with any android phone that has bluetooth (I guess all of them). SOME android phones let you use a serial port off the audio jack pins, and I recommend doing that for airplanes because you want as little latency as possible.

    Did you find the source code OK?
  • Heater.Heater. Posts: 21,233
    edited 2010-09-17 13:47
    Well I finally managed find a local source of 1 Euro Samsung Bluetooth modules. So I bought 4.

    Now I have no idea what to do with them. They are so small.

    Any ideas? Data attached.
  • rosco_pcrosco_pc Posts: 414
    edited 2010-09-17 20:21
    connect via serial, and talk to it using commands specified in H1 of the BT specs (at least according to this page: http://zuff.info/Bluetooth.html :) ).
  • Heater.Heater. Posts: 21,233
    edited 2010-09-18 01:06
    Thanks Rosco,

    All I can see now is that I can take a serial connection from Prop to these Bluetooth modules then what?

    Still many problems with this:
    These modules are really small, I'll never just hook wires on to them, they need a surface mount board.
    They need an antenna connection, what?, how? would just a strip of PCB trace do?
    Then what about this HCI protocol? Is it really necessary to have some huge protocol stack in the Prop to talk to this or what happens? No idea where to start with that one.

    Perhaps this is all more trouble than it is worth.
  • rosco_pcrosco_pc Posts: 414
    edited 2010-09-18 02:47
    Hi Heater,

    As antenna you could try a short piece of copper wire (around 4 6 cm will do good enough for 2.4 Ghz).

    For the stack you could have a look at the USB thread http://forums.parallax.com/showthread.php?t=121321 (I remember they were talking about bluetooth dongles in that one).

    You can find the BT spec also here: http://www.bluetooth.com/English/Technology/Building/Pages/Specifcation.aspx (the link in the previous post points to a members only website)

    I have not seen any better datasheet for the samsung dongle, because that would give you some more information on what the chipset is capable of (newer chipset implement the stack on chip).
  • Heater.Heater. Posts: 21,233
    edited 2010-09-18 03:02
    Wow. A couple of thousand pages of spec!

    Good grief, all I want is a serial link from Prop to Phone.

    The USB Host solution for the Prop is great and I intend to try it out. But it eats cogs.

    Looks like I have to blow 50 odd dollars in a SparkFun Bluetooth serial module or such which is a crazy lot of money to do what we normally do with a few cents worth of twisted pair.
  • rosco_pcrosco_pc Posts: 414
    edited 2010-09-18 03:16
    You would not need the whole USB stack, just the part needed to talk to the bluetooth dongle (I have not looked or tried it, so I might be talking complete bullshit).
  • DonEduardoDonEduardo Posts: 54
    edited 2010-09-26 13:26
    I got this working today using the Amarino app/library on the Android (Droid Incredible) and using these bluetooth modules:

    http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=270623873792&ssPageName=STRK:MEWNX:IT#ht_3715wt_1048

    I'm working with the MultiColorLamp example on the Amarino site. The Amarino protocol is basically (from what I can tell) just an initial byte flag, followed by the data, and then terminated by an Ack which is set to decimal 19. I've been able to send and receive data.

    On the Propeller side I'm just using FullDuplexSerialPlus set at 9600 baud (default for these modules).

    Now, what am I going to control with my new phone? Don't have any ideas yet, but wanted to at least get this communication hurdle out of the way.
Sign In or Register to comment.