My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/usr/bin/env python
# GoodFET HedyAttack Maxscan Example

############################
# HedyAttack - Tools for identifying and analyzing frequency hopping spread spectrum(fhss) implementations.
# Copyright (C) 2011 Cutaway, Q, and Atlas
# 2009 Travis Goodspeed <travis at radiantmachines.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Please leave comments and recommendations at http://code.google.com/p/hedyattack
############################

# This code dumps the maximum radio signal strength signal indication value
# as recorded in the cc1111emk's xdata
# ------------------------------------------------------------------------------
# | Channel Modes |
# ------------------------------------------------------------------------------
# | Marker | MSB Loop | LSB Loop | channel | channel | ... | channel | channel |
# | 0xFE | Count | Count | number | rssi | ... | number | rssi |
# ------------------------------------------------------------------------------

import sys;
import Gnuplot as plt

# sys.path.append('/Users/travis/svn/goodfet/trunk/client/')
sys.path.append('/home/cutaway/Hardware/Goodfet/trunk/client/')

from GoodFETCC import GoodFETCC;
from intelhex import IntelHex16bit, IntelHex;
import time;

client=GoodFETCC();
client.serInit();

client.setup();
client.start();
client.CChaltcpu();
client.CCreleasecpu();

time.sleep(1);

chanstart=0xf000;
#maxchan=132;
maxchan=53;
round=0;

g = plt.Gnuplot()

#print "time freq rssi maxrssi";
xlabel = "freq"
ylabel = "rssi"
title = "maxscan_plot"
g.xlabel(xlabel)
g.set_range('xrange',(900,930))
g.ylabel(ylabel)
g.set_range('yrange',(40,250))
g.title(title)
g('set style data linespoints')

########################
# Grab Freqs and store
########################
freqs = []
client.CChaltcpu();
for entry in range(0,maxchan):
adr=chanstart+entry*8
freq=((client.CCpeekdatabyte(adr+0)<<16)+
(client.CCpeekdatabyte(adr+1)<<8)+
(client.CCpeekdatabyte(adr+2)<<0));
hz=freq*366.21093303
freqs.append(hz/1000000.0)
client.CCreleasecpu()
time.sleep(1);

########################
# Grab RSSI and MRSSI
########################
run = True
while run == True:
time.sleep(3)
client.CChaltcpu()
rssi = []
mrssi = []
d0 = []
d1 = []
dn = 0
dm = 0

round=round+1

#g.show()
for entry in range(0,maxchan):
adr=chanstart+entry*8;
rssi.append(client.CCpeekdatabyte(adr+6));
mrssi.append(client.CCpeekdatabyte(adr+7));
#print "%03i %3.3f %03i" % (round,freqs[entry],rssi);
d0.append((freqs,rssi))
d1.append((freqs,mrssi))
dn = plt.Data(d0)
dm = plt.Data(d1)
g.title(title+str(round))
#g.plot(dn)
g.plot(dn,dm)
if round != 1:
g.refresh()
client.CCreleasecpu();


Change log

r2 by cutaway on Feb 6, 2011   Diff
added trunk and move all to trunk
Cutaway

Go to: 
Project members, sign in to write a code review

Older revisions

r1 by cutaway on Feb 5, 2011   Diff
Initial Import
All revisions of this file

File info

Size: 3460 bytes, 120 lines

File properties

svn:executable
Powered by Google Project Hosting