EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

RCM3700 HTTP Client on DC9.62

Started by yasj...@ysmgroup.net July 6, 2011
Hi there,

The HTTP_Client libraries spoken of in the TCP/IP Vol. 2 are compatible with DC10.54 and up, unfortunately i'm stuck to DC9.62 because i'm working with a RCM3700. I need to solve a simple problem:

every now and then i need to POST a xml-string to a certain server on a non-HTTP(80) port. I can't find any info on this though, can anyone help me on where to start looking?

TIA

Yasja S. de Miranda
Digi has a version of the HTTP client for DC 9.62. If you contact their tech support department (s...@rabbit.com) they should send you a copy, and I'm pretty sure it will fit your needs.

-Tom
On Jul 6, 2011, at 3:36 AM, y...@ysmgroup.net wrote:
> Hi there,
>
> The HTTP_Client libraries spoken of in the TCP/IP Vol. 2 are compatible with DC10.54 and up, unfortunately i'm stuck to DC9.62 because i'm working with a RCM3700. I need to solve a simple problem:
>
> every now and then i need to POST a xml-string to a certain server on a non-HTTP(80) port. I can't find any info on this though, can anyone help me on where to start looking?
>
> TIA
>
> Yasja S. de Miranda
> __..
>
>
Hi there,

I'm running into another problem with this. When i try to compile my program, the compiler gives an error from HTTPC.LIB

line 4 : ERROR HTTPC.LIB : Operands and/or operator incompatible.

Line 4 contains

/*** EndHeader */

Although i'm used to misleading error line numbers now i can't find this one anywhere. I got the lib directly from Digi, as the library wasn't included with DC9.62.

It runs fine with the included sample program. I call httpc_post(/*...*/) like this:

int postReset(char xml[128])
{
int retval;
char url[128];
sprintf(&url,"?XML=%s",xml);
gprsAttach();
if(ifstatus(IF_PPP3))
{
printf("\nEstablished PPP link. Now POSTing XML.");
retval = httpc_post ( &mysock, host_addr,
host_port, "/M/X/pt01.xml", NULL,
url );
ModemEscape();
printf("\nhttpc_post( ... ); returned %d",retval);
return retval;
}
else
{
printf("\nPPP link failed. Pun was not intended.");
return 1;
}
}

Regarding this statement:
 
sprintf(&url,"?XML=%s",xml);

I don't think "url" should have an ampersand.
 
I think this is what you want:
 
sprintf( url,"?XML=%s",xml );

Steve

From: "y...@ysmgroup.net"
>To: r...
>Sent: Monday, July 18, 2011 7:20 AM
>Subject: [rabbit-semi] Re: RCM3700 HTTP Client on DC9.62

>Hi there,
>
>I'm running into another problem with this. When i try to compile my program, the compiler gives an error from HTTPC.LIB
>
>line 4 : ERROR HTTPC.LIB : Operands and/or operator incompatible.
>
>Line 4 contains
>
>/*** EndHeader */
>
>Although i'm used to misleading error line numbers now i can't find this one anywhere. I got the lib directly from Digi, as the library wasn't included with DC9.62.
>
>It runs fine with the included sample program. I call httpc_post(/*...*/) like this:
>
>int postReset(char xml[128])
>{
>int retval;
>char url[128];
>sprintf(&url,"?XML=%s",xml);
>gprsAttach();
>if(ifstatus(IF_PPP3))
>{
>printf("\nEstablished PPP link. Now POSTing XML.");
>retval = httpc_post ( &mysock, host_addr,
>host_port, "/M/X/pt01.xml", NULL,
>url );
>ModemEscape();
>printf("\nhttpc_post( ... ); returned %d",retval);
>return retval;
>}
>else
>{
>printf("\nPPP link failed. Pun was not intended.");
>return 1;
>}
>}
>
Hi Steve,

You're right, but this doesn't solve my problem.
Another strange thing is when i click on the error in the compiler messages window, the cursor points to the far right end of the HTTPC.LIB document, way beyond the gray line that delimits the "Beyond this point your code will become ugly" something.
Anyhow, DC isn't giving me any good clue on what's going wrong, except for the error message

line 4 : ERROR HTTPC.LIB : Operands and/or operator incompatible.

I've been through the whole file now and tried some things in my own source but nothing helps. The included sample source works and even trying it with a basic PPP setup works, but not in the main project. I don't know what information I have to provide to help you guys to help me..?

This project is coming to an end now but obstacles like these are bugging me a lot hehe.
Dynamic C is notorious for giving erroneous line numbers and compiler error messages.
Generally, the real error is much earlier in the code than the line DC has flagged.
 
What is library HTTPC.lib and how does it differ from HTTP.lib that is
delivered with Dynamic C?
 
Steve

From: "y...@ysmgroup.net"
>To: r...
>Sent: Tuesday, July 19, 2011 1:22 AM
>Subject: [rabbit-semi] Re: RCM3700 HTTP Client on DC9.62

