So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By murrayc2000
#73387 Hi my question is - is it possible to run multiple protocols using the WiFi client class i.e https://github.com/witnessmenow/arduino-ifttt-maker and https://github.com/knolleary/pubsubclient. If so how do I write the code to accommodate both...reliably? I want to be able to trigger IFTTT and publish and subscribe to MQTT in the same sketch

Many thanks,

Murrayc2000
User avatar
By btidey
#73408 Yes. Once you have made the network connection you can program it to do whatever you want.

The two 'protocols' you mention are just methods of sending a message. So in your foreground loop you just check if you have a message to send to one or both then call a function to send the mqtt message and a function to send the ifttt message as required.
User avatar
By murrayc2000
#73470 Thanks btidey. I don't suppose somebody could show me a quick sketch of how this would work with both protocols in the sketch?

It would be much appreciated.

Many thanks

Murrayc2000