Re: [HACK-ADL] Rasberry Pi, Peavey 1600 MIDI controller, USB to MIDI interface and a 9 year old daughter

851 views
Skip to first unread message

Steven Pickles

unread,
Aug 15, 2012, 3:50:55 AM8/15/12
to hackerspac...@googlegroups.com
Hey Sam,

I haven't played with (physical) MIDI in Linux recent history, but I have in the past. I'm out of town at the moment but when I get back I plan to play around with my old MIDI keyboard, and I'll let you know what I find for checking if "this thing is on". I'm hoping those buttons default to note-on note-off commands which are going to be the easiest to play with at first.

It's good that PyGame has MIDI support. Normally getting the MIDI data into your programming environment of choice would be the hardest part.

pix

On 15 August 2012 11:02, Sam Hodge <sam....@gmail.com> wrote:
Hello Hackerfolk,

Sorry if I havent been involved until now...

I have recently ordered a Rasberry Pi model B from Farnell and also been gifted a MIDI controller and have bought a generic USB to midi breakout cable and a USB powered hub.

I have a few years experience with Python, and many years of professional multimedia and CGI experience. http://www.hodge.net.au/sam

But I am pretty new to hardware hacking, apart from some OpenWRT firmware hacking in the hey day of Air-Stream. http://www.air-stream.org.au/r100

Here is the link to the midi controller's manual

http://www.peavey.com/assets/literature/manuals/80301652.pdf

and PyGame's docs

http://www.pygame.org/docs/ref/midi.html

What I was thinking is that if I can get a sprite onto screen with slider control for it X,Y position and Z rotation, that would be a pretty good programming project for myself and my 9 year old daughter to tackle.

What would be a good "HelloWorld" in Linux to see if the hardware is connected and operational?

The gear wont arrive for a month so I have some time to read up on some stuff about MIDI and Linux.

What would you recommend for reading up about MIDI and Linux?

Basically I want to poll a value from a slider to an integer or float.

I have a lappy Dell Precision M65 with Ubuntu 10.04 with ICH7 sound card and working kernel modules for sound and the Peavey 1600 MIDI controller, but I should have the USB to MIDI interface within a week: http://www.ebay.com.au/itm/USB-MIDI-Keyboard-Interface-Converter-Cable-Adapter-/320438116273.

So I can dev on that until the Rasberry Pi arrives, in 20+ days time.

Sam

--
You received this message because you are subscribed to the Google Groups "HackerSpace - Adelaide, South Australia" group.
To view this discussion on the web visit https://groups.google.com/d/msg/hackerspace-adelaide/-/hIY2_9SHZEoJ.
To post to this group, send email to hackerspac...@googlegroups.com.
To unsubscribe from this group, send email to hackerspace-adel...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/hackerspace-adelaide?hl=en.

Sam Hodge at GMail

unread,
Aug 16, 2012, 2:32:00 AM8/16/12
to hackerspac...@googlegroups.com
On Wed, Aug 15, 2012 at 5:20 PM, Steven Pickles <thatp...@gmail.com> wrote:
> I'll let you know what I find for
> checking if "this thing is on". I'm hoping those buttons default to note-on
> note-off commands which are going to be the easiest to play with at first.
>

Looks like this might help

http://home.gna.org/gmidimonitor/

but I was kinda hoping for an equivlant of xev that you use for
debugging joysticks and multimedia keyboards

sam

Sam Hodge at GMail

unread,
Sep 14, 2012, 12:12:26 AM9/14/12
to hackerspac...@googlegroups.com
Hullo

I now how all my parts:


Rasberry Pi, with power supply, SD card with Raspian distro, keyboad and mouse

usb powered hub, 7 ports (not tested, finest ebay chinese workmanship)
usb to midi cable (not tested)
peavey midi thing (not tested)
usb sound card, for kicks (tested)

for starters I want to update a parameter in some code by adjusting
one of the buttons on the peavey midi controller.

I know Python and Linux fairly well and enough C and C++ to be dangerous.

Should I experiment a little more at home or come into Hackerspace and
see what we can mix up?

sam

Robert Hart

unread,
Sep 14, 2012, 12:28:30 AM9/14/12
to hackerspac...@googlegroups.com
Hi Sam,

That sounds very interesting, always nice to see your work popping up
about the place.

Robert

Sam Hodge at GMail

