Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot work out how to get camera view on A1 #232

Open
TheCableGuy99 opened this issue Feb 17, 2025 · 16 comments
Open

Cannot work out how to get camera view on A1 #232

TheCableGuy99 opened this issue Feb 17, 2025 · 16 comments

Comments

@TheCableGuy99
Copy link

Hi,

I have the X1C's working and everything is fine including the camera but I cannot work out what I need to do different to get a new A1 printer live view working.

In bambu-web-env.txt everything is setup the same as the X1C's apart from the following line which specifies it's an "a1" instead:
bambu.printers.myprinter3.model=a1

I also noted that I couldn't see a "Lan Mode Live View" setting on the printer like the X1C so I'm hoping you can access the camera without having to disable cloud mode?

Please could I get some guidance?

Thanks.

@TheCableGuy99
Copy link
Author

I'm wondering if there's no way to get the A1 camera view to work can I get an RTSP stream to work for that printer from another camera?

@TFyre
Copy link
Owner

TFyre commented Feb 18, 2025

In bambu-web-env.txt everything is setup the same as the X1C's apart from the following line which specifies it's an "a1" instead:

If live-view is enabled, please disable/remove it, since its not available for the A1, only X1*'s

Refer to this section: /~https://github.com/TFyre/bambu-farm/tree/main?tab=readme-ov-file#live-view

It should NOT have the following line:

bambu.printers.myprinter3.stream.live-view=true

@TFyre
Copy link
Owner

TFyre commented Feb 18, 2025

I'm wondering if there's no way to get the A1 camera view to work can I get an RTSP stream to work for that printer from another camera?

Yes, this is possible, refer to the live-view section: /~https://github.com/TFyre/bambu-farm/tree/main?tab=readme-ov-file#live-view

You can configure the docker container to stream from any RTSP camera and allow you to serve it via MediaMTX

@TheCableGuy99
Copy link
Author

Hiya Buddy, I'm so glad you replied... I was beginning to think you might have given up on the project because a few issues on here have gone unanswered and I reached out on Discord but couldn't get hold of you. So pleased the project is still going :) :) :)

That's working now... thanks so much pal!

@TheCableGuy99
Copy link
Author

Hey,

Sorry to re-visit this. I got it working this morning with the built in cam but thought if I'll try to get it working with an RTSP stream.

I must not be understanding something as I changed this:
bambu.printers.myprinter3.stream.url=${bambu.live-view-url}${PRINTER_ID}

To:
bambu.printers.myprinter3.stream.url=rtsp://user:pass@ip:554/unicast

Sorry but what am I misunderstanding?

@TheCableGuy99
Copy link
Author

Forgot to mention, I'm getting this in the logs:

2025-02-18 18:54:21,003 ERROR [com.tfy.bam.pri.BambuPrinterStream] (executor-thread-22) Bambu 3: No image received since 2025-02-18T18:47:24.059799163Z

2025-02-18 18:54:41,026 ERROR [com.tfy.bam.pri.BambuPrinterStream] (vert.x-eventloop-thread-1) Bambu 3: clientFailure: javax.net.ssl.SSLHandshakeException - Failed to create SSL connection

@TheCableGuy99
Copy link
Author

Still struggling with this if anyone can help please.

@TFyre
Copy link
Owner

TFyre commented Feb 19, 2025

Using your own camera stream is fairly involved. Browsers generally cannot display rtsp directly from a camera. You need the appropriate settings to transcode it from rtsp to something that the browser can handle.

You need something like this:
/~https://github.com/TFyre/bambu-farm/blob/main/docker/bambu-liveview/example%20-%20compose.yml#L40-L49

Which also includes something like this:
/~https://github.com/TFyre/bambu-farm/blob/main/docker/bambu-liveview/common-liveview.yml

In a nutshell, it needs to have a docker container that uses ffmpeg to read the rtsp from the camera, transcode it and publishes it to mediamtx. Once this is done, the browser can easily stream the camera

@TheCableGuy99
Copy link
Author

TheCableGuy99 commented Feb 19, 2025

Hey, So please excuse my lack of understanding as I'm no coder by any stretch of the imagination...

