Skip to content

How to POST bin file instead of hex file? #671

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

Closed
dhanushshettigar opened this issue Nov 13, 2021 · 2 comments
Closed

How to POST bin file instead of hex file? #671

dhanushshettigar opened this issue Nov 13, 2021 · 2 comments
Assignees

Comments

@dhanushshettigar
Copy link

I am using esp32 as a board, compiled output generates bin files.is there any way to upload bin file through Arduino create agent js client

@umbynos
Copy link
Contributor

umbynos commented Nov 15, 2021

Hi @dhanushshettigar, The documentation mentions:

hex contains the sketch binary encoded in base64 (could decode in Intel hex or raw binary)

But does not have to be an hex file, in fact it can be also be a bin file (it's only a different format, but it's a binary), remember to use the correct name and extension in the filename field.

For esp32 you need also another set of files to upload:

  • /tools/partitions/boot_app0.bin
  • /tools/sdk/bin/bootloader_qio_80m.bin
  • Blink_ESP32.partitions.bin

You can place them in extrafiles with the correct filename:

{
   "board":"esp32:esp32:esp32:CPUFreq=240,DebugLevel=none,FlashFreq=80,FlashMode=qio,FlashSize=4M,PSRAM=disabled,PartitionScheme=default,UploadSpeed=921600",
   "commandline":"python \"{runtime.tools.esptool_py.path}/esptool.py\" --chip esp32 --port \"{serial.port}\" --baud 921600  --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 \"{runtime.platform.path}/tools/partitions/boot_app0.bin\" 0x1000 \"{runtime.platform.path}/tools/sdk/bin/bootloader_qio_80m.bin\" 0x10000 \"{build.path}/{build.project_name}.bin\" 0x8000 \"{runtime.platform.path}/{build.project_name}.partitions.bin\"",
   "data":"6QYCL1QeCEDuAAAAAAAAAAAAAAAAAAABIABAP...",
   "extra":{
      "use_1200bps_touch":false,
      "wait_for_upload_port":true
   },
   "extrafiles":[
      {
         "filename":"/tools/partitions/boot_app0.bin",
         "hex":"AQAAAP///////////////////////////////5qYQ0f..."
      },
      {
         "filename":"/tools/sdk/bin/bootloader_qio_80m.bin",
         "hex":"6QQCL7QGCEDuAAAAAAAAAAAAAAAAAAABGAD/PwQAAAD/////HAD..."
      },
      {
         "filename":"Blink_ESP32.partitions.bin",
         "hex":"qlABAgCQAAAAUAAAbnZzAAAAAAAAAAAA..."
      }
   ],
   "filename":"Blink_ESP32.bin",
   "hex":"6QYCL1QeCEDuAAAAAAAAAAAAAAAAAAABIABAP...",
   "network":false,
   "port":"/dev/ttyUSB0",
   "signature":"9eaedb39254e3891828c6cae2e9c208985..."
}

PS command line could change depending what OS are you using: on linux there's no compiled binary, and you have to use esptool.py to upload code using the agent. The agent only runs the command line to upload code to a board, using external tools to achieve it.

@dhanushshettigar
Copy link
Author

Hi, @umbynos Thanks for the help,

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