The following is a typical debug flow. The printer message was Accepted for Device 2372 with new text of "Opening serial port"
HSEvent of type VALUE_CHANGE was given. This shows that HS Device was updated.
The third line shows that message received at the time it was being evaluated as an event trigger.
When I look into mcsMQTT.db for Device 2372 I find the StatusType = 4 which means that mcsMQTT thinks this is a List type. What you should see in VSP tab of the HS Device Management page is the mapping of the eight states to the Values 0 through 7. Please confirm.
What this means is that when the above message was received with text of "Opening serial port", mcsMQTT will store a Value of 0 in Device 2372. When HS displays the status of this device on the Device Management page and elsewhere it will do the lookup of the VSP to find a Value of 0 means it should display "Opening serial port". mcsMQTT does not find graphics for these states, but if you do have graphics for them then they can be added to the VGP definitions that are just below the VSP definitions.
You can further look at the Advanced tab of the Device Management page for this device. It will show the actual Device Value and Device String that are stored in the Device. These should be what mcsMQTT stores.
I recognize that your printer state may not be in the "Opening" state now, but whatever state it is in should follow the description above. What do you actually see in Device Management for Device 2372?
When I look at the "filename" I see that it is mapped to Device 2382 and is of status type Text from mcsMQTT.db. This is consistent with your screen shot. From the debug I find the message with text "Knob_PLA.gcode" to have been recognized. What I do not see is the HSEvent callback.
The code segment that follows the "Update Accepted" message in the debug is below. Previously it had determined that 2382 is a mcsMQTT device and obtained nHSValue as the current DeviceValue for this device. It will always set DeviceValue, but perhaps the callback does not occur when the DeviceValue does not occur such is the case here. The DeviceString is only updated if it changes.
Where are you looking when you expect to see "Knob_PLA.gcode" and "Opening serial port"?
HSEvent of type VALUE_CHANGE was given. This shows that HS Device was updated.
The third line shows that message received at the time it was being evaluated as an event trigger.
Code:
4/11/2018 6:19:11 AM 41828959 | Update Accepted 2372 to Opening serial port 4/11/2018 6:19:11 AM 41828967 | HSEvent Do= False VALUE_CHANGE for Device 2372 4/11/2018 6:19:12 AM 41829373 | ActoOnMessageFor Trigger Topic mpsmoctoprint/event/PrinterStateChanged,Payload={"_timestamp": 1523441951, "state_string": "Opening serial port", "_event": "PrinterStateChanged", "state_id": "OPEN_SERIAL"}
What this means is that when the above message was received with text of "Opening serial port", mcsMQTT will store a Value of 0 in Device 2372. When HS displays the status of this device on the Device Management page and elsewhere it will do the lookup of the VSP to find a Value of 0 means it should display "Opening serial port". mcsMQTT does not find graphics for these states, but if you do have graphics for them then they can be added to the VGP definitions that are just below the VSP definitions.
You can further look at the Advanced tab of the Device Management page for this device. It will show the actual Device Value and Device String that are stored in the Device. These should be what mcsMQTT stores.
I recognize that your printer state may not be in the "Opening" state now, but whatever state it is in should follow the description above. What do you actually see in Device Management for Device 2372?
When I look at the "filename" I see that it is mapped to Device 2382 and is of status type Text from mcsMQTT.db. This is consistent with your screen shot. From the debug I find the message with text "Knob_PLA.gcode" to have been recognized. What I do not see is the HSEvent callback.
Code:
4/11/2018 6:19:22 AM 41840086 | Update Accepted 2382 to Knob_PLA.gcode 4/11/2018 6:19:23 AM 41840292 | ActoOnMessageFor Trigger Topic mpsmoctoprint/event/PrintStarted,Payload={"origin": "local", "_timestamp": 1523441960, "_event": "PrintStarted", "name": "Knob_PLA.gcode", "file": "/home/pi/.octoprint/uploads/Knob_PLA.gcode", "path": "Knob_PLA.gcode", "filename": "Knob_PLA.gcode", "size": 9063176}
Code:
ElseIf iVGP = StatusTypes.Text Then Dim sString As String = hs.DeviceString(iRef) bValueChange = sString <> sValueIn If bValueChange Then hs.SetDeviceString(iRef, sValueIn, False) End If hs.SetDeviceValueByRef(iRef, nHSValue, True) 'so devicevalue trigger can be used
Comment