Monthly Archives: April 2012

Tom 4.20.2012

Start: 10:00

  • The states of the ComUtil now cycle properly.  If data starts on the PC side but the data doesn’t print out properly when transfered back from the arduino
  • When starts on the arduino side, its prints out properly but then gets stuck after the trys to send then goes into a state that it shouldn’t be able to get to.
  • There is something wrong with the receive method on the arduino.
  • The Mega has 4 serial ports.  I can print out variables and stuff on another port without interfering with the data transfer.
  • Noticed that TRUE on the arduino is defined as !FALSE.  On the PC TRUE is 1.  I can’t see why this would cause me to get into odd states but considering the code is identical on both sides and the arduino is being more wacky than the PC maybe this is the problem.

End: 6:00

Dong Shin 04.20.2012

Mike 4.20.2012

  • Usual backups at site
  • The PKI site was back up so I was able to access the signed cert.  Couldn’t figure out how to construct the .jks file from it, Phil said he would show me on Monday.
  • No word from the firewall people.
  • Back at the mill reading about Maven best practices and general java naming conventions

Phil 12.20.12

8:00 – FP

  • Installing arduino drivers and generally setting up environment.Done
  • Working on understanding ASCII serial communications
  • Serial echo:
    const unsigned int BAUD_RATE = 9600;
    void setup(){
    void loop(){
      int numChars = Serial.available();
      if(numChars > 0){
        Serial.print("numChars = [");
        Serial.print("] string = ");
        for(int i = 0; i < numChars; ++i){
          // returns the first byte (int?) of incoming serial data
          // available (or -1 if no data is available) - int
          char inp =;
  • Turns out that I don’t have Visual Studio here. Talking from C++ will have to wait until this afternoon.
  • The arduino book references arduino-serial.c for example c code. The book’s code is here.

Tom DeVito 4.19.2012

Start: 9:00

  • After lots and lots of headaches I have finally got it to do an echo test.
  • The data corrupts over time because there is too many parts of the code that can trigger a sendmessage()
  • I need to make it so only one part of the code sends a message and that only one message can be sent per pass
  • I need to optimize the state machine and simplify it.
  • Need to get this done so I can focus on the hardware next week.  I will be in on the weekend if I need to.

End: 6:00

Tom DeVito 4.18.2012

Start: 9:00

  • Worked on figuring out what was wrong with the code which allows more than one packet to be send.
  • Fixed calculations for number of packets and for figuring out buffer position when loading the buffers
  • uint8_t has a weird definition in the avr world.  I changed all instances to unsigned char to ensure this didn’t cause any problems for me.  uint16_t is still required
  • Started using the addon I recommended in the previous post.  It pretty much automates everything that is really annoying.
  • Fixed lo0ts of minor bugs and things that could potentially cause major problems but Still can not get the arduino to receive properly

End: 10:00

Mike 4.19.2012

  • Usual backups at site
  • No word on my help ticket regarding the production server connectivity
  • Since the production server IP address changed I decided to get it a new PKI Cert in hopes that might resolve the issue.  I applied for it yesterday, it was approved, and today the download site is unreachable.
  • Back at the mill looking at GWT Calendar widgets from various libraries

Dong Shin 04.19.2012

  • got GWTRequestFactory working with hibernate JPA..
  • to create GWT Request Factory with Hibernate…
    1. create a domain model class, e.g.,
    2. create a server service class that contains EntityManagerFactory, e.g.,
    3. create a service locator class that extends Locatorr<T, ID>, e.g.,
    4. create a proxy interface in Client that extends EntityProxy and defines ProxyFor, e.g., PersonProxy
    5. create a request interface that extends RequestContext and defines service, e.g, PersonRequest
    6. create a request factory interface that initialize the request in step 5, e.g., PersonRequestFactory
    7. create a persistence.xml that defines database properties and object relation mappings
    8. create a orm.xml that defines entities used in persistence.xml

Phil 4.19.12

8:00 – FP

DataCommunication Library Requirements


  • Check serialize Method
  • Flush loops enough times completes data transfer.  Need to integrate all the communications stuff into this method.  (Implemented but Dependent on ComUtil Progress)
  • Add get data to data dictionary level.
  • Add error checking to importData.  ??? possibly done needs testing
  • Add a define for name length.


    Get Large Data Transfer Working Reliably

  • Make sure message is sent before data.
  • Fix Constructor on Arduino side
  • Determine if FinishedProcessing should send a message (No it should not, I need to make it so only one part of the program sends messages for better reliability)
  • clearRBuffer() on PC side missing rbufindex reset
  • Change CTS case in handshake switch to receive message then data.  Remove receiveMessage() from the ReceiveDataMethod.
  • Fix Pointer intialization in both version of the receiveData method
  • Figure out if the state commented out is necessary in changeState() both sides
  • Adjust methods to evaluate the number of bytes read/written to determine true/false return ???  For some reason the counters in the windows api don’t seem to return properly
  • Optimize logic for less passes and better reliabilty


  • Change return of Send and Receive methods on both sides to return number of bytes read/written  This doesn’t work very well.  For some reason the variable that is supposed to return the data sent does not seem to work at all.
  • Figure out why the Arduino is not receiving properly


  • Need to add variables with names and sizes mirroring the PC side
  • adjust logic for new variables
  • add some commands for various feature(ex. Material)


Mike 4.18.2012

  • Usual backups at site
  • The firewall team replied to my help desk request saying the firewall is open just fine because their firefox responds with a generic SSL error when trying to connect to our production server.  I recreated their results both with our webserver on and off and asked how it could be an SSL issue if the server is not even on and firefox reports the same error.  Waiting for a reply…
  • Back at the mill, tried checking in my log changes to svn and it wouldn’t go.  So I deleted my sandbox project, redownloaded the latest checked in version, and redid all my changes: checks in fine now.
  • Added a cursor example page to my sandox, clicking buttons changes the cursor to various options: default, wait, help, hand, etc.

Dong Shin 04.18.2012

  • spent past few days going over GWT Request Factory tuorials. Not many helpful tutorials out there…. Phil’s GWT in action book helped a lot. The example projects from the book contains Maven projects, but need some tweaking to work in my environment.
  • got GWTRequestFactory project working
  • got Mike’s sandbox project working – hibernate stuff
  • working on GWTRequestFactory with Hibernate (PPM Database)
  • Basic JPA attribute mapping to XML

Tom DeVito 4.17.2012

Start:  11:00pm

  • Found the main problem with the comutil.  Apparently I started implementing the large data transfer but did not finish so it was bugging out.
  • For whatever reason, casting the return of ceil(float), wouldn’t work the way I am used to (int)ceil(float).  Instead I had to use int(ceil(float)).
  • Fixed the problem with calculating packets of data in the send buffer and the packets sent counter.
  • The reason I needed to move the message from the end of the data transefer to the beginning is the number of packets was getting corrupted and returning 255.  This meant that every send tried to send 255 packets.  Single transfers were working fine but multiple pass echo testing was broken.
  • Still having a problem with echoing back from the arduino.  I also need to test multiple packet data to make sure that it is actually working as intended.
  • Changed the name of the library from ComConsoleLib.lib to DataCommunication.lib
  • The ComMonitor class is now just called Monitor
  • _isLocal and related methods and variables are now called isShared.  This signifies data that will cross the wire.  The criteria to send something across is that it must be initialized as isShared and be dirty.  An object becomes dirty when you use the setData method of the DataElement.  Although its not the most memory efficient way to do things, using container variables in your class and then sync them with their datadictionary entries at the end of the classes cycle, may be the best way to ensure the datadictionary is aware of the change without having to use the dataelements set command throughout your whole class.
  • —- This is a add-on for Visual Studio.  It has a lot of good reviews from c++ developers as it adds a lot of the convience of the .net/java ide.  It is not free but their is a trial so I will see if its worth the money.  It is $250 for the professional license or $100 for the personal license.

End: 7:00am

Mike 4.17.2012

  • Usual backups this morning
  • Someone got back to me about my help ticket concerning connectivity to our production machine.  They believe the firewall change request was not correctly filled so they are checking with the firewall team and will get back to me
  • Back at the mill incorporating Dong’s gwtLogger in to my sandbox to try it out, local log works well so far
  • Helped Dong build my sandbox so he can check out my hibernate usage