Go Down

Topic: Get IP Address of Anyone Connected to my Arduino set up as server (Read 4 times) previous topic - next topic

bubulindo

Hello,

I'm on Mac OSX.
If you search for those files in your computer, you can find them inside the Arduino folder. Just use search and you shouldn't have more than one copy of the files in your hard drive.
Eu não sou o teu criado. Se respondo no fórum é para ajudar todos mediante a minha disponibilidade e disposição. Responder por mensagem pessoal iria contra o propósito do fórum e por isso evito-o.
Se realmente pretendes que eu te ajude por mensagem pessoal, então podemos chegar a um acordo e contrato onde me pagas pela ajuda que eu fornecer e poderás então definir os termos de confidencialidade do meu serviço. De forma contrária toda e qualquer ajuda que eu der tem de ser visível a todos os participantes do fórum (será boa ideia, veres o significado da palavra fórum).
Nota também que eu não me responsabilizo por parvoíces escritas neste espaço pelo que se vais seguir algo dito por mim, entende que o farás por tua conta e risco.

Dito isto, mensagens pessoais só se forem pessoais, ou seja, se já interagimos de alguma forma no passado ou se me pretendes convidar para uma churrascada com cerveja (paga por ti, obviamente).

johnwasser

#6
Mar 07, 2011, 05:08 pm Last Edit: Mar 07, 2011, 05:12 pm by johnwasser Reason: 1

Thank you for your help and the example, but I just looked through my entire arduino folder and can not find either of those files. Could you give me an idea where I might find them? Thanks.

Jeremy


On Mac OS X, applications are folders and the Arduino standard libraries are inside the Arduino application.  Ctrl-Click on the Arduino app and select "Show Package Contents".  From there:  Resources->Java->libraries->Etherrnet

On my system I renamed Arduino.app v22 to Arduino22.app so the full path for me is:
/Applications/Arduino22.app/Contents/Resources/Java/libraries/Ethernet

The built-in libraries are read-only so to make changes you'll need to copy the Etherenet folder to a read-write flder.  I think if you put a 'libraries' folder in your Home/Docuements/Arduino folder the libraries there will override the standard libraries?
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

robtillaart

#7
Mar 07, 2011, 05:13 pm Last Edit: Mar 07, 2011, 05:47 pm by robtillaart Reason: 1
@bubulindo
Very usefull addition to the ethernet lib, should be candidate for in a next release. Name could be more descriptive e.g.

void Client::getRemoteIPAddress(uint8_t * addr)

update:
just tried to run the sample program under win7 - IDE21 => two errors

1)    #include <SPI.h>  should be added for version 19 and up
2)   'getSn_DIPR' was not declared in this scope

The first was solved easily, do you know how to fix the second? Fixed!!

The second is to use the code below in Client.cpp

void Client::IP_address(uint8_t * addr)
{
   W5100.readSnDIPR(_sock, addr);    // replaces the getSn_DIPR(_sock, addr); V18 and below
}
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Jeremy-arduino

Ok, well I am on Windows 7 and I have not directory structure like that. The closest thing I can find is this:
C:\Users\Jeremy\Desktop\arduino-0022\libraries\Ethernet\Ethernet.cpp
C:\Users\Jeremy\Desktop\arduino-0022\libraries\Ethernet\Ethernet.h

I did do the edit on those files but I might not have put the code in the right spot because I got an error on compile:
sketch_mar07a.cpp: In function 'void loop()':
sketch_mar07a:47: error: 'class Client" has no member named 'IP_address'

I even closed all the sketch windows and save the files and then restarted the Arduino sketch. Is there a certain spot that the code needs to go in the files?

Jeremy

bubulindo



Thank you for your help and the example, but I just looked through my entire arduino folder and can not find either of those files. Could you give me an idea where I might find them? Thanks.

Jeremy


On Mac OS X, applications are folders and the Arduino standard libraries are inside the Arduino application.  Ctrl-Click on the Arduino app and select "Show Package Contents".  From there:  Resources->Java->libraries->Etherrnet

On my system I renamed Arduino.app v22 to Arduino22.app so the full path for me is:
/Applications/Arduino22.app/Contents/Resources/Java/libraries/Ethernet

The built-in libraries are read-only so to make changes you'll need to copy the Etherenet folder to a read-write flder.  I think if you put a 'libraries' folder in your Home/Docuements/Arduino folder the libraries there will override the standard libraries?


Did you actually read through the thread?
I, the guy that wrote the software change, am on Mac OSX. I know exactly where the files are, as I showed on my post. I do not know, however, where those files might be located in Windows or Linux Operating Systems, which appear to be the problem Jeremy is having.

About the addition in the Ethernet lib, go ahead. There's a few more functions coded in the w5100.c file that could be mapped to the C++esque world, but this one is actually quite useful. :)
Eu não sou o teu criado. Se respondo no fórum é para ajudar todos mediante a minha disponibilidade e disposição. Responder por mensagem pessoal iria contra o propósito do fórum e por isso evito-o.
Se realmente pretendes que eu te ajude por mensagem pessoal, então podemos chegar a um acordo e contrato onde me pagas pela ajuda que eu fornecer e poderás então definir os termos de confidencialidade do meu serviço. De forma contrária toda e qualquer ajuda que eu der tem de ser visível a todos os participantes do fórum (será boa ideia, veres o significado da palavra fórum).
Nota também que eu não me responsabilizo por parvoíces escritas neste espaço pelo que se vais seguir algo dito por mim, entende que o farás por tua conta e risco.

Dito isto, mensagens pessoais só se forem pessoais, ou seja, se já interagimos de alguma forma no passado ou se me pretendes convidar para uma churrascada com cerveja (paga por ti, obviamente).

Go Up