mqtt-publisher

More
11 months 4 weeks ago #337677 by CADdy
mqtt-publisher was created by CADdy
Hi all,
I experimented with the mqtt-publisher on a trial basis. It works well so far, but I can't publish more than 10 HAL pins. Even if there are more than 10 parameters under keys=, only the first 10 are transmitted. Does anyone know if I'm doing something wrong? I followed the mqtt-publisher instructions exactly.
Thanks for help
Peter
 

Please Log in to join the conversation.

More
11 months 4 weeks ago #337679 by unknown
Replied by unknown on topic mqtt-publisher
Did you notice the bit where each token is limited to 255 characters and to get sound this you can use multiple "keys" entries ?

It's hidden in under the examples heading.
If you have no further luck it may be of interest to raise an issue on the GitHub page.

Please Log in to join the conversation.

More
11 months 4 weeks ago #337681 by CADdy
Replied by CADdy on topic mqtt-publisher
When I create multiple “keys=” entries one below the other, LinuxCNC no longer starts:

Preparing LinuxCNC2MQTT info: Publishing MQTT message (devices/linuxcnc/machine): {"halui.axis.x.pos-relative": -84.95, "halui.axis.y.pos-relative": -92.95, "halui.axis.z.pos-relative": 24.496, "halui.joint.0.is-homed": false, "halui.joint.1.is-homed": false, "halui.joint.2.is-homed": false, "mqtt-publisher.period": 10} qtdragon_hd_postgui.hal:30: Unknown command 'keys=halui.estop.is-activated,halui.tool.number,halui.machine.is-on,halui.program.is-running,halui.mode.is-auto,halui.mode.is-manual,halui.mode.is-mdi,halui.mode.is-teleop' info: MQTT connected: Connection Accepted. Shutting down and cleaning up LinuxCNC... task: 526 cycles, min=0.000012, max=0.011844, avg=0.009461, 0 latency excursions (> 10x expected cycle time of 0.010000s) Note: Using POSIX realtime LinuxCNC terminated with an error.
 
My configuration:

loadusr -W mqtt-publisher \
--mqtt-broker=[MQTT]BROKER --mqtt-user=[MQTT]USERNAME \
--mqtt-password=[MQTT]PASSWORD \
keys=halui.axis.x.pos-relative,halui.axis.y.pos-relative,halui.axis.z.pos-relative,\
halui.joint.0.is-homed,halui.joint.1.is-homed,halui.joint.2.is-homed

keys=halui.estop.is-activated,\
halui.tool.number,\
halui.machine.is-on,\
halui.program.is-running,\
halui.mode.is-auto,halui.mode.is-manual,halui.mode.is-mdi,halui.mode.is-teleop

setp mqtt-publisher.period 1
setp mqtt-publisher.enable 1

Peter

Please Log in to join the conversation.

More
11 months 4 weeks ago #337688 by unknown
Replied by unknown on topic mqtt-publisher
Try this for the keys
Code:
keys=halui.axis.a.pos-feedback,halui.axis.b.pos-feedback,\ halui.axis.c.pos-feedback,halui.axis.u.pos-feedback,\ halui.axis.v.pos-feedback,halui.axis.w.pos-feedback,\ halui.axis.x.pos-feedback,halui.axis.y.pos-feedback,\ halui.axis.z.pos-feedback \ keys=halui.estop.is-activated, halui.joint.0.is-homed,\ halui.joint.1.is-homed,halui.joint.2.is-homed,halui.joint.3.is-homed,\ halui.joint.4.is-homed,halui.joint.5.is-homed,halui.joint.6.is-homed,\ halui.joint.7.is-homed,halui.joint.8.is-homed \ keys=halui.machine.is-on,halui.max-velocity.value,halui.mode.is-auto,\ halui.mode.is-manual,halui.mode.is-mdi,halui.mode.is-teleop,\ halui.program.is-running

I see what you mean, even when it starts with multiple key entries only the last group of keys get sent

Please Log in to join the conversation.

More
11 months 4 weeks ago #337721 by CADdy
Replied by CADdy on topic mqtt-publisher
With your settings, I only receive 7 values. 

Attachment not found



After removing the axes and joints that are not present on my milling machine, the result is the same - only 7 values are received. Sorry, I don't understand the principle of keys entries.

I have now shortened the list to 9 entries and am only using one key= statement. This allows me to transfer all 9 values.
loadusr -W mqtt-publisher \
--mqtt-broker=[MQTT]BROKER --mqtt-user=[MQTT]USERNAME \
--mqtt-password=[MQTT]PASSWORD \
keys=halui.axis.x.pos-relative,halui.axis.y.pos-relative,halui.axis.z.pos-relative,\
halui.joint.0.is-homed,halui.joint.1.is-homed,halui.joint.2.is-homed,\
halui.estop.is-activated,halui.machine.is-on,halui.program.is-running \

  

Attachment not found


Peter

Please Log in to join the conversation.

More
11 months 4 weeks ago #337722 by unknown
Replied by unknown on topic mqtt-publisher
Like I said it may be worth raising an issue on GitHub as the actual behaviour does not match the behaviour in the docs.

Please Log in to join the conversation.

More
11 months 4 weeks ago #337724 by CADdy
Replied by CADdy on topic mqtt-publisher
yes, you are right. I'll do it.

Please Log in to join the conversation.

Time to create page: 0.714 seconds
Powered by Kunena Forum