Added custom mac addresses + dhcp renew, longer tcp ack retransmit timeout, improved error handling.#4
Open
BlakeGarner wants to merge 2 commits intoninjablocks:masterfrom
Open
Added custom mac addresses + dhcp renew, longer tcp ack retransmit timeout, improved error handling.#4BlakeGarner wants to merge 2 commits intoninjablocks:masterfrom
BlakeGarner wants to merge 2 commits intoninjablocks:masterfrom
Conversation
+ begin(byte *mac) {...} lets you specify your own MAC address [begin() is still supported]
+ Fix to not send "Content-Type" in GET requests.
+ Close connection if data size error, so it can restart gracefully.
+ Added maintain() method that should be called periodically to refresh DHCP settings.
Signed-off-by: BlakeGarner <blake.garner@gmail.com>
|
Hey what was the reason for the custom mac address? Is this a common thing to need to override on arduino? |
Author
|
Hey, |
|
Ahh just reviewing the examples on the Arduino site. http://arduino.cc/en/Tutorial/WebClient Has a note in the code associated with the mac address. // Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };Given this is labeled a library we should certainly enable this to be overridden. |
Previously single HTTP GET or POST messages were broken up across multiple TCP packets. While okay, it did put additional load on the SPI and Ethernet interfaces and could be fixed by preparing the entire message ahead of time in a local buffer. This did require some rearrangement of how httppost and ninjaMessage were run, and a buffer (448 bytes). The extra memory used by the buffer has mostly been reclaimed through other optimisations: - Fixed strings use program (flash) memory instead of SRAM. - Build the JSON data on the fly within the packet buffer, rather than in its own. - Use the same buffer for reading and sending packets to/from the W5100, as they can't occur at the same time. Other Changes: - strcat has a O(n) penalty to find the end of the string every time it is run. Removed it in favour of strcpy and keeping track of where the pointer is up to. - Removed a few redundant or unused library or variable declarations. - Added a few extra Serial.prints to help debug connection errors in the future.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added support for: