Data Transfer System by MQTT
Filename is 'M5Stack_CloudMQTT_MIDI_OUT.ino'. Added for MIDI keyboard at Hamamatsu side on this event. When someone play this keyboard, this program send MQTT-MIDI data to Bankok.
- M5Stack
- MIDI Library
- PubSubClient
Filename is 'M5Stack_CloudMQTT_MIDI_OUT.ino'. This program send serial data to Arduino Uno of massage chair when it receive MQTT from Bankok. One serial data describe how 5 each cylinder will move in massage chair.
- M5StickC
- PubSubClient
Filename is "M5Stack_CloudMQTT_MIDI_MP3.ino".
You can hear Hamamatsu Sound from M5stack by pushing buttonB and receiving MIDI.
- M5Stack
- MIDI Library
- PubSubClient
- ESP8266Audio https://github.com/earlephilhower/ESP8266Audio
- Set MP3 file to M5Stack.
- There are 21 files in folder "HamamatsuSound" below.
- Prepare a microSD card.
- Copy those files to root directory of the microSD card.
- Insert the microSD card into M5stack.
- write your WiFi SSID/PW.
- const char ssid[] = "xxxxxxxx"; // #### Your Wifi ID
- const char password[] = "xxxxxxxx"; // #### Your Wifi PW
- write MQTT settings. (You should get these information from Hamamatsu)
- const char* mqttBrokerAddr = "xxxxxxxx";
- const char* mqttUserName = "xxxxxxxx";
- const char* mqttPassword = "xxxxxxxx";
- write your client ID. Anything you like is OK.
- const char* mqttClientID = "xxxxxxxx"; // #### Your Client ID
- Install this firmware to your M5Stack.
- If you push buttonB(center button), you can hear Hamamatsu Sound randomly.
- If M5Stack get MQTT-MIDI, you can hear Hamamatsu Sound randomly.
Filename is 'M5StickC_CloudMQTT_MIDI.ino', but it's for M5Stack. You may prepare only M5Stack.
- M5Stack
- MIDI Library
- PubSubClient
- When it receives MIDI data, it generates short beep sound.
- Evenif you don't have any MIDI instrument, you can recognize receiving MIDI.
- If you want to use a real MIDI instrument, You need MIDI shield or board that has same functionarity.
- https://www.sparkfun.com/products/12898
- connect 4lines to M5stack (Rx/Tx/5v/Gnd)
- connect to MIDI instrument
- write your WiFi SSID/PW.
- const char ssid[] = "xxxxxxxx"; // #### Your Wifi ID
- const char password[] = "xxxxxxxx"; // #### Your Wifi PW
- write MQTT settings. (You should get these information from Hamamatsu)
- const char* mqttBrokerAddr = "xxxxxxxx";
- const char* mqttUserName = "xxxxxxxx";
- const char* mqttPassword = "xxxxxxxx";
- write your client ID. Anything you like is OK.
- const char* mqttClientID = "xxxxxxxx"; // #### Your Client ID
- Install this firmware to your M5Stack.
- Open "Audio MIDI Setup"
- Applications -> Utilities -> Audio MIDI Setup
- Choose "Show MIDI Studio" from pulldown menu
- Double click "IAC Driver"
- Choose "Ports" tab
- Add new port by clicking "+", and name it freely
- Install "Processing"
- write topicName that you want to get.
- String topicNtOn = "HMMT_hasebe/MIDI/note_on"; // ####
- String topicNtOf = "HMMT_hasebe/MIDI/note_off"; // ####
- write MIDI port name that you wrote in "Audio MIDI Setup".
- String myMIDIIn = "xxxxxxxx"; // ####
- String myMIDIOut = "xxxxxxxx"; // ####
- Start "Garage Band"
- Start "Processing" and Open "Processing_MQTT_MIDI.pde"
- Click Start(Play) Button in Processing