unread,
Sep 14, 2012, 7:46:59 AM9/14/12
to hackerspac...@googlegroups.com
has anybody else had problems with a rasberry pi and a powered USB hub?

It seems when I plug it in it drains the power so the ethernet barely works.

I thought a powered USB hub was meant to solve the power issues not cause them.

Good news is that the USB2.0 to midi works, and the Peavey pc 1600
midi controller works too just needed a reset, looks like the powered
USB hub was the only ebay fail.

I guess I need to get the multimeter onto the rasberry pi and see if I
can salvage anything out of my $7 usb powered hub.

Sam
> --
> You received this message because you are subscribed to the Google Groups
> "HackerSpace - Adelaide, South Australia" group.

Sam Birbeck

unread,
Sep 14, 2012, 8:09:03 AM9/14/12
to hackerspac...@googlegroups.com
It seems "revision 1" pis have an issue with powered hubs that feed power back. The issue would ~probably~ be solved with the following modification: http://theiopage.blogspot.com.au/2012/06/increasing-raspberry-pis-usb-host.html Or, of course, finding a hub that doesn't cause problems!

The new "revision 2" pis that are apparently being shipped now deal with this issue: "The resetable fuses protecting the USB outputs have been removed. This feature was implemented on some later revision 1.0 PCBs by replacing the fuses with links; revision 2.0 permanently implements this modification. It is now possible to reliably power the RPI from a USB hub that back feeds power, but it is important that the chosen hub cannot supply more than 2.5A under fault conditions." - http://www.raspberrypi.org/archives/1929

Sam Birbeck

unread,
Sep 14, 2012, 8:11:02 AM9/14/12
to hackerspac...@googlegroups.com

Sam Hodge

unread,
Sep 15, 2012, 7:40:56 PM9/15/12
to hackerspac...@googlegroups.com, hackerspac...@googlegroups.com
Looks like I might get a new hub rather than solder my nice new RPi.

To save others the pain here is the results of dmesg and lsusb and a photo, or if you like this you can buy from MSY for $10 or $7 via eBay 

[48292.934071] usb 1-1.2: new high speed USB device number 17 using dwc_otg
[48293.034969] usb 1-1.2: New USB device found, idVendor=1a40, idProduct=0101
[48293.035004] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[48293.035024] usb 1-1.2: Product: USB 2.0 Hub
[48293.045977] hub 1-1.2:1.0: USB hub found
[48293.046239] hub 1-1.2:1.0: 4 ports detected
[48293.324070] usb 1-1.2.4: new high speed USB device number 18 using dwc_otg
[48293.425092] usb 1-1.2.4: New USB device found, idVendor=1a40, idProduct=0101
[48293.425129] usb 1-1.2.4: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[48293.425150] usb 1-1.2.4: Product: USB 2.0 Hub
[48293.426388] hub 1-1.2.4:1.0: USB hub found
[48293.427396] hub 1-1.2.4:1.0: 4 ports detected
pi@raspberrypi ~ $ ^C
pi@raspberrypi ~ $ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 017: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Bus 001 Device 005: ID 0d62:700c Darfon Electronics Corp.
Bus 001 Device 018: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB

image.jpeg


I will either get one off the approved list or risk the 10 port one from MSY for $15 as I don't think there are any known bad 10 port ones.

Live and Learn

Might work with my mk802 anyway.

Thanks for the good info, it's kinda fun plugging a mouse in and out of the USB hub and watching your ping to google drop from 27ms up to 7000ms then back to 27 ms on disconnect , but it doesn't give me my extra USB ports.

Sam

Sent from my iPhone

Tamsyn Michael

unread,
Sep 15, 2012, 8:52:20 PM9/15/12
to hackerspac...@googlegroups.com

I kind of agree, but on the other hand any one of those ports will at least triple the weight.  Considering the tiny payload I have to play with on the Hexy (~370g) I might need to consider it.

image.jpeg

Sam Hodge

unread,
Sep 15, 2012, 9:37:27 PM9/15/12
to hackerspac...@googlegroups.com, hackerspac...@googlegroups.com
Here is a solution to fix the hub or the cable from the hub to the RPi so the power doesn't swim upstream from the hub. A well placed diode on the +5V inside the hub or on the cable from the hub to the RPi should make the hub viable, without modding the RPi itself.


