knolleary / pubsubclient

A client library for the Arduino Ethernet Shield that provides support for MQTT.
http://pubsubclient.knolleary.net/
MIT License
3.82k stars 1.47k forks source link

artefact 2000ms after publication : what is sent at that time by the broker please ? #671

Open derrgis opened 4 years ago

derrgis commented 4 years ago

Working on a art performance, I get an audio clic with all sounds triggered via a mosquitto publication, on a JQ6500 mp3 chipset, around 2000 ms after publishing.

The blue light on the ESP01 (8266) suddenly flashes synchronously with the audio clic from the speaker and I wonder what is sent from my broker and if I could delay or get rid of this information to get the soundfile undisturbed while playing.

saloid commented 4 years ago

Blue led on ESP-01 connected to TX port (GPIO1). Need connection schematic to suggest something.

derrgis commented 4 years ago

Hello, Fritzing capture attached. ESP01 GPIO 0 is connected to JQ6500 TX while GPIO 2 to RX as you can see. Audio clic (more a "craak") occurs after 2 secondes publication from a local client, triggering the sound from the ESP. Really annoying ... Is there something done by the ESP01 at this time, or is there something special sent from the broker after each publication ? Any idea would be appreciated.

[image: JQ6500+ESP01-HelloWorld_bb.png]

Le mer. 23 oct. 2019 à 00:32, Dmytro notifications@github.com a écrit :

Blue led on ESP-01 connected to TX port (GPIO1). Need connection schematic to suggest something.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/knolleary/pubsubclient/issues/671?email_source=notifications&email_token=AKOYUQHLV5G5S6HQ4JCEHGLQP55ORA5CNFSM4JC7HJVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB7NTEA#issuecomment-545184144, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKOYUQBWCLKJ5B5M66U2L53QP55ORANCNFSM4JC7HJVA .

saloid commented 4 years ago

Files not attaches from email. Use ![](http://site.com/image_link.png). And add code example please.

derrgis commented 4 years ago

Oh! Okay, the schematic is here : https://framadrop.org/r/vmSUFiYCcF#OfbWHElNZQlG/kZx/Wv7SEhVVQUZqeB2jH8zE9jCgbI=

Here's the relevant part of my sketch : Possibly I should to post to sleemanj repository (JQ6500 mp3 lib)

//-----------------payload retrieve if ( (strcmp(topic, (clientID + "/snd").c_str()) == 0) //pour ce client uniquement || (strcmp(topic, "snd") == 0)) { // pour tous les clients

global_enabled = true; // open flag : PLAY !

soundfile = payloadToInt(payload, length);

//-------------- play JQ6500 audiofile ---------------- if (global_enabled) { mp3.setVolume(volume); byte stat = mp3.getStatus(); if(stat != MP3_STATUS_PLAYING) {//soundfile index mp3.playFileByIndexNumber(soundfile); //play it ! mp3.play(); } } global_enabled = false; }

Le mer. 23 oct. 2019 à 13:44, Dmytro notifications@github.com a écrit :

Files not attaches from email. Use . And add code example please.

https://camo.githubusercontent.com/eec45dffe3462960a70348645bfa9ac0b9cf00e0/68747470733a2f2f692e70696e696d672e636f6d2f6f726967696e616c732f35642f35632f39632f35643563396332643937373030616135646435306565346466663738636335372e706e67

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/knolleary/pubsubclient/issues/671?email_source=notifications&email_token=AKOYUQEOG6AQ6NIJAS2WCCLQQA2LPA5CNFSM4JC7HJVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECBDJUQ#issuecomment-545404114, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKOYUQHQEO726PU5P7LC243QQA2LPANCNFSM4JC7HJVA .