ap/xxxxx

new technical notes

Table of Contents

1 2009-01-05 Mon 17:17 KiCad: How_can_I_use_relative_coordinates

http://kicad.sourceforge.net/wiki/index.php/FAQ#How_can_I_use_relative_coordinates.3F

2 2008-12-29 Mon 19:24 addition of libraries to default KiCad:

Edit /usr/share/kicad/template/kicad.pro

eg: LibName2=/root/xxxxx_2/xxxxx/trunk/scrying_hardware/lib/cywusb6935

3 2008-12-29 Mon 18:37 scrying hardware and kicad libraries

collected here:

https://code.goto10.org/svn/xxxxx/trunk/scrying_hardware/

4 2008-12-13 Sat 14:13 FGM-3 magnetic field sensor:

with scrying platform/ATmega128 functioning as frequency counter. The FGM-3 [Fluxgate Magnetometer] sensor outputs frequencies between approximately 120 kHz and 50 kHz.

4.1 FGM-3:

"The Fluxgate magnetometer's sensor uses ferrite ring core driven beyond magnetic saturation with about 10 kHz sine wave drive current. The sensor's output coil is tuned to the second harmonic with a resonant capacitor. The surrounding (geo)magnetic field effects as a bias factor making the output signal (saturation) to become unsymmetric, reacting to variations of the external magnetic field in the axis for which it is sensitive to."

"The idea of a flux gate is that when the core is saturated it essentially disappears and when it's out of saturation it bends the earth's magnetic field lines which cross the coil. The switching of the core in and out of saturation is gating the earth's magnetic filed through the coil thus generating a voltage according to Faraday's law."

[from links below]

4.2 Code:

Which also demonstrates use of counter and INT0 interrupt on pin 25 of the ATmega128 [pin18 on scrying connector].

http://scrying.svn.sourceforge.net/viewvc/scrying/freqcounttest.c?view=markup

4.3 Plot:

4.4 Links:

5 2008-12-11 Thu 16:06 LRA board for scrying

Local Resonance Amplifier

Now tested and working for additional power: connections for coil and external power source.

http://1010.co.uk/lra2.tar.gz

Software: http://scrying.svn.sourceforge.net/viewvc/scrying/

[in main scheme interpreter and also test code as lra.c]

6 2008-11-21 Fri 15:53 hidclient

http://1010.co.uk/hidclient02.tar.gz

Command line client for xxxxx-HID device (see http://1010.co.uk/avrhid.html)

Usage: ./hidtool read 5

[first rmmod usbhid to detach driver]

reads analogue 10 bit values form channel 5 to STDOUT.

Also included eegtool and hidtoolosc [channel] [IP] [port] for HID to OSC message forwarding.

(also note for pd-extended Debian testing/Lenny install: http://www.mail-archive.com/pd-list@iem.at/msg21782.html )

7 2008-10-28 Tue 16:26 Added dacwrite function (

for the MAX548 DAC) to scrying/avr Scheme interpreter and hardware library:

 (dacwrite 128)

[library code for the AVR Atmega128 written in C]:

http://scrying.svn.sourceforge.net/viewvc/scrying/

For prototype LRA [Local Resonance Amplifier] board:

http://1010.co.uk/lra.tar.gz

8 2008-10-26 Sun 15:09 Porting gr-bbn example code for transmitting and receiving 802.11 style bpsk.

1] Ported from gr.hier_block to use gr.hier_block2 and from flow_graph to top_block

2] Our example code replaces examples within:

http://acert.ir.bbn.com/projects/adroitgrdevel/

source tree:

http://acert.ir.bbn.com/viewvc/adroitgrdevel/adroitgrdevel/

3] New code:

http://1010.co.uk/bbn-examples-hier2.tar.gz

4] Usage:

 ./bbn_80211b_rx.py -R B -f 2.46G -v -b -p -S 4

5] TODO: decode packets and print to file/stdout.

6] [un]related references:

http://www.gnuradio.org/trac/browser/gnuradio/trunk/gnuradio-core/src/python/gnuradio/gr/hier_block2.py?rev=6466

http://beagleboard.org/project/Beagle+SDR/

http://span.ece.utah.edu/pmwiki/pmwiki.php?n=Main.80211bReceiver

http://www.nabble.com/BBN's-802.11b-code-td18136664.html

http://www.mail-archive.com/discuss-gnuradio@gnu.org/msg15066.html

http://www.nd.edu/~jnl/sdr/docs/tutorials/8.html

http://www.phys-x.org/grblog/grblog.html

http://www.gnuradio.org/trac/wiki/Tutorials/WritePythonApplications

9 2008-10-24 Fri 15:09 Plotting with R and gnuplot in GNU Emacs

1] R:

svn checkout https://svn.r-project.org/ESS/trunk

(load "/path/to/ess-svn/lisp/ess-site.el")

M-x R in GNU Emacs

