Sunday, September 19, 2010

Release notes

Version naming:

XYZ-AABBbCC
XY:
   LS=local server
   MS=main server
   WS=web server
Z:
   P=prototype
   C=commercial
AA: Hardware version number (01-99)
BB: Software version number (01-99)
b= build
CC: build number(01-99)

current version:
LSP-0201b02
MSP-0101b01
WSP-0101b02

(move notes regarding old build when releasing new one.)
in Hardware V01 for MS it is PC with UBUNTU.
in Hardware V01 for LS it is wired board ctrl brd (micro controller PIC16F628)
in Hardware V02 for LS it is PCB ctrl brd (micro controller PIC16F628a)
in Hardware V01 for WS it is LAMP with ubuntu.

WS (Web server):
web interface
- load ctrl para and sens para right after log in... all depends on it.
- interface GUI set auto online
[BAD IDEA]- if we need to make each function in two stages, online then DB, to improve performance...
- interface GUI get sens
[CLOSED-NONEED]- interface GUI set sens
[CLOSED-NONEED]- interface GUI get sens para
- interface GUI set sens para
[SOLVED] - interface GUI get ctrl sch
[SOLVED] - interface GUI set ctrl sch
- interface GUI get sens sch
- interface GUI set sens sch
[SOLVED] - make ctrlstat get info from ctrlPara to show name instead of ID.
[NEED TO TEST] - getting "too many DB connections"
[SOLVED] - week days shifted.
- implement more error code to simplify maintenance.

[SOLVED]PHP todo:
[SOLVED]/var/www/web/secure/sens_sock.inc
[SOLVED]read socket message and parse it to extract the xml file name and return it.
[SOLVED]if sendOrd function returns 0 means error, if returns file name (20chars) means success.
[SOLVED]PHP, AJAX todo:
[SOLVED]/var/www/web/secure/getSensStat.inc
[SOLVED]add JS here.....
[SOLVED]JS will read the existing webpage ById to prepare array that holds alarm onColor.
[SOLVED]JS will then receive XML file name from sendOrd()
[SOLVED]then will open the XML, send FLAG 0, populate the webpage
[SOLVED]js should test if XML open failed, in this case, decrease connection quality.
[SOLVED]wait 1 second then do read XML again.
[SOLVED]LS-MS Heartbeat interfering with service requests like getSensStat, an idea is to stop heartbeat whenever a service request is on. another problem is that what if a heartbeat have been sent and service data recieved instead? we need to fix the heartbeat mechanizm, it should help, not interfere.
[SOLVED][WEB] when connecting to real sens function (router) the web cannot read/parse the xml, no java error.
 


MS (Main Server):
listener

[SOLVED]- improve the overlapping of Keep-alive and transaction.
[SOLVED]- since there will be no keep alive during transaction, make sure there will be no long blocking...
- for active connections, if recieve wrong data instead of k, we must time out, recieve one more time, drop silently, then disconnect.
[NEED TO TEST] - too many connections to database
[SOLVED]- receive data in one packet and single confirmation.

[SOLVED]- make separate functions for send and recieve
[SOLVED]- write packet parser in getCtrlStat
[SOLVED]- make separate functions for TCP transactions so we focus on core.
[SOLVED]- re-write all transaction functions
[SOLVED]- function getSensStat accepts illegal values and disconnects.
[SOLVED]- transactions should detect empty results and leave DB.
- readConfig for other config files is not finished.
[SOLVED][MS] when getSensStat get order failed, it doesn't release the activeFd.
[SOLVED][MS] (read previous) if we set activeFd.stat=TIMEOUT, the activeFd will disconnect but we cannot get new connection
[SOLVED][MS] (read previous) if ord.failed, new connection cannot establish (wrong ESN) although the received ESN is correct !! Why?
[SOLVED][MS] each function should set the activeFd.counter = KEEP_ALIVE_TIMER.
[FALSE][MS] still have race_hazard for implementing orders and SEND_K, in one case, MS send K and right after it sends ORD. !!

[SOLVED][MS] hash generator always starts with same seed, not good.
[MS] what if user open two browsers and send two commands?

 


LS (Local Server):
client
[SOLVED] - doCtrlSch() does update ctrlWord, but doesn't update the controller stat actually.
[DELAYED]- must upload all names (ctrlpara, sens para) to LS only once right after connect.
[DELAYED]- must recieve names from LS only when changed, and not send back new names in return! better performance but less reliability (argued).

- apply the same rule when updating files.
- write flow chart
- test each function thoroughly [Part of Beta test]
[SOLVED] - Improve the overlapping between keep-alive and transaction
[CANCELED]- [bad idea] since there will be no keep alive during transaction, make sure there will be no long blocking...
- make log data restriction, new file every hour
- add email /sms remote notify includes cfg file read/write  implement global variable holds the info.
- create transaction function set ( for remote notify)
- add sysinfo transaction function
- add global variable holds it
- define startTransaction prototype in clientFunctions.h (I forgot why)
- log to certain log file size or time. then compress it to arkive
[SOLVED]- CtrlSchedule doesn't really work
[SOLVED]- note sure if today() or time() provides correct info, need to setup log for it.
[SOLVED]- check message "sprintf (logBuf, "threads||ctrlPoll||buffer: %s",buffer);" right after the schedule is due.
[SOLVED] setCtrlsch is doing the job right. (Traced, successful)
[SOLVED] doCtrlSch is updating the ctrlWord (Traced, successful)
[SOLVED] ctrlPoll is implementing the new ctrlWord
[SOLVED]- doCtrlSch updates the ctrlWord, but doesn't updates Ctrl ctrl !!! need to add those lines.
[SOLVED]- sensors cannot get stat
- sens/ctrl really annoying when get to work with the IO board. not reliable.
- make backup connnection.cfg file for secondary server.

