Monday, June 23, 2008

UPB Functionality Moved

I'm having some issues with multiple serial ports interacting in starCOMUltra and Bill is taking a look at it. Basically, what I have is a WGL800 attached to one serial port and the UPB PIM on another. I was trying to send a UPB command out one serial port after it receives a wireless X10 signal from the WGL800, but for some reason it locks sCU. While Bill is investigating this problem, I added a serial port to my xPL sCU app and moved the PIM there. It was a very smooth transition as I just had to copy the jscript I was developing on sCU to xPL sCU. Now, UPB functionality in the system is controlled by xPL. This adds another layer of communication to get UPB going, but it's transparent to the user and UPB is much faster than X10 so it's not noticeable. When the sCU issue is resolved, I can just copy everything back to the sCU script and be up and running in no time.

Once I got the basic communication established, I was able to work more on integrating UPB. As we are running both X10 and UPB, and sCU and the TimeCommander+ have no UPB support, I had to implement a method to maintain state of non-X10 devices. We already have state mirrored in mySQL and the database is accessible in jscript, sCU and our web interfaces, so this was the logical place to dump UPB device state. After I got all that worked out, I implemented register reads and writes from/to the PIM, UPB device queries and handling of status responses. I also added code to handle status reports from devices when local control turns on the device. I threw in some error handling to retry commands for PIM busy and device NAK conditions. Finally, I coded a function to parse the UPStart export file so that both sCU and xPL sCU have the most updated list of UPB devices. All this achieves the basic level of UPB functionality I initially set out to do. I have some kinks to work out as some things aren't quite working perfectly yet, but when that's done, I'm going to park the UPB stuff for a while and work on other projects. In the future, I want to take a look at other UPB features, like links, etc.

No comments:

Post a Comment