Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass data #396

Open
GoGs99 opened this issue Aug 8, 2020 · 2 comments
Open

Pass data #396

GoGs99 opened this issue Aug 8, 2020 · 2 comments

Comments

@GoGs99
Copy link

GoGs99 commented Aug 8, 2020

I rly need help.
Im using server localy.

`const char website[] PROGMEM = "192.168.0.5";

static byte myip[] = { 192,168,0,211 };

static byte mask[] = { 255,255,255,0 };

static byte hisip[] = { 192,168,0,5 };
`

String dataInput = "/arduino/test.php?data1=test";

//NOT WORKING

int str_len = dataInput.length()+1;
const char char_array[str_len];
dataInput.toCharArray(char_array, str_len);

//NOT WORKING
const char *postval = dataInput.c_str();

//NOT WORKING
const char *postval = "/arduino/test.php?data1=test";

//WORKING
ether.browseUrl(PSTR(""), "/arduino/test.php?data1=test", website, my_result_cb);

ether.browseUrl(PSTR(""), "/arduino/test.php?data1=test", website, my_result_cb);
NOT working if not using gateway:
Gateway has nothing to do with direct local ip connection i guess...
ether.staticSetup(myip, 0, 0, mask);

ether.browseUrl(PSTR(""), postval, website, my_result_cb);

httpPost is even worse.

What im doing wrong here, please any advice?

Thanks in advance

@GoGs99
Copy link
Author

GoGs99 commented Aug 9, 2020

Ok, i solve my problem.. Somehow i lost pointer.
Solved by creating class array.

Still have problem how get i to work without gateway?

@GoGs99
Copy link
Author

GoGs99 commented Aug 11, 2020

Solved gateway by removing gateway wait
if (tcp_client_state==TCP_STATE_SENDSYN **&& (waitgwmac & WGW_HAVE_GW_MAC)**)

Problem about "tcp port reused" i solve it:

**#define TCPCLIENT_SRC_PORT_H 11** _changed to_
static uint8_t TCPCLIENT_SRC_PORT_H = random(11,45);

to function static void client_syn
add

if(tcpclient_src_port_l>30)
    {
    		tcpclient_src_port_l = 1;
    		TCPCLIENT_SRC_PORT_H++;
    		if(TCPCLIENT_SRC_PORT_H >45)
    			{
    				TCPCLIENT_SRC_PORT_H = 11;
    			}
    }

Hope i help someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant