Skip to content

WIP: Added possibility to send messages larger than 1400 bytes...

Viktor Kynchev requested to merge vkynchev/painlessMesh:master into master

I've done developing the functionality. I've tested that you can successfully send over 15kB but directly from Serial(i.e. not saving the message in variable). I've restricted the MAX_MESSAGE_BUNDLE_SIZE in painlessMesh.h to prevent the free memory to fall under the 16000 bytes limit. If anyone wants he/she could change it and the ESP should be successfully sending larger messages(i think 4kB is large enough 🆗).

The way I've tested it:

  • declare variable in the ram with random text with size 4kB
  • send that variable every 10s
  • print the length of everything received from the mesh

Other minor fixes:

  • removed the JSON_BUFSIZE as it is no longer needed by the ArduinoJson library (as long the buffer is dynamic it will expand over time if needed)
  • changed _nodeId to be the ESP.getChipId() as I find it more practical. Every ESP comes with its random ID assigned from the factory...
  • indented the switch statements better(I think it's easier to read)
  • fixed NUMBER_OF_TIMESTAMS to be NUMBER_OF_TIMESTAMPS

@BlackEdder If you want to merge this, please first test it on your hardware as I may have missed something to debug and write comment so I can fix it... After that I'll remove the WIP: thing up there 👌

Merge request reports