moononournation / ATtinyPowerMeter

34 stars 8 forks source link

Sketch uses 6514 bytes (108%) of program storage space. Maximum is 6012 bytes. (Digispark) #1

Closed rradar closed 5 years ago

rradar commented 5 years ago

Hello @moononournation sorry to bother. I stumbled upon your instructables yesterday and were very impressed by your work. I anted to start right away with this project. I don't have attiny85 but a digispark which is driven by a tiny85.

I have the first one in this picture: image

I tried to compile your sketch with the arduino IDE 1.8.6 but get the following error message:

Sketch uses 6514 bytes (108%) of program storage space. Maximum is 6012 bytes.
Global variables use 110 bytes of dynamic memory.

Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it.
Error compiling for board Digispark (Default - 16.5mhz).

Is there anything I can do about it? I would really like to have this DIY Power Meter :cry:

image

rradar commented 5 years ago

I think I found the important diffrence between a pure ATTiny85 and the digispark.

So the question: Is it possible to shrink the code by 8% (=502 bytes) to fit into the digispark? Maybe a lite version... even though I have no idea were to save space :confused:

moononournation commented 5 years ago

Hi radar, there are INA219 and SSD1306 exist before I made this project. I cannot use those library because it cannot fit in 8 KB storage. My tailor-made libraries already squeeze much in size. I think there are still 2 places you may try:

rradar commented 5 years ago

Hi @moononournation

thank's for your feedback! Meanwhile I had success to shrink my boot loader (see this instructable for more) of the digispark to have unbelievable usable space for program code of 6714 bytes! :smiley:

Right now I have only problems to flash any program code via arduino on my digispark. But I will get over it hopefully! https://github.com/micronucleus/micronucleus/issues/130 previously and now https://github.com/micronucleus/micronucleus/issues/131

moononournation commented 5 years ago

It is a good news to heard that the reset pin still work to flash latest micronucleus!

rradar commented 5 years ago

It works @moononournation !

image

Thank's a lot! I made it :smiley:

moononournation commented 5 years ago

As per your screen output, you may still using the outdated TinyWireM library bundle with DigiSpark. You can download the bug fixed version at Arduino Library Manager.

rradar commented 5 years ago

@moononournation thank's for your feedback! How can you see it? Is it the spots on the right side in the screen? My screen actually has one dead line you can see in the mWh...

Does it just help to download the TinyWireM library in arduino and than compile the sketch again? Or is it necessary to do more steps like changing the code?

moononournation commented 5 years ago

yes, download, compile and upload