Now that I have it all installed OK I'm trying to write my own
example that connects to a given server/ socket and sends then
receives responses. This is structured exactly as per the hello world example.
Looking at this code in dhcp_status():
> Serial.println(buf); // our local IP address ex DHCP
> uip.query_name("www.greenend.org.uk");
> // Start the "hello world" app defined earlier, listening on port 1000
> uip_listen(HTONS(1000),hello_world_appcall);
I see that you are getting an IP for www.greenend.org.uk which later
gets printed but not otherwise used.
Then you listen to port 1000 on localhost
I looked in the headers for a call to connect to a given server/ port
but did not find anything.
So, in my example I guess I would not start listening until
resolv_found comes back with the IP of the server I want to connect
to. I'd call uip.set_ip_addr() passing the address just found and
then start listening on the desired port.
Does that sound right?
Initially I decided to hard code the IP of the server I want to talk to.
> uip.query_name("beta.pachube.com");
> // Start the "pach get" app defined earlier, listening on port 8081
> uip.set_ip_addr(173,203,109,233);
> uip_listen(HTONS(8081),pach_get_appcall);
This never gets a connection. Any ideas?
Also, I really need a much longer input buffer. I see that
TCP_APP_STATE_SIZE is set at max 150 bytes. Any reason not to
increase this to around 500?
Final point: when it does come back from the name lookup it does not
show the correct address. Not important if I am doing nothing with
it but strange nonetheless.
Regards, Paul
Paul Tanner - Virtual Technologies - http://www.virtual-techno.com
Tel: +44 1494 581979 Mob: +44 7973 223239 mailto:pa...@virtual-techno.com
Hi,Now that I have it all installed OK I'm trying to write my own
example that connects to a given server/ socket and sends then
receives responses. This is structured exactly as per the hello world example.Looking at this code in dhcp_status():
> Serial.println(buf); // our local IP address ex DHCP
> uip.query_name("www.greenend.org.uk");
> // Start the "hello world" app defined earlier, listening on port 1000
> uip_listen(HTONS(1000),hello_world_appcall);I see that you are getting an IP for www.greenend.org.uk which later
gets printed but not otherwise used.
Then you listen to port 1000 on localhost
I looked in the headers for a call to connect to a given server/ port
but did not find anything.
So, in my example I guess I would not start listening until
resolv_found comes back with the IP of the server I want to connect
to. I'd call uip.set_ip_addr() passing the address just found and
then start listening on the desired port.Does that sound right?
Initially I decided to hard code the IP of the server I want to talk to.
> uip.query_name("beta.pachube.com");
> // Start the "pach get" app defined earlier, listening on port 8081
> uip.set_ip_addr(173,203,109,233);
> uip_listen(HTONS(8081),pach_get_appcall);This never gets a connection. Any ideas?
Also, I really need a much longer input buffer. I see that
TCP_APP_STATE_SIZE is set at max 150 bytes. Any reason not to
increase this to around 500?
Final point: when it does come back from the name lookup it does not
show the correct address. Not important if I am doing nothing with
it but strange nonetheless.
-adrian
-adrian
Paul Tanner - Virtual Technologies -
http://www.virtual-techno.com
-adrian
On Mon, Oct 31, 2011 at 6:49 AM, Winston Brummer
<winston...@gmail.com> wrote:
> Talking about examples. Has anyone ever read this article
> (http://www.instructables.com/id/A-Remotely-Programable-Relay-Controller-Christmas/).
> It also uses the AtMega328 but he seems to be able to get out bigger pages
> (980 bytes). Seems to be using something like PROGMEM, think its from
> EEPROM. I tried to follow his code but my grasp op the language seems
> lacking a lot.
>
> Winston