Paritcle.publish Event names like MQTT (with slashes in them)


#1

Hi There.

I am trying to get a bit clever with the event names on an electron to “standardise” on a format so I can subscribe to events based on the path like MQTT does.

Here is my event path
company/client/project/site/device/event

I have kept within the 63 byte limit and can see the events coming through on the web page for the device.

However if I try and subscribe to the event from the cli it crashes.

i.,e

particle subscribe company/client/project

It all seems to work but the CLI bombs straight away, are slashes in the event name supported?

Regards

Marshall


#2

You can subscribe via

particle subscribe company%2Fclient%2Fproject

Since the forward slash normally is the path seperator you need to esacape it

BTW, CLI does not crash in that case but only finishes since you’d try to subscribe to a non-existent path.


#3

Brilliant I’ll give it a go now

Thanks for the prompt reply!

Regards