So my goal is to create panel plugin that is just a simple button that on click sand MQTT massage to broker. Because I am total beginner I started by modifying grafana-clock-panel. I made changes in /dist/module.html (i changed clock display to button and added some java script code.) Code that I added was same as here: http://www.hivemq.com/blog/build-javascript-mqtt-web-application.
Problem that I have is how to us library for MQTT (in this case mqttws31.js). If I am doing this wrong pleas correct me.
You will have to include the mqttws31.js file in the src directory. Create a sub directory called libs (or something similar) copy the js file in there and then import it like this in your controller:
i try to send mqtt data from Grafana to Node-Red.
Unfortunally it doesn´t work.
In my case this Test Button is not active.
I try different IP, Ports etc.
I would be very happy about your help!
Do you definitely have a WebSockets server running on port 1883? That looks like the standard (default) MQTT port. Your browser can only communicate with the MQTT broker over the WebSockets protocol, so you’ll need to make sure you enable that on the broker (usually on a different port).