Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't compile on arduino Uno: not enough memory #4

Open
jvermillard opened this issue Apr 19, 2014 · 10 comments
Open

Doesn't compile on arduino Uno: not enough memory #4

jvermillard opened this issue Apr 19, 2014 · 10 comments

Comments

@jvermillard
Copy link

Result of compiling microcoap.ino with Arduino IDE: 1.5.6-R2

The sketch uses 14,560 bytes (45%) of storage space programs. The maximum is 32,256 bytes.
Global variables use 2348 bytes (114%) dynamic memory, leaving -300 bytes for local variables. The maximum is 2048 bytes.

@cache91
Copy link

cache91 commented Apr 24, 2014

Yes correct. I was facing this problem. So i had reduced the buffer size and by doing so the program compiled and was up and running. I had also forked this version. Please do check that out.

@jvermillard
Copy link
Author

works fine on a Mega, maybe it would be nice to fix the README because it's claiming it's working out-of-the-box on a Uno?

@tobyjaffey
Copy link
Contributor

README changed. Thanks.

@mcicolella
Copy link

Hi all,
I'm trying to compile on Arduino Uno. With code of cache91 it's OK, but is this code merged here?
Also I can connect and receive data but the commands PUT (0/1) seem not to be executed.
The led is always ON.
Thanks

@valpackett
Copy link

The biggest memory usage is in the endpoints.c file which dynamically constructs the /.well-known/core response. The response should be built at compile time! No reason to keep it in dynamic memory at all.

@draggett
Copy link

draggett commented May 22, 2016

I am considering forking microcoap to avoid the dependency on the Arduino sockets library. I've had success with writing network code from scratch to work with the Ethernet Shield via the SPI bus. The W5100 chip has 16KB of embedded RAM, so that longer UDP packets are not a problem. I've also been able to work this way with binary encoded JSON over TCP and multicast based discovery. A similar lightweight library could be used with the ESP8266 with its embedded WiFi transceiver.

@a-andreyev
Copy link

@draggett, sounds great. I'm also trying to provide something similar (and also looking forward to add json-ld and msgpack support). Right now I'm trying to implement c++ version of microcoap: https://github.com/semiotproject/minicoap to simplify the library API while working with Arduino and provide option to build it for Arduino (also for ESP8266 Arduino firmware), Raspberry Pi (with the Wiring Pi library) and general POSIX-based systems.
I'm also implementing observe option support (right now I have enough memory to support about 50 observations with ESP8266 Arduino firmware but need much more tests).
Please, feel free to criticize me, cause my solution is far from ideal and not stable at all.

@draggett
Copy link

Thanks for the pointer. I look forward to looking at it when I get the time. Right now, I am focusing on a C++ web of things server and looking to include CoAP as one of the protocols.

@Aliraheem
Copy link

plz, could anyone help me? I have the same problem with compiling my code. it shows this message
Sketch uses 231733 bytes (22%) of program storage space. Maximum is 1044464 bytes.
Global variables use 32548 bytes (39%) of dynamic memory, leaving 49372 bytes for local variables. Maximum is 81920 bytes.
I did not understand your solution!

@bmenonathira
Copy link

plz, could anyone help me? I have the same problem with compiling my code. it shows this message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants