![]() |
HowTo.AddVellemanK8055USBBoard HistoryHide minor edits - Show changes to markup June 18, 2009, at 10:02 AM
by -- Formatting
Changed lines 22-23 from:
to:
Changed lines 31-33 from:
@@ SUBSYSTEM=="usb_device", SUBSYSTEMS=="usb", ATTRS{idProduct}=="5500", ATTRS{idVendor}=="10cf", \\
MODE="0666", SYMLINK+="k8055", RUN+="/usr/bin/k8055.sh" @@
to:
SUBSYSTEM=="usb_device", SUBSYSTEMS=="usb", ATTRS{idProduct}=="5500", ATTRS{idVendor}=="10cf", \\
MODE="0666", SYMLINK+="k8055", RUN+="/usr/bin/k8055.sh"
Changed lines 38-42 from:
@@ #!/bin/sh
to:
@@#!/bin/sh \# Based on: \# http://www.nslu2-linux.org/wiki/Applications/DigitalCameraBackup \# Called from /etc/udev/rules.d/10-local.rules Changed lines 49-50 from:
to:
Changed lines 76-77 from:
to:
Changed line 84 from:
@@ Syntax : k8055 [-P:(number)] [-D:(value)] [-A1:(value)] [-A2:(value)] [-NUM:(number) [-DELAY:(number)]] [-DBT1?:(value)] [-BDT2?:(value)] [-reset1] [-reset2] [-debug] to:
@@Syntax : k8055 [-P:(number)] [-D:(value)] [-A1:(value)] [-A2:(value)] [-NUM:(number) [-DELAY:(number)]] [-DBT1?:(value)] [-BDT2?:(value)] [-reset1] [-reset2] [-debug] Changed line 106 from:
* -debug Activate debug mode @@ to:
* -debug Activate debug mode@@ Changed lines 110-111 from:
to:
Changed lines 116-117 from:
to:
Changed lines 124-125 from:
to:
Changed lines 128-129 from:
to:
Changed lines 132-133 from:
to:
June 18, 2009, at 09:58 AM
by -- Formatting
Changed line 28 from:
Create the following udev rule and added it to a new file to:
Create the following udev rule and added it to a new file: Changed lines 31-33 from:
to:
@@ SUBSYSTEM=="usb_device", SUBSYSTEMS=="usb", ATTRS{idProduct}=="5500", ATTRS{idVendor}=="10cf", \\
MODE="0666", SYMLINK+="k8055", RUN+="/usr/bin/k8055.sh" @@
Changed lines 38-44 from:
@@ #!/bin/sh\\
\# Based on: to:
@@ #!/bin/sh
/bin/beep -f 392.0 -n -f 493.9 Changed lines 49-50 from:
to:
Changed lines 70-71 from:
@@ k8055
to:
@@ k8055 Changed lines 75-78 from:
Timestamp is the number of milliseconds taken to report back the output (not the number of milliseconds between data being read and program start ). to:
Timestamp is the number of milliseconds taken to report back the output (not the number of milliseconds between data being read and program start). Changed line 84 from:
@@ Syntax : k8055 [-P:(number)] [-D:(value)] [-A1:(value)] [-A2:(value)] [-NUM:(number) [-DELAY:(number)]] [-DBT1?:(value)] [-BDT2?:(value)] [-reset1] [-reset2] [-debug]
to:
@@ Syntax : k8055 [-P:(number)] [-D:(value)] [-A1:(value)] [-A2:(value)] [-NUM:(number) [-DELAY:(number)]] [-DBT1?:(value)] [-BDT2?:(value)] [-reset1] [-reset2] [-debug] Changed lines 110-111 from:
to:
Changed lines 116-117 from:
to:
Changed lines 124-125 from:
to:
Changed lines 128-129 from:
to:
Changed lines 132-133 from:
to:
June 18, 2009, at 09:55 AM
by -- Formatting
Changed lines 22-23 from:
to:
June 18, 2009, at 09:54 AM
by -- Formatting
Changed lines 22-23 from:
to:
Changed line 31 from:
@@ SUBSYSTEM=="usb_device", SUBSYSTEMS=="usb", ATTRS{idProduct}=="5500", ATTRS{idVendor}=="10cf", \\
to:
@@ SUBSYSTEM=="usb_device", SUBSYSTEMS=="usb", ATTRS{idProduct}=="5500", ATTRS{idVendor}=="10cf", \\ Changed lines 38-42 from:
@@ #!/bin/sh\\
to:
@@ #!/bin/sh\\
\# Based on: Changed lines 49-50 from:
to:
June 18, 2009, at 09:52 AM
by -- Formatting
Added lines 1-2:
Changed lines 49-50 from:
to:
June 18, 2009, at 09:49 AM
by -- Formatting
Changed lines 20-21 from:
to:
Changed lines 29-30 from:
to:
Changed line 36 from:
@@ #!/bin/sh\\ to:
@@ #!/bin/sh\\ Changed line 68 from:
@@ k8055\\ to:
@@ k8055\\ Changed lines 73-74 from:
to:
Changed lines 107-108 from:
to:
Changed lines 113-114 from:
to:
Changed lines 121-122 from:
to:
Changed lines 125-126 from:
to:
Changed lines 129-130 from:
to:
June 18, 2009, at 09:47 AM
by -- formatting
Changed line 80 from:
@@ Syntax : k8055 [-P:(number)] [-D:(value)] [-A1:(value)] [-A2:(value)] [-NUM:(number) [-DELAY:(number)]] [-DBT1?:(value)] [-BDT2?:(value)] [-reset1] [-reset2] [-debug] to:
June 18, 2009, at 09:45 AM
by -- More formatting
Changed lines 20-21 from:
to:
Changed lines 29-30 from:
SUBSYSTEM=="usb_device", SUBSYSTEMS=="usb", ATTRS{idProduct}=="5500", ATTRS{idVendor}=="10cf", MODE="0666", SYMLINK+="k8055", RUN+="/usr/bin/k8055.sh" to:
Changed lines 35-48 from:
\#!/bin/sh \# Based on: \# http://www.nslu2-linux.org/wiki/Applications/DigitalCameraBackup \# \# Called from /etc/udev/rules.d/10-local.rules /bin/beep -f 392.0 -n -f 493.9 exit 0; to:
@@ #!/bin/sh\\
Changed lines 46-47 from:
udevcontrol reload_rules to:
Changed lines 67-70 from:
k8055 499;0;128;230;9;8 to:
Changed lines 72-73 from:
timestamp;digital;analog 1;analog 2;counter 1;counter 2 to:
Changed line 80 from:
Syntax : k8055 [-P:(number)] [-D:(value)] [-A1:(value)] [-A2:(value)] [-NUM:(number) [-DELAY:(number)]] [-DBT1?:(value)] [-BDT2?:(value)] [-reset1] [-reset2] [-debug] to:
@@ Syntax : k8055 [-P:(number)] [-D:(value)] [-A1:(value)] [-A2:(value)] [-NUM:(number) [-DELAY:(number)]] [-DBT1?:(value)] [-BDT2?:(value)] [-reset1] [-reset2] [-debug] Changed lines 102-103 from:
* -debug Activate debug mode to:
* -debug Activate debug mode @@ Changed lines 106-107 from:
k8055 -reset1 -reset2 to:
Changed lines 110-111 from:
Now for a more existing example: k8055 -P:0 -D:147 -A1:25 -A2:203 to:
Now for a more exciting example: Changed lines 120-121 from:
k8055 -A1:10 to:
Changed lines 124-125 from:
k8055 -A1:128 to:
Changed lines 128-129 from:
k8055 -A1:255 to:
June 18, 2009, at 09:37 AM
by --
Changed lines 20-21 from:
to:
June 18, 2009, at 09:33 AM
by -- formatting
Changed lines 20-21 from:
'udevinfo -a -p /sys/class/usb_device/usbdev3.2/dev' to:
April 26, 2009, at 06:39 PM
by -- Spelling
Changed lines 1-2 from:
How to Connect a Velleman K8055 USB Experimenter's/Breadkout Board to an NSLU2 running SlugOS/BEto:
How to Connect a Velleman K8055 USB Experimenter's/Breakout Board to an NSLU2 running SlugOS/BEApril 15, 2009, at 08:18 PM
by --
Changed lines 1-2 from:
--How to Connect a Velleman K8055 USB Experimenter's/Breadkout Board to an NSLU2 running SlugOS/BE-- to:
How to Connect a Velleman K8055 USB Experimenter's/Breadkout Board to an NSLU2 running SlugOS/BEApril 14, 2009, at 08:42 PM
by --
Added line 34:
Added line 36:
Added line 38:
Added line 40:
Added line 42:
Added line 44:
Added line 73:
Added line 88:
Added line 90:
Added line 92:
Added line 94:
Added line 96:
Added line 98:
Added line 100:
Added line 102:
Added line 104:
Added line 106:
Added line 111:
April 14, 2009, at 08:40 PM
by -- Formatting
Changed lines 7-9 from:
1.Having the operating system recognise the board and give you access to it 2.Having an executable or library that lets you or user-applications manipulate the board to:
Changed lines 34-38 from:
to:
\#!/bin/sh \# Based on: \# http://www.nslu2-linux.org/wiki/Applications/DigitalCameraBackup \# \# Called from /etc/udev/rules.d/10-local.rules Changed lines 45-46 from:
to:
udevcontrol reload_rules Changed lines 54-55 from:
http://libk8055.sourceforge.net/ to:
http://libk8055.sourceforge.net/ Changed lines 58-59 from:
http://robin.mulloy.ca/index.php?blog=4&c=1&more=1&p=34&pb=1&tb=1 to:
http://robin.mulloy.ca/index.php?blog=4&c=1&more=1&p=34&pb=1&tb=1 Changed lines 62-63 from:
http://robin.mulloy.ca/media/blogs/a/k8055-NSLU2.zip to:
http://robin.mulloy.ca/media/blogs/a/k8055-NSLU2.zip Changed line 66 from:
to:
k8055 Changed lines 98-99 from:
Now for a more existing xample: k8055 -P:0 -D:147 -A1:25 -A2:203 to:
Now for a more existing example: k8055 -P:0 -D:147 -A1:25 -A2:203 Added line 107:
Added line 109:
Added line 111:
Added line 113:
April 14, 2009, at 08:38 PM
by -- First draft: How to add Velleman K8055 USB Board
Added lines 1-116:
--How to Connect a Velleman K8055 USB Experimenter's/Breadkout Board to an NSLU2 running SlugOS/BE-- A Velleman k8055 USB Experimenter's Board allows you to control up to eight digital outputs plus two pulse-width modulated digital outputs. It allows you to read two digital counter inputs, two analog inputs. There are two steps to being able to work with a Velleman k8055: 1.Having the operating system recognise the board and give you access to it 2.Having an executable or library that lets you or user-applications manipulate the board Dealing with recognising the k8055 board first, plugging in the k8055's USB cable should produce a response in the SlugOS/BE's udev control system. You can see the physical plug-in by watching the 'dmesg' command. We need the SlugOS/BE to modify its response to plug-in to enable us to have write permissions to the k8055. To do that, we need to write a udev rule that tells udev what to do on connection. To do that, we first need to find the k8055's VendorID? and its ProductID?. Find these parameters by running 'udevmonitor' and noting which 'usbdev#.#' number-set appears when the k8055 is plugged in. On my NSLU2, the k8055 shows up as usbdev3.2. Once you have the usbdevice number, you can find the VendorID? and ProductID? by feeding the usbdevice number to udevinfo. Eg: 'udevinfo -a -p /sys/class/usb_device/usbdev3.2/dev' shows the k8055 as 'Bus 3 Device 2: ID 10cf:5500'. That's vendorID '10cf 'and ProductID? '5500'. You can also acquire this information by manually working through the output of 'cat /proc/bus/usb/devices'. With that VendorID? and ProductID? information, we can move on to the next step: writing a udev rule to set up access to the device on connection. Create the following udev rule and added it to a new file /etc/udev/rules.d/10-local.rules SUBSYSTEM=="usb_device", SUBSYSTEMS=="usb", ATTRS{idProduct}=="5500", ATTRS{idVendor}=="10cf", MODE="0666", SYMLINK+="k8055", RUN+="/usr/bin/k8055.sh" On detection of the USB device by udev, this rule uniquely identifies the device using the idProduct and idVendor numbers. It then sets the access mode to 0666 (read and write access for everyone), it also creates a symbolic link /dev/k8055 (which will be usable). Finally the rule runs my 'beep' script located at /usr/bin/k8055.sh Contents of /usr/bin/k8055.sh
/bin/beep -f 392.0 -n -f 493.9 exit 0; To reload this new udev rule run:
Now run 'udevtrigger' to simulate a reconnect so that the k8055 is picked up by the new udev rule. I found I do also need to physically reconnect the k8055 to be able to write to the board. After these steps, you should be able to hear the NSLU2 beep when the k8055 is connected. We can now turn to being able to operate the board. There appear to be two ways to do this. One is via a user-space executable and the other is via a library+user-space executable written by Sven Lindberg. I haven't played with Sven's library approach and I would appreciate it if anyone who has to update this how-to with information about how that went. The code for that is available at: http://libk8055.sourceforge.net/ For my first bite at this, I took the easy way out and used Robin Mulloy's pre-compiled k8055 executable from his blog at: http://robin.mulloy.ca/index.php?blog=4&c=1&more=1&p=34&pb=1&tb=1 The pre-compiled binary is in a zip within the zip at: http://robin.mulloy.ca/media/blogs/a/k8055-NSLU2.zip Simply placing this executable in the executables path on the NSLU2 makes it available. Once it is made available, simply running the command 'k8055' will display the k8055's output. It should look something like this:
499;0;128;230;9;8 That output breaks down like this: timestamp;digital;analog 1;analog 2;counter 1;counter 2 Timestamp is the number of milliseconds taken to report back the output (not the number of milliseconds between data being read and program start ). You can quickly test the effect of changing the input by pressing either of the two 'Inp1' or 'Inp2' buttons on the left of the board. Doing so should increment the final two counters by one for each press. Now let's test writing to the k8055 board. Here it is from the horse's mouth: Syntax : k8055 [-P:(number)] [-D:(value)] [-A1:(value)] [-A2:(value)] [-NUM:(number) [-DELAY:(number)]] [-DBT1?:(value)] [-BDT2?:(value)] [-reset1] [-reset2] [-debug] * -P:(number) Set board number
* -D:(value) Set digital output value (8 bits in decimal)
* -A1:(value) Set analog output 1 value (0-255)
* -A2:(value) Set analog output 2 value (0-255)
* -NUM:(number) Set number of measures
* -DELAY:(number) Set delay between two measure (in msec)
* -DBT1?:(value) Set debounce time for counter 1 (in msec)
* -DBT2?:(value) Set debounce time for counter 2 (in msec)
* -reset1 Reset counter 1
* -reset2 Reset counter 2
* -debug Activate debug mode
Let's reset the counters first by issuing: k8055 -reset1 -reset2 which should bring both back to zero. Now for a more existing xample: k8055 -P:0 -D:147 -A1:25 -A2:203 The board number 'P' is set by SK5? and SK6? on the board. Both closed equals a board number of “0” - as indicated on the board itself. Feeding decimal numbers to -D – such as -D:147 - will display the binary equivalent in the column of LEDs? on the right of the board. Obviously, you can take these outputs out to MOSFETs? or relays (presumably via transistor drivers) to turn appliances on and off. The -A1 and -A2 parameters will set a simulated analog voltage at PWM1? and PWM2?. So, if you run: k8055 -A1:10 followed by: k8055 -A1:128 followed by: k8055 -A1:255 you should see the PWM1? LED glow at three levels of brightness. Thanks to the various people who have been involved with writing Linux-usable, and NSLU2-usable, code for the k8055. I'm interested to hear from people who have interfaced the k8055's output with switches and who have used 'Inp3', 'Inp4', and 'Inp5'. I plan to experiment with adding MOSFETs? to the output of my k8055 and will document that once I have some results. Page last modified on June 18, 2009, at 10:02 AM
|