Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

AT Commands and RS232


  • Please log in to reply
17 replies to this topic

#1 StefanoZ

StefanoZ

    Member

  • Members
  • PipPip
  • 16 posts

Posted 07 January 2011 - 11:03 AM

Hi gurus, First of all let me wish you a healthy and successful 2011! I am trying to interface an old Ericsson T28 mobile phone to the Netduino using its phone data cable (why buying a new GSM shield if my drawers are filled with electronic waste?). I successfully interfaced this mobile phone using Windows Hyper Terminal but I am not able to achieve the same result with the Netduino. This is the problem. - I open the COM1; - I send an "AT\r" command to the COM1; - I read the COM1 and I find the same 3 bytes I sent ("AT\r") instead of the "OK" answer. Is it correct to use the \r to close the message string? Is it correct that the COM1.write works even if the mobile phone is not connected? What do you think I need to check? Bye! Stefano.

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 07 January 2011 - 08:35 PM

Hi StefanoZ, First of all, are you using an RS232 expansion shield for the Netduino? The D0/D1 pins (COM1) are 0/3.3V, not -12V/12V like RS232... Also, could you please provide a bit of guidance on how you're wiring the two together? There should be three pins (Netduino TX to phone RX, Netduino RX to phone TX, Netduino GND to phone GND). Chris

#3 StefanoZ

StefanoZ

    Member

  • Members
  • PipPip
  • 16 posts

Posted 08 January 2011 - 12:38 PM

Hi StefanoZ,

First of all, are you using an RS232 expansion shield for the Netduino? The D0/D1 pins (COM1) are 0/3.3V, not -12V/12V like RS232...

Also, could you please provide a bit of guidance on how you're wiring the two together? There should be three pins (Netduino TX to phone RX, Netduino RX to phone TX, Netduino GND to phone GND).

Chris


Hi Chris,

thank you very much for your reply. No, I'm not using an RS232 shield. Probably this is the problem!!!
I wired the phone and the netduino together as you mentioned: phone rx to netduino tx, phone tx to netduino rx, phone ground to netduino ground.

I will search for an RS232 shield.

Bye!

Stefano.

#4 StefanoZ

StefanoZ

    Member

  • Members
  • PipPip
  • 16 posts

Posted 08 January 2011 - 01:18 PM

Chris, is it really necessary to buy a RS232 shield? I used a FTDI cable to interface the netduino with my computer and this works fine! Is it possible to make something similar? I really appreciate your help. Stefano.

#5 Fred

Fred

    Advanced Member

  • Members
  • PipPipPip
  • 302 posts
  • LocationUK

Posted 08 January 2011 - 01:30 PM

Of course if you need +/-12V RS232, there's always the Netduino Mini which has one onboard. You'll then need an RS232 TTL cable to program it. It may or may not be a more suitable solution than a standard Netduino with RS232 shield.

#6 Fred

Fred

    Advanced Member

  • Members
  • PipPipPip
  • 302 posts
  • LocationUK

Posted 08 January 2011 - 01:34 PM

Cross-post... What's the FTDI cable that you've got? If it's USB to Serial TTL then you could use it to connect to a Netduino Mini to program it. If it's RS232 to Serial TTL then this should do the job of a RS232 shield.

#7 StefanoZ

StefanoZ

    Member

  • Members
  • PipPip
  • 16 posts

Posted 08 January 2011 - 01:55 PM

Hi, thank you very much for your help. The FTDI cable I have is a USB to Serial TTL. So I need to buy the RS232 shield. One more question: is it necessary to use a 12V power supply for the Netduino to use the RS232 shield? Bye! Stefano.

#8 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 08 January 2011 - 06:50 PM

Hi Stefano, You can communicate between the PC and your Netduino using a 3.3V USB-TTL cable. The RS232 shield is only necessary if you're communicating between the Netduino and an RS232 device. You do not need a 12V power supply for the Netduino when using an RS232 shield. Chris

#9 Fred

