Cayenne Remote Jukebox


#1

About This Project

I’ve been slacking lately and felt like having a little fun with a set of prank apps.

The first one is a Jukebox using the JQ6500 mp3 module to play song/sound files, but integrate it with an ESP module to control over wifi.

Oh the possibilities!


What’s Connected

Uses the JQ6500 and NodeMCU module and a speaker. USB battery optional.

Triggers & Alerts

No triggers or alerts currently, but the chip does allow for an alert when not playing, and a low battery monitor may be in the cards in the future.

Scheduling

Not used, but could be a pretty stellar alarm clock!

Dashboard Screenshots

Photos of the Project

Code

#define CAYENNE_DEBUG         // Uncomment to show debug messages
#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space

#include "CayenneDefines.h"
#include "BlynkSimpleEsp8266.h"
#include "CayenneWifiClient.h"
#include "Arduino.h"
#include "SoftwareSerial.h"
#include "JQ6500_Serial.h"

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = "";
char ssid[] = "";
char password[] = "";

// Create the mp3 module object, 
//   Arduino Pin 4 is connected to TX of the JQ6500
//   Arduino Pin 5 is connected to RX of the JQ6500
JQ6500_Serial mp3(4,5);

void setup()
{
  Serial.begin(9600);
  
  Cayenne.begin(token, ssid, password);

  mp3.begin(9600);
  mp3.reset();
  mp3.setVolume(20);
  mp3.setLoopMode(MP3_LOOP_ALL);
  mp3.play();  
}

void loop()
{
  Cayenne.run();
}

CAYENNE_IN(V0)
{
  int volume = getValue.asInt();

  //android widget hack
  if(volume <= 1024)
  {
    //android widget scales over 1024
    volume = 30*volume/1024;
  }
  else
  {
    //browser widget scales over set range * 1000
    volume /= 1000;
  }
    
  Serial.print("Volume:");
  Serial.println(volume);
  
  mp3.setVolume(volume);  
}


CAYENNE_IN(V1)
{
  mp3.prev();
}

CAYENNE_IN(V2)
{
  mp3.next();
}

CAYENNE_IN(V3)
{
  mp3.pause();
}

CAYENNE_IN(V4)
{
  mp3.play();
}

CAYENNE_IN(V5)
{
  mp3.playFileByIndexNumber(1);
}

CAYENNE_IN(V6)
{
  mp3.playFileByIndexNumber(2);
}

CAYENNE_IN(V7)
{
  mp3.playFileByIndexNumber(3);
}

CAYENNE_IN(V8)
{
  mp3.playFileByIndexNumber(4);
}

CAYENNE_IN(V9)
{
  mp3.playFileByIndexNumber(5);
}

HELP...Please Hold MY Hand!
Submit Your Cayenne Projects! [contest ended]
#2

Now we need a video of you dancing to your jukebox :wink:

-B


#3

Ha.

I think this weekend I’ll load it up with sound files to disturb my children. Words like Moist, and Pustule, and Mucus, and Slurp enunciated from the kitchen would be great fun.

Also, maybe stick it in the drive through line at McDonalds with a script…

Oh the uses of this device are endless.

MWAHAHAHAHA!

Craig


#4

Haha. Or hide it in the ceiling above a colleague at work?

Let me know a PayPal link I can use when you get a chance :slight_smile:

-B


#5

That’s what @dion.dube said to do too. Have you guys been scheming? Lol.

My next act is a doozy. If I build it, I could get beat up, so I’m having a bit of an Oppenheimer moment.

Cheers,

Craig


#6

An Oppenheimer moment? Am I supposed to read this in any other way than you attempting nuclear weapons development with Cayenne? :fearful:


#7

I will not deny you your panic, but I hope you have your towel.

Non destructive in that way, but it will be as if a million voices suddenly cried out in terror and were then, suddenly silenced :stuck_out_tongue:

SCI-FI Nerdisms are the bomb though.

Cheers,

Craig


#8

Really good project!