GithubHelp home page GithubHelp logo

Comments (20)

brycekahle avatar brycekahle commented on May 29, 2024

I think I know what the error is. Can you try specifying platformId as '6'? If that fixes it, I will fix the library.

from particle-api-js.

ethantmcgee avatar ethantmcgee commented on May 29, 2024
var fdPr = particle.flashDevice({
    deviceId: deviceId,
    platformId: '6',
    files: {"temp.cpp": "./" + deviceId + ".cpp"},
    auth: authToken
});

I tried it as both 6 and '6' with the same error message resulting.

Edit: fixed spelling error and same error message.

from particle-api-js.

brycekahle avatar brycekahle commented on May 29, 2024

Are you using this from node or the browser? I noticed you are using a relative file path too, so I would verify that is correct.

from particle-api-js.

ethantmcgee avatar ethantmcgee commented on May 29, 2024

I am doing this from node, and yes, the relative file path is correct.

-- 
Ethan McGee
Sent with Airmail

On March 21, 2016 at 2:15:33 PM, Bryce Kahle ([email protected]) wrote:

Are you using this from node or the browser? I noticed you are using a relative file path too, so I would verify that is correct.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

from particle-api-js.

brycekahle avatar brycekahle commented on May 29, 2024

Another note is that you can call only flashDevice if you want, and it will compile and flash.

from particle-api-js.

ethantmcgee avatar ethantmcgee commented on May 29, 2024

I noticed that from the documentation on the main site. However, when I encountered the stream error with flashDevice I wrapped it in a compile thinking maybe flashDevice failed if there was a syntax error in the cpp.

from particle-api-js.

brycekahle avatar brycekahle commented on May 29, 2024

I've definitely tested this from node and had success. Can you try using the absolute file path?

from particle-api-js.

brycekahle avatar brycekahle commented on May 29, 2024

Oh, is compileCode succeeding but flashDevice is failing?

from particle-api-js.

ethantmcgee avatar ethantmcgee commented on May 29, 2024

Yes,

That is the issue that I am experiencing.  Compile works correctly, flash throws the streams error.

-- 
Ethan McGee
Sent with Airmail

On March 21, 2016 at 2:26:14 PM, Bryce Kahle ([email protected]) wrote:

Oh, is compileCode succeeding but flashDevice is failing?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

from particle-api-js.

brycekahle avatar brycekahle commented on May 29, 2024

Got it. I know the issue. New release forthcoming.

from particle-api-js.

ethantmcgee avatar ethantmcgee commented on May 29, 2024

Thank you much. Please let me know when to pull.

from particle-api-js.

brycekahle avatar brycekahle commented on May 29, 2024

5.2.4 just published

from particle-api-js.

ethantmcgee avatar ethantmcgee commented on May 29, 2024

Also, as an aside.

The documentation on docs.particle.io hasn't been updated to reflect changes to the JS API. It states that compile and flash both take a list of files rather than an object. Anyone that does some poking can find the discrepancy, just an FYI.

from particle-api-js.

brycekahle avatar brycekahle commented on May 29, 2024

Thanks for the heads up on that.

from particle-api-js.

ethantmcgee avatar ethantmcgee commented on May 29, 2024

Does flash device queue the binary until the device turns on? The API call returns true even though my device is definitely off.

from particle-api-js.

brycekahle avatar brycekahle commented on May 29, 2024

Not at the moment. Are you using a Photon or Electron?

from particle-api-js.

ethantmcgee avatar ethantmcgee commented on May 29, 2024

Photon.

from particle-api-js.

ethantmcgee avatar ethantmcgee commented on May 29, 2024

Should I continue passing the platformId of 6?

from particle-api-js.

brycekahle avatar brycekahle commented on May 29, 2024

For flashDevice it is not needed because you are passing the deviceId.

from particle-api-js.

ethantmcgee avatar ethantmcgee commented on May 29, 2024

Okay, well in any case, flashDevice returning true even when the device is off is not problematic to my use case. It just wasn't what I expected.

Thanks for your assistance.

from particle-api-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.