Shop OBEX P1 Docs P2 Docs Learn Events
Eb500 vs JSR-87 — Parallax Forums

Eb500 vs JSR-87

jmspaggijmspaggi Posts: 629
edited 2009-08-19 15:56 in General Discussion
Hi,

I'm trying to connect my Eb500 to a cell phone with JSR-87, but I have some troubles. They are able to see one the other, but seems that they are not able to communicate. I'm able to connect them together, but after that, nothing seems to appen.

JSR-87 define devices and profiles that bluetooth can offer, but on the Eb500 side, I don't have all those details.

I "just" want to send strings from my cell phone to my eb500.

Do you have any hints to provide?

Thanks,

Jean-Marc

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-06-19 20:47
    Jean-Marc,

    That information is provided in the documentation for the EB500. The EB500 supports SPP (Serial Port Profile). This essentially means it can transfer serial data. Your phone is the wild card here. It may not support SPP. There are several layers within the BT standard and your phone may simply not use that one. If you could you would most certainly need software on the phone side to implement the transfer of data. Your phone by default most likely wouldn’t have such a facility built-in to just send data serially until it supports some sort of BT Sync with a PC.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • jmspaggijmspaggi Posts: 629
    edited 2008-06-19 21:04
    Hi Chris,

    I'm able to transfert files (pictures) between my 2 phones using the internal url btspp://localhost:XXXXXXXXXXXXXX;name=Picture Server;authorize=false

    So I think my phones are SPP capables. My server (in the phone) is listening on this URL. Over SPP, they seems to be able to do packet propocol (which I don't really need), and they are not able to do OBEX (which I don't need).

    On the Javelin side, I'm doing that (dirty):

                      System.out.println("Connection ");
                      eb500.sendCommand(Eb500.Connect, "00:14:FF:FF:CF:FF");
                      if (eb500.response())
                              eb500.print();
                      CPU.delay(30000);CPU.delay(30000);
                      if (eb500.response())
                              eb500.print();
                      CPU.delay(30000);CPU.delay(30000);
    
                      eb500.enterDataMode();
                      txUartBlue.writeByte(65);
                      txUartBlue.writeByte(65);
                      txUartBlue.writeByte(65);
                      eb500.commandmode();
                      checkIn(rxUartBlue);
    
                      eb500.sendCommand(Eb500.Disconnect);
                      if (eb500.response())
                              eb500.print();
                      CPU.delay(30000);CPU.delay(30000);
                      if (eb500.response())
                              eb500.print();
                      CPU.delay(30000);CPU.delay(30000);
    
    



    The phone is able to get the connection request, but then the "acceptAndOpen()" method never exit. Like if after the eb500 connect command I will have something else do to/send. Should I try to update the security configuration or speed or encryption or flow or anyting else? Or this can't be related?

    Thanks,

    Jean-Marc
  • jmspaggijmspaggi Posts: 629
    edited 2008-06-20 12:47
    Hi,


    I did some test last night and I was finally able to connect the phone to the Eb500 when I place the eb500 as a server and the phone as a client. The phone need to use btspp://ADRESSE:1 instead of 3.

    But now, I have something strange. I'm loosing about 40% of the data between the 2. They are at about 1 meter one to the other, so that's not coming from the signal.

    The code is the server is very simple:

                     eb500.sendCommand(Eb500_test.SetFlowControlHardware);
                      CPU.delay(10000);
                      if (eb500.response())
                              eb500.print();
                      eb500.sendCommand(Eb500_test.SetSecurityModeOff);
                      CPU.delay(10000);
                      if (eb500.response())
                              eb500.print();
                      eb500.sendCommand(Eb500_test.SetEncryptModeOff);
                      CPU.delay(10000);
                      if (eb500.response())
                              eb500.print();
                      eb500.sendCommand(Eb500_test.SetConnectableModeOn);
                      CPU.delay(10000);
                      if (eb500.response())
                              eb500.print();
                      eb500.enterDataMode();
                      if (eb500.response())
                              eb500.print();
                      Timer timer = new Timer ();
                      while (true)
                      {
                              checkIn(rxUartBlue);
                              if (eb500.response())
                                      eb500.print();
                      }
    
    



    And from the client, I try to send 256 times the letter "A". but I never receive it 256 times. Last time was 114 times. On the client side, I do a write (65) in the output, then a flush, then a 500ms delay just to be sure it's not too fast, but seem's that it doesn't help.

    Any idea?

    Thanks,

    JM
  • jmspaggijmspaggi Posts: 629
    edited 2008-06-20 15:16
    Wow!

    I found something, so I will share it in case someone got the same issue.

    NEVER check eb500.response() while you are in the data mode... That will remove some bits from the flow, and then you will miss many data. I removed it from the code above, and it's now working fine. So I'm able to use the eb500 as a server. Still not able to make it work as a client, but will continue to try.

    JM
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-06-20 15:29
    Hello,

    I do not claim to be an authority on Bluetooth Devices, but the limited knowledge I have tells me the stuff you’re doing uses the L2CAP layer (and possibly the baseband layer). That stuff doesn’t have anything to do with the Serial Port Profile. Think of it like a PC…You can plug your PC into a network…And it may have a Serial Port on it, but your web browser can’t directly access the serial port, but it can access the network. As for the server/client mode, you've steppped into a realm we are unable to help you in. On that I would recommend contacting A7 Engineering directly for further assitance with those issues.

    http://www.a7eng.com/support/support.htm



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • jmspaggijmspaggi Posts: 629
    edited 2008-06-20 16:26
    Hi Chris,

    I understand that my issue is more related to BT knowledge than the components and I agree with you. I found many hints using google, and I think I will continue to investivate with it.

    I have already sent an email to a7eng, but I think the issue is that the cell phone already reserved 0x1101 channel so when the eb500 try to connect to my MIDP application, it's instead connecting to something else hidden.

    I will post here what I found (if I found something) just to keep a record in case someone will face the same issues.

    Thanks again for your help,

    Regards,

    JM
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-06-20 19:10
    JM,

    Thanks for the offer to follow up. The subject of connecting Cell Phones to the EB500 has come up on these forums many times. The problem is either that the issue is never solved or those that do solve it move on and never share what they find. Because of this not everyone benefits from the knowledge. I hope you are able to solve your problem. And if you do, posting it here would help many others who will undoubtedly follow in your footsteps. I wish there was more we could do. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • jmspaggijmspaggi Posts: 629
    edited 2008-07-30 14:39
    Hi Chris,

    As promise, here is a sample application which is communicating between an EB500 and a cell phone.

    It's working only when the cell phone is the client and the Javelin the server. This is because the EB500 is able to communicate only on a single port (1101), and my cell phone is already listening to this port. So when the EB500 try to call the cell phone, it's not reaching the application, but some other cell phone internal application which I can't manage. (That's my understanding, but I'm not a BT expert, so maybe I'm wrong somewhere)

    So if you place the EB500 as a server, and then the cell phone as a client, it's working fine and I will now build a BT remote control of my Javelin application. In the attached files you have:

    DemoMDIlet.java: Cell phone side application. Connect to the EB500, send some letters to listen to the reply. Then display it.
    Eb500_test.java: Listen for a connexion, then read everything from the connexion and return it back to it (like an echo).

    It's pretty dirty, but it's more a proof of concept than a shining demo.

    You can reply here if you have any question. I will be happy to reply if I can.

    Regards,

    Jean-Marc
  • poulipouli Posts: 15
    edited 2009-08-19 08:21
    Hello jmspaggi,

    I am not sure if it matters but what i your mobile's brand and model ?
    The bluetooth module has been bought from parallax's store ?
    At the store they have several modules.
    I am not sure which one is the eb500.

    Have you tried to connect your Javelin to the mobile through USB (write a file for example) ?

    Thank you,
    Klearchos
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2009-08-19 08:29
    The eb500 module is discontinued.
    Instead you need the Easy Bluetooth module.
    http://www.parallax.com/Store/Accessories/Communication/tabid/161/CategoryID/36/List/0/Level/a/ProductID/550/Default.aspx?SortField=ProductName%2cProductName


    Unfortunately there are only Basic Stamp example programs.
    So you need to write some Javelin Classes.
    You can use the Eb500 class and modify it for the Easy Bluetooth.

    regards peter
  • jmspaggijmspaggi Posts: 629
    edited 2009-08-19 12:20
    Hi Klearchos,

    My phone brand was Nokia and the model was a 7110. I changed for another Nokia cell phone since.

    The eb500 was coming from Parallax, but as Peter is saying, it's not discontinued. I will not buy the new one because I will be able to do what I need with the eb500.

    I have not try to connect the Javelin to my cell phone through USB because the Javelin is not easy to access (hidden in the ceiling). That's why I need a remote access.

    If someone want to offer me the new bluetooth module, I will be happy to write the classes for it [noparse];)[/noparse]

    JM
  • poulipouli Posts: 15
    edited 2009-08-19 13:32
    JM,

    thank you a lot about the information and that you have shared with us the code for the eb500.
    Currently I want to find how to connect the Javelin or stamp through USB to a mobile.

    regards,
    pouli
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2009-08-19 13:43
    USB won't be easy, because it needs to be a USB host.
    You will need a serial to USB host module like USBWiz.
    Or the Vinculum: http://www.ftdichip.com/FTProducts.htm#Vinculum

    Then you probably need to access the usb slave (your mobile)
    using lowlevel usb commands because there will not be a standard
    driver that works with your phone.

    regards peter
  • poulipouli Posts: 15
    edited 2009-08-19 15:29
    I see.
    Sorry for my wrong assumptions and wrong way of thinking.
    You see I am a developer and not an electronic engineer [noparse]:)[/noparse]

    Basically I want to make my applet communicate with the Javelin.
    Maybe I do not need to write on the USB if I can open a channel directly to the applet from Javelin.

    I am thinking now not to use USB because I will have to use it later on since direct conection is not possible.

    I was thinking (if it is possible) having a DSL router (with WiFi suport) and connect all of them there:
    1. Javelin
    2. Mobile with applet (through WiFi)
    3. other devices....

    But the problem again is how I will connect the Javelin with the WiFi.
    I suppose that there is something ready like a tiny small web server.
    I know that it exists.

    Possibly if I use a tiny web server and connect the Javelin with this somehow.
    I will be able to control the Javelin through my mobile (over the Internet or LAN) if required

    I am quite ambitious for my basic electronic knowledge I know [noparse]:)[/noparse]
    But I think that with your help I will be able to do it finally.

    Thank you,
    pouli
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2009-08-19 15:40
    To control the javelin via LAN (or wireless access point, or router with WiFi), you can use
    the Parallax PINK webserver.
    There is a class for the PINK module.·The javelin can send AND receive
    udp packets using the PINK. All you·need on the 'other' side is a program that
    relays udp packets to and from your mobile.

    regards·peter
    ·
  • poulipouli Posts: 15
    edited 2009-08-19 15:48
    Peter Verkaik said...
    To control the javelin via LAN (or wireless access point, or router with WiFi), you can use
    the Parallax PINK webserver.
    There is a class for the PINK module. The javelin can send AND receive
    udp packets using the PINK. All you need on the 'other' side is a program that
    relays udp packets to and from your mobile.

    regards peter


    Peter,

    thank you a lot.
    I will read how and what I can do with PINK.
    But I think that this is what I need.
    It will free my hands from many problems.

    Thank you,
    Pouli
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2009-08-19 15:56
    Here is the PINK class.
    The javelin interfaces to the PINK using uarts.

    regards peter
Sign In or Register to comment.