Yes,
void loop() {
client.loop();
}
is lets the MQTT client run. If not you lose connection to the broker (HiveMQ on my Debian server)
http://knolleary.net/arduino-client-for-mqtt/api/#loop
Yes i need to subscript to the whole topic in the callback. I tested also "*/IR-SonyTV" and "#/IR-SonyTV" because i thought
it would work because i already subscribe in the setup.
This part does not compile:
if (strncmp(message,"volume-stop")==0) {
// do whatever you need to stop the volume-up
Serial.println("stop volume-up");
message[0] = '\0';
}
c:/programme (zip)/arduino/hardware/tools/avr/lib/gcc/../../avr/include/string.h: In function 'void callback(char*, byte*, unsigned int)':
c:/programme (zip)/arduino/hardware/tools/avr/lib/gcc/../../avr/include/string.h:135: error: too few arguments to function 'int strncmp(const char*, const char*, size_t)'
sketch_apr30a:58: error: at this point in file
If i take it out the "volume-ups" part works. "Up" is printed one time.