Activity

kkazimir

Sooooo this is a pretttyy nice update, the hole backend/api is basicaly done.
So my python code connections now to the printer over lan AND cloud to get all the important data, stuff like print history, current status etc. and because some things are only accessable on the mqtt lan server(that runs on the printer) and some data you can only get from the cloud I had to use both.

In the Pictures you can see the overview of all api endpoints I have made and that are all working correctly

But yeah this is done now, all the important data is now abstracted and easy accessable for my frontend, other data like prints get written in the db to save that for stats and stuff like that for the frontend.
The next step is now the frontend, I need to make the hole interface and display all the data in a nice way (I hate ui and frontend design) so yeah this is gonna be a pain

Just a quick roadmap what I wanna do in the future, I am planning on doing a esp32 intigration so you can select which filament is currently connected, the code will remember the spool and automaticaly know which spool this is the next time you load it. With this you then have a fully automatic filament tracking system. Multi printer support is also on the roadmap, this shouldnt take too long to implement its just not my focus yet because I need to make the system work for 1 printer

Attachment
Attachment
Attachment
Attachment
Attachment
Attachment
0
kkazimir

Extended the mqtt client to now expose all mqtt data to the intern api
Extended the cloud client to now get and expose all important data to the intern api
bugfix in db_helper.py
made a filaments endpoint to now get and create filaments in the database
added database models for filaments and changed/finished the print job and spools models(spools is now directly connecting with the filaments)
Tried to bugfix wrong page in frontend but didnt fix it(should be a fast fix, didnt take time for it, I do it later)
moved methodes out of printer_service.py and back into there own files (bambu_cloud.py and bambu_client.py)
added api endpoints for the printers, so now you can get all the available data for printers (cloud and mqtt status, print jobs, projects and a lot more)
fixed optimization bug in settings endpoint
added masive spools api endpoint for getting all the spools data from the db and creating and modifying spools.

Attachment
Attachment
Attachment
Attachment
Attachment
Attachment
0
kkazimir

Rewrote authentication system to use Exceptions for better functionality.
Added the Exceptions system to the bambu_cloud system to now use the exceptions for better communication with the authentication system.
Added cloudscraper as a fallback for the cloud api if request doesnt work somehow.
Updated frontend that it accounts for the possibility that the access code is expired.
Updated the methodes in printer_service.py for saving stuff to the database so they account for the possibility that the key already exists in the db.
Updated methodes in api endpoints for saving stuff to the database so they account for the possibility that the key already exists in the db.
updated requirements.txt to now include the cloudscraper package.
added a bambu_exceptions.py file with a few custom exception classes

Attachment
0
kkazimir

Continued learning Docker and Fastapi trough the docker and fastapi docs.
Played around with fastapi functions and systems.
Completely rewrote bambu mqtt client for connecting localy to the printer, now heavily inspired by “ha bambulab”.
Made the endpoints for the mqtt clients working, now you can see all the data from the printers mqtt client on the api endpoint
finished authentication endpoint, and fixed firewall rules to secure critical settings that were open in the api endpoint earlier.
finished bambu cloud client.
made a db helper to make working with the db easier.
bugfixes.

Attachment
Attachment
0
kkazimir

Worked on the fastapi backend, added endpoints for: authenticating (more later), get basic printer info, settings, and spools.
Made the python code for the database intigration and made api endpoints to write and read from the database.
made a basic next.js frontend for logging in with you bambu lab cloud account.
made the implementation of the bambu lab cloud api, you can now log in on the site, get the verification code and put that in and the code will get a token to use the bambu lab cloud apid over your account, this enables features like getting printers, and print history

Attachment
Attachment
Attachment
Attachment
0
kkazimir

I made the basic project structure, and prepared everything for the python backend, next.js frontend and the postgress db. Then I made a few tests with different bambu lab apis to connect with my printer and get printer information. Last thing I did is I learned the basics of docker and setup a Docker image for the project so everything runs cleanly on my pc and this makes a lot easier later.

Screenshots of working api and website container

Attachment
Attachment
Attachment
0