# Can the program be automatically updated like 'OTA'?

**URL:** https://discourse.processing.org/t/can-the-program-be-automatically-updated-like-ota/42219
**Category:** Project Guidance
**Created:** [June 15, 2023, 8:00am UTC](https://discourse.processing.org/t/can-the-program-be-automatically-updated-like-ota/42219 "2023-06-15T08:00:12Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)
#### Post date: [June 15, 2023, 8:00am UTC](https://discourse.processing.org/t/can-the-program-be-automatically-updated-like-ota/42219/1 "2023-06-15T08:00:12Z")

</div>

Can the program be automatically updated like ‘OTA’?

- OTA(Over-the-air programming)  
Does anyone have a good method or experience?  
 ![fig](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/9/d/9d173480a5a7fcefac7e8cb28a230642e5e7a35e.png)  
Like the picture, is there any way to do it? I wonder.

---

<div class="post-metadata">

### Author: ![PerryJohnson](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@PerryJohnson](https://discourse.processing.org/u/PerryJohnson)
#### Post date: [June 18, 2023, 3:00pm UTC](https://discourse.processing.org/t/can-the-program-be-automatically-updated-like-ota/42219/2 "2023-06-18T15:00:11Z")

</div>

I’m following this too, because I’m writing a program I’d like to fully update OTA. I’ve stored as much as I can in configuration files that I read into the main program. You can read/write with a variety of Java calls, and Processing has `exit()` that you can use as a hook to perform server read/local write operations on exit.

> **[exit() / Reference](https://processing.org/reference/exit_.html)**
>
> Quits/stops/exits the program. Programs without a draw() function exit automatically after the last line has run, but programs with draw() run continuously until the program is manually …

> **[BufferedReader / Reference](https://processing.org/reference/BufferedReader.html)**
>
> A BufferedReader object is used to read files line-by-line as individual String objects. Starting with Processing release 0134, all files loaded and saved by the Processing …

> **[java read file from server at DuckDuckGo](https://duckduckgo.com/?q=java%2Bread%2Bfile%2Bfrom%2Bserver)**
>
> DuckDuckGo. Privacy, Simplified.

---

<div class="post-metadata">

### Author: ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)
#### Post date: [June 18, 2023, 8:48pm UTC](https://discourse.processing.org/t/can-the-program-be-automatically-updated-like-ota/42219/3 "2023-06-18T20:48:59Z")

</div>

Dear PerryJohnson / @PerryJohnson

Thank you for answer. I understand the big meaning. However, it would be of great help if there were example source codes.

thank you

---

<div class="post-metadata">

### Author: ![PerryJohnson](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@PerryJohnson](https://discourse.processing.org/u/PerryJohnson)
#### Post date: [June 18, 2023, 9:55pm UTC](https://discourse.processing.org/t/can-the-program-be-automatically-updated-like-ota/42219/4 "2023-06-18T21:55:49Z")

</div>

Sorry, I don’t have time to write code now but perhaps a forum search or someone else will chime in.

---

<div class="post-metadata">

### Author: ![PerryJohnson](https://avatars.discourse-cdn.com/v4/letter/p/57b2e6/32.png) [@PerryJohnson](https://discourse.processing.org/u/PerryJohnson)
#### Post date: [August 16, 2023, 8:44pm UTC](https://discourse.processing.org/t/can-the-program-be-automatically-updated-like-ota/42219/5 "2023-08-16T20:44:11Z")

</div>

Okay, I’ve coded up an update system for my app and the idea might work for you too. From my app, I zip up the sketch directory, upload the compressed file to my server via FTP. Through java code within my program, I can also download that zip and extract it to the running sketch folder. Any duplicates will be replaced by default. I’m using the built-in java.util.zip and org.apache.commons.net.ftp which you can include in your code directory.

---

<div class="post-metadata">

### Author: ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)
#### Post date: [August 16, 2023, 10:05pm UTC](https://discourse.processing.org/t/can-the-program-be-automatically-updated-like-ota/42219/6 "2023-08-16T22:05:28Z")

</div>

@PerryJohnson

Thank you for answer. have a good day.  
thank you.
