Hi all,
Yesterday I finally got the WolfSSL client (ported my @cermak) connected to AWS IoT. It’s not a stable connection yet, but I’ll post the file back to Rob’s repository as soon as it’s working as it should. My biggest hurdle right now is finding space to run any kind of application. Thanks to @peekay123 I now know exactly how much memory I have available on Photon/P1 and it’s not a lot given that WolfSSL takes up 118Kb.
I’m compiling locally and I’m now inspecting my .map file for ideas of how to free more memory to make this useful. Looking at the .map file there are several classes related to float handling that I don’t think I need.
For example - libgcc links “arm_addsubdf3.o” with methods named “floatdidf”,“aeabi_ui2d”, “floatunsidf” and a host of other large items. I presume this is for handling addition, subtraction but several of them seem to involve specific routines for Floats and I’m pretty sure that I can survive without that. How would I go about removing it? Are there any flags I can set to save memory?
@jenschr, if you are willing to not use OTA, you may be able to get more space byt compiling a monolithic image (like the old Core). You will need to flash via DFU and it is assumed you are compiling locally. The make is in the lines of this:
cd firmware/main
make clean all PLATFORM=photon MODULAR=n
This is unknown territory so YMMV as to the size of image you can get on the device.
I’m up and running with two very stable project builds yielding excellent connection reliability to AWS IoT. I’m running the WolfSSL v0.0.2 port by @cermak “out of the box”, and even with all my app specific code, I’m still able to fit with some spare.
One app is doing some high speed analog sample/capture with analytics that packages up the results into JSON payloads, and the other is an edge device monitoring a mesh network of endpoints that also frames up database snapshots into JSON. They’re what I’d categorize as mid-weight operations doing some involved processing, and my worst case usages are as follows:
Memory use:
text data bss dec hex filename
121244 288 5024 126556 1ee5c /workspace/target/workspace.elf
Longer term for me, OTA is not necessary as these things will be mature enought for standalone operation. The bigger question will be provisioning at scale and if Photons are the right fit.
This is hard to read. If you have the library working and you just want to focus on your code, you can turn off the error strings: NO_ERROR_STRINGS. That will give you 11k. I don’t remember if the server code is turned on, if so, turning that off saves 6k.
@jimini I’m curious - what extra code did you add to connect to AWS IoT? We’ve made a wrapper class that adds the standard PubSub client and with that in place we’re spending 118Kb without having any app in there.
@jenschr, I didn’t add anything in the way of code… I did add all my endpoint specifics and cert/key instances. The client is working out of the box, and all I have done is cleanup and modularization of the example code in the project.ino as repo’d in the GitHub example.
I’ve yet to go disable these other pieces of WolfSSL, nor have I had to consider doing so thus far. Where are these located @cermak?