Hi, i'm new in arduino's WORLD. I create a web switch with a enc28j60 but i don't know the reason when i try to control the board over the internet, it doesn't work. I only see the ''web page'' and can't control any led from the 3 i set. In lan it works perfectly !
i open the port 85
check this sketch :
#include "etherShield.h"
// please modify the following two lines. mac and ip have to be unique
// in your local area network. You can not have the same numbers in
// two devices:
static uint8_t mymac[6] = {0x54,0x55,0x58,0x10,0x00,0x24};
static uint8_t myip[4] = {192,168,1,15};
static char baseurl[]="http://192.168.1.15/";
static uint16_t mywwwport =85; // listen port for tcp/www (max range 1-254)
#define BUFFER_SIZE 1500
static uint8_t buf[BUFFER_SIZE+1];
#define STR_BUFFER_SIZE 200
static char strbuf[STR_BUFFER_SIZE+1];
EtherShield es=EtherShield();
// prepare the webpage by writing the data to the tcp send buffer
uint16_t print_webpage(uint8_t *buf, byte on_off1, byte on_off2, byte on_off3);
int8_t analyse_cmd(char *str);
// LED cathode connects the Pin4, anode to 5V through 1K resistor
#define LED_PIN4 4
#define LED_PIN5 5
#define LED_PIN6 6
uint16_t plen, dat_p;
int8_t cmd;
byte on_off1 = 0;
byte on_off2 = 0;
byte on_off3 = 0;
void setup(){
/*initialize enc28j60*/
es.ES_enc28j60Init(mymac);
es.ES_enc28j60clkout(2); // change clkout from 6.25MHz to 12.5MHz
delay(10);
/* Magjack leds configuration, see enc28j60 datasheet, page 11 */
// LEDA=greed LEDB=yellow
//
// 0x880 is PHLCON LEDB=on, LEDA=on
// enc28j60PhyWrite(PHLCON,0b0000 1000 1000 00 00);
es.ES_enc28j60PhyWrite(PHLCON,0x880);
delay(500);
//
// 0x990 is PHLCON LEDB=off, LEDA=off
// enc28j60PhyWrite(PHLCON,0b0000 1001 1001 00 00);
es.ES_enc28j60PhyWrite(PHLCON,0x990);
delay(500);
//
// 0x880 is PHLCON LEDB=on, LEDA=on
// enc28j60PhyWrite(PHLCON,0b0000 1000 1000 00 00);
es.ES_enc28j60PhyWrite(PHLCON,0x880);
delay(500);
//
// 0x990 is PHLCON LEDB=off, LEDA=off
// enc28j60PhyWrite(PHLCON,0b0000 1001 1001 00 00);
es.ES_enc28j60PhyWrite(PHLCON,0x990);
delay(500);
//
// 0x476 is PHLCON LEDA=links status, LEDB=receive/transmit
// enc28j60PhyWrite(PHLCON,0b0000 0100 0111 01 10);
es.ES_enc28j60PhyWrite(PHLCON,0x476);
delay(100);
//init the ethernet/ip layer:
es.ES_init_ip_arp_udp_tcp(mymac,myip,85);
Thx in advance