It works with the mk802 anyway, and I confirmed that charge is coming from the hub as the mk802 led lit up before power was applied, but did not boot until I added the power supply also. A HDD connected to the hub was powered OK and the data connection seemed OK too.

Sent from my iPhone

Sam Birbeck

unread,
Sep 15, 2012, 9:57:18 PM9/15/12
to hackerspac...@googlegroups.com

Nice!

Tamsyn Michael

unread,
Sep 17, 2012, 12:17:59 AM9/17/12
to hackerspac...@googlegroups.com

Guys, check out your local post office for the Laser 7 port hub mentioned here:
http://elinux.org/RPi_VerifiedPeripherals
They are getting rid of them for $6.

Sam Birbeck

unread,
Sep 17, 2012, 1:36:18 AM9/17/12
to hackerspac...@googlegroups.com

Nice find, thanks :D

Sam Hodge at GMail

unread,
Sep 20, 2012, 12:23:36 AM9/20/12
to hackerspac...@googlegroups.com
So I got one of the Laser & port hubs, and it turns out that it works
to some extent.

funnily enough it reports as a Terminus 7 port hub, whereas the one
off ebay reports as a Terminus 4 port hub, it also leaks charge
upstream, but only freezes the ethernet card if you plug in the sound
card dongle.

Has anybody got experience with a web cam and the security camera
command line daemon "motion"?

I got it to work once only and it hasnt worked since.

my webcam is a Logitech Quickcam E 3500 (uvcvideo kernel module) and
seems to be working OK both as a USB audio device and the camera the
one time it did work, I set it up in alsamixer and recorded audio in
audacity.

v4l2 leaves me a little confused, are there good documents about how
it should work?

Maybe I should go back to my initial goal of getting the midi
controller working.

sam

Steven Pickles

unread,
Sep 20, 2012, 1:01:27 AM9/20/12
to hackerspac...@googlegroups.com
has anyone tried disabling the power pin in the usb cable that connects their hub?

pix

Kim Hawtin

unread,
Sep 20, 2012, 1:18:52 AM9/20/12
to hackerspac...@googlegroups.com
hi pix,
> has anyone tried disabling the power pin in the usb cable that connects
> their hub?
you mean the 5v supply from the host to the hub? i did on one hub, but
when the power line was disconected the hub went to sleep. so i hooked
a mosfet from the plugpack supply swichted into saturation from the 5v
from the host and set the current limit until the usb hub turned on.
was all a bit of an ugly ratsnest, but worked ok. alternatively if you
wanted a simpler package you could go for a six pin opto-isolator,
wires and some heatshrink...
cheers, kim

Sam Birbeck

unread,
Sep 21, 2012, 1:14:02 AM9/21/12
to hackerspac...@googlegroups.com
Just filing this here as another possibly useful, possibly terrifying little pi USB mod: http://www.raspberrypi.org/phpBB3/viewtopic.php?p=130653#p130653

I get the feeling I will end up wanting to do something like this as I piece together my bastard rpi-C64 project. I will have enough challenges getting everything I want in there wired up & working without worrying about my USB/ethernet crapping out on me..!

Sam Hodge at GMail

unread,
Sep 23, 2012, 12:09:58 AM9/23/12
to hackerspac...@googlegroups.com
I dont really understand electronics that well, but I really would
like plentiful reliable USB ports on my Raspberry Pi without spending
$50+ on a fancy USB hub.

Could you make a schematic, or instructions, that a eletronics n00b
with a USB cable to cut up and a shopping list from Jaycar a soldering
iron and a multimeter could walk thier way through.

It should be an easy mod, make the data flow in both directions, but
dont let the current and voltage flow from the usb hub back to the
Raspberry Pi, or am I over simplfying the issue?

Now for the good news:

I got "motion" http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome
working perfectly for about 24+ hours uptime, using a uvcvideo kernel
and v4l2 and my Logitech Quickcam E3500, 640x480, 8 bits per RGB
channel with a time and date stamp burned in, server up to a httpd
that comes with motion.

If anybody is really curious I can give you and IP and port number and
you can see the stream for yourself.

There is a 99c iOS app (CamView) that allows me to view the MotionJPEG
stream, so its like I am living in the future, I can log in from
anywhere and view the video stream on my iPhone.