- when read config file in the beginning, replace any faulty line with new line with defaults.
[SOLVED]- getSensor hangs up sometimes. it times out.
- when ORD_NAK, the MS panics.
- getSensPara, setSensPara doesn't work, very unstable.
[SOLVED]- receive/send data in one packet and single confirmation.
[SOLVED]- make separate functions for send and recieve
[SOLVED]- write packet parser in getCtrlStat
[SOLVED]- make separate functions for TCP transactions so we focus on core.
[SOLVED]- re-write all transaction functions
- getSensStat sends wrong data, actually, see ap.
- readConfig put illegal data in memory, take sens for example. it is good test though. let's use it to test transaction.
[SOLVED][LS] socket time out after 30 seconds of alarm streaming, may be waiting for heartbeat, lets set each function to restart wait_heartbeat after the function success.
[SOLVED][LS] the sensor digits aren't mapped well to the gui.
[LS] make sure sensIn and ctrlOut doesn't interfere !!
[LS] not every sensIn() get back with results from serial port.




in all project files, make sure "const " has correct application and no data modification will occur.


WRT platform:

in autoupdate:
- backup doesn't handle error, doesn't detect failure (useless, but it works!)
in platform:
-fix rdate in cronjob
-don't start ls_com if data is less than 2010

IO-Board:

- Make I/O test function to test board reliability.


Next Version Wish List:

URGENT:
1- comment out (reduce) logs
2- reduce variables
3- reduce variable sizes if possible
now we are processing file (transactionfunctions.h) at getsenspara
this should release some memory for this problem:
  - getCtrlPara getSensPara cannot deal with compose big packets due to lack of memory.
DON'T LOG BIG BUFFERES LIKE PACKETS, THAT WILL OVERFLOW THE LOG BUFFER.

- Modify the logger to a separate program with socket.

-


Later, we need to create:
- realtime sensor reporting to web (java script).
- email
- sms
- think about the Security interface
- create "report bug" function.

Later, we need to improve:
- Hardware connection reliability

Later, we need to test all functions thoroughly.


[Archive]


LSP-0201b01
Platform:
[SOLVED]- make startup script in init.d to start up updater, ls_com, and rdate
[SOLVED]- can a daemon run a script?
[SOLVED]- wrtstarter cannot do anything !!
[SOLVED]- S999startup cannot start ./ls_com
Autoupdate:
[SOLVED]- install doesn't handle error, it contains error
[SOLVED]- PID recorder should take care of the PID, i think it is not working
[SOLVED]- killer script should be the "ls_stop" and it should be tested.
[SOLVED]- why killer hangs? why no service can be stopped?
[SOLVED]- make upgrade package creator script
[SOLVED]- **uninstall doesn't really uninstall anything
[SOLVED]- install doesn't really overwrite anything or may be it is being restored !
[SOLVED]- copy autoupdate.sh to MS to back it up
Client:
[SOLVED] - when ttl reaches 5 (time to send k) and getctrlstat command is sent:
[SOLVED] 1- MS will time out recieving ctrl data in only 5 seconds (should be 10)
[SOLVED] A: have nothing to do with TTL, the blocking-select has a 5sec timeout ! it is a magic number need to change.
[SOLVED] 2- LS will delay sending the third line of data for about 5 seconds (why)
[SOLVED] A: reason unknown but it has been dissappeared after rectifiying the previous errors.
MSP-0101b01
WSP-0101b02

Monday, August 9, 2010

Project components

Published with Blogger-droid v1.5
This project has the following main components: - main server -local server - web server Local server has the followings checkpoints to be verified in order to indicate that it is completed: - ls core server....ok -core starter....ok -core maintainer...not yet -autoupdater script...ok -autoupdater starter and scheduler...ok -clock setting startup script...ok -clock script cron job ...ok -log manager...not yet -other scripts like backup install uninstall etc...ok

Friday, August 6, 2010

Todo list

update the todo list.

Currently:
router ls_com can startup automatically
autoupdater starts automatically every 10min.
router setup clock and sync time automatically


Autoupdate:
later- backup doesn't handle error, doesn't detect failure


Ls:
- log to certain log file size or time. then compress it to arkive
- check if the software can handle serial port,
- check if possible another serial for sms

Router platform:
solved- install rdate in cronjob
solved- install clock setup
- make installation image
- make step by step guide for deployment
- make ls_com maintainer

Next:
- enhance log function.
- Rent VPS
- Test solution
- Milesotne (beta HSP)