Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic reset for every TFTP put operation #17

Closed
douglasveronez opened this issue Oct 28, 2014 · 3 comments
Closed

Automatic reset for every TFTP put operation #17

douglasveronez opened this issue Oct 28, 2014 · 3 comments

Comments

@douglasveronez
Copy link

Hi, I know this is not a forum for support but I really need help.
I would like the bootloader to reset every time a TFTP put operation is performed. That is, every time I want to upload a new code would not need to use an http request to reprogram it, causing the upload to be "automatic".
Not sure, but in this case it would be necessary to use only wdt.reset () and NetEEPROM.writeImgBad()?
Which part of the code should I take a look?
Thanks.

@loathingKernel
Copy link

That is something you should do in your sketch, resetting the arduinot into the bootloader from the sketch has nothing to do with the bootloader itself.

From what I can understand, you just want to issue the command once and have it all be done automatically? In that case, you will have to implement a very light version of TFTP into your sketch that only accepts the PUT command, and have it reset the arduino. But you will have to not ACK the PUT in order to force the client to resent the command once the arduino has restarted into the bootloader. This can achieve I think you want to do, but it is very very sketchy.

@douglasveronez
Copy link
Author

Thanks for the reply.
From what I understood, every time I want to upload a new code to arduino I need to use a http request to do so (http://ip_arduino/password/reprogram) before using the PUT command. What I want is to reprogram the arduino without this HTTP request in a way that when I use the PUT command the arduino will always reset and load the new code itself. So, I was wondering if would be necessary to change the way the bootloader receives the reset/reprogram order, in this case, to be right after the PUT command sent through the TFTP client.

@loathingKernel
Copy link

The bootloader has nothing to do with the reset because after your program boots, the bootloader stops running. The bootloader doesn't receive the reset, it is your sketch that receives it. The HTTP server that handles the reset request is part of the user sketch, not the bootloader. All the bootloader does is wait for a period of time for a PUT request and if not, it boots the existing code or if it does receive it, it uploads the new code.

If you really want to do it, you have to create a TFPT server in your code, let it receive the PUT command, reset the arduino, and then let your TFTP client resent the PUT command to the bootloader.

I cannot see why would you need such a hack though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants