1 <style type=
"text/css">
6 background-color: #232323;
9 /* slime-repl-input-face */
13 /* slime-repl-output-face */
17 /* slime-repl-prompt-face */
25 background-color: inherit
;
27 text-decoration: inherit
;
30 text-decoration: underline
;
36 <h1 class=
"title">IXM repl
</h1>
38 <p>See
<a href=
"http://illuminatolabs.com/IlluminatoXMachina.htm">here
</a> information on the
<i>Illuminato X Machina
</i> (IXM)
41 Functions for interacting with a tribe of IXM through
<code>sfbprog
</code> from
42 inside of an
<a href=
"http:clojure.org">Clojure
</a> repl. Allows for accepting input from the tribe
43 and printing to the tribe programmatically, also provides for the
44 definition of reflexes associating different actions (e.g. printing to
45 the repl, logging to a file, etc
…) with different packet types.
48 Here is an example session
…
51 create a persistent connection to the boards through
"sfbprog"
55 <pre class=
"src src-slime-repl">
56 </span><span class=
"slime-repl-prompt">user
> </span>
57 <span class=
"slime-repl-prompt">user
> </span><span class=
"slime-repl-input">(load-file
"/home/eschulte/research/ixm/ixm-repl/src/ixm_repl.clj")
</span>
58 <span class=
"slime-repl-result">#'ixm-repl/connect
59 </span><span class=
"slime-repl-prompt">user
> </span><span class=
"slime-repl-input">(in-ns 'ixm-repl)
</span>
60 <span class=
"slime-repl-result">#
<Namespace ixm-repl
>
61 </span><span class=
"slime-repl-prompt">ixm-repl
> </span><span class=
"slime-repl-input">(connect)
</span>
62 </span><span class=
"slime-repl-prompt">ixm-repl
> </span><span class=
"slime-repl-input">tribe
</span>
63 <span class=
"slime-repl-result">{:sfbprog-cmd
"sfbprog", :usb-dev
"/dev/ttyUSB0"}
64 </span><span class=
"slime-repl-prompt">ixm-repl
> </span>
65 <span class=
"slime-repl-output">Ln Sun Apr
18 11:
22:
54 2010 [Running in server mode]
66 Ln Sun Apr
18 11:
22:
54 2010 [Loaded EMS:MFL/
20100418-
172245 Size=
72408 CS=B3B15106-
58012D1E Copyright=GPL V3]
67 Ln Sun Apr
18 11:
22:
56 2010 [North baud rate set to
115200]
68 Ln Sun Apr
18 11:
23:
01 2010 [North baud rate set to
9600]
69 Ln Sun Apr
18 11:
23:
02 2010 [North baud rate set to
115200]
70 Ln Sun Apr
18 11:
23:
03 2010 [North seeking arch
2 code, responding]
71 Ln
4.235 Best offer so far: EMS:MFL/
20100418-
172245 (size
72404) from North ESCHUL/SFBPRG
72 Ln
5.733 About to burn:
0/
0 bootCount=
1185; burnCount=
585 (+
1); powerOnHours=
889; flags=
0
73 Ln Sun Apr
18 11:
23:
04 2010 [Sending checksum North for
0x10014+
32748=C6DDEDD8-F56B9A5]
74 Ln Sun Apr
18 11:
23:
10 2010 [Sending checksum North for
0x18000+
32768=C9DB2E22-ECB85E4F]
75 Ln Sun Apr
18 11:
23:
10 2010 [Sending checksum North for
0x20000+
6868=
5CFB5CB9-
2317F28C]
76 Ln Sun Apr
18 11:
23:
11 2010 [North burned successfully!]
77 Ln Sun Apr
18 11:
23:
15 2010 [North baud rate set to
9600]
78 Ln Sun Apr
18 11:
23:
34 2010 [North baud rate set to
115200]
79 Ln
33.466 [East seeking arch
2 code, responding]
81 Ln
35.126 [Sending checksum East for
0x10014+
32748=C6DDEDD8-F56B9A5]
83 Ln
48.341 [Sending checksum East for
0x18000+
32768=C9DB2E22-ECB85E4F]
84 Ln
48.574 [Sending checksum East for
0x20000+
6868=
5CFB5CB9-
2317F28C]
85 Ln
49.496 [East burned successfully!]
87 </span><span class=
"slime-repl-result">#
<Object$IDeref$Future$
2b9be1f9@
5c2a25: :pending
>
92 output from the boards appears in the repl, reflexes can be defined
93 to handle output, the following uses the
<code>dump
</code> function to drop
94 all
<code>i
</code> packets without displaying them to the repl.
98 <pre class=
"src src-slime-repl">
99 </span><span class=
"slime-repl-prompt">ixm-repl
> </span><span class=
"slime-repl-input">(add-reflex :i dump)
</span>
100 <span class=
"slime-repl-result">#'ixm-repl/reflexes
107 the following initiates the collector, which results in a flood of
108 data from the boards, which can be redirected to a file using the
109 <code>log
</code> function as follows
113 <pre class=
"src src-slime-repl">
114 </span><span class=
"slime-repl-prompt">ixm-repl
> </span><span class=
"slime-repl-input">(tribe-print
"c4")
</span>
115 <span class=
"slime-repl-output">c (
0,
0) seconds:
84
116 c (
0,
0) goal:
55+
55+xs*
117 c (
0,
0) position: (
0.00,
0.00)
118 c (
0,
0) horizon_x:
10.00
119 c (
0,
0) horizon_y:
0.00
120 c (
0,
0) neighbor_fitness: -
1.00
121 c (
0,
0) mean_fitness:
16841.17
122 c (
0,
0) best_fitness:
15091.01
123 c (
0,
0) fittest_individual:
526x4y7/*
125 c (-
1,
0) goal:
55+
55+xs*
126 c (-
1,
0) position: (
0.00,
0.00)
127 c (-
1,
0) horizon_x:
10.00
128 c (-
1,
0) horizon_y:
0.00
129 c (-
1,
0) neighbor_fitness: -
1.00
130 c (-
1,
0) mean_fitness:
29855.63
131 c (-
1,
0) best_fitness:
15091.01
132 c (-
1,
0) fittest_individual:
23/
047-
9-*
92y3-
0y
133 </span><span class=
"slime-repl-result">nil
134 </span><span class=
"slime-repl-prompt">ixm-repl
> </span><span class=
"slime-repl-input">(add-reflex :c (log
"/home/eschulte/Desktop/collected"))
</span>
135 <span class=
"slime-repl-result">#'ixm-repl/reflexes
140 <p>This program is free software; you can redistribute it and/or modify
141 it under the terms of the GNU General Public License as published by
142 the Free Software Foundation; either version
3, or (at your option)
146 This program is distributed in the hope that it will be useful, but
147 WITHOUT ANY WARRANTY; without even the implied warranty of
148 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
149 General Public License for more details.
152 See the file COPYING for a copy of the GNU General Public License or
153 write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth
154 Floor, Boston, MA
02110-
1301, USA.
157 <img src=
"http://www.gnu.org/graphics/gplv3-88x31.png"/>
159 <p class=
"author"> Author: Eric Schulte
161 <p class=
"date"> Date:
2010-
04-
18 11:
36:
34 MDT
</p>
162 <p class=
"creator">HTML generated by org-mode
6.35trans in emacs
24</p>