Show Posts
|
|
Pages: 1 2 3 [4] 5 6 ... 26
|
|
46
|
International / Nederlands / Re: IO Communicatie tussen Arduino's onderling over Ethernet
|
on: December 10, 2012, 05:45:57 am
|
Hoi, oké het weeekend was te druk (of te ontspannend) Ik post even een stukje van de code die kan gebruiken, om te communiceren over het netwerk met udp. De master (die verstuurd) Udp.beginPacket(slaveIp, 8888); Udp.write(bufferomtezenden); Udp.endPacket(); packetBuffer[0] = 0; // now we keep listening for the acknowledge byte while (packetBuffer[0] != 0x04){ int packetSize = Udp.parsePacket(); if(packetSize){ Udp.read(packetBuffer, 1); } } en de slave (de ontvanger): int packetSize = Udp.parsePacket(); if(packetSize) { // Now that we know the master's IP thanks to receving an // UDP packet, we are going to set the senders IP as our // master IP. IPAddress remote = Udp.remoteIP(); for (byte i=0;i<4;i++){ masterip[i] = remote[i]; } // read the packet into our bufffer and get the senders IP addr and port number Udp.read(buffer, 92); Udp.beginPacket(Udp.remoteIP(), Udp.remotePort()); // send the acknowledge byte Udp.write(0x04); Udp.endPacket(); } delay(10); Zorg dat je zelf opzoek werk doet over hoe je udp gebruikt (met Arduino), want dat is wat je nodig hebt. Je zorgt voor een buffer, die vul je op en verstuur je naar een poort en IP. Daar ontvang je die en zet deze weer in een buffer bij ontvangst. Deze buffer kan je dan weer uitlezen en koppelen aan een opdracht. zorg dat je code verschillende onderdelen heeft die na elkaar worden uitgevoerd: master: void loop { doe iets(); doe iets anders(); als het moet, verstuur dan een udp pakket(); doe nog iets ander (); slave: void loop{ die iets(); luister of er iets toekomt op udp(); doe iets met de ontvangen gegevens(); doe nog iets anders(); }
|
|
|
|
|
48
|
Using Arduino / Networking, Protocols, and Devices / Re: how to find out DHCP-server's IP-address?
|
on: November 22, 2012, 12:51:57 pm
|
Because this is a separate DHCP object from the one Ethernet is using the DHCP server you find may be different from the one that Ethernet found. Yes, I came to that conclusion myself too. And it is not the kind of behaviour I want, if I get an IP, I most now for sure what dhcp client it came from. So your first post, is the way to solve the problem. I'll just have to include the changed ethernet.h within the sketch and that should make it portable, doesn't it?
|
|
|
|
|
50
|
International / Nederlands / Re: Scroll text met PCF8574A I2C
|
on: November 22, 2012, 04:38:17 am
|
een andere oplossing is beide regels constant opnieuw te schrijven en bij de onderste de positie niet te veranderen. lcd.setCursor(0,0); // set first line on the LCD lcd.print( "scrollende tekst"); lcd.setCursor(0,1); // set second line on the LCD lcd.print( "vaste tekst"); besef wel goed, dat met je delay's om te scrollen, je niets anders kan gaan doen naast het tonen van tekst op je LCD scherm, zolang de tekst aan het scrollen is. kijk eens naar blink without delay.
|
|
|
|
|
52
|
International / Nederlands / Re: beginner die hulp nodig heeft
|
on: November 06, 2012, 03:20:07 pm
|
|
Wat jij wil bereiken, staat helemaal uitgelegd in het book: arduino cookbook (hoofdstuk 15) maar wel in het Engels.
PS: met dit boek heb ik ongeveer al mijn eigen arduino (netwerk) problemen kunnen oplossen.
|
|
|
|
|
54
|
International / Nederlands / Re: Verschillen in boards
|
on: November 06, 2012, 03:05:51 pm
|
POE wil zeggen power over ethernet en met een POE switch kan je deze arduino dus voeden over je netwerkkabel en heb je geen extra voeding nodig (stroom dus), maar je kan je hem wel nog steeds meteen gewone voeding voeden, mocht je geen POE switch hebben (en die zijn niet goedkoop) Een arduino ethernet is gelijk aan een UNO met een ethernet shield (dus niet een mega) Sketches kan je standaard enkel opladen met een serialTOusb adapter, dus die heb je zeker ook nodig http://arduino.cc/en/Main/USBSerialMits een speciale bootloader zou je in de toekomst ook sketchen via het netwerk kunnen opladen, maar dat is niet iets voor beginners. ps: als je een email wil krijgen bij antwoord moet je dit zelf aanvinken bij additional options
|
|
|
|
|
56
|
Community / Exhibition / Gallery / Re: Network settings web page FORM using EEPROM to save submit [DONE]
|
on: November 05, 2012, 04:34:03 pm
|
I hope this is ok? I can try to explain my application further if you need, but what you have done is so close except for DHCP/Static . Ok, I'll continue my work and add dhcp/static switch, but you'll have to give me time. 1 more question. What has to be default? Static or dhcp. You'll have to consider a lot, before deciding. 2nd extra question. Does it have to save settings into EEEprom? Once done, you can't fall back on a simple reset button to go back to default settings (or has this to be a possible selection: save to eeprom/don't save to eeprom) 3th question: why don't I make separate program for your needs, but then I need full explanation of your project, better email about it and we'll work together. info at JO3RI.be
|
|
|
|
|
57
|
Community / Exhibition / Gallery / Re: Network settings web page FORM using EEPROM to save submit [DONE]
|
on: October 31, 2012, 10:42:28 am
|
|
Now if you're willing to help, I could update the code so you have the choice between static and DHCP.
I need to know some things:
- do you need other webpages (look at those screenshots, you'll see more pages for your own stuff) - do you need that fancy layout (or do you want minimalistic) - what Arduino IDE are you using? - do you need the DNS ip (without it, it might be quiet simple to add dhcp support)
|
|
|
|
|
58
|
Community / Exhibition / Gallery / Re: Network settings web page FORM using EEPROM to save submit [DONE]
|
on: October 31, 2012, 10:29:11 am
|
Hi vk5oi, thanks for trying out my code, now for your question. There is a reason why I ditched DHCP. for DHCP you'll need the Arduino IDE above 1.0, but when you do, it will not compile because it's confusing DNS for some reason (I don't really know why) and it only is with the byte DNS[] = { , , , } Now in my code you won't find anything on DNS, but I have been working on this thing for other projects and there it has DNS included (needed for things like twitter lookups). Maybe I should continue my work on this and include a choice on DHCP/STATIC. But I'll have to figure out how to get it working on the new IDE. this is actually how those setup pages look at this moment:  from my project CastDuino (CastDuino Slave): http://www.jo3ri.be/arduino/projects/castduino from my project DUAL TANK LEVEL MEASURING: http://www.jo3ri.be/arduino/projects/tank-level-measuring-basic
|
|
|
|
|