DynDns Get, Authorisation

Hello I’m just trying to update IP, for a Domain name, from a Q2686 using Dyndns.org. This requires a GET with username password. I have coded as follows:

wm_sprintf( temp50,"GET /nic/update?hostname=xxxxxxxx.dyndns.org&myip=");
wip_write(c,temp50,strlen(temp50));
wip_write(c,ipaddress,strlen(ipaddress));
            wm_sprintf( temp50, "\r\n");
wip_write(c,temp50,strlen(temp50));
wm_sprintf( temp50, "Content-Type: application/x-www-form-urlencoded\r\n");
wip_write(c,temp50,strlen(temp50));
wm_sprintf( temp50, "User-Agent: mlcclient/1.0\r\n");
wip_write(c,temp50,strlen(temp50));
wm_sprintf( temp50, "Host: members.dyndns.org\r\n");
wip_write(c,temp50,strlen(temp50));
wm_sprintf( temp50, "Connection: Keep-Alive\r\n");
wip_write(c,temp50,strlen(temp50));
wm_sprintf( temp50, "Authorization: Basic bWxjYXxxxXI6bWF4GVhZDE=");
wip_write(c,temp50,strlen(temp50));
wm_sprintf( temp50, "\r\n\r\n");
wip_write(c,temp50,strlen(temp50));

I get a “badauth” respsonse

I sniffed the encoded usercode and password out of a browser.
Could anyone demostrate how to encode the username pasword correctly.
Thanks Mark.

Have you coded an update client on any other platform?

I would suggest that you do it first on a more “conventional” platform - so that you can get something that works without having to worry about all the extra complexities of GPRS and Open-AT.

Once you have the basic process working, then you can move on to overcoming the peculiarities of GPRS and Open-AT!

You are not checking the return value from wip_write…

yes have it working from browser No Problem.
Just need the base64 encoding sorted, if you can help there?

Sorted just needed HTTP/1.1 after the IP address

don’t forget to check the return value from wip_write - you must not just assume that it has sent everything!

Hi,

I have another problems, I can connect with DynDNS, but I obtain a “badagent” response. This is the connection sequence:

AT+WIPCREATE=5,1,“http://username:password@members.dyndns.org/nic/update?hostname=hostname.dnsalias.com&myip=192.168.0.1&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG

OK

+WIPREADY: 5, 1
AT+WIPOPT=5,1,1,51

+WIPOPT: 5,51,0

OK
AT+WIPOPT=5,1,2,53,6

OK
AT+WIPFILE=5,1,1,“http://username:password@members.dyndns.org/nic/update?hostname=hostname.dnsalias.com&myip=192.168.0.1&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG

CONNECT
badagent
+WIPFILE: 5,1,1,403,“Forbidden”

OK

¿How I can to resolve this problem?

DynDNS Web Developers section says:
“All clients must send a well-formed user agent that includes company name, model number, and software build revision. An example would be: Mellenium Inc. - Router 25001 - 1.1”

I don’t know how can I resolve this problem…

Thanks in advance…

Well, you obviously need to follow the instruction from DynDNS:

Are you doing that?

You said you have this working in another implementation - so have you compared that against your WIP version?

I’m trying it, but I’m not sure how to set my User-Agent I try changing the WIPFILE comand to:

AT+WIPFILE=5,1,1,“http://username:password@members.dyndns.org/nic/update?hostname=hostname.dnsalias.com&myip=192.168.0.1&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG",“User-Agent”,"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)”

But It get the same response…

I don’t say that, it’s other person, but don’t worry. I can change use this if I set firefox address to:

username:password@members.dyndns … ckmx=NOCHG

that is the address I put in AT+WIPFILE

Regards,

Oh yes, so it is - that’s what happens when you jump-in on someone else’s thread!

So my advice to you would be as it was to the Original Poster: try this first on some other, more “conventional”, platform; when you have that working, you can then move on to sorting-out the peculiarities of WIP…

Yes, but I try from “direction bar” of various pc browsers, and from all, the response is succesull.

