Reduce Code Size

1.My goal is: To reduce the firmware size
2. My actions are: I am using the mjs , I have edited the yml file and instead of using
jsbundle, I am adding libraries manually. This has helped me reduce the code size a bit. I am using the fs file system. I want to further reduce the code size. Is there any other options to reduce the code size? Here is the snapshot of my mos.yml file.

Here is the snapshot of my init.js file… The load files inside the yellow box are the code files of our code.


3. The result I see is: The code size has increased and the esp is giving core dump because of that. After removing js bundle and manually enlisting libraries, the code worked fine as the size was reduced. Now again , the code size has increased due to feature updates, now esp is again giving core dump problem.
4. My expectation & question is: I am using the mqtt , mdash , gpio , timer, file libraries. Can someone point on how to reduce the size of code ? Is there any library I can reduce? Or is there anything else which can reduce the size of the firmware?

Some ideas

1 Like