psnotch.sh.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?xml version='1.0' encoding='iso-8859-1'?>
  2. <!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
  3. <html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'>
  4. <head>
  5. <title>
  6. psnotch.sh
  7. </title>
  8. <meta http-equiv='content-type' content='text/html;iso-8859-1'/>
  9. <meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/>
  10. <meta name='author' content='cmaier@cmassoc.net'/>
  11. <meta name='robots' content='noindex,nofollow'/>
  12. <link href='toolkit.css' rel='stylesheet' type='text/css'/>
  13. </head>
  14. <body>
  15. <div class='headerlink'>
  16. [<a href='host.sh.html' title=' host.sh '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='pts.sh.html' title=' pts.sh '>NEXT</a>]
  19. </div>
  20. <pre>
  21. #!/bin/sh
  22. # file: scripts/pibnotch.sh
  23. # This is an experimental script used to test dynamic PIB notching;
  24. # if you do not know what that is then you probably don't need this
  25. # script;
  26. # ====================================================================
  27. #
  28. # --------------------------------------------------------------------
  29. . /etc/environment
  30. . ${SCRIPTS}/hardware.sh
  31. . ${SCRIPTS}/firmware.sh
  32. # ====================================================================
  33. #
  34. # ETH1 is Host Interface for Device 1
  35. # ETH2 is Host Interface for Device 2
  36. #
  37. # PLD1 is MAC of Powerline Device 1
  38. # PLD2 is MAC of Powerline Device 2
  39. #
  40. # PIB the PIB file used to load prescalars
  41. # MAP the MAP file used to save tonemaps read from device
  42. # OLD the OLD prescalars (no notches)
  43. # NEW the NEW prescalars (with notches)
  44. #
  45. # --------------------------------------------------------------------
  46. PIB=abc.pib # the PIB file used to load prescalars
  47. MAP=tonemap # the MAP file used to save tonemaps read from device
  48. OLD=scalars # the OLD prescalars (no notches)
  49. NEW=notches # the NEW prescalars (with notches)
  50. # ====================================================================
  51. # 1. print message;
  52. # 2. load OLD prescalars into PIB
  53. # 3. download and flash PIB
  54. # --------------------------------------------------------------------
  55. echo
  56. echo Setup
  57. echo
  58. psout ../firmware/v3.3.6.pib &gt; ${OLD}
  59. psin &lt; ${OLD} ${PIB}
  60. int6k -i ${ETH2} -P ${PIB} ${PLD1} -C2
  61. # ====================================================================
  62. # 1. Increment loop counter and print message
  63. # 2. request tonemap between PLD1 and PLD2; save in MAP
  64. # 3. read OLD prescalars and write NEW prescalars based on MAP; only
  65. # notch prescalars 57 through 63 if tone threshold is below 3;
  66. # 4. load NEW prescalars into PIB;
  67. # 5. plot prescalars from PIB discarding unwanted lines;
  68. # 6. print a message
  69. # 7. download and flash PIB to apply changes;
  70. # 8. wait some time
  71. # 9. load OLD prescalars into PIB
  72. # 10. print a message
  73. # 11. download and flash PIB to sample changes;
  74. # 12. wait some time
  75. # 13. repeat forever;
  76. # --------------------------------------------------------------------
  77. while [ 1 ]; do
  78. echo
  79. echo Check $((++count))
  80. echo
  81. int6ktone -qhi ${ETH2} ${PLD1} ${PLD2} &gt; ${MAP}
  82. psnotch -v -L 40 -U 66 -l 57 -u 62 -t 3 -f ${MAP} &lt; ${OLD} &gt; ${NEW}
  83. psin &lt; ${NEW} ${PIB}
  84. psgraph ${PIB} | head -n 66 | tail -n 36
  85. echo
  86. echo blocking ...
  87. echo
  88. int6k -i ${ETH2} -P ${PIB} ${PLD1} -C2
  89. sleep 10
  90. psin &lt; ${OLD} ${PIB}
  91. echo
  92. echo sampling ...
  93. echo
  94. int6k -i ${ETH2} -P ${PIB} ${PLD1} -C2
  95. sleep 60
  96. done
  97. </pre>
  98. <div class='footerlink'>
  99. [<a href='host.sh.html' title=' host.sh '>PREV</a>]
  100. [<a href='toolkit.html' title=' Index '>HOME</a>]
  101. [<a href='pts.sh.html' title=' pts.sh '>NEXT</a>]
  102. </div>
  103. </body>
  104. </html>