My compose.yml already appears correct and matches the example:

printer3:
        extends:
            file: common-liveview.yml
            service: liveview
        depends_on:
            - mediamtx
        environment:
            PRINTER_HOST: 192.168.xxx.xxx
            PRINTER_ID: myprinter3
            PRINTER_ACCESS_CODE: xxxxxxxx

So I'm presuming I just need to edit common-liveview.yml? If so, what do I need, it currently reads:

version: '3'

services:
    liveview:
        image: linuxserver/ffmpeg
        restart: always
        environment:
            PRINTER_HOST: DONT_TOUCH
            PRINTER_USER: bblp
            PRINTER_ID: DONT_TOUCH
            PRINTER_ACCESS_CODE: DONT_TOUCH
            PRINTER_PORT: 322
            PRINTER_URL: /streaming/live/1
            RTSP_SERVER: mediamtx:8554
        entrypoint:
            - "bash"
            - "-c"
            - >
              /usr/local/bin/ffmpeg
              -timeout 30000000
              -re -stream_loop -1
              -i rtsps://$${PRINTER_USER}:$${PRINTER_ACCESS_CODE}@$${PRINTER_HOST}:$${PRINTER_PORT}$${PRINTER_URL}
              -c:v copy -f rtsp -rtsp_transport tcp
              rtsp://$${RTSP_SERVER}/$${PRINTER_ID}

Lastly this is my bambu-web-env.txt, is this correct?

bambu.printers.myprinter3.name=Bambu 3
bambu.printers.myprinter3.device-id=xxxxxxxxx
bambu.printers.myprinter3.access-code=xxxxxxxxx
bambu.printers.myprinter3.ip=192.168.xxx.xxx
bambu.printers.myprinter3.model=a1
bambu.printers.myprinter3.stream.live-view=true
bambu.printers.myprinter3.stream.url=rtsp://user:pass@192.168.xxx.xxx:554/unicast

Sorry to be a pain, it's just a getting everything correct in all the files can be difficult and any one 1 thing stops it working so I need to be sure each file is correct.

Thanks for your help as always :)

@TheCableGuy99
Copy link
Author

Still struggling with this after 5 days i've no hair left now... would really appreciate a little help to finish off the config if someone could help please as my scalp is next!

@TFyre
Copy link
Owner

TFyre commented Feb 22, 2025

Do not edit/change common-liveview.yml, because that will break all your printers

compose.yml should have something like this for printer3:

    printer3:
        extends:
            file: common-liveview.yml
            service: liveview
        depends_on:
            - mediamtx
        environment:
            PRINTER_HOST: FIXME_this_is_the_webcam_ip
            PRINTER_ID: FIXME_this_is_my_printer_id
            PRINTER_USER: FIXME_this_is_the_webcam_username
            PRINTER_ACCESS_CODE: FIXME_this_is_the_webcam_password
            PRINTER_PORT: 554
            PRINTER_URL: /unicast

bambu-web-env.txt remove the stream.url:

#bambu.printers.myprinter3.stream.url=rtsp://user:pass@192.168.xxx.xxx:554/unicast

@TheCableGuy99
Copy link
Author

Thanks but where do I specify the streams username?

@TheCableGuy99
Copy link
Author

sorry ignore that, i missed it, i'm trying now

@TheCableGuy99
Copy link
Author

I'm sorry but i'm still not getting this working. It's saying in the stream window "Error: stream not found, retrying in some seconds", it's also got the name of the printer in a red box at the top. I'm presuming it's not able to connect to the printer either because we removed the access code replacing it with the webcam password.

I've included a screenshot and uploaded my configs in case you can see what i'm doing wrong please?

Thanks for your help with this.

Image

bambu-web-env.txt

compose.yml.txt

common-liveview.yml.txt

@TFyre
Copy link
Owner

TFyre commented Feb 22, 2025

The ip for printer3 in compose.yml should be the webcam ip and not the printers ip

@TheCableGuy99
Copy link
Author

I'm sorry but it's the same error. Do you think you could spend 5 minutes on Discord with me to get to the bottom of this please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants