The idea is to have a Raspberry Pi Zero W hidden in the Eurorack case, and powered by the case. It receives OSC sent from various devices and transmits the messages to an I2c follower on the i2c bus. It’s been tested successfully with TXo and I’m trying to make it work with an ER-301 too and I would need some help for that.
There are several other options to achieve the same result, including Norns + Crow of course but in this specific case I wanted something not requiring additional cables and devices.
Objective:
To put it briefly, my initial goal was to control the ER-301 from an iPad, by sending OSC mesages from TouchOSC or Lemur. At the moment, the ER-301 is not supported (see below) but the setup works fine with a TXo and could probably work with other follower modules on the I²C bus. It uses OSC, sends I2C and the “conversion job” is handled by Node.js on a Raspberry Pi. The latency is very low.
Approach:
I explained my approach and detailed the steps on the O|D forum if you want to read the whole thing.
Unfortunately, I never managed to connect the RPI to the ER-301. That’s a big disappointment (explanations at the end of this post)
But considering that I have used a Txo for testing the process without risking to harm the ER-301, I will share the project anyway, even if it doesn’t supports the ER-301. I hope I can fix that with the help of this community.
Hardware:
I have considered several hardware solutions but I chose a RPI Zero W because it’s cheap (around 15€), it provides Bluetooth, Wifi and an additional micro USB port. The most important, I can power it from the 5V rail of a Eurorack case (it only draws around 220mA). The hardware I2c GPIOS are exposed, there are two (1.8k) pull-up resistors and a level of 3.3V. On the paper, it doesn’t need an additional circuit (Logic level shifter etc) to work and control an I2C capable module. For now I can only confirm that it’s working with Teensy based modules like TXo.
Software:
I wanted to prototype this idea as fast as possible. I don’t know Python or C++, I know Lua and JS.
So I decided to use Node.js, it’s fast, reliable and most importantly there are thousands of modules available.
After a bit of research, I found Node-red which is a node.js based open source « programming tool for wiring together hardware devices, APIs and online services. » Super reliable, it doesn’t need to write a lot of code, is accessible from a web browser and also has dozens of modules aka « nodes » available, ready to patch.
Preparing the RPI for I2c takes a few minutes, and the node-red install is entirely scripted. 5 minutes to install, you open a web browser and start patching like you’d do in Max, TouchDesigner, Cables.gl etc. In case of problem, the documentation is excellent. The resulting patch is called a « flow ». Once ready, you « deploy » it to the Pi from a simple click.
So I got Max/MSP and Lemur talking to the PI via OSC in no time.
Following that, using the node-red patching environment I wrote some additional JS functions in order to process the OSC messages, pack them to nice JSON messages.
Then I send this to an « i2c node » which converts and sends the command to the i2c bus.
I’m not re-inventing the wheel, I’m using the Monome ii protocol and all the commands available.
The latency is ultra reasonable so far, I’m not fully done with the tests yet. I will do more « stress » tests once the entire set of commands is implemented.
the node-red patching environment
Roadmap:
I will publish the full node-red « flow » and install process on Github in a few days. I just need to add all the Txo commands before I publish it.
Technically, it could work with other i2c followers on the bus. It’s just a matter of adding the corresponding commands.
I wanted to use OSC, but Node-red has many other interesting nodes and it would be easy to add support for other inputs such as:
- Leapmotion
- Midi
- any API
- Midi over Bluetooth (Roli devices for example), this one is on my roadmap.
Downsides:
The Raspberry Pi is a Leader on the bus and unless you want to write some additional code for supporting multiple masters on the i2C bus (I can’t and won’t do that), it probably needs to be the only leader on the bus.
The problem with the ER-301
ER-301 -> Like I said, I can’t connect the Pi to the ER-301, this is so disappointing because it was the original plan. I’m not going to write here all the tests I did, trying to make it work, perhaps it’s better to leave that on the Orthogonal Devices forum but if somebody can help me to fix that, I would really really appreciate.
My knowledge in electrical engineering, software etc is very limited. A week ago, I didn’t know anything about the I2c bus and protocol but since then I’ve read a lot of material but still can’t fix the issue.
I’ve read that the RPI 3 and Zero hardware I2c doesn’t handle « clock stretching », there are a few workaround like lowering down the baud rate excessively or using another set of GPIO and creating a new software i2c bus. I tried this on a breadboard because in that case, the lines need some external pull-resistors but that didn’t help.
There are two scenarios:
1 - If I start the Pi before the 301, the ER-301 will simply not boot. I tried to monitor it’s UART output using an FTDI to USB cable, but nothing.
2 - If I start the 301 first or if both devices start together then impossible to find the 301 on the bus and the bus scan is really slow. It looks like a follower on the bus holds the line down and stuck the bus. Or could it be the Olimex pulling power from the Pi as it was suggested on the OD forum ?
I tried to give them a common GND by powering the Pi from the same case. Also tried to « regulate » the level and provide another set of pull-up resistors using a TT backpack (without TT connected) I tried many things but I’m running out of ideas and I don’t have a Logic analyzer or oscilloscope to test with.