Git Product home page Git Product logo

bambusource2raw's Introduction

USE AT YOUR OWN RISK!

How to use

Prepare

  1. Download release archive of this project or just compile your own.

Linux

  1. apt-get install -y libcurl4

  2. Download https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz

    Extract ffmpeg to release dir

  3. Download https://github.com/aler9/rtsp-simple-server/releases/download/v0.20.0/rtsp-simple-server_v0.20.0_linux_amd64.tar.gz

    Extract rtsp-simple-server and rtsp-simple-server.yml to release dir

  4. Download https://public-cdn.bambulab.cn/upgrade/studio/plugins/01.04.00.15/linux_01.04.00.15.zip

    Extract libBambuSource.so to release dir

  5. Get dev id and access code of the machine

    ./bambusource2raw list_dev -u <account_name> -p <password> -r <region: us cn>

  6. Generate BambuNetworkEngine.conf

    ./bambusource2raw gen_cfg -u <account_name> -p <password> -r <region: us cn> -d <dev_id>

  7. Start

    For X1/X1C

    Start in host shell:

    cd release-dir
    cp BambuNetworkEngine.conf .
    ./start_rtsp_feed.sh
    

    Start in docker:

    mkdir bambu_cfg
    cp -f BambuNetworkEngine.conf bambu_cfg
         
    cd release-dir
    docker build -t bblrtsp:v1 .
    docker run --name BambuRTSP-1 -p 8554:8554 -v <FULL_PATH_OF_bambu_cfg_DIR>:/bambu-bin/cfg -d bblrtsp:v1
    

    For P1P

    Start in host shell:

    Modify P1PIP and P1PACCESSCODE in start_rtsp_feed_p1p.sh to the exact value

    cd release-dir
    cp BambuNetworkEngine.conf .
    ./start_rtsp_feed_p1p.sh
    

    Start in docker:

    Modify P1PIP and P1PACCESSCODE in start_rtsp_feed_docker_p1p.sh to the exact value

    Modify the entry of Dockerfile to /bambu-bin/start_rtsp_feed_docker_p1p.sh

    mkdir bambu_cfg
    cp -f BambuNetworkEngine.conf bambu_cfg
         
    cd release-dir
    docker build -t bblrtsp:v1 .
    docker run --name BambuRTSP-1 -p 8554:8554 -v <FULL_PATH_OF_bambu_cfg_DIR>:/bambu-bin/cfg -d bblrtsp:v1
    

Windows

  1. Download https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z

    Extract bin\ffmpeg.exe to release dir

  2. Download https://github.com/aler9/rtsp-simple-server/releases/download/v0.20.0/rtsp-simple-server_v0.20.0_windows_amd64.zip

    Extract rtsp-simple-server.exe and rtsp-simple-server.yml to release dir

  3. Download https://public-cdn.bambulab.cn/upgrade/studio/plugins/01.04.00.16/win_01.04.00.16.zip

    Extract BambuSource.dll to release dir

  4. Get dev id and access code of the machine

    bambusource2raw.exe list_dev -u <account_name> -p <password> -r <region: us cn>

  5. Generate BambuNetworkEngine.conf

    bambusource2raw.exe gen_cfg -u <account_name> -p <password> -r <region: us cn> -d <dev_id>

  6. Put BambuNetworkEngine.conf in the same folder with bambusource2raw.exe

  7. Start

    For X1/X1C

    start start_rtsp_feed.bat

    For P1P

    Modify P1PIP and P1PACCESSCODE in start_rtsp_feed_p1p.bat to the exact value

    start start_rtsp_feed_p1p.bat

View live stream

Use VLC or something else to view the live stream: rtsp://127.0.0.1:8554/bbl or rtsp://[ip of pc]:8554/bbl

How to compile

Linux

apt-get install -y unzip libcurl4 libcurl4-openssl-dev 
cd BambuSource2Raw
make -f Makefile.linux

