Cellphone to BS2P Comms problem
John Bond
Posts: 369
Hi
I'm working on a project which uses a Siemens Industrial Cell Phone to transmit and receive SMS data from a BS2p. It communicates with the BS2 using RS232 using a MAX232 IC and flow control. The cellphone uses the AT commands.
The cellphone receives the various AT commands and responds correctly but the data is received all garbled by the stamp. I've made a data sniffer and, by using 2 pcs, I am able to watch what is happening in each direction on the RS232. All the characters are correct on the RS232. The Stamp interprets the first character correctly but the remaining characters are mostly in the ASCII 150 to 255 range. Also, about half the characters are missing.
It is almost as though flow control isn't working. But, if you disconnect RTS CTS. the cellphone doesnt download anything.
We've simulated Cellphone to PC and PC to Stamp and these work fine (though, maybe the PC downloads character more slowly than the cellphone). The RTS CTS is working correctly on the PC
The baud rate is correct, we've tried without the MAX232, inverting the signal, ·with the same results. We've even tried the circuit at 2400 baud without success.
THIS HAS BEEN GOING ON FOR WEEKS.
PLEASE HELP
kind regards from Kwa Dukuza
John Bond
·
I'm working on a project which uses a Siemens Industrial Cell Phone to transmit and receive SMS data from a BS2p. It communicates with the BS2 using RS232 using a MAX232 IC and flow control. The cellphone uses the AT commands.
The cellphone receives the various AT commands and responds correctly but the data is received all garbled by the stamp. I've made a data sniffer and, by using 2 pcs, I am able to watch what is happening in each direction on the RS232. All the characters are correct on the RS232. The Stamp interprets the first character correctly but the remaining characters are mostly in the ASCII 150 to 255 range. Also, about half the characters are missing.
It is almost as though flow control isn't working. But, if you disconnect RTS CTS. the cellphone doesnt download anything.
We've simulated Cellphone to PC and PC to Stamp and these work fine (though, maybe the PC downloads character more slowly than the cellphone). The RTS CTS is working correctly on the PC
The baud rate is correct, we've tried without the MAX232, inverting the signal, ·with the same results. We've even tried the circuit at 2400 baud without success.
THIS HAS BEEN GOING ON FOR WEEKS.
PLEASE HELP
kind regards from Kwa Dukuza
John Bond
·
Comments
A difference between signal ground and chassis ground?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
http://ca.geocities.com/steve.brady@rogers.com/index.html
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
·· When you say you tried inverting the signal, did you try using inverted baud mode in the baud rate settings?· Also, if you tried this without the MAX232, are you sure the Stamp pins are still intact?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
- The pins are still OK, Ive got a 2K resistor between BS2P and MAX232.
- The only ground link between modem and stamp is through the RS232 cable. That appears OK
Kind regards from Kwa Dukuza
John Bond
Sounds like a baud rate mismatch too me.· Double check that you are using the correct baudrate setting·for the PBASIC for the stamp you are using.· I once·wasted considerable time because I was using a BS2sx setting with a BS2.
**Another thought - the correct first character and wrong ones after it would indicate that you have a incorrect stop bit setting - again, check that you have the correct baudrate/startbit/stopbit code for the stamp you are using**
Nate
Im fairly sure it isn't baud rate...
Same baud rate works - Between the Stamp and the PC
Same Baud rate works - Between the Cellphone and the PC
Same baud rate works - when we sniff the port on either the Cellphone or the Stamp
We've run it this way at 200, 2400, 9600. The above applies to all baud rates
We've tried inverting the bits - nothing works, no pc no cellphone no stamp
We've removed the MAX232 and inverted the bits - Everyting works but data from the stamp is still garbled
We' ve tried changing handshake, 7Bit etc but nothing works.
We've tried switching the handshaking manually, we can't do it quickly enough.
Both of us have tried these and many other "fixes" over the last two weeks, but without success!! We have even simulated the Stamp program in VB on the PC and this works perfectly!!!
As I said earlier, it is almost as if the cellphone accepts handshaking on the incomming side but doesn't use it when it sends out information.
We must be missing something stupid.
John Bond in Kwa Dukuza - (I'm as lost on this project as Kwa Dukuza is in Darkest Africa)
I've had luck troubleshooting serial comm. problems by looking closely at the garbled data.· You say you get the first character correctly?· Is the data that follows true garbage (ie seemingly random letters, numbers and characters) or is it the data you want but missing characters?·
Sometimes by looking at the binary string sent (binary or decimal representation therof, NOT the ASCII values)·and comparing it to the·recieved data you will see a pattern that will tell you exactly is wrong.· Send a simple string and compare it to what the stamp says it recieves and see if there is a commonality (ie off by one, shifted, inverted, missing a bit,·etc.).
Nate
Post Edited (Nate) : 6/15/2005 9:22:08 PM GMT
This is a very useful tip - Thanks.
I won't get to try it out for a couple of days but I'll get back to you by Monday.
Kind Regards from Etekwini (The new name for Durban)
John Bond