User Tools

Site Tools


salzamt

This is an old revision of the document!



Warning: Declaration of syntax_plugin_wrap_div::handle($match, $state, $pos, Doku_Handler &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/div.php on line 43

Warning: Declaration of syntax_plugin_wrap_div::render($mode, Doku_Renderer &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/div.php on line 81

Warning: Declaration of syntax_plugin_wrap_closesection::handle($match, $state, $pos, Doku_Handler &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/closesection.php on line 23

Warning: Declaration of syntax_plugin_wrap_closesection::render($mode, Doku_Renderer &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/closesection.php on line 29

Warning: Declaration of syntax_plugin_wrap_span::handle($match, $state, $pos, Doku_Handler &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/span.php on line 43

Warning: Declaration of syntax_plugin_wrap_span::render($mode, Doku_Renderer &$renderer, $indata) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/kucjica/emperors-wiki/lib/plugins/wrap/syntax/span.php on line 63

Warning: Declaration of syntax_plugin_gallery::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/kucjica/emperors-wiki/lib/plugins/gallery/syntax.php on line 51

Warning: Declaration of syntax_plugin_gallery::render($mode, &$R, $data) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/kucjica/emperors-wiki/lib/plugins/gallery/syntax.php on line 147

Warning: Declaration of syntax_plugin_vshare::handle($match, $state, $pos, &$handler) should be compatible with DokuWiki_Syntax_Plugin::handle($match, $state, $pos, Doku_Handler $handler) in /var/www/kucjica/emperors-wiki/lib/plugins/vshare/syntax.php on line 47

Warning: Declaration of syntax_plugin_vshare::render($mode, &$R, $data) should be compatible with DokuWiki_Syntax_Plugin::render($format, Doku_Renderer $renderer, $data) in /var/www/kucjica/emperors-wiki/lib/plugins/vshare/syntax.php on line 107

Warning: preg_match(): Compilation failed: invalid range in character class at offset 3444 in /var/www/kucjica/emperors-wiki/inc/parser/lexer.php on line 118
A PCRE internal error occured. This might be caused by a faulty plugin

==== element 1: the body ==== * a cuboid structure made of plywood and stretchable fabric {{:img_20120907_231737.jpg?nolink&100|}} the process of [[linz-making-of|making of, here]] ==== element 2: the mechanics ==== * two firgelli [[http://nodna.de/linear-actuator_11|linear servo actuators]] to move the top of the structure * the motors are controlled by an arduino diecimila board. ==== element 3: the controls ==== * arduino diecimila with [[extended-python-arduino-api|extended-python-arduino-prototyping-api]] firmware * startup script [[startup-sh|startup.sh]] that runs airodump in the background and starts the python script * python script [[motors-scanner-test-1|motor-scanner.py]] ==== development ==== a simple [[2linearmotors-code|arduino code]] to test the motors, moves up and down with a delay of 3 seconds in between. the [[extended-python-arduino-api|extended-python-arduino-prototyping-api]] firmware is uploaded on an arduino board and controlls are sent to it from python. * get the network traffic: parse a cvs from airodump, look for IVs column and print the values > cat salzamt1009-01.csv | awk -F "," '{print $11}' http://www.backtrack-linux.org/forums/showthread.php?t=15519 parse the airodump csv file, using the python csv module <code python> import csv scan=open(file.csv) scanDict=csv.DictReader(scan, delimiter=',') </code> from here, lookup the value for the #IVs <code python> for adict in scanDict: if adict.has_key(' # IV'): data=adict.get(' # IV') print data </code> * choose the last edited .csv file in the current folder; this can be done using the subprocess module: <code python> import subprocess listlasted=subprocess.Popen("ls -ct1 | head -1". shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) lasted=listlasted.communicate()[0].strip() print lastedited </code> * calculate the next position of the motors based on the change in the number of packets. this number is returned by the lookup() function that reads the last edited .csv file <code python> newPackets=int(lookup(airodump)) packetsDiff=newPackets-packet </code> based on this difference, a position value is sent to the motors <code python> if packetsDiff>10: newPosition=position+2 print 'should stretch', newPosition linearone.write(newPosition) time.sleep(0.3) lineartwo.write(newPosition) time.sleep(0.3) elif packetsDiff<=0: newPosition=position-1 print 'should shrink', newPosition linearone.write(newPosition), lineartwo.write(newPosition) </code> * the full python script is available [[motors-scanner-test-1|here]] * the whole process is finally wrapped in an automatic [[startup-sh|startup script]]

salzamt.1349643172.txt.gz · Last modified: 2012/10/07 20:52 by 85.218.109.130