One devive, two channel to publish

Raúl Moreno Sánchez on 24 Jun 2022
Latest activity Reply by Raúl Moreno Sánchez on 26 Jun 2022

I work with an Arduino device. I have subscribed separately two thingspeak devices that works properly. Every device has a channel and I would like to publish on both channel using an only device.
I have added the second channel to the first device(see image).
Althougt this device can publish on both channel separately, I can't publish at the same time (after a few seconds, obviously). When I try to publish both of then, no one works.
Christopher Stapels
Christopher Stapels on 24 Jun 2022 (Edited on 24 Jun 2022)
Can you try to reproduce this with a desktop client? MATLAB or MQTTX perhpas? Is there a wait time that will work at all (say 20 seconds)?
Raúl Moreno Sánchez
Raúl Moreno Sánchez on 24 Jun 2022
I use MQTT.
This is the first Channel
This is the second one
Separately, it works properly.
I need to manage both channel in a only device.
Christopher Stapels
Christopher Stapels on 24 Jun 2022
My understanding:
If you program your device to publish to channel 1, it works. If you pogram the device to publish to channel 2 it works.
If you program the device to publish to channel 1 then wait 3 seconds and publish to channel 2, it fails. What if you program to publish to channel1, wait 30 seconds, then publish to channel 2? Does this work?
Or alternatively, what if you use MQTT x to publish to a channel via an MQTT device. Then you publish to another channel with that same device, manaully, after 3 seconds, then after 30 seconds. What do you see? Does it work?
Raúl Moreno Sánchez
Raúl Moreno Sánchez on 24 Jun 2022
"wait 30 seconds, then publish to channel 2?"
I doesn't work. Indeed, I wait 1 min between Channel 1 and Channel 2 data transfer to thingspeak system (allways via MQTT device)
Maybe it's not possible to do that. But, why not?
Christopher Stapels
Christopher Stapels on 24 Jun 2022 (Edited on 24 Jun 2022)
I just tried with MQTTx and was sucessful to publish to two different channels with the same device. Can you share the topic structure you are using? And please show the data you are sending. You can redact you channel number if you wish, but I wont be able to access it if it is private.
I sent
field1=10 to the topic
channels/1285400/publish
and
the same data to
channels/1381616/publish
Raúl Moreno Sánchez
Raúl Moreno Sánchez on 26 Jun 2022
I found the reason why it doesn't work.
A sensor is broken.
Thanks for your replay.