Upload contributions in the Arduino libraries

Hello to all!

I have performed some changes in the Ethernet library. Concretely, I have modified the function which allows to obtain an IP address via DHCP. Before that changes, the function which obtains that IP address was like this:

int begin(uint8_t *mac_address)

And, after performing the changes I have done, the function admits now the timeout and response timeout for DHCP (of course, having the same default parameters as in Dhcp class, making that changes backward compatible). The reason why I have done these changes is to be able to reduce the timeout (by default, it is set to 60 seconds, I think it can be a bit high) and set up either a lower value or a higher one. The function, after being modified, is now like this:

int begin(uint8_t *mac_address, unsigned long timeout = 60000, unsigned long responseTimeout = 4000);

The question is, I would like to upload these changes (of course, I can admit a previous code review to make sure we comply with the code quality) to be included in the next Arduino version (the latest stable version I am using is the 1.0.5). How could I do it?

Thanks in advance!

A simple and immediate solution is to attach your Zip file to a post here and, if you come across Threads elsewhere in the Forum where someone could benefit from it you could give them a link to your post.

...R

It's not appropriate to give people copies of libraries that you haven't modified. They should just use the regular libraries.

I had assumed you were going to upload a single library with your special name so that someone could include that in their project if they needed its new features. The special name should be chosen so it won't conflict with the standard ethernet library.

My strong recommendation would be to remove the file attached to your post and replace it with a file containing only your new library.

...R

Ok.

I have just removed the previous message, with its attached file. I attach a new file with the Ethernet library only (which is the one I have modified).

Best regards.

Arduino_library_Ethernet_modified.tar.gz (35.2 KB)

But, as far as I can tell, I assure that the modifications I have performed are completely compatible with the Standard Ethernet. You can take a look at the README.txt file included in the tar.gz attachment and you can see that the only modifications I have performed is to make both the timeout and the response timeout for DHCP request parametrizable from the Arduino sketch. I have not included a new library, because I think it is more appropriate to adapt the Ethernet library to make those timeouts configurable from the Arduino sketch.

I have found it comfortable, because, when doing some tests, I realized that the default timeout is, in my humble opinion, a bit high (60 seconds). Of course, it is completely backward compatible, because if you do not specify any timeout, you will have exactly the same behaviour as we have now.

If you prefer, see Ethernet.hpp and Ethernet.cpp files to see my modifications (compare them with the same files you have in your Arduino environment).

I think it could be useful for other developers.

Thanks for your time :slight_smile:

BR.

I didn't mean to imply any criticism of your work - I suspect it will be very welcome to some users.

I just think it should be seen to be separate from the official body of Arduino code to avoid confusion.

It may well make sense for it to be adopted as the official version but that process seems to be slow or non-existent.

...R

PS. in general it is not a good idea to delete posts as it can confuse readers. It would have been sufficient to have replaced the attachment. In this case as there had not been much discussion no harm has been done. ...R

Luis i hope that if you find some else modifications as this to do you will have to become a arduino dev on github

Hello Robin2, vector0.

Of course I do not take your reply as a criticism, don't get me wrong :wink: . I completely agree that the code should be reviewed.

Regarding the message I have deleted, I also understand it, but I did not find the way to remove only the attached file without deleting the message. Could it be due to Chrome, the browser I sent the post from?

Regarding the github, I have an account. Now it is a bit late, but as soon as I can, I will upload my modifications to GitHub.

Thanks for your feedback!

Hello again.

Finally, I have uploaded my libraries modified to Git Hub. The URL is here:

Now it can be reviewed.

Hello to all.

Has anybody been able to review my contribution to the Ethernet library?
Thanks :slight_smile: .

Try posting your change here. Redirecting to Google Groups
You should clone, do the change and issue a pull request. Follow that and I think you will get better attention. Your change is very small so that should not be a problem. Cheers!

Hello.

Sorry for answering too late and for my ignorance, but, how do I post my changes there? I have tried to clone, include my changes and then perform a push, but an error appears:

error: Cannot access URL Redirecting to Google Groups, return code 22
fatal: git-http-push failed

My .git/config file have this content:

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
fetch = +refs/heads/:refs/remotes/origin/
url = "Redirecting to Google Groups"
[branch "master"]
remote = origin
merge = refs/heads/master

Thanks in advance :slight_smile: .

Regards.

You should discuss your changes on the developers form Redirecting to Google Groups, clone/fork the Arduino respository and do a pull request. The better you present your changes on the forum the quicker the pull request is merged. If you check the Arduino git respository you can figure out who are the maintainers.

Cheers!

PS: Sorry about the bad link to the forum.

Sorry, but I still do not know how to post any message in that forum.
I have logged in, with my Google account, but I have read-only grants, as it seems. I cannot post any message.
Should I ask for write grants?

Thanks in advance :).
Regards.

Hello again.

In effect, I have no permissions, the following message appears when I try to create a new post:

Developers
You do not have permission to post to this group.
Return to the group's topic listing.

Can anybody give me that grants?
Thanks in advance!

Log into github, go here: Arduino/libraries/Ethernet/src at ide-1.5.x · arduino/Arduino · GitHub

Make your changes, then click save. Cos you do not have write permission github will automatically fork if needed, then put the commit in a new branch.

Then you can create a pull request.

When you work out the developers forum, a discussion there may support the pull request.