Go Down

Topic: SOLVED: Send EMAIL using SIM-5320 (3G) HELP please! (Read 2367 times) previous topic - next topic

lastchancename

Aug 17, 2016, 06:32 am Last Edit: Aug 30, 2016, 07:46 am by lastchancename
SOLVED - SEE LAST REPLY
Trying to use current model SIMCOM 5320 modem to end email...
Sooo close, but no prize - yet.s

Unfortunately, it's a bit different to the SIM900, as it implements a newer version of the AT command set.

Is there anyone here that can help, or has experience in what I'm missing?
Should I revert to the 'old' AT email commands - or will they become extinct within my lifetime!?

POWER ON - FIRST attempt
Quote
AT+CGATT=1 OK
AT+CGDCONT=1, "IP", "internet", "0.0.0.0"
AT+CGACT=1, 1 OK
AT+CGPADDR=1 >> +CGPADDR: 1,"10.146.53.134"  <<==  ASSIGNED IP ADDRESS
AT+CSMTPSSRV="smtp.optusnet.com.au", 465, 2
AT+CSMTPSAUTH=0
AT+CSMTPSFROM="a_user@gmail.com"
AT+CSMTPSRCPT=0,0,"b_user@gmail.com", "Controller Report"
AT+CSMTPSSUB=17
   Controller Report
AT+CSMTPSBODY=62
   internode test
   Test message body
   on multiple lines
   We 22:50
OK
>
+CSMTPSSEND: 8  <<== NETWORK ERROR
Immediately after - make SECOND attempt
Quote
AT+CGATT=1 OK
AT+CGDCONT=1, "IP", "internet", "0.0.0.0"
AT+CGACT=1, 1 OK
AT+CGPADDR=1 >> +CGPADDR: 1,"0.0.0.0"  <<==  IP ADDRESS HAS GONE ??!
AT+CSMTPSSRV="smtp.optusnet.com.au", 465, 2
AT+CSMTPSAUTH=0
AT+CSMTPSFROM="a_user@gmail.com"
AT+CSMTPSRCPT=0,0,"b_user@gmail.com", "Controller Report"
AT+CSMTPSSUB=17
   ControlMate Report
AT+CSMTPSBODY=62
   internode test
   Test message body
   on multiple lines
   We 22:53
+CSMTPSSEND: 255  <<== UNKNOWN ERROR
>
Note the IP address has gone on the second attempt!
I didn't drop the connection
I tried with optus and gmail servers - same result

Finally power cycle - then a THIRD attempt - result identical to the FIRST
Which makes me think the modem is receiving all the commands - and getting into 'a mode' where it won't accept another 'send' until the previous one is sent, or the modem is power cycled (clearing the operational states)

http://www.edaboard.com/thread125473.html seems to suggest we're doing the right stuff...
The lost IP address may occur because I'm establishing the connection 'again' - but I don't think so.
Ask the right question, which can be hard for beginners, but this doesn't mean that google is broken.
Experienced responders have a nose for laziness, (they were beginners once)... expecting the poster to contribute to the learning experience.

acitta

I have a 3G module in the post so I can't help yet but maybe once it arrives we can collaborate. I did however buy the sim5216 because there appears to be a lot more AT command manuals related to HTTP access. I'm not sure what the difference the two modules is though. The sim800-900 had very similar AT commands, so with any luck the 5216 and 5320 will be similar too. Have you tried using the SIM5216 at command manual?

I also can't remember exactly why, but there was a reason I couldn't use SIM900 modules with my gmail account. I think it was to do with port access on googles end not allowing the type of connection the GSM module makes. Not sure if the SIM5320 has a way around that

lastchancename

Thanks for the thoughts.
I'lll take a look at the 5216 ref. manuals...  as noted above, the 5320 implements BOTH the older SMTP commands, as well as the newer CSMTPSxx commands - which I decided to go with for future-proof compatibility - but if it gets too hard, I'll fall back to the older commands for now.

There are a number of error possibilities - and only these two show up...
    8=NETWORK ERROR
    255=UNKNOWN ERROR
...Are the least helpful... !

There are specific error responses for server, recipient, authentication etc - but they all seem to be for 'later' (!)
Ask the right question, which can be hard for beginners, but this doesn't mean that google is broken.
Experienced responders have a nose for laziness, (they were beginners once)... expecting the poster to contribute to the learning experience.

lastchancename

SOLVED
The sequence that worked - as below

Quote
AT+CGDCONT=1, "IP", "myAPN", "0.0.0.0" >>
AT+CGATT=1 OK
  <takes ~5 secs>
AT+CGACT=1, 1 >>
+CGPADDR: 1,"10.146.90.214"       << == assigned DHCP from carrier
AT+CSMTPSSRV="smtp.optusnet.com.au", 25, 1
AT+CSMTPSAUTH=0
AT+CSMTPSFROM="sendername@optusnet.com.au"
AT+CSMTPSRCPT=0,0,"recipient@destination.net", "Test Report"
AT+CSMTPSSUB=38
  ControlMate [Test Board] Status Report
AT+CSMTPSBODY=66
  Version 160830
  NEW Test message
  body
  on multiple
  lines
Tu 15:44
>> SENDING...
  <takes ~5 secs>
+CSMTPSSEND: 0

AT+CGACT=0, 1 OK
AT+CGATT=0 OK
AT+CGDCONT=1 OK
Not sure what I changed - perhaps it's just the weather.
Ask the right question, which can be hard for beginners, but this doesn't mean that google is broken.
Experienced responders have a nose for laziness, (they were beginners once)... expecting the poster to contribute to the learning experience.

AndyM

I know this thread is over 12 months old,but I have only recently purchased the Tinysine 3G shield.(uses SIM 5320)
Is there any update on your work?

Thanks

lastchancename

I hadn't been playing with the GPRS (data) side of things - but this code certainly worked last time I touched it.
I suspect it could be tweaked a bit for efficiency - but it was robust - which counts!

My current call in-out /SMS tools are asynchronous - and I really should upgrade this as well - so the main loop() never blocks while the modem is working in the background
Ask the right question, which can be hard for beginners, but this doesn't mean that google is broken.
Experienced responders have a nose for laziness, (they were beginners once)... expecting the poster to contribute to the learning experience.

Go Up