M-x ess->tabcomplete for functions

  #simplest
  
  require(akima)
  
  require(lattice)
  
  mtab<-read.table("/root/2310test.log")
  par(bg = "slategray")
  persp(interp(mtab[,1],mtab[,2],mtab[,3],duplicate="strip"), theta = 110, phi = 100, col = "green3", ltheta = -120, shade = 0.8, border = NA)
  
  # cloud (lines) and wireframe
  
  mtab<-read.table("/root/2310test.log")
  temp <-data.frame(mtab[,1],mtab[,2],mtab[,3])
  reggrid <-interp(mtab[,1],mtab[,2],mtab[,3],duplicate="strip")
  cloud(mtab[,3]~mtab[,2]*mtab[,1],type="l")
  wireframe(reggrid$z,scales=list(arrows=FALSE),drape=TRUE,colorkey=TRUE)
  
  help(persp)

2] gnuplot:

See: http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html

  ;; Lines enabling gnuplot-mode
  
  ;; move the files gnuplot.el to someplace in your lisp load-path or
  ;; use a line like
    (setq load-path (append (list "/root/soft/gnuplot-mode.0.6.0") load-path))
  
  ;; these lines enable the use of gnuplot mode
    (autoload 'gnuplot-mode "gnuplot" "gnuplot major mode" t)
    (autoload 'gnuplot-make-buffer "gnuplot" "open a buffer in gnuplot mode" t)
  
  ;; this line automatically causes all files with the .gp extension to
  ;; be loaded into gnuplot mode
    (setq auto-mode-alist (append '(("\\.gp$" . gnuplot-mode)) auto-mode-alist))
  
  ;; This line binds the function-9 key so that it opens a buffer into
  ;; gnuplot mode 
    (global-set-key [(f9)] 'gnuplot-make-buffer)
  
  ;; end of line for gnuplot-mode

  # make sure all data is tabbed and good
  
  # C-c C-r to send region to gnuplot
  
  set parametric
  unset key
  set style data line
  set surface
  set contour both
  set cntrparam bspline
  set dgrid3d 30,30,10
  splot "/root/2310test.log"
  
  # flat heat map
  
  unset surface
  unset contour
  set view map
  set pm3d at b
  set dgrid3d 30,30,10
  splot "/root/2310test.log" using 1:2:3
  
  help splot
  
  # for line style plot (a la plot3)
  
  set ticslevel 0
  set surface
  unset contour
  unset pm3d
  unset dgrid3d 
  splot "/root/2310test.log" using 1:2:3 with lines
  
  # animation and overlays??
  TBC

10 2008-10-21 Tue 14:50 voice-TEMPEST broadcast

[photo credit: Lindsay Brown]

During the TEMPEST workshop we developed live TEMPEST voice transmission based on:

http://www.erikyyy.de/tempest/

contents:

1] Patch mp3player.cpp (in above code):

  101c101
  <   screen = SDL_SetVideoMode(resx, resy, 8, SDL_HWPALETTE | SDL_ANYFORMAT | SDL_FULLSCREEN);
  ---
  >   screen = SDL_SetVideoMode(resx, resy, 8, SDL_HWPALETTE | SDL_ANYFORMAT); // | SDL_FULLSCREEN);
  130a131,132
  > 
  > #if 0
  143a146,151
  > #else
  >   FILE *input=fdopen(0,"rb");
  >   audiolength=128;
  >   audiobuf = (u_int8_t*) malloc (audiolength);
  >   fread(audiobuf,audiolength,1,input);
  > #endif
  182c190,194
  <       if (curpos>=audiolength) exit(0);
  ---
  >       if (curpos>=audiolength) 
  >       {
  >         curpos=0;
  >         fread(audiobuf,audiolength,1,input);
  >       }
  184a197
  >     usleep(1.0/7680*128*1e6-100);

2] Commandline invocation:

  sox -t alsa hw:0,0 -t raw -u -b -c 1 -r 7680 - | ./tempest_for_mp3 65000000 1024 768 1344 806 1500000 1 100 fake

with latter figures culled from: xvidtune -show

11 2008-10-13 Mon 19:08 USRP note

 ./usrp_tv_rcv_nogui.py -d 32 -i usrp -f 623.234M -R B -8 -g 59 ~/testingpipe

and:

 cat testingpipe | devdisplay 128 625 1

[using new devdisplay with blocksize option now at: http://1010.co.uk/devdisplay.c ]

12 2008-10-12 Sun 18:16 temppar.c

Simple C code for phototransistor TEMPEST using BPW42

http://1010.co.uk/temppar.c

13 2008-10-10 Fri 18:34 playing with USRP:

Using the following applications and options:

13.1 spectrum analysis (with range dependent on decimation option)

 usrp_fft.py -R B -g 59 -W -f 640M -d 16

which uses the second installed USRP daughterboard (in this case 800-2.4 GHz DBSRX) with a gain of 59 dB and centre frequency of 650 MHz and decimation of 16 (default)

greatest bandwidth is with:

 usrp_fft.py -R B -g 59 -f 640M -d 8 -8

13.2 oscilloscope

 usrp_oscope.py -R B

13.3 and in: ~/gnuradio/gnuradio-examples/python/usrp

 ./usrp_tv_rcv.py -R B -f 519.25M -g 59 -d 8 -8

for video

 ./usrp_am_mw_rcv.py -O plughw:0,0 -R B -f 519.25M

for audio output (plughw compensates for sample rate mismatch)

 usrp_wfm_rcv.py -O plughw:0,0 -R B

and ~/gnuradio/gnuradio-examples/python/apps/hf_explorer

 ./hfx2.py -R B -O plughw:0,0 -c 640M

quickly hacked to support soundcard option

13.4 plotting

Using code based on:

http://pages.cs.wisc.edu/~shravan/specsense.txt

updated for new blocks API:

 class my_graph(gr.top_block): // rather than class my_graph(gr.flow_graph):

 python specsense.py -R B 800M 2400M -d 32 > testing_spec
 plot "/root/testing_spec" (in gnuplot)

13.5 references:

14 2008-10-08 Wed 18:31 installing gnuradio to get running with the USRP:

1] On Debian testing:

 apt-get install libtool python-wxgtk2.8 sdcc-libraries-nf sdcc-nf guile-1.8-dev libfftw3-dev libboost-test1.35-dev libcppunit-dev 

2]

 svn co http://gnuradio.org/svn/gnuradio/trunk gnuradio

3]

 ./bootstrap
 ./configure
 make
 make install

No use of auto***. Only libtool.

References:

http://gnuradio.org/trac/wiki/BuildConfiguration

http://staff.washington.edu/jon/gr-osx/gr-osx-core.html

15 2008-09-27 Sat 23:51 IP mapping

Using GeoIP, matplotlib and basemap to plot geography of IPs currently swarming with same OS/browser fingerprint to:

http://1010.co.uk/org/autotate.html

After much configuration and patching of basemap and geos:

http://osdir.com/ml/gis.geos.devel/2006-06/msg00021.html

For first processing of logs using grep and a keyboard macro in GNU Emacs based on:

re-search-forward "^[0-9][0-9]*[0-9]*"

And then using variant of:

https://fedorahosted.org/fedora-infrastructure/browser/scripts/geoip/generate-worldmap.py

from mpl_toolkits.basemap import Basemap

http://matplotlib.sourceforge.net/

http://www.scipy.org/Cookbook/Matplotlib/Maps

http://www.maxmind.com/download/geoip/database/

16 2008-09-25 Thu 16:28 GNU Emacs and the serial port

M-x serial-term

and then C-c is escape eg>

C-c C-b to switch buffers

C-c C-k char mode

C-c C-j line mode [with history accessed by way of M-p previous and M-n next]

providing adequate console for scrying serial connection [/dev/ttyUSB0].

To upload a region of code to the serial device:

  (defun serial-send-region ()
    (interactive)
  (let ((tmper (buffer-substring (region-beginning) (region-end))))
    (switch-to-buffer (find-file-noselect "/tmp/scrying.transfer"))
    (erase-buffer)
    (insert tmper)
    (save-buffer "/tmp/scrying.transfer")
    (start-process "scrying-upload" nil "/root/scrying/scrying/scrying.sh")))

acii-xfer command is wrapped in scrying.sh:

  #!/bin/sh
  
  /usr/bin/ascii-xfr -sen -l 10 -c 10 /tmp/scrying.transfer > /dev/ttyUSB0

17 2008-09-16 Tue 15:36 org-remember

Adding code to org-remember.el to place note title and URL on WelcomePage.html/index:

http://1010.co.uk/org-remember.el

18 2008-07-29 Tue 20:38

18.1 Rough notes for remember with org-mode and publishing:

C-u C-c C-c : for default handling of templated remember buffer

otherwise// for a new org-mode file C-c C-c

and in .emacs:

 '(org-directory "~/svn_test/trunk/orgpub/")
 '(org-remember-interactive-interface (quote outline))
 '(org-remember-store-without-prompt nil)

also: M-x org-go-to-remember-target

19 2008-07-25 Fri 19:22

19.1 testing org-mode publishing and notes on resurrection of laptop:

19.2 1] Use chsh

to change default shell to zsh

19.3 2] xtt

as shell wrapper for xterm for .xinitrc:

exec /usr/bin/evilwm -term xtt -fg green -bg black 

19.4 3] install libncurses

on Debian testing BEFORE we configure and make GNU Emacs CVS

19.5 4] In Debian testing:

blacklist padlock-aes and intel-rng in /etc/modprobe.d/blacklist

19.6 5] For Meta key in xterm:

XTerm.vt100.metaSendsEscape: true

in .Xdefaults

19.7 6] For org-mode/firefox/remember:

In: org-annotation-helper.el

we need to call:

(org-remember nil ?w))