For the record this was setup by plugging the cam into the RPi in
built port, along with a keyboard and doing the setup via ssh from
another computer, so I could use the mouse and a browser to test.

motion can also dump JPEG's to disk when the image changes, so you can
find out which cat has been taking a dump in your backyard, or other
more interesting wildlife spotting applications.

sam

Ryan Leach

unread,
Sep 23, 2012, 12:20:57 AM9/23/12
to hackerspac...@googlegroups.com

It "should" work but who knows with the pi, a diode is what you use to let power flow one way only, but they also drop the voltage... I have no idea what rating you would need either.

Andrew Helgeson

unread,
Sep 23, 2012, 2:10:54 AM9/23/12
to hackerspac...@googlegroups.com

You dont need to spend $50 on a "fancy" hub! Just go buy an "OfficeOne" powered hub from k mart!
Mine cost me $12!
There is a bit more to a hub than some diodes and a plug pack

Andrew

> Just filing this here as anoth...

Sam Hodge

unread,
Sep 23, 2012, 7:39:06 AM9/23/12
to hackerspac...@googlegroups.com, hackerspac...@googlegroups.com
What chipset is the OfficeOne powered USB hub? Have you tested it with the raspberry Pi and seen if it allows you to hot plug devices into the raspberry Pi ? Does it leak charge into the USB host ?
Can you power the raspberry Pi from it ?

I have spent $7 on one 7 port USB hub and $16 on another 7 port hub.

I don't want to spend another $12 on an untested device, but if a trip to Kmart solves my problem, that would be a great solution.

Sam

Sent from my iPhone
--

Ryan Leach

unread,
Sep 23, 2012, 2:19:00 PM9/23/12
to hackerspac...@googlegroups.com

You have confused each other i had to read it twice before i understood. The idea Is to make a modified cable _for_ a hub that won't allow power to back-feed right?

Sam Hodge at GMail

unread,
Sep 23, 2012, 7:54:25 PM9/23/12
to hackerspac...@googlegroups.com
I have two powered hubs, both of them feedback power but are otherwise
functional.

I was wondering if I could modify a USB cable so that the power hubs
that I have already purchased dont feedback power to the USB host,
which is one of the two Raspberry Pi's USB ports.

I have a soldering iron, a USB cable, a multimeter, and can buy
electronic components such as diodes and heat shrink at Jaycar.

Sorry the previously purchased USB hubs are documented earlier in this thread.

sam

Ken

unread,
Sep 23, 2012, 8:19:42 PM9/23/12
to hackerspac...@googlegroups.com
Can't you just cut the power (USB) lead to the host?

Ken.

Sam Hodge at GMail

unread,
Sep 23, 2012, 9:07:15 PM9/23/12
to hackerspac...@googlegroups.com

Ken

unread,
Sep 23, 2012, 9:08:15 PM9/23/12
to hackerspac...@googlegroups.com
Yes.

Steven Pickles

unread,
Sep 23, 2012, 9:17:57 PM9/23/12
to hackerspac...@googlegroups.com
For a quick test I'd probably menace the pin at the connector: http://wiki.bemaniso.ws/w/images/e/e9/USB_A_pinout.jpg

However, Kim posted that he tried this and his hub wouldn't wake up. So a diode inline in the cable might be necessary. The diode will drop the voltage a little, but hopefully not so much that the hub notices.

pix

Ken

unread,
Sep 23, 2012, 9:22:56 PM9/23/12
to hackerspac...@googlegroups.com
If you are going to use a diode, use a schottky diode.

Steven Pickles

unread,
Sep 23, 2012, 9:37:47 PM9/23/12
to hackerspac...@googlegroups.com
(... because it has a lower voltage drop than a normal diode).

Ken

unread,
Sep 23, 2012, 9:40:25 PM9/23/12
to hackerspac...@googlegroups.com
:) Sorry, could have given an explanation.

And what pix meant to say was "because it has a lower voltage drop than a silicon diode".
Germanium diodes have a lower voltage drop, but aren't normally used in power situations, generally only for signal handling.

Sam Hodge at GMail

unread,
Sep 23, 2012, 9:41:18 PM9/23/12
to hackerspac...@googlegroups.com
So does anybody have a link to the properties of the diode I should buy.

It seems that not all diodes are created equal.

sam

Ken