From WIP commands, I allways obtain the same response. In DynDNS explains another form to try to make it, but I don’t know how to make it:

How can I try to make that with WIP commands???

Thanks a lot,

Have you actually read the WIP AT Commands documentation?

Do you understand how the HTTP protocol works?

Yes, I did

I think so…

I’m trying some things in WIP AT Commands, for example, if I make:

AT+WIPCREATE=5,1,“How To Find Any IP Address in a Flash

I get an ERROR. I can’t put any HTTP Header in AT+WIPCREATE, but the documentation says another thing…

If I do

AT+WIPCREATE=5,1,“http://whatsmyuseragent.com/
OK
AT+WIPFILE=5,1,1,“How To Find Any IP Address in a Flash
OK

Then I get the html file, but if I view the html file in the brower, there is no User-Agent.

If I connect to whatsmyuseragent.com/ from my PC I can see the User-Agent in the html file…

Then, I don’t understand how I must set the User-Agent in AT+WIPFILE command…

Thanks a lot for your help…

You seem to be confusing “HTML files” with HTTP protocol request and response messages :?:

Or, at least, you are muddling the terminology in your post.

Hi,

First of all, thanks for your help…

Now, may be I’m muddling the terminology, or may be I’m not explaining as well as I desire, I don’t know. I’m not english…

Now, I try to explain what I’m trying to do, and may be you can told me what I’m doing wrong or what I don’t understand so much about “HTTP protocol” and “HTML files”.

For update the IP in DynDNS I know that I need to make a GET HTTP protocol, but all I get is “badagent” response.
Then I search for a HTML file that told me what I’m sending when I use the WIP commands.
For this reason I connect to web page “http://whatsmyuseragent.com/” that told me whats my User-agent information. If I connect with my PC local browser, I can see a User-Agent html header, but if I connect from the wavecom modem, I don’t see any User-Agent html header. I need to get the HTML file from “http://whatsmyuseragent.com/” to see if I am sending any User-Agent information.
Furthermore, I’m using ethereal from my PC to see the information sending to DynDNS and “http://whatsmyuseragent.com/” but I can’t see with ethereal the information about modem connection, then, I can’t compare where is the problem…

Thanks a lot for your help

Regards,

I think you need to look again - more carefully.

Look again at that command line - check the parameters carefully…

To get a more detailed error code, do AT+CMEE=1
See: FAQ forum/wiki? - #7 by davidc

Again, you need to check the documentation carefully - and ensure that you are doing precisely as it tells you…

Hi,

Thanks a lot, I can resolve my problem.

I check with other online web and I can see what happens.

The cme error doesn’t show enough information, and the command shows me the next information:

Then I supossed that username and password was optional, but it is NOT OPTIONAL if you want to send header lists. This is my problem, I was not sending username and password…

Now I set an username and password and all works fine…

Thanks a lot for all your help…

to the wip-comamd it is optional

but you were not following the dyndns update procedure :exclamation:

that requires username and password!

For the WIP command may be is not optional, If I connect to a webpage that not requires username and password (“http://whatsmyuseragent.com/”) without username and password, it doesn’t get the User-Agent.

I try to explain what I want to say:

If I connect using this form:

AT+WIPFILE=5,1,1,“http://whatsmyuseragent.com/",“User-Agent”,"UserAgentTest

It takes “User-Agent” as username and “UserAgentTest” as password…

If I connect using this form:

AT+WIPFILE=5,1,1,“http://whatsmyuseragent.com/",“a”,“b”,“User-Agent”,"UserAgentTest

It takes “a” as username, “b” as password, an finally “User-Agent” as HTTP Header and “UserAgentTest” HTTP value of header…

With last form connection I can check the User-Agent value and after that I connect to DynDNS without any problem…

The WIP documentation does look wrong here:

If, as that syntax shows, [,,] can just be omitted, how can it possibly distinguish between [,,] and the first header+value pair from [,[…]] :question: :exclamation:

Hi,

It’s the same conclusion I arrived, I think the right syntax would be:

Thanks another time for all,