>Hi Steve,
>
>You're right, but this doesn't solve my problem.
>Another strange thing is when i click on the error in the compiler messages window, the cursor points to the far right end of the HTTPC.LIB document, way beyond the gray line that delimits the "Beyond this point your code will become ugly" something.
>Anyhow, DC isn't giving me any good clue on what's going wrong, except for the error message
>
>line 4 : ERROR HTTPC.LIB : Operands and/or operator incompatible.
>
>I've been through the whole file now and tried some things in my own source but nothing helps. The included sample source works and even trying it with a basic PPP setup works, but not in the main project. I don't know what information I have to provide to help you guys to help me..?
>
>This project is coming to an end now but obstacles like these are bugging me a lot hehe.
In my experience with DC 10.xx the prescence of C statements that span more than one line seems to throw the compilers error reporting off. Many times when porting the BACnet stack, I had to edit the code to make function calls etc fit on a single line before I could get the line number for the error message match up with the actual line in code where the error was.

Regards,
Peter

--- In r..., Steve Trigero wrote:
>
> Dynamic C is notorious for giving erroneous line numbers and compiler error messages.
> Generally, the real error is much earlier in the code than the line DC has flagged.
>  
> What is library HTTPC.lib and how does it differ from HTTP.lib that is
> delivered with Dynamic C?
>  
> Steve
>
> From: "yasja@..."
> >To: r...
> >Sent: Tuesday, July 19, 2011 1:22 AM
> >Subject: [rabbit-semi] Re: RCM3700 HTTP Client on DC9.62
> >
> >
> > 
> >Hi Steve,
> >
> >You're right, but this doesn't solve my problem.
> >Another strange thing is when i click on the error in the compiler messages window, the cursor points to the far right end of the HTTPC.LIB document, way beyond the gray line that delimits the "Beyond this point your code will become ugly" something.
> >Anyhow, DC isn't giving me any good clue on what's going wrong, except for the error message
> >
> >line 4 : ERROR HTTPC.LIB : Operands and/or operator incompatible.
> >
> >I've been through the whole file now and tried some things in my own source but nothing helps. The included sample source works and even trying it with a basic PPP setup works, but not in the main project. I don't know what information I have to provide to help you guys to help me..?
> >
> >This project is coming to an end now but obstacles like these are bugging me a lot hehe.
> >
> >
> >
>

Hi there,

The C in HTTPC stands for "Client", it contains functions for retreiving web-stored content through HTTP. It is included with DynC 10.xx, but I got a DynC 9.62 compatible version directly from Rabbit/Digi's tech support.

I will try the single line command thing, this might be the solution to my problem. Thanks Peter.

Best regards,

Yasja S. de Miranda
Hi Yasja,

It's worth a try. The BACnet stack was full of lines like:

x = fn_y(parm1, parm2,
parm3,
parm);

and

x = yyyyy + zzzzz
* ttttt + hhhh;

and so on which really throws the compilers error tracking off. I suspect the same would be true for the 9.xx compiler.

Regards,
Peter
--- In r..., yasja@... wrote:
>
> Hi there,
>
> The C in HTTPC stands for "Client", it contains functions for retreiving web-stored content through HTTP. It is included with DynC 10.xx, but I got a DynC 9.62 compatible version directly from Rabbit/Digi's tech support.
>
> I will try the single line command thing, this might be the solution to my problem. Thanks Peter.
>
> Best regards,
>
> Yasja S. de Miranda
>

Yasja,

Sometimes those errors are caused by problems in other libraries, or the order that libraries are included in your program.

Make sure you're #use'ing HTTPC.LIB after any libraries it requires (like DCRTCP.LIB).

Do you get the error if you #use the library but not reference anything from it?

If you reference only some functions, which function causes the problem? You can troubleshoot this by just listing symbols separated by semicolons in main():

int main( void)
{
function1;
function2;
global_var1;
global_var2;

// your program here
}

Including a function name causes the compiler to compile that section of the .LIB file (code between EndHeader and the next BeginHeader). Maybe one of the sections of the library has a syntax error?

Dynamic C's error reporting leaves something to be desired. It definitely improved in recent DC 10 releases (like 10.56 or 10.60 and later), but DC 9.62 still has those problems.

-Tom
On Jul 19, 2011, at 1:22 AM, y...@ysmgroup.net wrote:
> Hi Steve,
>
> You're right, but this doesn't solve my problem.
> Another strange thing is when i click on the error in the compiler messages window, the cursor points to the far right end of the HTTPC.LIB document, way beyond the gray line that delimits the "Beyond this point your code will become ugly" something.
> Anyhow, DC isn't giving me any good clue on what's going wrong, except for the error message
>
> line 4 : ERROR HTTPC.LIB : Operands and/or operator incompatible.
>
> I've been through the whole file now and tried some things in my own source but nothing helps. The included sample source works and even trying it with a basic PPP setup works, but not in the main project. I don't know what information I have to provide to help you guys to help me..?
>
> This project is coming to an end now but obstacles like these are bugging me a lot hehe.
>

The 2024 Embedded Online Conference