Well, this is the tricky part.
I once found a very interesting cabling problem on the internet.
It went like that:
- you have a long cable making the connection across a sea.
- this cable contains a lot of wires and for some reason the manufacturer forgot to label them. So, there is no way for you to know which wire is which from one side to the other of the sea.
- the problem is to identify them with as little steps as possible. You can use a multimeter, and you can travel overseas to make some connections (with local wires only). But you have to limit the number of travel to the bare minimum.
This is exactly the kind of thing I had to do... Moreover, I had no clue about the way the keyboard was organised (it could be a matrix, multiple contact keys, or a mix of them).
Hopefully I knew the answer to the initial problem. Given a flat ribbon, a multimeter, key-presses, and a big bucket of patience I was able to sort it out.
Each key of the keyboard makes actually 2 connections with a ground plane. If one wants to simulate a key-press, just connect simultaneously these 2 wires to the ground, and voilà ! Also, further experimentation showed that timing is important; the contact must be no less than 100ms.
Now that we know how to spoof the keyboard, we have to choose how to do it:
- we can use directly the Odroid GPIO
- we can use some interface board
If you know what you're doing when hacking some equipment that is connected to the mains, or simply went through miserable failures where your contraption mysteriously catches fire, you should know about current loops and isolation.
The minimum we could do is to use optocouplers to fake key contacts. So we went for an additional interface board. This board controls optos on one side, and receives commands from a USB on the other side, using a software USB stack.
The board is placed inside the console where there is still some spare room.
After a couple of iterations and careful measurements, we have our design.
With this board inside the treadmill console, we achieve exactly what we were missing: an external connector for remote control. The advantage of using a USB connection (instead of I2C, or other) is that it can be controlled by a PC as well. So, it eases further development and testing of the control software; we are not forced to develop directly on the Odroid.