Fred

    Advanced Member

  • Members
  • PipPipPip
  • 302 posts
  • LocationUK

Posted 08 January 2011 - 09:38 PM

I just happen to have a Sony Ericsson lying around, so may well look at doing this sort of thing when I get a chance.

A quick google around suggests that the communication with the phone could be either 0-3.3V or 0-5V (depending on model) rather that +/-12V RS232 levels. You may find the SE data cable is dropping the +/-12V from the PC down to these levels at the phone end. If you investigate a bit further it might be possible to avoid the need for a RS232 shield. I could well be wrong though.

#10 StefanoZ

StefanoZ

    Member

  • Members
  • PipPip
  • 16 posts

Posted 09 January 2011 - 10:00 AM

Thank you Chris and Fred! I will check if the SE data cable converts from -12/12 to 0-3.3 or 0-5. I will let you know asap.

#11 StefanoZ

StefanoZ

    Member

  • Members
  • PipPip
  • 16 posts

Posted 12 January 2011 - 03:23 PM

Hello,

I have THIS.

Do you think it could be fine?

Bye.

Stefano.

#12 StefanoZ

StefanoZ

    Member

  • Members
  • PipPip
  • 16 posts

Posted 12 January 2011 - 09:38 PM

Nothing. The RS232 shifter does not work. The T28 data cable I have is THIS. There is a MAX3232 inside. So now I'm a little bit confused. The data cable is compliant with the RS232 specifications (it works with the PC serial port). The shifter should convert from standard rs232 to ttl. Why does this not work? Uhm...

#13 StefanoZ

StefanoZ

    Member

  • Members
  • PipPip
  • 16 posts

Posted 12 January 2011 - 09:47 PM

Ok, probably I bought the wrong shift register. I found this in the compatible shield section.

URF!

#14 StefanoZ

StefanoZ

    Member

  • Members
  • PipPip
  • 16 posts

Posted 03 February 2011 - 10:15 PM

Ok, probably I bought the wrong shift register. I found this in the compatible shield section.

URF!


Ok, now I have the right rs232 shifter, but nothing to do.
When I send something to the serial port, the RX led flash, but I did not receive anything.

So, now I would like to test separately each component. What is the best way to verify that the rs232 shifter is working fine? Is it possible to connect TX to RX on the serial cable to see that I receive what I sent? Any other way to test the rs232 shifter?

Fortunately today the weather is very cold so the window is closed and I cannot throw everything outside!!! ;)

#15 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 03 February 2011 - 11:10 PM

StefanoZ, If you connect TX and RX together, you'll receive the same data you transmit. If you get the data back, then the transmitter/receive circuitry is working properly. If you have a diagram (Frtizing, perhaps) of how you have things hooked up, we might be able to offer insights along those lines as well... Chris

#16 StefanoZ

StefanoZ

    Member

  • Members
  • PipPip
  • 16 posts

Posted 05 February 2011 - 02:21 PM

Hello, the rs232 shifter seems to work. It is linked in this way: vcc to 3.3 volt ground to ground tx to rx rx to tx As you suggested, I linked together pin 2 and pin 3 of the rs232 shifter connector. When I send something the rx led blinks, the tx led blinks and I receive back what I send. Now I'm trying to link the phone again. Perhaps the problem is the AT command line terminator...

#17 StefanoZ

StefanoZ

    Member

  • Members
  • PipPip
  • 16 posts

Posted 22 February 2011 - 08:11 AM

White flag! I give it up! Finally I decided to buy the Sparkfun Cellular Shield. It works fine!!! Now I have only a problem regarding power consumption. I will open a new topic for this. Thank you all for your suggestions. Ste.

#18 Pete

Pete

    Member

  • Members
  • PipPip
  • 10 posts

Posted 20 August 2011 - 02:32 AM

A lot of modems default to echoing back the transmitted characters, so if you transmit "AT\r" you should receive back the same "AT\r" and then the response afterwards (something like "\rOK\r"). You can usually disable this by sending the command ATE0.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.