-->
Page 1 of 1

Multiple protocols

PostPosted: Mon Jan 22, 2018 3:46 pm
by murrayc2000
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

Re: Multiple protocols

PostPosted: Tue Jan 23, 2018 5:56 am
by btidey
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.

Re: Multiple protocols

PostPosted: Wed Jan 24, 2018 8:01 pm
by murrayc2000
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