EtherCard
EtherCard copied to clipboard
Pass data
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
Ok, i solve my problem.. Somehow i lost pointer. Solved by creating class array.
Still have problem how get i to work without gateway?
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.