Software Problems: Difference between revisions

From IoT with AME
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:


* [[C++ is not Java]] - C++ can be harsh for people used to Java. Especially memory handling holds a number of surprises.
* [[C++ is not Java]] - C++ can be harsh for people used to Java. Especially memory handling holds a number of surprises.
 
* [[Memory Usage]] - The Arduino is small and powerful - and it all needs to fit in 32kB of flash and 2kB of RAM.
==SoftwareSerial==
* [[SoftwareSerial]] - Sounds great, causes frustration. Emulation thing that need to happen fast has limits.
 
SoftwareSerial sounds like a great way to free up your HardwareSerial connection to the computer, in example for debugging purposes. But it is a source of grief using it to communicated with the ESP8266. You'll be limited to low speed, and chances are you will loose characters anyways.
 
My recommendation: Don't do it, it is an avoidable source of self-created troubles. Programming with an ISP is not a big deal, and so is logging with I2C. Check out [[AC.programmer]]!
 
==Memory Usage==
 
Talking to the ESP8266, dealing with its quirks, and putting a MQTT client on top easily consumes half of the 32kB of program memory and half of the 2kB data memory normal Arduinos have to offer.
 
I first tried to let the air out of the PubSubClient and ESP8266Client libraries, succeeded to a degree, and then decided to write my own MQTT- and ESP8266 libs, designed to rely on streaming as much as possible and to reduce the use of buffers to a few and small occasions, and make use of more compact and readable code.


[[IoT with AME|Home]]
[[IoT with AME|Home]]
__NOTOC__
__NOTOC__

Revision as of 23:15, 14 June 2018

Home

Software Problems

  • C++ is not Java - C++ can be harsh for people used to Java. Especially memory handling holds a number of surprises.
  • Memory Usage - The Arduino is small and powerful - and it all needs to fit in 32kB of flash and 2kB of RAM.
  • SoftwareSerial - Sounds great, causes frustration. Emulation thing that need to happen fast has limits.

Home