Not able to Receive Messages on Client

I’m troubleshooting a program that is able to send messages, but not able to receive it on other clients.

I’ve checked that the handlers are set up correctly, and to the best of my knowledge, they are. The only thing I can think of so far is that my scope is currently only defined to “C” to include clients and maybe it should be “CG” to include clients and the gateway.

Other than user error, I’m not sure where else to look for a problem. I’ve attached the code of the button, just as a reference

user = system.security.getUsername() message = event.source.parent.getComponent('Message').text payload = {"user":user, "message":message} system.util.sendMessage(project="Ignition7_7GoldCertificationTest", messageHandler="Handler", payload=payload, scope="C")

Any thoughts would be greatly appreciated! :slight_smile:

Hi alewayhar,

More data is needed. Can you show a screenshot of the client message handler that is supposed to receive the messages?

You only need the G scope if you want to send the messages to the gateway. If you only want to send messages to other clients then you only need the C scope.

Best,

Nmudge,

Does this help? I think that this is what you’re asking for though, right?


Yep, that is what I am asking for and it helps a lot.

The name of your message handler “Message Handler”, does not match the name of the message handler you are sending messaged to, “Handler”. That is why the message handler in your clients are not receiving messages.

Best,

So by changing my code to

user = system.security.getUsername() message = event.source.parent.getComponent('Message').text payload = {"user":user, "message":message} system.util.sendMessage(project="Ignition7_7GoldCertificationTest", messageHandler="Message Handler", payload=payload, scope="C")

Or by changing the name of my Message Handler to “Handler” would fix the problem? This being said (and assumed), is one better than the other?

Yes. Either one will work. One is not better than the other. The naming is arbitrary.

Awesome, thanks so much! :thumb_left: