Send data to database in server with wip at commads


#1

Hi.

I need send data to database ina server with at commands. I need insert the data in the next chart:

unit date tank1 tank2 tank3 state

Here a direction through which are sent the data:

www.xxxxxxxxxxxxxxx.com.mx/Demo/clases/MovimientosW.php?Unit=201
0069468&Date=25-01-2010%2011:20:00&Tank1=200&Tank2=123&Tank3=
012&State=E

The data are sent through the previous league, but not as making the connection to send data to each field,I am not sure but i have done this:

at+wipcfg=1
OK
at+wipcfg=3
WIP Soft v501 on Open AT OS v610
Aug 21 2008 17:38:37 WIPlib:v5a03 WIPSoft:3a04a
OK
at+cmee=1
OK
at+wipbr=1,6
OK
at+wipbr=2,6,11,“APN”
OK
at+wipbr=2,6,0,“user”
OK
at+wipbr=2,6,1,“password”
OK
at+wipbr=4,6,0
OK
at+wipbr=3,6,15
+WIPBR: 6,15,“10.4.138.146”

OK
at+wipcreate=2,1,“www.xxxxxxxxxx.com.mx”,80
OK

+WIPREADY: 2,1
at+wipdata=2,1,1
CONNECT

Up here every good, but not as insert the data in each field and not meeting documentation of how to do,

Please somebody help me, is urgent


#2

So you’re encoding your data into the URL?

Therefore, you’ll need to make the appropriate HTTP Request to that URL, won’t you…?


#3

Good day, thank you for your response; no, the data is not are encoded, a partner undertook this task in C language but does not work properly and gave me the league of previous message and said that the data are sent through the league. The parameter “=” indicates the data to send to each field. the values after the “=” are the ones that require insert in the database.

Please need to know how to send data to the address.


#4

Hi awneil, have you messenger to communicate more quickly?


#5

OK, maybe “embedded” would be a better word: the data you are sending is actually embedded into the URL - isn’t it?

That is, the URL is made-up from the data values.

You are passing your data as a Query String as part of the URL - see: en.wikipedia.org/wiki/Query_string

But you aren’t actually sending any “payload” data here at all, are you?

Everything is in the URL - isn’t it?
There isn’t anything else to send.

You might find this HTTP tutorial useful: jmarshall.com/easy/http/


#6

yes, the url is made from data values, as i read wikipedia, but how i do this with at commands. I think that i have to start a http session but do not get done. please help


#7

Have you read the WIP AT Commands manual?
Especially the examples…


#8

Yes, i read the examples, in fact i have been trying, but i see no way to do so, i have only a manual, there are more?
i have this WIPAT_Commands_User_Guide_V5_11.pdf


#9

That’s the one.

Look at section 9.5, the HTTP example - it shows you how to connect to the HTTP server, and howto issue a GET request.

That should be sufficient - shouldn’t it?


#10

I read the example of http but this returns +cme error: 3 to write at+wipcreate=5,1,“xxxxxxx”,80

Only accepts at+wipcreate=2,1,…


#11

Hmmm - so HTTP fails (“not allowed”), but TCP works.

Could this be another case where your modem doesn’t have the necessary “Commercial Features” enabled?

See: https://forum.sierrawireless.com/t/smtp-internet-protocol-feature-not-activated/3845/9

And: https://forum.sierrawireless.com/t/faq-forum-wiki/3491/15

You should talk to your Distributor about this!


#12

Hi again here, i continue to work, talk to my distributor and gave me a code of activation, writing at+wipfile=5,1,“www.xxxxx.xxx”,etc. mark +cme error 839 “error during creation of channel” What am i doing wrong?

In addition, are possible my pretenses?


#13

Hi again, i am finalized the project, but to write:
at+wipfile=5,1,1,“http://www.abcdefghijklmn.com.mx/xxxx/xxxx/xxxxxxxW.p
hp?Unit=2010480418&Date=15-04-2010%2015:50:00&Tank=000&Tank2=000&Tank3
=000&State=A”

return this:

CONNECT

+WIPFILE: 5,1,1,200,“OK”

But not data is stored in the DB

the “” is the only character that returns. how i do it wrong?

I tried with put, post method and nothing.

Please beg help!!!


#14

This means that your HTTP server has accepted the Request, and returned the “OK” (code 200) response to you.

Therefore the modem has done its job - it has made a request to the Server, and the server has accepted it.

You need to be looking on the Server to determine why it accepted the Request, but then didn’t store the data…


#15

To make a request to the page xxxxxxxxxx.com.mx/ejem.htm should return “hello” but nothing, appears CONNECT and responds only to the sequence “+++”

I’m using the same code to send data to the DB only I change the URL, If i conclude that i have finished all, because i need a true response of server.

I put the url xxxxxxxxxx.com.mx/ejem.htm in the browser and it return “hello” correctly. what i need to do it? I try all but nothing works.

Here the code:
at+cgatt=1
at+cmee=1
at+wipcfg=1
at+wipbr=1,6
at+wipbr=2,6,11,“APN”
at+wipbr=2,6,0,“user”
at+wipbr=2,6,1,“password”
at+wipbr=6,6,0
at+wipbr=4,6,0
at+wipopt=5,1,1,51
at+wipopt=5,1,2,53,6
at+wipcreate=5,1,“http://www.xxxxxxxxxxx.com.mx/ejem.htm”,80
at+wipfile=5,1,1,“http://www.xxxxxxxxxxx.com.mx/ejem.htm

need something else?


#16

Hi again, i made it, i send data to the DB. The DB had an error but all resolved Thank you very much.