Tag: crunchbang

XMOS startKIT running on Crunchbang
20/12/2013
Wanted to look at xTimecomposer and the XMOS startKit so I dived into crunchbang again.
You need to do the following first:
Create a file “/etc/udev/rules.d/99-xmos.rules” with the following contents:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
SUBSYSTEM!="usb|usb_device", GOTO="xmos_rules_end" ACTION!="add", GOTO="xmos_rules_end" # 20b1:f7d1 for xmos xtag2 ATTRS{idVendor}=="20b1", ATTRS{idProduct}=="f7d1", MODE="0666", SYMLINK+="xtag2-%n" # 20b1:f7d3 for xmos startkit ATTRS{idVendor}=="20b1", ATTRS{idProduct}=="f7d3", MODE="0666", SYMLINK+="startkit-%n" # 0403:6010 for XC-1 with FTDI dual-uart chip ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="0666", SYMLINK+="xc1-%n" LABEL="xmos_rules_end" |
Note: The ATTRS, MODE and SYMLINK stanzas must be all on one line, as each rule can only be on one line.
Now tell udev to reload to ensure the new rules file is added:
1 |
service udev reload |
It is also necessary to unplug and re-plug the USB cable to allow udev to recognise the device with the new rules. Alternatively trigger a re-plug in udev with either the “udevadm trigger” or “udevtrigger” command, depending on the version of udev in your Linux distribution.
Copied from: http://www.xcore.com/questions/1973/how-enable-usb-drivers-linux-development-tools
Anyway,
Te code examples are nice for now. It just shows you enough to want more.
Share the post "XMOS startKIT running on Crunchbang"

