Pages: 1 2 [3]   Go Down
Author Topic: Ethernet UDP hang  (Read 8419 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The following might be helpful:

http://arduino.cc/playground/Main/Printf

There's stuff in there about getting printf to write directly to the serial port, no need for buffers (sprintf).  There are also notes on storing your strings in flash (like F() with the regular Serial.print functions).

Hope that helps,

Dylan

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you. Very interesting, again I'm able to optimize a bit more my code  smiley-wink
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm trying to webserver programs, and i got many errors. something wrong with my udp? please help me to solve this.

Code:
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:35: error: 'UdpClass' has not been declared
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: In function 'void begin(uint16_t)':
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:36: error: '_port' was not declared in this scope
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:37: error: '_sock' was not declared in this scope
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: At global scope:
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:44: error: 'UdpClass' has not been declared
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: In function 'uint16_t sendPacket(uint8_t*, uint16_t, uint8_t*, uint16_t)':
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:45: error: '_sock' was not declared in this scope
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: At global scope:
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:50: error: 'UdpClass' has not been declared
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: In function 'uint16_t sendPacket(const char*, uint8_t*, uint16_t)':
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:56: error: '_sock' was not declared in this scope
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: At global scope:
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:60: error: 'UdpClass' has not been declared
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: In function 'int available()':
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:61: error: '_sock' was not declared in this scope
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: At global scope:
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:69: error: 'UdpClass' has not been declared
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: In function 'int readPacket(uint8_t*, uint16_t, uint8_t*, uint16_t*)':
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:70: error: '_sock' was not declared in this scope
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: At global scope:
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:74: error: 'UdpClass' has not been declared
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: In function 'int readPacket(uint8_t*, uint16_t)':
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:77: error: '_sock' was not declared in this scope
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp: At global scope:
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:80: error: 'UdpClass' has not been declared
C:\Users\acer\Documents\Arduino\libraries\Ethernet\Udp.cpp:88: error: 'UdpClass' does not name a type
Logged

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 115
Posts: 5380
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@Lugination: Looks like you did not add the include files required to compile the sketch. UDP requires these includes.
Code:
#include <SPI.h>
#include <Ethernet.h>
#include <EthernetUdp.h>
Logged

Pages: 1 2 [3]   Go Up
Jump to: