Software Problems: Difference between revisions

From IoT with AME
Jump to navigation Jump to search
(Created page with "Stacks =Software Problems= ==SoftwareSerial== SoftwareSerial sounds like a great way to free up your HardwareSerial connection to the computer, in example for debugging...")
 
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Stacks]]
[[IoT with AME|Home]]


=Software Problems=
=Embedded Software Problems=


==SoftwareSerial==
C++ and very small memory pose diverse challenges. The Arduino runtime environment has its intricacies as well.


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.
And then there is other people's software you may not have access to, such as firmware in components. Yes, ESP8266, I'm looking at you!


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]]!
* [[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.
* [[Flaky ESP8266 Behavior]] - It's not always you, sometime the ESP8266 has it's own mind


==Memory Usage==
[[IoT with AME|Home]]
 
__NOTOC__
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.
 
[[Stacks]]

Latest revision as of 12:48, 15 June 2018

Home

Embedded Software Problems

C++ and very small memory pose diverse challenges. The Arduino runtime environment has its intricacies as well.

And then there is other people's software you may not have access to, such as firmware in components. Yes, ESP8266, I'm looking at you!

  • 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.
  • Flaky ESP8266 Behavior - It's not always you, sometime the ESP8266 has it's own mind

Home