TCP Connection with Fastrack Supreme10


#1

Hello

I wanna start a TCP connection between my Fastrack Supreme 10 and my PC which is connected to the internet over GRPS.
In the OpenAT folder are some WIP samples, but i dont know how to start them with the Fastrack Supreme, or is this not the correct way?

Would be nice to get some help.

Thanks


#2

Well, I think it’s not generally a great way - to just leap in without doing at least some basic study first!

Start with the Tutorial for Open AT IDE - it will be installed as part of the SDK installation; filename is TU_Tutorial_for_Open_AT_IDE.pdf


#3

I read this file and programmed a part to read in incomming serial data.

Maybe I just explain you my hole project.

I have to read incomming serial data from a Zigbee device with the Fastrack supreme and send them over GPRS to a PC.
But now I have to sent this data to my PC.
I though I use a TCP client on the Fastrack supreme and write my own TCP server on my PC and connect them.
There is this example in the WIP folder to create a TCP client, think this is what I need. I tried to open this example over the wizzard, but it is not working.

Hope someone can help me!


#4

Nobody can help you from such a vague description!

You need to describe precisely what is “not working” and in precisely what way(s) it is “not working”!


#5

I start the Open AT Project wizzard and open over project path the WIP sample project tcp_client.

It looks like this:

When I go to OK, I get this error message:

When I delete the script part in the project wizzard, I get this error message, but I can build it:

Invalid project path: Duplicate path entries.

When I wanna send it to my Fastrack Supreme after compiling, I get this error message:


#6

Did you actually read the Tutorial document?

It tells you that you need to create your new project in an empty folder - you are messing with the “source” of the projects in your SDK installation folder!

You have probably broken your SDK installation by now, so you’ll probably need to re-install it.


#7

Sorry, but after reinstall it is allready not working.

No I build a new project, copied the source code into my new project.
After this I try to build the file bit I get some errors, I thing it depends on the inculding of the wip.h file.
The first error I get is this:

Line 60 is the line, where I try to include the wip.h file as you can see in the upper right corner of the following picture:

All following errors I have depends on the missing including of the wip.h file.
Hope someone can say me, which mistake I make.

Thanks


#8

You seem to be doing something really really strange with your project structure. All those header files under your “src” directory should not be there, ever.
This means a lot of other stuff could be wrong, so delete that project folder completely. Then use the Wavecom Project WIzard, create a new app (sample or anything) in C:\OATprojects\wiptest\ with the project name “wiptest” and be sure to add the WIP plugin in the wizard. Now under “src” should be ONLY appli.c (for a blank project, for other sample projects there might be some other files related to the project, not the API or Plugin headers etc). If this is the case, you can try adding your code again.

And, if you get any error like “no rule to make target”, try a Rebuild. It will ensure that all your files are copied to the folder where the compiler plays.


#9

I suspect that he has broken the SDK installation - so even this won’t work, because the source from which the Project Wizard creates the project is corrupt.

I think he needs to uninstall the SDK and install afresh


#10

I reinstalled everything several times

OK, I did it like this:

First create a project:

After creating the project, my eclipse looks like this:

You can see there is an error, here the detail:

I copy the code from C:\OpenAT\Plug-ins\WIP\3.10.2033\WIP\samples\tcp_client\src into aplli.c and try to buld the RTE.
But I get than this error, when I try to build the target:

