Failed to initialize MQTT: [Errno 101] Network is unreachable
#4
by
sgbaird
- opened
===== Application Startup at 2025-03-01 01:37:22 =====
2025-03-01 02:37:31,867 - bambu-analysis - INFO - MQTT Configuration: HOST=mqtt.bambulab.com, PORT=8883, USERNAME=bblp
2025-03-01 02:37:32,026 - bambu-analysis - INFO - Starting Bambu A1 Mini Print Control application
2025-03-01 02:37:32,026 - bambu-analysis - INFO - Initializing MQTT client
/home/user/app/app.py:57: DeprecationWarning: Callback API version 1 is deprecated, update to latest version
bambu_client = mqtt.Client()
2025-03-01 02:37:32,163 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
2025-03-01 02:37:42,066 - bambu-analysis - ERROR - Failed to initialize MQTT: [Errno 101] Network is unreachable
* Running on local URL: http://0.0.0.0:7860, with SSR โก (experimental, to disable set `ssr=False` in `launch()`)
2025-03-01 02:37:42,857 - httpx - INFO - HTTP Request: GET http://localhost:7860/gradio_api/startup-events "HTTP/1.1 200 OK"
2025-03-01 02:37:43,304 - httpx - INFO - HTTP Request: HEAD http://0.0.0.0:7861/ "HTTP/1.1 200 OK"
2025-03-01 02:37:43,307 - httpx - INFO - HTTP Request: HEAD http://localhost:7860/ "HTTP/1.1 200 OK"
To create a public link, set `share=True` in `launch()`.
2025-03-01 02:37:44,407 - httpx - INFO - HTTP Request: GET http://0.0.0.0:7861/?logs=container&__theme=system "HTTP/1.1 200 OK"
2025-03-01 02:37:44,526 - httpx - INFO - HTTP Request: GET http://0.0.0.0:7861/?logs=container&__theme=system "HTTP/1.1 200 OK"
2025-03-01 02:37:45,523 - matplotlib.font_manager - INFO - generated new fontManager
2025-03-01 02:37:45,859 - bambu-analysis - INFO - API call: capture_frame with URL: , use_test_image: False
2025-03-01 02:37:45,859 - bambu-analysis - INFO - API call: get_data
/home/user/app/app.py:65: DeprecationWarning: Callback API version 1 is deprecated, update to latest version
rpi_client = mqtt.Client()
2025-03-01 02:37:45,859 - bambu-analysis - INFO - API call: lambda with params: 200, 60, 60, 100, use_test_image: False, test_image_name:
2025-03-01 02:37:45,860 - bambu-analysis - INFO - API call: send_print_parameters with nozzle=200, bed=60, speed=60, fan=100
2025-03-01 02:37:45,860 - bambu-analysis - INFO - Subscribing to bambu_a1_mini/response/default_serial
2025-03-01 02:37:45,861 - bambu-analysis - INFO - No valid image data received, using default test image
2025-03-01 02:37:45,861 - bambu-analysis - INFO - Sending parameters to default_serial: nozzle=200, bed=60, speed=60, fan=100
2025-03-01 02:37:45,861 - bambu-analysis - INFO - Publishing request to bambu_a1_mini/request/default_serial
2025-03-01 02:37:45,862 - bambu-analysis - INFO - Parameters sent successfully
2025-03-01 02:37:45,864 - bambu-analysis - INFO - Using test image: /home/user/app/test_images/test4.png
2025-03-01 02:37:55,906 - bambu-analysis - ERROR - Error in capture_frame: [Errno 101] Network is unreachable
The RPI MQTT client was accidentally using the Bambu credentials.
fixed here: https://huggingface.co/spaces/AccelerationConsortium/Bambu_A1mini/discussions/5
The camera appears to be failing right now. I'll check this on Monday.
2025-03-02 19:59:24,820 - bambu-analysis - INFO - Using test image: /home/user/app/test_images/test1.png
2025-03-02 20:00:07,580 - bambu-analysis - INFO - Connected with result code 5
2025-03-02 20:00:09,914 - bambu-analysis - ERROR - Error in capture_frame: url is 'N/A'```
Thank you! Any update on this one?
2025-03-04 00:53:40,373 - bambu-analysis - INFO - API call: capture_frame with URL: , use_test_image: False
2025-03-04 00:53:40,373 - bambu-analysis - INFO - No valid image data received, using default test image
2025-03-04 00:53:40,373 - bambu-analysis - INFO - Subscribing to bambu_a1_mini/response/0309CA471800852
2025-03-04 00:53:40,373 - bambu-analysis - INFO - Sending parameters to 0309CA471800852: nozzle=200, bed=60, speed=60, fan=100
2025-03-04 00:53:40,373 - bambu-analysis - INFO - Subscribing to bambu_a1_mini/response/0309CA471800852
2025-03-04 00:53:40,373 - bambu-analysis - INFO - Publishing request to bambu_a1_mini/request/0309CA471800852
2025-03-04 00:53:40,374 - bambu-analysis - INFO - Parameters sent successfully
2025-03-04 00:53:40,374 - bambu-analysis - INFO - Using test image: /home/user/app/test_images/test7.png
2025-03-04 00:54:04,554 - bambu-analysis - INFO - Subscribing to bambu_a1_mini/response/0309CA471800852
2025-03-04 00:54:04,554 - bambu-analysis - INFO - Publishing request to bambu_a1_mini/request/0309CA471800852
2025-03-04 00:54:16,790 - bambu-analysis - INFO - Subscribing to bambu_a1_mini/response/0309CA471800852
2025-03-04 00:54:19,703 - bambu-analysis - INFO - Connected with result code 5
2025-03-04 00:54:25,414 - bambu-analysis - ERROR - Error in capture_frame: url is 'N/A'
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/gradio/queueing.py", line 625, in process_events
response = await route_utils.call_process_api(
File "/usr/local/lib/python3.10/site-packages/gradio/route_utils.py", line 322, in call_process_api
output = await app.get_blocks().process_api(
File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 2096, in process_api
result = await self.call_function(
File "/usr/local/lib/python3.10/site-packages/gradio/blocks.py", line 1643, in call_function
prediction = await anyio.to_thread.run_sync( # type: ignore
File "/usr/local/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2461, in run_sync_in_worker_thread
return await future
File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 962, in run
result = context.run(func, *args)
File "/usr/local/lib/python3.10/site-packages/gradio/utils.py", line 890, in wrapper
response = f(*args, **kwargs)
File "/home/user/app/app.py", line 266, in capture_image
raise Exception("url is 'N/A'")
Exception: url is 'N/A'
Sorry I didn't get a chance to go to the lab today. Tomorrow morning for sure though!
It works now. I just updated the secrets so I must've made a typo the first time around.
I made a PR to update the logging as it helped me debug this issue: https://huggingface.co/spaces/AccelerationConsortium/bambu-a1-mini/discussions/9