Shop OBEX P1 Docs P2 Docs Learn Events
Connect Mobile Phone to BS2 — Parallax Forums

Connect Mobile Phone to BS2

vitaly1213vitaly1213 Posts: 10
edited 2011-05-07 09:29 in BASIC Stamp
Hello,

I am trying connect Nokia (6230i) with Board Education USB (BS2sx), but without success. I have read,already, many topics about this information, but in the Internet not enough infromation for me to understand how to do this.
I connect Nokia thorough cable DKU-2 to the Sout and Sin to BS2sx, also i was trying connect to the USB. I use baud rate 9600 (8-bit; no-parity; inverted 16624) and 4800(also was trying).
This is the code I use to communicate with mobile phone (AT commands):

SEROUT 16, 16624, [ "AT" , CR] '16 pin is for serial output
'DEBUG "AT"
SERIN 16, 16624,[ WAIT ( "OK" )]
DEBUG "OK"

Please, HELP me to understand why I couldn't get answer from mobile phone.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-03-17 06:34
    The DKU-2 cable is a Nokia to USB host cable, designed to allow a Nokia phone to connect to a PC. You cannot use this to try to connect to a Stamp. It doesn't work to plug it into the Board of Education's USB connector. They are both USB clients and a USB connection needs a host and a client.

    A USB host would be a PC or, in some cases, something like the Parallax Memory Stick Datalogger which is designed to allow you to plug in USB Memory Sticks (another USB client) to a Stamp. The control chip on the Datalogger can handle some other types of USB client devices, but it's not clear whether that would include something like the Nokia. In addition, you'd need information about the internal USB registers of the Nokia that is probably not available.
  • vitaly1213vitaly1213 Posts: 10
    edited 2011-03-17 08:49
    I found in the forum (http://www.picbasic.co.uk/forum/showthread.php?t=219&page=6) that one person had already done this project with BS2. I also tried to do as this person did and I didn't menage and as well I connect to Sout and Sin because all BS2 models have a line receiver on its SIN pin (Rpin = 16), and Nokia need RS-323 to communicate with microcontoller. I think there is way out of the situation.

    Here is the code:
    Connection
    1.DKU-5 cable connected to the Nokia phone.
    2.a male type connector connected to the other end of the DKU-5 cable
    3.from that connector I set up the connection to the basic stamp2 as shown above.
    4.by the following bs2 code I successfully sent sms
    SEROUT 1, 16572,25, [ "AT+CMGF=1" , CR]
    SERIN 3, 16572,[ WAIT ( "OK" )]
    SEROUT 1,16572,25,["AT+CMGS=",34,"+880191787670",34,CR]
    SERIN 3, 16572, [WAIT (">")]
    SEROUT 1, 16572, [“hello”,CR]
    SEROUT 1, 16572, [26,CR]
    SERIN 3, 16572, [WAIT ("OK")]
    DEBUG "ok"
  • FranklinFranklin Posts: 4,747
    edited 2011-03-17 09:05
    They are not using the USB connector so we will need to see how you have yours connected. As Mike says you can't use the USB connector and will need to use other pins and modify the code as needed.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-03-17 09:11
    As far as I can tell, the DKU-5 cable is also a USB cable, not an RS232 cable. You MUST have a cable that has a DB-9 connector on the PC end and is designed to connect to an RS232 serial port on the PC.

    If you use SOUT and SIN, you need to remember that anything sent from the Nokia will be echoed back to the Nokia. This is a result of the RS232 interface circuitry in the Stamp. I don't know how the Nokia will respond to this echoing. Some devices get errors from this.
  • vitaly1213vitaly1213 Posts: 10
    edited 2011-03-17 09:38
    OK, I understand that if I want to connect for example Education Board USB (with BS2sx) I must to do RS232 connection like at this scheme.
    After this i can RX and TX connect to the PINs (Education Board USB) and try to communicate with phone. Is it correct?
    rs-232.JPG
    853 x 668 - 57K
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-03-17 11:20
    [A couple of years ago, Kickliter was doing something with a Motorola (280i?), its headphone jack enabled access via AT/modem commands and such. As I recall, it never really got nailed down; no "Eureka" moment.]

    PE -- It was a c168i
    http://forums.parallax.com/showthread.php?105901-Motorola-c168i-Cell-Phone-and-Propeller&highlight=Motorola
    There's some info, but, like I posted, it's sketchy, speculative.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-03-17 12:09
    The circuit you've shown (with the MAX232) would be ideal since the MAX232 properly converts the 5V logic signals from the Stamp to the RS232 signals on the DB-9. As I mentioned, the SOUT and SIN signals are not really RS232. They usually work, especially for programming purposes, but they're not quite correct for general RS232 use.

    That said, the cables you've shown are all USB cables and, as I've said, won't work with the Stamp. If you can find some cable for the Nokia designed for use with an RS232 port, you may be able to get this to work. No guarantees. Nokia only supports this with their own software.
  • vitaly1213vitaly1213 Posts: 10
    edited 2011-03-18 06:08
    OK, thanks for all your replays... I will work it out and will write about my results.

    Vitaly.
  • vitaly1213vitaly1213 Posts: 10
    edited 2011-03-18 14:30
    Please, could you tell me if I need rs323 interface in this project and also level translation form 5v(BasicStamp) to 3v(Mobile Phone)? Is it right? What could you advice in this case?
  • Mike GreenMike Green Posts: 23,101
    edited 2011-03-18 15:32
    First you have to find a proper cable for the Nokia. The documentation for the cable will tell you whether it expects RS232 or 5V logic or 3.3V logic levels. I suspect most serial cables will provide / expect RS232 voltage levels, but don't make assumptions. If you guess wrong, you can damage the phone or the Stamp.
  • pgbpsupgbpsu Posts: 460
    edited 2011-03-18 19:04
    PJ Allen is correct that Jay has worked on this using a propeller. He actually did get it working. You can find code examples in Jay's thread:
    http://forums.parallax.com/showthread.php?107112-Cell-phone-text-message-email-interface

    I used his work as a basis for a system of my own. It's a cell-phone based maple sap collection and temperature logging system. If you're interested you can see it action at:


    Unfortunately none of this helps with your phone. If you are able to switch to the Motorola c168i there's info on the prop forum. These phones can still be had on eBay but only work with GSM networks. It has a serial port and removes any need for this USB stuff. MUCH easier in my opinion. I don't frequent the BS2 forum (I'm a propeller head). pm me if you want more info about using the Motorola phone.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-03-18 19:22
    [Well, how about that. Unfortunate that Jay didn't update his original subject.]
  • vitaly1213vitaly1213 Posts: 10
    edited 2011-05-06 13:42
    Hello to everybody who was interested in this project!!! I have done it! I have connected mobile phone to the BS2 and I can control mobile with AT commands. If any question about this project, you are welcomed.
    Thank you for your help.

    Vitaly
  • FranklinFranklin Posts: 4,747
    edited 2011-05-06 14:46
    Can you turn off the unsolved tag?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-05-06 18:15
    Another guy has worked out the Android angle, if you're interested.
  • vitaly1213vitaly1213 Posts: 10
    edited 2011-05-07 09:25
    I don't know how to do this! Could you advice me how to do this?
  • LeonLeon Posts: 7,620
    edited 2011-05-07 09:29
    Edit the thread title!
Sign In or Register to comment.