Skip to content

Instantly share code, notes, and snippets.

@costyn
Last active December 26, 2020 20:22
Show Gist options
  • Select an option

  • Save costyn/73d5e8a91ca4e6fb269a9d71da10ca3d to your computer and use it in GitHub Desktop.

Select an option

Save costyn/73d5e8a91ca4e6fb269a9d71da10ca3d to your computer and use it in GitHub Desktop.

Revisions

  1. costyn revised this gist Dec 26, 2020. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions platformio.ini
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,8 @@ framework = arduino
    board = uno
    upload_protocol = custom
    upload_flags =
    --request POST
    --data-binary "@$SOURCE"
    upload_command = curl $UPLOAD_FLAGS https://wokwi.com/api/projects/save/hex
    --header "Content-Type: application/json"
    --data "@diagram.json"
    upload_command = curl $UPLOAD_FLAGS https://wokwi.com/api/projects/save
    extra_scripts =
    post:curl --request POST --data-binary "@$SOURCE" https://wokwi.com/api/projects/save/hex
  2. costyn created this gist Dec 26, 2020.
    12 changes: 12 additions & 0 deletions platformio.ini
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    ; https://docs.platformio.org/en/latest/projectconf/section_env_upload.html#upload-command
    ; https://stackoverflow.com/questions/9134003/binary-data-posting-with-curl

    [env:uno]
    platform = atmelavr
    framework = arduino
    board = uno
    upload_protocol = custom
    upload_flags =
    --request POST
    --data-binary "@$SOURCE"
    upload_command = curl $UPLOAD_FLAGS https://wokwi.com/api/projects/save/hex