Sunday, July 13, 2008

first brainstorming towards the final project


I did a first overall analysing on my white board with all necessary blocks present. This can be seen on the picture left. I will post more and more of those things like drawings and schemes in the near future as my project continues. This becomes possible now because almost all separate functional blocks are ready to be integrate in the final project. I'm also thinking on posting source examples of basic principles I used. I don't know yet how and in what format. Probably I will go for my google pages. I will check out how non proportional fonts look like when rendering on google pages.

Yesterday I tested the linux file/dir notifications 'inotify'. Great results on directory as well as individual file level. again a functionality that is ready to be used. The only block still to look at is the message queues but I'm confident in that because it's a default linux mechanism for inter process communication. I learned this out of one of my books presented in an earlier blog. So still a lot of new things to explore but I learned quit a lot in this passed 6 mounts I must say. The other half of the year will be more dedicated on building my project based on the knowledge I already gathered until now. But there'll always be some time to explore in the side line.

So don't hesitate to rss feed my blog if you want to follow my project. And feel free to write some comments and/or questions on the blogs.

Saturday, July 12, 2008

tests continued

Nice results in testing the GPIO as interrupt source coming from the input PCA ! I assembled the low level stuff in a DLL (SO) file and called from a test program. So the only thing I do is pushing/releasing a button connected with the first IO on the board.Below you can see some stdout printf which gives an idea :

0x00400000
negative edge I/O change detected
read --> 0x01 : 0x00 : 0x00 : 0x00 : 0x00

omit reset:
0x00600000 -> reset int
read --> 0x01 : 0x00 : 0x00 : 0x00 : 0x00

release:
0x00400000
negative edge I/O change detected
read --> 0x00 : 0x00 : 0x00 : 0x00 : 0x00

omit reset:
0x00600000 -> reset int
read --> 0x00 : 0x00 : 0x00 : 0x00 : 0x00

When the mask is 0x00400000 the button is pushed when the mask is 0x00600000 the button is released. Of course the positive edge will be omitted because this means that the interrupt is being cleared by the i2c readout.

The only thing left to test is the DAC values when the resistors are replaced. I also ordered a bigger SDRAM of 64Mb. Fingers crossed ;-)

Wednesday, July 9, 2008

i2c shared library continued

Previously I told you about some problems I encountered with writing my proper library to interface the I/O functionality of the i2c extension board.

- One of the leds didn’t work --> replaced and ok

- One opto coupler not connected --> wire patch and ok

- Unload function called twice --> constructor copy/paste error ok

After that I continued with testing the DAC. It was soon obvious that the levels were not correctly emitted. 3/4 of maximum digital input was already maximum analogue output. I discussed it with my friend who did the hardware and soon he saw an issue in the calculation of R2/R1 for the opamps he forgot the 1. The correct one was:

Vo = 1 + R2/R1

So he had to order some new resitance with 1.65K. Replacement planned for this weekend. I also finished testing my shared library interface now. I covered following :

  1. Writing all banks output PCA
  2. Writing per bank output PCA
  3. Reading all banks input PCA
  4. Reading per bank input PCA
  5. Writing all DAC
  6. Writing individual DAC

Error messages are logged into syslog system because this must be able to run as a daemon without stdin/out. Next thing todo is making a GPIO shared object on the same basis as i2c one. Finally test this out with a small interrupt handler that catches the pca level changes and act appropriate. If that is covered I only need to write one more proof of concept for the playing the wav files. This will be done using linux message queues. Also a little daemon process that sits and wait on new sound demand arrivals. Whenever these things are done, I hope end of this mounth, I finally can start with the real domotic logic.

Thursday, July 3, 2008

webtoolkit

After putting an enormous effort in porting the boost/wt I gave up because I found a better way to reach my rich client interface. There were still undefined errors on some functions even after a new buildroot. I posted two avrfreaks topics but as most of the time they face out and are doomed to die after introducing detailed problems or even things that are "too simple" for certain individuals or once you get off the front forum list page:

http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=65818

http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=65743

Instead of spending hours of iterating trying to find the buildroot problems JavaScript is the one to go for if you want to redirect and lighten the burden on the server site. I bought two books on the subject:

- JavaScript: The Definitive Guide, 5th Edition (David Flanagan)

Need to learn JavaScript fast? This best-selling reference’s visual format and step-by-step, task-based instructions will have you up and running with JavaScript in no time. In this completely updated edition of our best-selling guide to JavaScript, leading Web and computing experts Tom Negrino and Dori Smith use crystal-clear instructions and friendly prose to introduce you to all of today's JavaScript essentials. Along the way, you'll find extensive coverage of Ajax and XML techniques, current browsers (Opera, Safari, Firefox), and more.

- JavaScript and Ajax for the Web, 6th Edition: Visual QuickStart Guide (Tom Negrino, Dori Smith)

Two brand-new chapters explain the cornerstones of the Ajax application architecture: scripted HTTP and XML processing. Another new chapter shows how to draw client-side graphics using the tag and other cutting-edge technologies. Yet another new chapter explains the use of namespaces in JavaScript: essential when writing complex programs, rather than simple scripts. This edition also includes new material on classes, closures, persistence, Flash, and JavaScript embedded in Java applications.
As always, JavaScript: The Definitive Guide is both a complete programmer's guide and a keep-on-your-desk reference manual. Part I explains the core JavaScript language in intimate detail. If you are new to JavaScript, it will teach you the language. If you are already a JavaScript programmer, Part I will sharpen your skills and deepen your understanding of the language.
Part II explains the scripting environment provided by web browsers, with a focus on DOM scripting with unobtrusive JavaScript. The broad and deep coverage of client-side JavaScript is illustrated with many sophisticated examples that demonstrate how to:Generate a table of contents for an HTML document :
Display DHTML animations Automate form validation Draw dynamic pie charts Make HTML elements draggable Define keyboard shortcuts for web applications Create Ajax-enabled tooltips Use XPath and XSLT on XML documents loaded with Ajax And much more...
Part III is a complete reference for core JavaScript. It documents every class, object, constructor, method, function, property, and constant defined by JavaScript 1.5 and ECMAScript version 3. Part IV is a reference for client-side JavaScript, covering legacy web browser APIs, the standard Level 2 DOM API, and emerging standards such as the XMLHttpRequest object and the tag.
About the AuthorDavid Flanagan is a computer programmer who spends most of his time writing about JavaScript and Java. His books with O'Reilly include Java in a Nutshell, Java Examples in a Nutshell, Java Foundation Classes in a Nutshell, JavaScript: The Definitive Guide, and JavaScript Pocket Reference. David has a degree in computer science and engineering from the Massachusetts Institute of Technology.

These are to ones I'm going to read during the summer period and of course practice a bit the language spec. So in fact the user interface can now be served by PHP as cgi and JavaScript as the client site enrichment. Nice I would say.

I tested yesterday my i2c shared object that will contain all i2c functionality internally divided in following structure:


- general
- board specific
- pca specific
- dac specific


Tests are going well. I saw that one of the leds acted some kind unstable but it's now back ok. And also the fact of missing a one of the inputs. This must have some further investigation. But normally the library itself proceeds very well. I introduced the _fini/_init load and unload functions to trigger those actions. Strange thing was the whenever my test executable starts and load the SO lib I get a unload event first. This is kind strange though because there's no other process that uses this lib. I check on it with strace.