Shady Cove, OR
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #15 on: March 07, 2011, 01:55:39 pm » |
OK, I feel like the village idiot... Yes, I was looking for and gave you the wrong files... Here are the correct ones... http://www.towerboy.com/arduino/Client.h //Removed from my server now.http://www.towerboy.com/arduino/Client.cpp //Removed from my server now.I made the changes to them and I still get the same error as before: sketch_mar07a.cpp: In function 'void loop()': sketch_mar07a:47: error: 'class Client' has no member named 'IP_address' Any ideas? I am using the arduino uno if that makes a difference... Jeremy
|
|
|
|
« Last Edit: April 22, 2011, 09:56:38 am by Jeremy-arduino »
|
Logged
|
|
|
|
|
Shady Cove, OR
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #16 on: March 07, 2011, 02:02:19 pm » |
maybe i messed something up, because now I can't compile anything with Ethernet.h in it... overwriting messed up files now...
Jeremy
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 89
Posts: 9393
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #17 on: March 07, 2011, 02:16:10 pm » |
After modifying files you might need to restart all instances of the IDE.
Which version of the IDE are you using?
Rob
|
|
|
|
|
Logged
|
|
|
|
|
Shady Cove, OR
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #18 on: March 07, 2011, 03:29:32 pm » |
OK, here is what I have now... It took me a while to figure out that in your snippets of the .h and .cpp file I was supposed to find some of the text and add the pertinant stuff right after it... Got that done now. I am running Ver0022 and yes, every time I make a change to the files, I close and reopen all the Arduino IDE's. When I compile now, this is what I get: C:\Users\Jeremy\Desktop\arduino-0022\libraries\Ethernet\Client.cpp: In member function 'void Client::IP_address(uint8_t*)': C:\Users\Jeremy\Desktop\arduino-0022\libraries\Ethernet\Client.cpp:26: error: 'getSn_DIPR' was not declared in this scope
??? Jeremy
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 89
Posts: 9393
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #19 on: March 07, 2011, 04:50:00 pm » |
@ Jeremy :
See my previous post, but here again: The ethernet lib changed in version 19. The patch proposed here was for version 18.
----- 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 }
Hopes this helps, Rob
|
|
|
|
|
Logged
|
|
|
|
|
Shady Cove, OR
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #20 on: March 07, 2011, 05:49:43 pm » |
@Rob I am not used to going back and looking for edits in post. On most forums, a new post is made. This is not your fault. I am just explaining why I missed it and will learn to re-read and look for edits. Thank you for your help. I made the change that you edited and got a few more errors that I will not bother to post because, I read through them and managed to understand what was wrong! When I copied the code into the Client.h file, I missed copying the semicolon. Now it all compiles and uploads fine. Thanks! Any idea now, how to make the arduino scan the connected computer for credit card info? Yes, the previous line of text was a JOKE!!!  Thanks everyone that help straighten me out! Jeremy
|
|
|
|
|
Logged
|
|
|
|
|
'round the world...
Offline
Edison Member
Karma: 20
Posts: 2308
|
 |
« Reply #21 on: March 08, 2011, 04:45:16 am » |
Any idea now, how to make the arduino scan the connected computer for credit card info?
Ohhh, just when I thought I had found a new day project to get me busy. Glad you got it working.
|
|
|
|
|
Logged
|
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).
|
|
|
|
Shady Cove, OR
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #22 on: March 21, 2011, 10:52:28 pm » |
OK, so this has worked great for everything that I have tried so far except one thing. I'm sure it's something simple but I am trying to store the IP to a variable instead of just printing the IP at the present time. This is what I have but it does not work. client.IP_address(&client_ip[0]);//added //client.println("Your IP is:");//added int currentIP; // My addition for (int n = 0; n<=3; n++)//added {//added lcd.print((int)client_ip[n]);//added -- I changed this and it works currentIP += ((int)client_ip[n]); // My addition if(n < 3){ lcd.print(".");//added -- I changed this and it works currentIP += '.'; // My addition }//added I would have thought that would work but it might not be the right data type? Not sure what it is that I should do. Thanks. Jeremy
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 89
Posts: 9393
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #23 on: March 22, 2011, 02:20:22 am » |
An IP address is four bytes, that cannot be storeds in an int of two bytes. You need a long
pack: for (int i=0; i<3; i++) { long_ip *= 256; long_ip += client_ip; }
unpack;
temp = long_ip; for (int i=0; i<3; i++) { client_ip = (byte) temp & 0xFF; temp /= 256; }
|
|
|
|
|
Logged
|
|
|
|
|
Shady Cove, OR
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #24 on: April 21, 2011, 11:08:32 pm » |
I know I had this working at one time and now when I compile, after I made changes to an unrelated part of code, it fails. Here is the part that is failing. client.IP_address(&client_ip[0]); lcd.setCursor(0, 1); lcd.print(" "); lcd.setCursor(0, 1); long long_ip; for (int n = 0; n<=3; n++) { long_ip *= 256; long_ip += client_ip; // This part here is where I get my errors.....which are posted below... } long temp = long_ip; for (int i=0; i<3; i++) { client_ip = (byte) temp & 0xFF; // This part here is where I get my errors.....which are posted below... temp /= 256; }
gate_garage_NewHTML.cpp: In function 'void loop()': gate_garage_NewHTML:129: error: invalid conversion from 'byte*' to 'long int' gate_garage_NewHTML:135: error: incompatible types in assignment of 'int' to 'byte [4]' client_ip is declared before the setup function... What is supposed to be happening here is the clients ip is to be written to a long and then printed to the LCD16X2. I have it working on the arduino right now, but that was from a burn about a month ago and I don't seem to have saved the correct way to do it... Any ideas?
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 89
Posts: 9393
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #25 on: April 22, 2011, 01:32:39 am » |
long_ip += client_ip[n]; // need to add the index of the array you want to add
client_ip = (byte) temp & 0xFF; // idem
|
|
|
|
|
Logged
|
|
|
|
|
Shady Cove, OR
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #26 on: April 22, 2011, 09:28:31 am » |
OK, adding the index fixed the first issue. Thanks. But I have now idea what "idem" means. I googled it, and found some results, but they didn't make any sense...
|
|
|
|
|
Logged
|
|
|
|
|
'round the world...
Offline
Edison Member
Karma: 20
Posts: 2308
|
 |
« Reply #27 on: April 22, 2011, 10:08:55 am » |
What were you planning to achieve with this: for (int i=0; i<3; i++) { client_ip = (byte) temp & 0xFF; // This part here is where I get my errors.....which are posted below... temp /= 256; }
?
|
|
|
|
|
Logged
|
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).
|
|
|
|
Shady Cove, OR
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #28 on: April 22, 2011, 10:30:00 am » |
I don't quite know what that does, I didn't write it. It was given a few posts back and at one time, I had it working, must have forgot to save my work after the last burn, and lost it. If there is a simpler idea, I'm open to it.
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 89
Posts: 9393
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #29 on: April 22, 2011, 01:02:27 pm » |
What were you planning to achieve with this: It looks like splitting a long into 4 separate bytes, but the index [n] is missing.
|
|
|
|
|
Logged
|
|
|
|
|
|