unread,
Sep 23, 2012, 9:46:30 PM9/23/12
to hackerspac...@googlegroups.com
This looks like it would be more than beefy enough:
http://www.jaycar.com.au/productView.asp?ID=ZR1048

Or you could grab an oversized looking thing from a PC switching power supply, TV power supply, etc.

Kim Hawtin

unread,
Sep 23, 2012, 11:11:40 PM9/23/12
to hackerspac...@googlegroups.com
On Mon, Sep 24, 2012 at 11:16 AM, Ken <k...@waggies.net> wrote:
> Or you could grab an oversized looking thing from a PC switching power
> supply, TV power supply, etc.

<confused> What are you trying to achieve? Are you trying to power the
external USB hub or the Pi itself? </confused>

If you want to power the Pi is a reliable way, you really need to use
a regulated PSU that is current rated about double what the Pi needs.

You obviously don't want to reduce the voltage on the inpupt to the
hub from the Pi. Do you know what the minimum current to drive the
input of your external usb hub? Crack the lid, find the part number go
find the data sheet and see what the input current and volate ranges
are...

regards,

Kim
--
"Art without engineering is dreaming; engineering without art is
calculating." --SKR

Steven Pickles

unread,
Sep 23, 2012, 11:43:10 PM9/23/12
to hackerspac...@googlegroups.com
Kim, we are trying to find a cheap way around the fact that the Pi gets freaked out by the numerous powered USB hubs that feed current back over their USB-B port in to the host computer (the Pi).

... at least that's my understanding.

My only run-in with such hubs is the difficulty in doing a reboot as you need to disconnect the power from the Pi and the Pi from the hub, but apparently it causes other problems also.

pix

Kim Hawtin

unread,
Sep 24, 2012, 12:16:04 AM9/24/12
to hackerspac...@googlegroups.com
hi pix,

On Mon, Sep 24, 2012 at 1:13 PM, Steven Pickles <thatp...@gmail.com> wrote:
> Kim, we are trying to find a cheap way around the fact that the Pi gets
> freaked out by the numerous powered USB hubs that feed current back over
> their USB-B port in to the host computer (the Pi).
>
> ... at least that's my understanding.

i see. In that case the opto coupler is probably the best option, IMHO.
no feedback and only a tiny current draw on the Pi.

> My only run-in with such hubs is the difficulty in doing a reboot as you
> need to disconnect the power from the Pi and the Pi from the hub, but
> apparently it causes other problems also.

external watchdog timers?

cheers,

kim

Damien P

unread,
Sep 24, 2012, 4:34:23 AM9/24/12
to hackerspac...@googlegroups.com
On Monday, September 24, 2012 11:11:19 AM UTC+9:30, Sam Hodge wrote:
So does anybody have a link to the properties of the diode I should buy.

It seems that not all diodes are created equal.

Any diode should do - a 1N4001 or similar can be salvaged from many things.  Diodes have a voltage drop across them: 0.6V for a regular one, 0.3 for a Schottky diode (but they let more current through backwards).  In this case you probably want the voltage drop.

By the sounds of it, disconnecting the power line would be your first action.  If the hub goes to sleep, try adding the diode (if you're going to buy one, I'd go for a Schottky diode).  If it still goes to sleep, you might need to use a FET to behave like a diode with no voltage drop:

http://dangerousprototypes.com/2012/05/29/p-fet-reverse-voltage-polarity-protection-tutorial/

Andrew Helgeson

unread,
Sep 24, 2012, 4:37:18 AM9/24/12
to hackerspac...@googlegroups.com

You wont need 2 diodes, just one on the +5v line, remember though you'll get a 0.6v drop across the diode

On 24/09/2012 9:24 AM, "Sam Hodge at GMail" <sam....@gmail.com> wrote:

I have two powered hubs, both of them feedback power but are otherwise
functional.

I was wondering if I could modify a USB cable so that the power hubs
that I have already purchased dont feedback power to the USB host,
which is one of the two Raspberry Pi's USB ports.

I have a soldering iron, a USB cable, a multimeter, and can buy
electronic components such as diodes and heat shrink at Jaycar.

Sorry the previously purchased USB hubs are documented earlier in this thread.

sam


On Mon, Sep 24, 2012 at 3:49 AM, Ryan Leach <ryan.th...@gmail.com> wrote:

> You have confused e...

Reply all
Reply to author
Forward
0 new messages