Updating RTE kernel file…
no generated DLL found…
[wmmake error #1] Build error.

Here the code I copy into appli.c

/*****************************************************************************/
/*  entry_point.c   -  Copyright Wavecom S.A. (c) 2006                       */
/*                                                                           */
/* DISCLAIMER OF WARRANTY                                                    */
/* ======================                                                    */
/* This Software is provided free of charge on an 'as is' basis. No warranty */
/* is given by Wavecom S.A. in relation to the Software of the uses to which */
/* it may be put by you, the user, or its merchantability, fitness or        */
/* suitability for any particular purpose or conditions; and/or that the use */
/* of the Software and all documentation relating thereto by the Licensee    */
/* will not infringe any third party copyright or other intellectual property*/
/* rights. Wavecom S.A. shall furthermore be under no obligation             */
/* to provide support of any nature for the Software and the Documentation.  */
/*                                                                           */
/* LIMIT OF LIABILITY                                                        */
/* ==================                                                        */
/* In no event shall Wavecom S.A. be liable for any loss or damages          */
/* whatsoever or howsoever caused arising directly or indirectly in          */
/* connection with this licence, the Software, its use or otherwise except to*/
/* the extent that such liability may not be lawfully excluded.              */
/* Notwithstanding the generality of the foregoing, Wavecom S.A. expressly   */
/* excludes liability for indirect, special, incidental or consequential loss*/
/* or damage which may arise in respect of the Software or its use, or in    */
/* respect of other equipment or property, or for loss of profit, business,  */
/* revenue, goodwill or anticipated savings.                                 */
/*                                                                           */
/*****************************************************************************/


/****************************************************************************
 * File    :   entry_point.c                                                        
 *
 * Very basic TCP client application:
 * - Connects a TCP client socket to the TCP server on host [PEER_STRADDR]
 *   on port [PEER_PORT]
 * - Sends all data in [snd_buffer], possibly in several steps, by using
 *   [WIP_CEV_WRITE] events to control data flow.
 * - Puts everything received by the socket into [rcv_buffer], until
 *   the table is full.
 */

/*
 * $LogWavecom:$
 * --------------------------------------------------------------------------
 *  Date     | Author | Revision       | Description
 * ----------+--------+----------------+-------------------------------------
 *  27.10.06 | FFT    | 1.0            | Initial revision.                  
 * ----------+--------+----------------+-------------------------------------
 */

/***************************************************************************/
/*  Defines                                                                */
/***************************************************************************/

#define PEER_STRADDR    "192.168.1.5"
#define PEER_PORT       2000
#define RCV_BUFFER_SIZE 10240

#include "adl_global.h"
#include "wip.h"

/***************************************************************************/
/*  Globals                                                                */
/***************************************************************************/

/* Whatever data I want to send in [DST_FILENAME]. */
static u8 snd_buffer [] =
  "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc\n"
  "velit nisl, rhoncus at, tristique et, egestas in, nulla. Sed a\n"
  "pede quis orci sollicitudin euismod. Donec pulvinar tortor at\n"
  "neque. Donec iaculis. Curabitur varius ornare dui. Nullam auctor\n"
  "nisl sit amet ipsum. Etiam urna massa, blandit dapibus, varius\n"
  "ac, rhoncus sit amet, urna. Suspendisse potenti. Curabitur et leo\n"
  "non sapien tristique laoreet. Integer rutrum sapien scelerisque\n"
  "velit. Nunc at tellus. Fusce quis velit. Nunc ornare tortor. In\n"
  "hac habitasse platea dictumst. Sed pretium tincidunt\n"
  "lacus. Nullam lorem mauris, interdum nec, pretium non, euismod\n"
  "sit amet, mauris. Morbi hendrerit quam pretium sapien placerat\n"
  "lobortis. Curabitur consectetuer. Sed dolor. Duis varius enim vel\n"
  "tortor.\n"
  "\n"
  "Phasellus nulla risus, consequat id, vestibulum ut, elementum ac,\n"
  "urna. Vestibulum auctor magna tempor augue. Morbi vel purus eget\n"
  "ligula vulputate eleifend. Quisque urna sem, sagittis a, ornare\n"
  "ac, hendrerit adipiscing, lectus. Sed a magna sit amet sem\n"
  "placerat malesuada. Nunc suscipit est viverra tellus. Morbi sit\n"
  "amet massa quis est ultricies lobortis. Sed pede diam,\n"
  "condimentum sed, malesuada ornare, eleifend eget, tellus. Class\n"
  "aptent taciti sociosqu ad litora torquent per conubia nostra, per\n"
  "inceptos hymenaeos. Proin cursus justo vitae nibh.\n"
  "\n"
  "Aenean vel elit non nisi bibendum lobortis. Cras porttitor odio\n"
  "eu nulla. Aliquam id orci. Phasellus sed nisi. Lorem ipsum dolor\n"
  "sit amet, consectetuer adipiscing elit. Proin id arcu. Praesent\n"
  "imperdiet diam vel quam. Sed lobortis placerat velit. Vestibulum\n"
  "sit amet urna sit amet sem malesuada dapibus. Sed in ipsum in\n"
  "magna nonummy porttitor. Sed nisl. In eu ante non nibh elementum\n"
  "facilisis. Phasellus non felis vel elit lacinia tempus. Fusce\n"
  "aliquet. Cum sociis natoque penatibus et magnis dis parturient\n"
  "montes, nascetur ridiculus mus. Donec sit amet arcu. Curabitur\n"
  "rutrum, erat ac viverra porta, libero pede bibendum lectus, ac\n"
  "tempor dui tellus quis tellus. Nulla interdum. Maecenas tortor\n"
  "lectus, faucibus quis, blandit pulvinar, auctor eu, ligula. Nunc\n"
  "leo enim, sodales congue, laoreet ac, pellentesque vitae, diam.\n";

/* How many bytes of [buffer] have already been sent. */
static int snd_offset = 0;

static char rcv_buffer [RCV_BUFFER_SIZE];
static int  rcv_offset = 0;

/***************************************************************************/
/*  Function prototypes                                                    */
/***************************************************************************/
static void evh( wip_event_t *ev, void *ctx);


/***************************************************************************/
/*  Function   : appli_entry_point                                         */
/*-------------------------------------------------------------------------*/
/*  Object     : Called once the WIP IP stack is fully initialized.        */
/*               This is the starting point of user applications.          */
/*-------------------------------------------------------------------------*/
/***************************************************************************/
void appli_entry_point() {
  wip_channel_t socket;
  wip_debug( "[SAMPLE]: connecting to client %s:%i...\n", PEER_STRADDR, PEER_PORT);
  socket = wip_TCPClientCreate( PEER_STRADDR, PEER_PORT, evh, NULL);
  if( ! socket) { wip_debug( "[SAMPLE] Can't connect\n"); return; }
}


/***************************************************************************/
/*  Function   : evh_data                                                  */
/*-------------------------------------------------------------------------*/
/*  Object     : Handling events happenning on the TCP client socket.      */
/*-------------------------------------------------------------------------*/
/*  Variable Name     |IN |OUT|GLB|  Utilisation                           */
/*--------------------+---+---+---+----------------------------------------*/
/*  ev                | X |   |   |  WIP event                             */
/*--------------------+---+---+---+----------------------------------------*/
/*  ctx               | X |   |   |  user data (unused)                    */
/*--------------------+---+---+---+----------------------------------------*/
/***************************************************************************/
static void evh( wip_event_t *ev, void *ctx) {
  
  switch( ev->kind) {

  case WIP_CEV_OPEN: {
    wip_debug ("[SAMPLE] Connection established successfully\n");
    break;
  }
  case WIP_CEV_READ: {
    int nread;
    wip_debug ("[SAMPLE] Some data arrived\n");
    nread = wip_read( ev->channel, rcv_buffer + rcv_offset, 
                      sizeof( rcv_buffer) - rcv_offset);
    if( nread < 0) { wip_debug( "[SAMPLE] read error %i\n", nread); return; }
    rcv_offset += nread;
    if( rcv_offset == sizeof( rcv_buffer)) {
      wip_debug( "[SAMPLE] Reception capacity exceeded, won't read more\n");
    } else {
      wip_debug( "[SAMPLE] Wrote %i bytes of data from network to rcv_buffer. "
                 "%i bytes remain available in rcv_buffer\n",
                 nread, sizeof( rcv_buffer) - rcv_offset);
    }
    break;
  }
  case WIP_CEV_WRITE: {
    int nwrite;
    wip_debug ("[SAMPLE] Can send more data\n");
    nwrite = wip_write( ev->channel, snd_buffer + snd_offset,
                        sizeof( snd_buffer) - snd_offset);
    if( nwrite < 0) { wip_debug( "[SAMPLE] write error %i\n", nwrite); return; }
    snd_offset += nwrite;
    if( snd_offset == sizeof( snd_buffer)) {
      wip_debug( "[SAMPLE] Everything has been sent, won't send more.\n");
    } else {
      wip_debug( "[SAMPLE] Wrote %i bytes. "
                 "%i bytes left to send in snd_buffer\n",
                 nwrite, sizeof( snd_buffer) - snd_offset);
    }
    break;
  }
  case WIP_CEV_ERROR: {
    wip_debug( "[SAMPLE] Error %i on socket. Closing.\n", 
               ev->content.error.errnum);
    wip_close( ev->channel);
    break;
  }
  case WIP_CEV_PEER_CLOSE: {
    wip_debug( "[SAMPLE] Connection closed by peer\n");
    wip_close( ev->channel);
    break;
  }
  }
}

#11

But have you read the Tutorial yet?

Yes, that is a fault in the Wavecom Open-AT SDK 2.01! :angry:

Considering they’re making such a big thing about it being “Eclipse-based”, it really is rather poor that the build system still has basic faults like this!

In my opinion, the Eclipse version isn’t ready for prime-time yet - so I’m sticking with Visual Studio.

No! :open_mouth:
That is the wrong way to do it!

You need to read that Tutorial - or read it again, but more carefully!


#12

Also remember that if you copy/create new source files in ./src, you must quite Eclipse and reload your project using the wizard which will update makefiles etc. This also goes for header files in ./inc, but if you copied all the source from all the example files into your one appli.c file, it will probably not work. I get that Path entry error, use eclipse all the time, and you can ignore that error. It is not correct but does not affect the Build process.

Also try this without RTE, doing a simple Target Rebuild. I never use the RTE (when it does start up it crashes) and have gotten used to my own UART-based DEBUG lines. I know this is really not the way to do things, but it means my build is the same every time and I always load target code, so the effects look the same, just sometimes a little extra UART output or not.


#13

Thank you!

It works now fine, I found my mistake.
Can someone give me a source code how to programm a Serversocket programm.
My device can not connect, cause I have no programm running at the destination IP adress.

Think his is something what is still programmed.

thx