I’ve been looking for a solution to emulate the mlr app with the er-301 and Ansible but doesn’t look like it is entirely possible without modifying the software, so I’m not afraid of coding and willing to learn C but need some guidance as to where to go when you start from scratch.
All the monome modules are fairly similar hardware wise so you can move code between them w/o too much difficulty. I mention this because your ansible probably already has the UART header and reset switch installed. The older trilogy modules and teletype most likely don’t. If you want to work with one of the older modules you’ll want/need to solder on the UART header at a minimum:
The UART header part details are here:
…once you have that it looks like this installed on an earthsea (it is the 6-pin header on the right):
To connect to the serial adaptor I use the super basic cu command (which should work on linux as well) specifically:
sudo cu -l /dev/tty.usbserial-mod -s 115200
The device name part(tty.usbserial-mod) might differ depending on the adaptor but it will start with tty.usbserial-. You can read the man page for cu for more details if you’d like. Once connected you will at a minimum see the module name printed out when it is power cycled… depending on the build there may be other stuff printed (just look for calles to print_dbg() in the code).
…once you have the development environment up and running and can rebuild the existing firmware from source and re-flash your module then you are good to go - beyond that I recommend just reading the source code and trying to piece together how things work.
One area of the code which may unlock things is noting that at the end of main() there is an infinite loop which processes events. Trace what happens to the events and you are well on your way.
Ok and would there be a faster/automated way of uploading the firmware to the module? or do we have to follow the steps: turn module off, turn module on holding preset button etc… because that seems to me to be an awful dev cycle tbh! thanks!
Yes - that is the dev cycle. You can (sort of) skip the power cycle if you have a module with the reset button installed.
hold preset button + reset to enter firmware upload mode
…do the upload…
hit the reset button to restart the module with the USB stack back in the right mode
When I’m working on stuff I move the module (or modules) to a separate rack/case so that I have easy access to the reset button and UART headers. Overall I haven’t found the development cycle to be that bad, if anything it has taught me to slow down and think carefully about what I’m doing because the testing cycle is more involved.
Depending on what you are trying you might consider how you might keep the hardware dependent part of the code separate from the pure library code. Keeping them separate allows for unit testing the code on your development host instead of the hardware (within reason). There are examples of this in libavr32 and teletype