Researched and tried but now need some help

HI All,

I am hoping someone can give me some assistance as i'm now stuck!

building a web based controller using mega and ethernet shield.

Got most things working, but im stuck with the follow problem.

I need to send a series of commands to the arduino which then will run various voids.

I would like to be able to do this by programming a webpage to call various URL's with the command in the GET, thats all fine.

But im stuck parsing the data in the correct way .

the string will be in the format as follows.

@XN:

Where:

  1. @ symbol signifies start of command
  2. X = A-Z giving me first string and 26 groups of commands
  3. N = 0-9 giving me 10 different actual commands in the group.
  4. : = colon to show end of command

i.e. @0A:

OK so far..

Some of the commands have to have a integer passed with it as it will be used to set a parameter in the code.

in the format

@XN;11111:

where

1,2,3 same as above (@=start, X= command group, N=0-9 in group

;= Semi colon to say there is an interger value to parse
:= Colon to end the command.

Please can someone help me get the @XN;11111: from the post and parse it...

I have done this over serial with no problems, but cant seem to transpose it to Ethernet ..

I need to send a series of commands to the arduino which then will run various voids.

As void means nothing how can you run a nothing?

You need to post your code on what you have tried so far.

drubug:
... which then will run various voids.

The word you're looking for is function. Where you see 'void loop()' and so on, void is the return type of the function.

I suggest you encode your command in the URL of the HTTP request. Reading characters from a client connection to buffer the HTTP request string is just like reading characters from the hardware Serial port to buffer an incoming string.

There are conventional ways to URL-encode arguments to a request as ?name1=value1&name2=value2' and so on, where name1 etc represent names that you will define, and value1 etc represent values provided for that parameter. Once you have buffered the incoming HTTP request and identified the part containing the URL, you can use strtok to separate out the parameter assignments. You should find plenty of examples of Arduino web servers showing how to parse the incoming request to get the parameter values.

SOLVED..

Was do to a incompatible var.

parseint function did the trick for me