Start: 9:00
- Figured out what was wrong with the responses. They were being entered into the dictionary by the class above them, so when the child class created them the entry already existed. Originally the subscribe/publish methods were returning the dataelement, so I changed it to return the data pointer instead and set the local pointer to the result of these methods.
- C++ does not have a standard super keyword for dealing with super classes because of multiple inheritance. Parentclass::method seems to work though.
- Pure Virtual needs to be defined to be used on the arduino similar to the way new and delete do.
- Here is a useful link for fixing problems with c++ on the arduino: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=410870
- Pure Virtual is not needed for what I am doing. It makes the method abstract as opposed to being able to override it.
- Strange problem with the arduino initializing the child classes of controller. For some reason sargent works fine. The others end up in an infinite loop of initialization. There is nothing obviously different about how these classes are initialized.
- Not sure why it was looping before, now it only does it if I have two initializing at the same time
- The sequence of checkpoints goes 1,2,3,4,5,1,1,2,3,4,5,1,1,2,3,4,5. The five is part of the sargent’ s classes of special init class, so it seems to be resetting. If I take sargent out, lieutenant does the same thing, when private is also initialized, but only counts to 4 cause I didn’t add one to its own init.
- The problem was a memory overflow. The command, state, and response classes had 255 byte names. These quickly filled up the 8kb of arduino sram. Once everything is working well, I am going to go back and make these classes and the way they work with the controller more efficient.
- Before I start playing with the ComUtil and wired communication, I am going to write a debug utility class to make debugging on the Arduino easier.
- Checking out Apache log4cxx
- Decided to hold off on this til after the communications are working. The main reason is because I have very limited ability to print straight from the Arduino. I already have a console class which can handle displaying messages like this.
- Dropped the working classes from the testing project to the arduino project and committed the changes to subversion.
- I did not realize we only had 8kb of memory. If I am using a 1024 char buffer for ComUtil I am using 1/8th the running memory just for this. Maybe I should send each remote entry individually, instead of sending all at once.
- When asking Phil what the largest thing would be that we need to send over the wire, he said the logger would be. I am thinking that the log data can be stored as elements which the PC side can decode into strings that are meaningful. This would cut down the memory usage of the logger. This may be a bit more difficult then I think.
- I am going to leave the com buffer at 1024 for now, if we run out of memory, we will know where to cut first.
End: 5:00
Arduino Mega(2560) Memory Specs: 256kb storage space, 8kb SRAM for running programs, 4kb EEPROM for storage of variables you want to persists even when the Arduino loses power.
Possible solution if we run out of memory: http://hackaday.com/2011/09/07/want-2-megabytes-of-sram-for-your-arduino/
How store variables in the flash memory instead of SRAM: http://www.arduino.cc/en/Reference/PROGMEM (I’ll test this out, once the communication is working)
