bambu-lab-observer icon indicating copy to clipboard operation
bambu-lab-observer copied to clipboard

No support for P1S

Open tonyvan222 opened this issue 1 year ago • 9 comments

I have successfully added X1C printers, but cannot get P1S added. I think the issue is P1S connects over port 1883.

tonyvan222 avatar Mar 12 '24 16:03 tonyvan222

Indeed, as i don't have a PS1 (only a X1C), i've never been able to validate that it's working with P1S. I don't know which port is used for P1S (nowadays with recent X1C firmware, it's supposed to be (automatically applied by this program) the "8883" (with TLS) port.

However if you want to test with another port, you should be able to do it just with :

{
    "BambuLabPrinters" : [ 
        {
          "IP" : "192.168.0.130:1883",
           ...

SR-G avatar Mar 12 '24 17:03 SR-G

Thanks for this. I am on firmware 01.05.02.00 on my P1S machines. It looks like it was a different issue as the connection was refused on port 1883. I reverted back to port 8883. I can confirm the following resulted in a connection:

{
    "BambuLabPrinters" : [ 
        {
          "IP" : "192.168.1.149",
          "Disabled" : false,
          "MQTTTLS" : true,
          "MQTTUsername" : "bblp",
          "MQTTPassword" : "XXXXXXXX",
          "Comment" : "P1S Middle"
        }
    ],
    "CSVFileName" : "bambu_lab_observer.csv",
    "LogLevel" : "INFO",
    "Topics" : [ "device/XXXXXXXXXXXXXXX/report" ],
    "PolicyAboutRegisterStartOfPrint" : "FIRST_MESSAGE_TIMESTAMP"
}

The issue seems to be related to the wildcard subscription under "Topics". Replacing "device/+/report" with "device/P1S Serial Number/report"

Is there a way to incorporate a printer specific field for "Topics" or perhaps a field for "Serial number", and some other code could handle the rest?

tonyvan222 avatar Mar 12 '24 17:03 tonyvan222

Mhh not sure if i'm understanding correctly, you think that device/+/report is not working for PS1, but device/<some name>/report is ? (i don't see the differernces between the two, from a pure MQTT point of view, hence why i'm a bit surprised).

However, what you can probably do is to declare multiple topics (it's just that they are not "linked" to the printers configuration, being just the various topics being read ... it's not optimal (the program will try to read each topic for each printer, but this should not be an issue at all - it's just that no messages are never going to be received for some of the topics).

Like :

    "Topics" : [ "device/+/report", "device/PS1_SERIAL_NUMBER1/report", "device/PS1_SERIAL_NUMBER2/report" ],

(or anything else)

SR-G avatar Mar 12 '24 18:03 SR-G

I can confirm that does not work. According to this post, the server doesn't like when you connect to certain topics. More about the connection configuration here.

I think for now I will run separate instances of the observer for each P1S machine I have.

tonyvan222 avatar Mar 12 '24 18:03 tonyvan222

Just in case, i have just uploaded a 1.0.3-SNAPSHOT version, allowing to have :

  • either the "Topics" definition at top level in the JSON configuration (as nowadays, acting as a global topic definition applied to all printers)
  • either the "Topics" definition (with same structure) only inside each printer definition
  • either a mix of the two (in which cases the topics are then all considered

Of course in your situation removing the previous top-level "Topics" and putting it everywhere at "Printer" level would make more sense.

Example :

{
    "BambuLabPrinters" : [ 
        {
          "IP" : "192.168.0.130",
          "MQTTTLS" : true,
          "MQTTUsername" : "bblp",
          "MQTTPassword" : "zzzzzzzzzzzzzzzzz",
          "Topics" : [ "device/ID1/report" ]
        }
    ],
    "CSVFileName" : "bambu-lab-observer.csv",
    "LogLevel" : "INFO"
 

However, not sure if it will help in the end : quickly reading the linked topics, it seems the P1P may send different "mc_print" percent progression (not working at this time in this project).

See distribution here : https://github.com/SR-G/bambu-lab-observer/releases/tag/1.0.3-SNAPSHOT

SR-G avatar Mar 12 '24 20:03 SR-G

Trying 1.0.3 now. It appears to be working so far. I have some rather large prints going on P1S and X1C, so I won't get data until tomorrow. Below is a snapshot of P1S CSV file from 1.0.2 code.

P1S CSV

tonyvan222 avatar Mar 12 '24 21:03 tonyvan222

This is data from 1.0.3 that I'm pulling into google sheets. It looks like both P1S and X1C are importing correctly.

X1C and P1S CSV

tonyvan222 avatar Mar 13 '24 14:03 tonyvan222

Good, then - thanks for having confirmed that it's (at least somehow) working also for P1S.

SR-G avatar Mar 13 '24 19:03 SR-G

@SR-G where do we get the passwords required?

uhlhosting avatar Apr 02 '24 00:04 uhlhosting