0

I'm using an Arduino uno with a SIM900 GSM shield. I'm trying to connect the Arduino to my (ASP MVC) website. I've written an API which i've successfully tested with postman, and whilst the GET Command works fine, I've had no success with POSTING data as yet. Using the arduino to echo serial monitor input, I've done the following...

So, some setup commands

 AT+CGATT?
 AT+SAPBR=3,1,"CONTYPE","GPRS"
 AT+SAPBR=3,1,"APN","internet" (vodafone UK parameters
 AT+SAPBR=3,1,"USER","web"
 AT+SAPBR=3,1,"PWD","web"
 AT+SAPBR=1,1
 AT+SAPBR=2,1 (confirms i have an IP address)

i then do the following...

 AT+HTTPINIT
 AT+HTTPPARA="CID",1
 AT+HTTPPARA="PROIP","212.183.137.12" (vodafone uk proxy settings)
 AT+HTTPPARA="PROPORT","8799"
 AT+HTTPPARA="CONTENT","application/json"
 AT+HTTPPARA="URL","http://mywebsite.co.uk/api/obs"
 AT+HTTPDATA=83, 10000 (gives the download command).
 {"SensorName": "TestSensor", "ObsValue": 31, "ObsDateTime": "2017-10-01T03:30:00"}
 AT+HTTPACTION=1

and I just get an "OK" back, no httpaction response, and no data stored on the database.

Is there anything I'm doing that is obviously wrong? Does HTTPACTION come before the data?

Are there commands I can use to check the status of my http session on the GSM board? to confirm that my settings are correct?

Finally, I keep getting messages like

 +CREG: 1,"002A","0F48"

Always the 1 (presumably the CID i'm using), and always the 002A, but the final part varies.

Any help would be hugely welcome. Thanks.

asked Oct 3, 2017 at 16:30
4
  • Check the web server logs, and sniff your network traffic for port 83 using whatever tools are suitable for your operating system. Put the SIM in a phone and try browsing the web - it may need activating first and Vodaphone are redirecting the traffic to their own activation page. Commented Oct 3, 2017 at 16:47
  • Also I have never had to use a proxy with GSM access on vodaphone. Try without. Commented Oct 3, 2017 at 16:48
  • this is a sim i've taken from an IPAD, and had been working fine. Before I put the proxy stuff in, I was getting a 602 DNS error on my GET command, but I can give it a go :) My website is being hosted on a commercial hosting site (1and1) so I'm not sure whether sniffing traffic is a viable option, but many thanks for the suggestiongs Commented Oct 3, 2017 at 18:10
  • so, I removed the proxy settings - and its worked! once - still thats more often than before. Commented Oct 7, 2017 at 21:40

1 Answer 1

1
+CREG: 1,"002A","0F48"

That's the registration status. "1" is "Registered on your 'home' network", "002A" is your LAC (Location Area Code) and "0F48" is the Cell ID (CI).

answered Oct 3, 2017 at 16:46
1
  • so these are just messages when the serving cell changes? Having left the serial monitor up for a while, I do see the same numbers repeating - thanks for the info. Commented Oct 3, 2017 at 18:11

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.