Is it possible to reduce SRAM usage of Arduino Nano ethernet MySensors gateway (based on ECN28J60) ?
-
I need only few binary sensors/switches (relays) controllable from HomeAssistant, so I hoped to add their simple logic to
https://github.com/mysensors/MySensorsArduinoExamples/blob/master/examples/GatewayENC28J60/GatewayENC28J60.ino
But building above already takes: Sketch uses 29276 bytes (...) Global variables use 1757 bytesI tried to reduce SRAM usage, but disabling MY_DEBUG, MY_RADIO_RF24, MY_INCLUSION_* , MY_DEFAULT_* reduces sizes to
Sketch uses 22980 bytes (...) Global variables use 1626 bytes (79%)
onlyIs there any way one can go down with SRAM usage further?
-
@matkor yes. Use the W5100 module instead (if you need ethernet)
If you donât need ethernet, use usb or wifi since those options also use less ram.
-
Use the W5100 module instead (if you need ethernet)
Good idea, thanks! Same code, but only W5100 based:
Sketch uses 17190 bytes (...) Global variables use 853 bytes (41%)Using W5500 ( Ethernet2.h ) gives even better:
Sketch uses 14712 bytes (...) Global variables use 809 bytes (39%)If you donât need ethernet, use usb or wifi since those options also use less ram.
I need some kind of 25m wire so options are ethernet, RS-485 or PJON