Home automation
ciasaboark / apparatus-templi Goto Github PK
View Code? Open in Web Editor NEWA home automation framework and implementation written in Java and C++.
A home automation framework and implementation written in Java and C++.
Auto-detecting the serial port the local arduino is connected to is problematic. Simplify design by only connecting to the serial port named in the config file or on the command line.
Defaulting to the dummy serial connection will allow the service to be run without any hardware attached.
Outgoing messages should be automatically fragmented if the data block is too large.
Log file should only store log messages equal to or higher than the current log level.
Seems to be a different problem then #11.
Occasionally calls to storeTextData()
or storeBinData()
will generate a SQLException.
Hard to reproduce, only occurs once between a few hundred to a few thousand writes, sometimes not at all.
Implement basic database storage and retrieval methods.
Need a javascript solution to change the driver xml data into html to be displayed as widgets
System will deadlock if multiple threads try to send/receive messages at the same time. Do not run the system with more than one driver active for now. Disable as many response messages from the remote modules as possible.
Coordinator.parseCommandLineOptions() only looks for a few options, but running with —help will list a large number of possible options. Either these should be removed, or they should all be parsed.
Copyright headers need to be added to source files.
README file needs to be written
INSTALL file needs to be written
COPYING file needs to be written
Check on:
https://github.com/ciasaboark/apparatus-templi/blob/master/skeleton/arduino-sketches/lazy_sensor/lazy_sensor.ino#L254: for loss of precision.
https://github.com/ciasaboark/apparatus-templi/blob/master/skeleton/arduino-sketches/lazy_sensor/lazy_sensor.ino#L223
change to this so it can do away with the memcpy
byte fragmentBytes[sizeof(int)];
fragmentBytes = &fragmentNO;
payload[3] = fragmentBytes[1];
payload[4] = fragmentBytes[0];
https://github.com/ciasaboark/apparatus-templi/blob/master/skeleton/arduino-sketches/lazy_sensor/lazy_sensor.ino#L260 , https://github.com/ciasaboark/apparatus-templi/blob/master/skeleton/arduino-sketches/lazy_sensor/lazy_sensor.ino#L227 , can do away with the for loop and just use memset to zero out the array if the memset function is available to the arduino code.
https://github.com/ciasaboark/apparatus-templi/blob/master/skeleton/arduino-sketches/lazy_sensor/lazy_sensor.ino#L264 change the int to bytes or shorts to conserve space. The int is 2 bytes on the arduino, so it could save space if it is needed.
I would also try and change the parameters to use addresses instead of values, copying and passing arrays by value is alot of overhead. https://github.com/ciasaboark/apparatus-templi/blob/master/skeleton/arduino-sketches/lazy_sensor/lazy_sensor.ino#L216: change to: void sendCommandFragment(String *commandFragment, int fragmentNo)
Zigbee library should respond to broadcast requests to ‘ALL’ with some message. Message contents does not matter for now.
Setting the port number to "" should result in the value portNum having a blank value instead of the default value
Must standardize XML format for replying to controller and sensor status queries.
The service does not allow saving a config file with the same name as the default config file (to prevent accidental overwrites). This check should be removed, since the default config file will be packaged within the jar, and will not be overwritten.
-handler to save preferences will need to be updated to avoid checking file name collisions.
-default preferences file should be removed (default preferences are declared programmatically within Prefs anyway).
-make sure read prefs pulls from Prefs.DEF_PREFS instead of the default preferences file.
Seems to be windows specific for now.
Start the service as usual, use web interface to restart service. Drivers will terminate, web server will terminate, but new web server instance can not bind to same port
-- log
1394931511475: SimpleHttpServer:received request from /192.168.0.102:52149 GET: '/restart_module?module=all'
1394931511490: Coordinator:restarting all modules
1394931511491: Coordinator:restarting drivers
1394931511492: Coordinator:restarting all drivers
1394931511492: Coordinator:removing all event watchers
1394931511493: Coordinator:terminating driver XmlTest
1394931511493: Coordinator:waking driver XmlTest
1394931511494: Coordinator:terminating driver LOCAL
1394931511494: Coordinator:waking driver LOCAL
1394931511495: Coordinator:terminating driver LED_FLASH
1394931511495: Coordinator:waking driver LED_FLASH
1394931516496: Coordinator:driver LED_FLASH terminated
1394931516496: Coordinator:driver XmlTest terminated
1394931516496: Coordinator:driver LOCAL terminated
1394931516516: Warning: Coordinator:all drivers stopped
Coordinator:Initializing drivers...
1394931516517: Coordinator:driver LOCAL of type org.apparatus_templi.driver.Local initialized
1394931516517: Coordinator:driver LED_FLASH of type org.apparatus_templi.driver.LedFlash initialized
1394931516518: Coordinator:driver XmlTest of type org.apparatus_templi.driver.XmlTest initialized
Coordinator:Starting driver XmlTest
Coordinator:Starting driver LOCAL
Coordinator:Starting driver LED_FLASH
1394931516518: Coordinator:restarting web server
1394931516519: LOCAL:starting
1394931516520: LED_FLASH:starting
1394931516530: SimpleHttpServer:terminating
Coordinator:Starting web server on port 8000 bound to localhost address 192.168.0.101
1394931517521: SimpleHttpServer:port number 8000 not available
1394931517521: TERMINAL FAILURE: Coordinator:could not start web server on port 8000
1394931517524: Coordinator:system is going down. Notifying all drivers.
1394931517525: Coordinator:terminating driver 'XmlTest'
1394931517526: Coordinator:notified driver 'XmlTest'
1394931517526: Coordinator:terminating driver 'LOCAL'
1394931517528: Coordinator:notified driver 'LOCAL'
1394931517528: Coordinator:terminating driver 'LED_FLASH'
1394931517529: Coordinator:notified driver 'LED_FLASH'
Driver.sleep() calls Object.wait() to block execution of the current thread until it is notified. If this call is done in any driver method other than run() it will result in the coordinator core blocking indefinitely.
If the service goes down (either from the system tray, ctrl-c, etc.) it should send out an email (if possible), then cleanly exit. Right now the service hangs indefinitely, and must be killed manually.
The web interface should not be able to overwrite the default config file. Right now the javascript only checks that the new config file name exactly matches the default config file name. If the two match the button is disabled. If the user changes the config file name to ./coordinator.conf
then the name will not match, but the file referenced will be the default config. It will be hard to check this in the javascript, so it should be patched in the backend code.
Prefs.savePreferences()
should check based on the resolved file name instead of doing a direct string comparison.
Methods to store data make a call to read data to see whether previous data has been stored. This results in two connections to the database being open at the same time. Most of the time this works fine, but sometimes the call to getConnection() will generate a SQLException which throws a NullPointerException.
Possible fixes:
-issue read query inline, without opening a new connection
-keep reference to connection as class member instead of generating a new one on the heap
Relevant log:
1394763490464: DB_TESTER:Test 29 of 100
1394763490464: Coordinator:storeBinData()
1394763490465: DatabaseService:storing binary data
1394763490479: DatabaseService:reading binary data
1394763490482: Error: DatabaseService:unable to get connection to database, will try again
1394763490682: Error: DatabaseService:unable to get connection to database, will try again
1394763490882: Error: DatabaseService:unable to get connection to database, will try again
<repeats indefinitely>
The web server should present current settings as xml data (how would this work for passwords?). The settings handler should be replaced or supplemented with another handler that returns the current preferences as xml so that the front ends can format the data as needed.
Ant build script needs to be written so that distribution packages can be generated.
For whatever reason isModulePresent() does not match two strings that should match. i.e. 'LOCAL'.equals('LOCAL') will fail. Probably something to do with reading in the destination string from the message as utf-8 instead of unicode.
Coordinator checks for a headless environment before creating a system tray icon. The junit tests do not. The test for a headless environment should be moved within the SysTray class.
main.js needs to be broken into multiple files so that only the appropriate parts are loaded for each page.
Will need to update template so that javascript links can be inserted into header.
Will need to update handlers so that appropriate javascript links are inserted into header.
Need command line and/or preference option to set debugging level (debug, warning, error)
Zigbee library should break outgoing messages who’s command length is > MAX_DATA_SIZE into multiple messages with with decrementing fragment numbers (10 fragments should be sent as fragment 9 - fragment 0).
Need handler to take POST data from settings form and save the preferences back to the config file.
Auto-detecting port numbers is problematic, and was introduced to get around limitations on re-binding to the same port when restarting the web server. Since the server now re-uses the same socket whenever possible it no longer serves any use. The web server should bind to either the default port, the port number specified in the config file, or the port number specified as a command line option (in increasing precedence). If that port number can not be bound to, the service should terminate.
Web server capable of listening for incoming request from a single client and returning formatted xml based on responses from Coordinator API.
setting a field blank in the setting.html and trying to save the settings will now work. Server will respond with no data before closing the connection. Check that breaking the query string into key/value pairs can deal with this
Update Log class to write logging messages to a log file instead of printing to STDOUT
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.