Bus Pirate v3.6 Communication error fix for Windows
19/12/2013
The Bus Pirate v3.6 from Dangerous Prototypes arrived. So I followed the links on the wiki and installed the latest drivers on my windows 8.1 machine. Ready to go right? Nope.
Putty says no:
Looked in device manager and the drivers are installed and do not have any warning signs in front of it. Putty has some sort of connection and the PWR LED on the Bus Pirate is on. But I can type whatever I want into the terminal but nothing happens.
Weird. So I followed a lot of different suggestions from the community on the Dangerous Prototype forum (they are really helpful!). Tried to dig into it with the Bus Pirate GUI, thinking that if there is a connection I might update the firmware and then everything will work:
As you can see the GUI says No too.
Well lets see if I can upgrade the bootloader. There is a “hello world test” on the cmd-prompt. When you connect the PGD and the PGC the MODE LED lights up. Ok, thats good!
But then this output:
1 2 3 4 5 6 7 8 9 10 11 |
d:\downloads\bus pirate\BusPirate-package61\BPv3-firmware>pirate-loader.exe --dev=COM5 --hello +++++++++++++++++++++++++++++++++++++++++++ Pirate-Loader for BP with Bootloader v4+ Loader version: 1.0.2 OS: WINDOWS +++++++++++++++++++++++++++++++++++++++++++ Opening serial device COM5...OK Configuring serial port settings...OK Sending Hello to the Bootloader...ERROR No reply from the bootloader, or invalid reply received: 4 Please make sure that PGND and PGC are connected, replug the devide and try again |
Darn. So I am into my “WTF mode” and installed the drivers on the windows 7 machine. Same error. More shouting and cursing. Blame windows 8.1 and windows 7 so lets try it on the test machine (Vista). Nope, nada, nee! More cursing and shouting but that did not help me further either.
Now I am at the boiling point. Seeedstudio customer support (thanx Kevin!) was good (Seeed are the people who shipped it) and asked me all the things I already tried out so we could easily exchange errors and screenshots. Done that, been there, tried that.. After many emails forward and back, Seeed asked me to send the board back and they would return me another one.
Frustrated as I can be (why can’t I get it to work under all those windows flavours) I decided to do one more trick. I booted into my favorite Linux distro Crunchbang. I expected to see some errors in the log’s about the USB connection that might help me or the folks at Seeed to debug the error. To my surprise there was a /dev/ttyUSB0 available!
So I did the magic with
1 |
screen /dev/ttyUSB0 115200 |
And there it was! YES: Houston we have a connection!
First things first: Tried the self test to make sure everything was working ok and while I was on it I upgraded to the latest firmware.
Now I was sure the Bus Pirate worked, the latest firmware was on it. Back to windows and go go go!
Well the computer/putty said no again.
Then Samuel on the forum poked me about the drivers. But hey I made sure that I had the latest drivers installed so that could not be a problem! But who knows what happened (on three different windows machines). So I looked at the drivers in device manager. There are two: the Serial port and Serial Converter driver from FTDI. Both the latest version: 2.08.30
Update 21-12-2013:
Again Samual pointed out a driver uninstaller that works great:
http://www.ftdichip.com/Support/Utilities/CDMUninstaller_v1.4.zip
Or do it manual:
I decided to uninstall the drivers and try the “older” ones (2.08.28).
Now there this is the tricky part. First you need to uninstall (from within the device manager) the drivers and make sure you also remove the files. There is a checkbox you need to check! Somehow I installed the the drivers two times and to make sure the were gone to I had to check “show hidden drivers” under view. And remove them also. Almost there! If you are like me you have a download or driver installation directory. Delete the 2.08.30 installation drivers or windows will look in there and will use those again.
Anyway, Installed the 2.08.28 drivers from the FTDI download page and then started a putty session. Checked COM port, Baud Rate and and and…YES! Putty and the Bus Pirate worked! I also did the same on the win7 and win Vista machines and same thing. a Working connection between the machine and the bus pirate.
Now, I still think its strange that the latest drivers from FTDI wont work with the Bus Pirate.. But I am glad that this worked.
The folks at Seeed were happy to know that this might be the solution for some of us that write them that their Bus Pirate is bricked, DAO or broken.
In the long run I learned a lot about the Bus Pirate, reading the wiki and learning from the folks at the forum. You can do a lot with this tiny gem.
Share the post "Bus Pirate v3.6 Communication error fix for Windows"
buienradar (weather image) in conky
05/09/2010
Erik wanted some help with getting a piece of an animated gif to show up in his conky (Conky Help::Tips, Tricks & Scripts::CrunchBang Forums.)
Now I liked that idea very much so came up with this:
First I created a directory ~/.conky/radar/ (for the temp.gif).
Then the knmiradar.sh: (chmod it +x)
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 |
#!/bin/bash # # Erik # 2010-07-31 # iggikoopa and pieter # adjust the paths to your own liking! # # Enter the name of the radar GIF image you want to download: RADARIMAGEURL="http://www.knmi.nl/neerslagradar/images/meest_recente_radarloop451.gif" RADARIMAGE="meest_recente_radarloop451.gif" # Download the GIF file: wget -q -N -t 1 "$RADARIMAGEURL" # quiet, timestamping, 1 retry # Split the file, leave only the last frame. This might be tricky, because the # frames seem to share one background frame... # convert the gif to the right colors so we can do something with it. gifsicle --colors=255 "$RADARIMAGE" > /home/pieter/.conky/radar/temp.gif # make them B&W (I like it that way) gifsicle --use-col=bw /home/pieter/.conky/radar/temp.gif > /home/pieter/.conky/radar/tempbw.gif # For greyscale: # gifsicle --dither --use-col=bw /home/pieter/.conky/radar/temp.gif > /home/pieter/.conky/radar/tempbw.gif # grab the last animated gif and make a stilt image of it. gifsicle -U /home/pieter/.conky/radar/tempbw.gif "#-1" > /home/pieter/.conky/radar/radar.gif # if you want to keep the colors then comment above and uncomment these: #gifsicle --colors=255 "$RADARIMAGE" > /home/pieter/.conky/radar/temp.gif #gifsicle -U /home/pieter/.conky/radar/temp.gif "#-1" > /home/pieter/.conky/radar/radar.gif |
Then in Conky:
add variable:
1 |
imlib_cache_size 0 |
and use this (dont forget to edit the path):
1 2 |
${texeci 300 /home/pieter/.conky/knmiradar.sh} ${image /home/pieter/.conky/radar/radar.gif -p 50,15 -s 125x125} |
Works great here…
Share the post "buienradar (weather image) in conky"
Display a # in conky
04/09/2010
I wanted to display #! in my conky script but could not seem to get it working right.
This tip: Conky Help – Tips, Tricks & Scripts – CrunchBang Linux Forums worked great!
To display a “#” in conky you have to do
${exec echo “#”}
Share the post "Display a # in conky"
More conky tips (hellanzb and External IP)
04/09/2010
Sometimes I kinda get lost in the great conky rules that I and many people use..
For example look at this crunchbang conky forum.
a few snippets:
1 |
${execpi 3600 wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//';}|${addr eth0} |
Will give you your esternal and internal IP adress
Or for hellanzb:
1 2 3 4 5 6 7 |
${if_running hellanzb}${font terminus:bold:size=11}${color FFFFFF}NZB ${hr 2}${color 888888} ${execi 10 ~/.conky/hellaconky.py -n} Speed: ${execi 10 ~/.conky/hellaconky.py -r} k/s Percent Done: ${execi 10 ~/.conky/hellaconky.py -p}% ETA:${execi 10 ~/.conky/hellaconky.py -e} Queued: ${execi 10 ~/.conky/hellaconky.py -q} ${endif} |
The hellaconly.py looks like this:
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 |
#!/usr/bin/python # writen by Austin Trask # contact austin@arcintel.com # visit http://wiki.arcintel.com for more info import xmlrpclib import optparse #change this next line to represent your hellanzb server info SERVER = 'http://hellanzb:changeme@localhost:8760/' hellanzbServer = xmlrpclib.ServerProxy(SERVER) def NZB(option, opt, value, parser): download = hellanzbServer.status()['currently_downloading'] if( len(download)>0): print download[0]['nzbName'].encode('ascii', 'ignore') else: print 'None'> def rate(option, opt, value, parser): rate = int(hellanzbServer.status()['rate']) print rate def percentage(option, opt, value, parse): percent = hellanzbServer.status()['percent_complete'] print percent def ETA(option, opt, value, parse): eta = hellanzbServer.status()['eta'] hours = (eta/3600) minutes = (eta/60)%60 seconds = (eta%60) time_left = "%02d:%02d:%02d" % (hours, minutes, seconds) print time_left parser = optparse.OptionParser() parser.add_option("-n", "--nzb", action="callback", callback=NZB, help="output current NZB") parser.add_option("-r", "--rate", action="callback", callback=rate, help="output hellanzb rate") parser.add_option("-p", "--percent", action="callback", callback=percentage, help="output completion percentage of current NZB") parser.add_option("-e", "--eta", action="callback", callback=ETA, help="displays the ETA of the current NZB") # New function definitions added by ubuntuforums user "kebes" # to allow for query of the queue: def NZBNext(option, opt, value, parser): queued = hellanzbServer.status()['queued'] if( len(queued)>0): print queued[0]['nzbName'].encode('ascii', 'ignore') else: print 'None' def QueueLength(option, opt, value, parser): queued = hellanzbServer.status()['queued'] print len(queued) def ListQueued(option, opt, value, parser): queued = hellanzbServer.status()['queued'] if( len(queued)>0): for item in queued: print item['nzbName'].encode('ascii', 'ignore') else: print 'None' parser.add_option("-N", "--next", action="callback", callback=NZBNext, help="output next NZB") parser.add_option("-l", "--length", action="callback", callback=QueueLength, help="output queue length") parser.add_option("-q", "--list", action="callback", callback=ListQueued, help="output all items in queue") (options, args) = parser.parse_args() |
Share the post "More conky tips (hellanzb and External IP)"