# Upgrade device on connect

**URL:** <https://forum.genieacs.com/t/upgrade-device-on-connect/3454>\
**Category:** Uncategorized\
**Created:** [January 22, 2023, 1:58pm UTC](https://forum.genieacs.com/t/upgrade-device-on-connect/3454 "2023-01-22T13:58:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mstrolo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/mstrolo/32/941_2.png) [@mstrolo](https://forum.genieacs.com/u/mstrolo)\
**Post date:** [January 22, 2023, 1:58pm UTC](https://forum.genieacs.com/t/upgrade-device-on-connect/3454/1 "2023-01-22T13:58:36Z")

</div>

Hi all.

how can I make a specific model that connects to the ACS server to receive the latest firmware when he first connects

thanks for the helpers.

---

<div class="post-metadata">

**Author:** ![jakeny2023](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/jakeny2023/32/1264_2.png) [@jakeny2023](https://forum.genieacs.com/u/jakeny2023)\
**Post date:** [March 8, 2023, 7:08pm UTC](https://forum.genieacs.com/t/upgrade-device-on-connect/3454/2 "2023-03-08T19:08:48Z")

</div>

Premises:Upload firmware in files first

//Create script in “provisions”:  
const now = Date.now();

declare(“Downloads.[FileType:1 Firmware Upgrade Image]”, {path: 1}, {path: 1});  
declare(“Downloads.[FileType:1 Firmware Upgrade Image].FileName”, {value: 1}, {value: “Firmware name”});  
declare(“Downloads.[FileType:1 Firmware Upgrade Image].Download”, {value: 1}, {value: Date.now()});

//Then in “presets”, create trigger rules

 ![1](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/d/dce370b9c6b41b0b95f8b9761ae769ad684b8f28.jpeg)

---

<div class="post-metadata">

**Author:** ![mstrolo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/mstrolo/32/941_2.png) [@mstrolo](https://forum.genieacs.com/u/mstrolo)\
**Post date:** [April 19, 2023, 1:30pm UTC](https://forum.genieacs.com/t/upgrade-device-on-connect/3454/4 "2023-04-19T13:30:00Z")

</div>

Hi.

thank you for the answer.

what do I need to change here? only the Firmware name?

---

<div class="post-metadata">

**Author:** ![mstrolo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/mstrolo/32/941_2.png) [@mstrolo](https://forum.genieacs.com/u/mstrolo)\
**Post date:** [April 19, 2023, 1:34pm UTC](https://forum.genieacs.com/t/upgrade-device-on-connect/3454/5 "2023-04-19T13:34:19Z")

</div>

i tried the provision code and i get syntax error

---

<div class="post-metadata">

**Author:** ![chandsmistry](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/chandsmistry/32/1359_2.png) [@chandsmistry](https://forum.genieacs.com/u/chandsmistry)\
**Post date:** [April 25, 2023, 4:18pm UTC](https://forum.genieacs.com/t/upgrade-device-on-connect/3454/6 "2023-04-25T16:18:05Z")

</div>

did you declare the actual firmware package name in the value ?

declare(“Downloads.[FileType:1 Firmware Upgrade Image].FileName”, {value: 1}, {value: “FW\_FILENAME\_U0.bin”});

works as expected for me

---

<div class="post-metadata">

**Author:** ![mstrolo](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/mstrolo/32/941_2.png) [@mstrolo](https://forum.genieacs.com/u/mstrolo)\
**Post date:** [April 29, 2023, 8:46pm UTC](https://forum.genieacs.com/t/upgrade-device-on-connect/3454/7 "2023-04-29T20:46:07Z")

</div>

![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/e/e957819feebd49b79c63ff16f58d687b2578a1f8.png)

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [May 1, 2023, 5:07pm UTC](https://forum.genieacs.com/t/upgrade-device-on-connect/3454/8 "2023-05-01T17:07:41Z")

</div>

You have an error on line two.  
 ![Screenshot 2023-05-01 at 9.06.20 AM](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/2X/7/792e87560d31c4beec4ac52645dc649c7eb7bd58.png)

The issue is going to be the curly quotes (“”). Convert them to normal quotes `"`.

---

<div class="post-metadata">

**Author:** ![JoeSuarez](https://avatars.discourse-cdn.com/v4/letter/j/958977/32.png) [@JoeSuarez](https://forum.genieacs.com/u/JoeSuarez)\
**Post date:** [May 24, 2023, 5:07pm UTC](https://forum.genieacs.com/t/upgrade-device-on-connect/3454/9 "2023-05-24T17:07:52Z")

</div>

> [@mstrolo](#):
>
> how can I make a specific model that connects to the ACS server to receive the latest firmware when he first connects
> 
> thanks for the helpers.

To create a specific model that connects to an ACS (Auto Configuration Server) to receive the latest firmware when it first connects, you would need to follow these general steps:

```
Identify the appropriate ACS server: Determine the specific ACS server that you want your model to connect to in order to receive the latest firmware. This may involve obtaining the server's URL, port number, and authentication credentials.

Implement the ACS protocol: Research and understand the protocol used by the ACS server for firmware updates. Common protocols include TR-069 (also known as CWMP - CPE WAN Management Protocol) and SNMP (Simple Network Management Protocol). Implement the necessary code or libraries in your model to communicate with the ACS server using the appropriate protocol.

Set up connection parameters: Configure the connection parameters in your model to match the requirements of the ACS server, such as the server URL, port number, and authentication credentials. This may involve using configuration files or setting up environment variables in your model.

Initiate connection on first startup: Set up your model to initiate a connection to the ACS server when it first starts up. This may involve adding code or logic in your model's initialization process to establish a connection to the ACS server and request the latest firmware.

Handle response and update firmware: Once connected to the ACS server, your model should handle the response from the server, which may include information about the latest firmware available. Your model should then proceed to download and install the latest firmware as needed, based on the instructions provided by the ACS server.

Error handling and logging: Implement appropriate error handling and logging mechanisms in your model to handle any issues that may arise during the connection to the ACS server or the firmware update process. This may include error messages, retries, and logging of relevant information for troubleshooting purposes.

```

It’s important to note that the implementation details may vary depending on the specific hardware, software, and ACS server being used. It’s recommended to consult the documentation and resources provided by the ACS server vendor or relevant protocols for specific guidance on implementing ACS connectivity and firmware updates in your model.