Windows

  1. Download and Install Windows Driver Kit Version 7.1.0 from https://www.microsoft.com/en-us/download/details.aspx?id=11800

    Open 'x64 Free Build Environment'

    cd /d [Project Root Dir]
    build
    
  2. Download https://www.gyan.dev/ffmpeg/builds/ffmpeg-git-full.7z

    Extract bin\ffmpeg.exe to win-build/amd64 dir

  3. Download https://github.com/aler9/rtsp-simple-server/releases/download/v0.20.0/rtsp-simple-server_v0.20.0_windows_amd64.zip

    Extract rtsp-simple-server.exe and rtsp-simple-server.yml to win-build/amd64 dir

  4. Download https://public-cdn.bambulab.cn/upgrade/studio/plugins/01.04.00.16/win_01.04.00.16.zip

    Extract BambuSource.dll to win-build/amd64 dir

  5. Copy start_rtsp_feed.bat to win-build/amd64 dir

Remark

If bambusource2raw fails when starting stream, try to generate a new BambuNetworkEngine.conf.

bambusource2raw's People

Contributors

hisptoot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bambusource2raw's Issues

New version of bambulabs supports camera in lan mode

is there a plan to update the code that would support the new mode?

https://github.com/bambulab/BambuStudio/releases/tag/v01.07.00.53

Liveview in LAN only mode (X1) https://github.com/bambulab/BambuStudio/issues/1372 We have received multiple requests from our customers in regard to having liveview available in LAN only mode. The latest firmware for X1 series combined with the latest version of Bambu Studio introduces support for accessing the video from the printer locally, without requiring an internet connection. Please note that when the printer is set in LAN only mode, you will not have access to the liveview stream from Bambu Handy. Please update the printer firmware to V01.06 as well.

Not sure how to get started

This is exactly the project i've been looking for but i'm struggling to get setup.

In portainer I try to build the image using the dockerfile but get this message. Any ideas?

Step 5/13 : WORKDIR /bambu-bin



 ---> Using cache

 ---> c83892d060a7

Step 6/13 : COPY bambusource2raw /bambu-bin/bambusource2raw



COPY failed: file not found in build context or excluded by .dockerignore: stat bambusource2raw: file does not exist

Error trying to get device id.

Get dev id and access code of the machine
./bambusource2raw list_dev -u <account_name> -p -r <region: us cn>

I'm using my email address - maybe it needs something else?

Output is:

by hisptoot 2022.12.26
user_name: REDACTED
passwd specified by user
region: us
getting token by login
getting user_id by token
curl_easy_perform() failed: Failed writing received data to disk/application
failed get_user_id
{"tfaKey":""}

Errors when trying to connect to a P1P

I have everything working properly with 2 X1Cs and now I'm trying to get this working on my P1P with firmware version 01.02.02.00. I'm following all directions from the README but unfortunately bambusource2raw is returning errors when trying to connect to the printer.

wait for 5 seconds
starting bambusource2raw
ffmpeg version 5.1.1-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
by hisptoot 2022.12.26
p1p ip: <x.x.x.x>
access code specified by user
getting user info by BambuNetworkEngine.conf
region: eu user_id: <xxxxxxxxxx> dev_id: <xxxxxxxxxxxxxx>
Starting Session
[1] [BambuTunnelLocal::open] host=<x.x.x.x> port=6000
[1] [BambuTunnelTutk::read]  [-104]
[1] [BambuTunnel::read_sample] error [-104]
[1] [BambuTunnel::read_sample] error [1]
[1] [BambuTunnel::read_sample] error [1]
[1] [BambuTunnel::read_sample] error [1]
[1] [BambuTunnel::read_sample] error [1]
[1] [BambuTunnel::read_sample] error [1]

I have no idea what to do with this error. I just unpacked this P1P and updated the firmware to the latest version, so I can't tell whether this does work with an earlier firmware.

Does not recover after power off and on of the P1P

Thanks for this project! I was able to get it running on Gentoo Linux.

Could you maybe enhance it so that it recovers automatically after the P1P was powered down for a while and was started again?

At the moment, I have to do it manually by pressing CTRL-C and starting it again.

munmap_chunk(): invalid pointer

Trying to generate the cfg and I get this error, any idea?

root@5151c851e8b2:/bambu-bin# ./bambusource2raw gen_cfg -u [email protected] -p xxxxx-r eu -d xxxxx
by hisptoot 2022.12.26
user_name: xxxxx
passwd specified by user
region: eu
dev_id: xxxxx
getting token by login
getting user_id by token
user_id: xxxxx
region: eu user_id: xxxxx dev_id: xxxxx
munmap_chunk(): invalid pointer
Aborted (core dumped)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.