Monitoring serial data


#1

This is probably a silly question. I did a forum search and documentation search but could not find an answer.

I'm trying to build a plugin that monitors the reply text from the printer and updates an input field in the GUI with the current value. To do this I successfully set up a listener using the octoprint.comm.protocol.gcode.received hook. This seems to be working correctly.

The next step (as I understand it) is to pass this data up to the GUI. My understanding is that the self._plugin_manager.send_plugin_message() routine can be used to accomplish that. This also requires having a listener routine defined in the plugin to receive the message. This involves adding the following routine to the view model code:

    self.onDataUpdaterPluginMessage = function (plugin, zoffset_data) {
          console.log('MSL: got it!');
          return;
    }

I get the concept of how this works but for some reason the onDataUpdaterPluginMessage() routine never gets called even after I send the message. I'm guessing that I'm missing a step somehow. Any ideas what it could be?

Thanks in advance.

-larry