[arduino team help needed]Arduino Create Agent JS CLIENT how to use

Welcome,
currently, I want to upload code to Arduino using JavaScript (NodeJS),
I HATE using FIRMATA to upload code,
I want to use the official Arduino create agent and Arduino create agent js client

I just downloaded the arduino create agent,
I run the below in empty directory

git clone https://github.com/arduino/arduino-create-agent-js-client.git

I inserted arduino nano(old bootloader) in COM7,
thus I changed(edited) the file .\demo\app.jsx line 189-205 to,

handleUpload() {
    const target = {
      board: 'arduino:avr:nano',
      port: 'COM7',
      network: false
    };

    this.setState({ uploadingPort: target.port });
    daemon.boardPortAfterUpload.subscribe(portStatus => {
      if (portStatus.hasChanged) {
        this.setState({ uploadingPort: portStatus.newPort });
      }
    });

    // Upload a compiled sketch.
    daemon.uploadSerial(target, 'serial_mirror', { bin: HEX });
  }

then I run

npm run dev

since the local host runs on http://localhost:8000/
I edited the config file

C:\Users\USER\AppData\Roaming\ArduinoCreateAgent\config.ini

and set
origins = http://localhost:8000

that is

gc = std  # Type of garbage collection. std = Normal garbage collection allowing system to decide (this has been known to cause a stop the world in the middle of a CNC job which can cause lost responses from the CNC controller and thus stalled jobs. use max instead to solve.), off = let memory grow unbounded (you have to send in the gc command manually to garbage collect or you will run out of RAM eventually), max = Force garbage collection on each recv or send on a serial port (this minimizes stop the world events and thus lost serial responses, but increases CPU usage)
hostname = unknown-hostname  # Override the hostname we get from the OS
regex = usb|acm|com  # Regular expression to filter serial port list
v = true  # show debug logging
appName = CreateAgent/Stable
updateUrl = https://downloads.arduino.cc/
origins = http://localhost:8000 #this is where I have setted
#httpProxy = http://your.proxy:port # Proxy server for HTTP requests
crashreport = false # enable crashreport logging


it keep on uploading as shown above :arrow_up: :arrow_heading_up:

please help

In order to make all relevant information available to any who are interested in this subject, I'll share a link to the related report here:


@456951. Have you considered using Arduino CLI instead of Arduino Create Agent?

https://arduino.github.io/arduino-cli/latest/

This is the tool used by the TypeScript-based Arduino IDE 2.x. In addition to a command line interface, it also provides a gRPC interface for tighter integrations with other applications (this is the approach used by Arduino IDE):

https://arduino.github.io/arduino-cli/latest/rpc/commands/

ooh!

  1. you don't need to share because I am the same user who posted it there (in Github and stack overflow) :sweat_smile: sorry don't flag it because I am double posting I will itself end/close it soon.

that's an offline ide I am talking about online uploading technic, to upload anything online I can use `Arduino create agent', it will get the value from web socket(where I send the code) and upload it.

but the issue is in its demo page that I run using

npm run dev

if I click the upload button it keeps on uploading(but never uploads to the board).

I realize that. I didn't share it for your benefit. I shared it for the benefit of the helpers here on the forum and for others who have a similar question and find this thread while searching for an answer.

I didn't have any plans to do that. I am only connecting the dots.

OK. It sounds like a good project.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.