Copyright ©

Mongoose OS Forum

ATTENTION! This forum has moved to:

Do not post any new messages.

Smart.js debugger?

Any plans to implement a debugger? Maybe something that conforms to the Chrome Debugging protocol?


  • @Capstan , do you mean something like ?

    Which platform(s) would be most important to you?
  • CapstanCapstan Texas, USA

    I write quite a bit of node.js code and use node-inspector which allows me to debug it with the Chrome debugger. This allows me to use the same exact debugger for javascript running in the browser and for node.js code running on a server. And in fact I am writing server code in Node that interacts with smart.js on the ESP8266, and debugging that the same way.

    I don't know how technically feasible it is, but if you could get smart.js to fit in to that same debugger environment it would be truly awesome. Maybe you could investigate how node-inspector does it and provide the appropriate hooks in smart.js?

  • We'll take a look and see how feasible is to use the chrome debugging protocol;
    no ETA yet; the protocol per se is not the biggest problem, it's not easy to provide debugging information with such a small amount of memory.
  • CapstanCapstan Texas, USA
    Maybe you could make it the inclusion of debug capability a flash option in FNC. Or a build option when the firmware image is made.

    Which brings up another issue. The nodeMCU community (Lua) has a mechanism whereby you can leave out specific subsystems you don't intend to use when you build their FW. For example, if I'm not going to use MQTT, SPI, and I2C in my Smart.js  project it would be nice to leave them out of the build and reclaim that memory.
  • yeah, we have a lot of build flags as well. Unfortunately they are not all documented in the same place and many are not even documented.

    and grep SJ_DISABLE_ in the firmware sources:


    Look at the You can add your flags to the `FEATURES` variable
  • CapstanCapstan Texas, USA
    Thanks for the info. Does removing some of those features free up RAM? Or does it just reduce the size of the flash?
  • The build flags are intended as a way to reduce the code size.

    Some optional features might include a global variable, so you might shave of a few bytes. Most of the data structures comprising the JS APIs for those functionalities are kept in ROM/flash and they they don't consume RAM if you don't use them.
Sign In or Register to comment.