Midi System Exclusive Control of Arduino Application

Most recent project has been an midi foot controller based around an Arduino/PJRC Teensy and a companion windows application to configure it.

Details and source over at github

The configuration tool in Windows(Works in wine on Linux)

Sysex Format

The sysex format is in this format.
   System Exclusive Configuration Messages

Configuration of the project is by Midi System Exclusive MEssages, the format of which are now described

The midi header counting from byte 0

0 0xF0 Start of sysex
1 0x7D indicating research/school/not  a manufacturer
2 0xNN 4 Character key , the same in the arduino application
3 0xNN
4 0xNN
5 0xNN
6 0xMM A device ID, you choose identify your arduino project
7 0xMM A Command 
. Variable number of bytes depending on message
. 0xF7 End of SysEx marker

The 4 character code is set in the arduino source and can be configured in the windows pedal manager (see its documentaion )

  Request arduino send out its current configuration

0 0xF0 Start of sysex
1 0x7D indicating research/school/not  a manufacturer
2 0xNN 4 Character key , the same in the arduino application
3 0xNN
4 0xNN
5 0xNN
6 0xMM A device ID, you choose identify your arduino project
7 0x02 Command 0x01 is send config
8 0xf0 End of SysEx marker

On receipt of correctly formatted message the Arduino should reply

 0 0xF0 Start of sysex
 1 0x7D indicating research/school/not  a manufacturer
 2 0xNN 4 Character key , the same as in the arduino application
 3 0xNN
 4 0xNN
 5 0xNN
 6 0xMM A device ID, you choose to identify your arduino project
 7 0x02 indicates this is response to a "give me your configuration" request 
Posted in arduino, coding, computing, midi, teensy, Uncategorized | Leave a comment

SQL and secure_file_priv

Reminder of how to export from mysql when you run into the secure_file_priv message!

to find what its set at currently from within sql

SELECT @@global.secure_file_priv;

to export stuff to csv


Posted in coding, computing, mysql | Leave a comment

Logitech C270 and Linux hangups

Problems on a debian install that each time I plugged in a C270 the usb hung.

A look at logs showed two symptoms. lots of
usb 3-6: 3:1: cannot get freq at ep 0x86
and multiple instances of udevd also lsusb would hang.

Reason is the audio, quick fix is to unload usb audio module
rmmod snd_usb_audio so later today I may get round to writing a udev rule,

Posted in coding, opencv, Uncategorized | Tagged , , , | Leave a comment

OpenCV 3 and ffmpeg fun

Had a few hours of  ‘fun’ getting OpenCV3 to build… I will expand on that sometime, meantime some reminders

Some reminders mainly to me…

The main problem was configure for OpenCV would not find ffmpeg, in spite of all the solutions to the problem posted around the web, none worked. In the end I reinstalled OpenCV from source.

Note below the configure needs some specific flags or open CV will get grumpy.


clear build folder with rm -r

#before doing the




ffmpeg build required

./configure --enable-nonfree --enable-pic --enable-shared

You may find ffmpeg complains when it is run of missing libraries, its the usual solution apt-get….

A couple of functions I use from older version has different args, for thos a quick fix os

#contours returns more values so…
(_,contours,_) = cv2.findContours(
contours, hierarchy = cv2.findContours(…)[-2:]
[/sourcecode ]

ps for the java libs it doesnt find thing unless

export JAVA_HOME=/usr/local/jdk1.8.0_20


Posted in computing, opencv, python | Tagged , , | Leave a comment

From mbed online to mbed-cli via KDS and LPCXpresso

After an exciting few weeks with projects using 11u35/1764 and K64F with lpcXpresso and Kinetis Design Studio I have yet to find a good working IDE for ALL of them. So as the online tools have been slow this week I have resorted to mbed-cli command line tools.

The export as zip option has been removed from the online tools so I have used either export to LPCXpresso or as a GCC project.

So here are  the steps:-

1)download as expresso or gcc export
2)unpack into folder
3)cd into folder
4)mbed new .
5)modify mbed.bld to

(theres a post about this at https://github.com/ARMmbed/mbed-cli/issues/391#issuecomment-259932373 )
6)mbed deploy

it then complains about libraries references

[mbed] ERROR: Library reference “MPU6050.lib” points to a folder “/junk/jt_mbed_cli/nl_DEV_datalogger_nolib/MPU6050”, which is not a valid repository.
[mbed] ERROR: You can remove the conflicting folder manually and use “mbed deploy” to import the missing libraries
[mbed] ERROR: You can also remove library reference “/junk/jt_mbed_cli/nl_DEV_datalogger_nolib/MPU6050.lib” and use “mbed sync” again.
To work round this is is up to you I just deleted the libs and then doing
step 7 to get them to download again was easiest
7)mbed deploy

8) mbed compile -t GCC_ARM -m LPC1768

In a later post I will explain how I then got mbed-cli to actually export something for KDS and LPCXpresso and the fun it was getting them to compile…

If you have an easier way, please drop me a line

Posted in coding, computing, MBED | Leave a comment

Reminder how to Program an MBED 11u35 from Linux or mac

For a work project I am using an embedded artists 11u35. These notes are reminder of how to download code to it when on mac or linux…

Note below taken from this link on mbed forums by Neil Thiessen

a)remember to start the boat up by keeping left button pressed while pressing reset. (assuming usb is top)
b)will appear as device called CRP_DISABLED

For Mac or Linux:

delete firmware.bin
unmount device (sudo on MAC)
using Linux umount /dev/sd* (where * is the location of your device)
using Mac OS umount /volumes/CRP DISABLD

copy the file to the disk
Using Linux dd if=mbed_if.bin of=/dev/sd* seek=4
Using Mac dd if=mbed_if.bin of=/dev/disk* seek=4

Posted in coding, computing, MBED | Leave a comment

Kinetis K64 Not Starting after Power Up

A day of misery with various micro-controllers. More to be explained over the coming days, tales of misery and imagination involving LPCExpresso and Kinetis Studio….
But for not the misery was a Kinetis K64F that seemed to not boot reliably. The answer is need pull up R75 or remove a capacitor. It all relates to NMI. Until I write up a better post see here
Short version answer to this is answer here

10K resistor populated in R75 by the tricolour LED or handle NMIs….

The  NMI handler. On a K64F the  interrupt vector resides in bytes 8-9-10-11, also NMI connected to SW3.

And some notes on how to write your own boot loader!

Posted in Uncategorized | Tagged , , , | Leave a comment