bambu-farm icon indicating copy to clipboard operation
bambu-farm copied to clipboard

MQTT: Not authorized to connect

Open ualinker opened this issue 1 year ago • 1 comments

I have minimal cfg in .env file with correct IP, SN and access code. Unfortunately, this is what I got while I'm trying to start the server:

 $ java -Djdk.tls.useExtendedMasterSecret=false -jar bambu-web-1.2.1-runner.jar
__  ____  __  _____   ___  __ ____  ______
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2024-08-02 23:19:40,894 INFO  [io.und.servlet] (main) Initializing AtmosphereFramework
2024-08-02 23:19:40,902 INFO  [com.vaa.flo.ser.sta.ServletDeployer] (main) Skipping automatic servlet registration because there is already a Vaadin servlet with the name com.vaadin.quarkus.QuarkusVaadinServlet
2024-08-02 23:19:40,910 INFO  [org.atm.cpr.AtmosphereFramework] (main) Installed AtmosphereHandler com.vaadin.flow.server.communication.PushAtmosphereHandler mapped to context-path: /*
2024-08-02 23:19:40,910 INFO  [org.atm.cpr.AtmosphereFramework] (main) Installed the following AtmosphereInterceptor mapped to AtmosphereHandler com.vaadin.flow.server.communication.PushAtmosphereHandler
2024-08-02 23:19:40,926 INFO  [org.atm.cpr.AtmosphereFramework] (main) Atmosphere is using org.atmosphere.util.VoidAnnotationProcessor for processing annotation
2024-08-02 23:19:40,929 INFO  [org.atm.uti.ForkJoinPool] (main) Using ForkJoinPool  java.util.concurrent.ForkJoinPool. Set the org.atmosphere.cpr.broadcaster.maxAsyncWriteThreads to -1 to fully use its power.
2024-08-02 23:19:40,933 INFO  [org.atm.cpr.AtmosphereFramework] (main) Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol
2024-08-02 23:19:40,934 INFO  [org.atm.con.JSR356AsyncSupport] (main) JSR 356 Mapping path /VAADIN/push
2024-08-02 23:19:40,936 INFO  [io.und.websockets] (main) UT026005: Adding programmatic server endpoint class org.atmosphere.container.JSR356Endpoint for path /VAADIN/push
2024-08-02 23:19:40,937 INFO  [io.und.websockets] (main) UT026005: Adding programmatic server endpoint class org.atmosphere.container.JSR356Endpoint for path /VAADIN/push/
2024-08-02 23:19:40,937 INFO  [org.atm.cpr.AtmosphereFramework] (main) Installing Default AtmosphereInterceptors
2024-08-02 23:19:40,937 INFO  [org.atm.cpr.AtmosphereFramework] (main) 	org.atmosphere.interceptor.CorsInterceptor : CORS Interceptor Support
2024-08-02 23:19:40,937 INFO  [org.atm.cpr.AtmosphereFramework] (main) 	org.atmosphere.interceptor.CacheHeadersInterceptor : Default Response's Headers Interceptor
2024-08-02 23:19:40,937 INFO  [org.atm.cpr.AtmosphereFramework] (main) 	org.atmosphere.interceptor.PaddingAtmosphereInterceptor : Browser Padding Interceptor Support
2024-08-02 23:19:40,937 INFO  [org.atm.cpr.AtmosphereFramework] (main) 	org.atmosphere.interceptor.AndroidAtmosphereInterceptor : Android Interceptor Support
2024-08-02 23:19:40,938 INFO  [org.atm.cpr.AtmosphereFramework] (main) 	org.atmosphere.interceptor.HeartbeatInterceptor : Heartbeat Interceptor Support
2024-08-02 23:19:40,938 INFO  [org.atm.cpr.AtmosphereFramework] (main) 	org.atmosphere.interceptor.SSEAtmosphereInterceptor : SSE Interceptor Support
2024-08-02 23:19:40,938 INFO  [org.atm.cpr.AtmosphereFramework] (main) 	org.atmosphere.interceptor.JSONPAtmosphereInterceptor : JSONP Interceptor Support
2024-08-02 23:19:40,938 INFO  [org.atm.cpr.AtmosphereFramework] (main) 	org.atmosphere.interceptor.JavaScriptProtocol : Atmosphere JavaScript Protocol
2024-08-02 23:19:40,938 INFO  [org.atm.cpr.AtmosphereFramework] (main) 	org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor : org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor
2024-08-02 23:19:40,938 INFO  [org.atm.cpr.AtmosphereFramework] (main) 	org.atmosphere.interceptor.OnDisconnectInterceptor : Browser disconnection detection
2024-08-02 23:19:40,938 INFO  [org.atm.cpr.AtmosphereFramework] (main) 	org.atmosphere.interceptor.IdleResourceInterceptor : org.atmosphere.interceptor.IdleResourceInterceptor
2024-08-02 23:19:40,938 INFO  [org.atm.cpr.AtmosphereFramework] (main) Set org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults to disable them.
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Installed AtmosphereInterceptor CORS Interceptor Support with priority FIRST_BEFORE_DEFAULT
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Installed AtmosphereInterceptor Default Response's Headers Interceptor with priority AFTER_DEFAULT
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Installed AtmosphereInterceptor Browser Padding Interceptor Support with priority AFTER_DEFAULT
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Installed AtmosphereInterceptor Android Interceptor Support with priority AFTER_DEFAULT
2024-08-02 23:19:40,939 INFO  [org.atm.int.HeartbeatInterceptor] (main) HeartbeatInterceptor configured with padding value 'X', client frequency 0 seconds and server frequency 60 seconds
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Installed AtmosphereInterceptor Heartbeat Interceptor Support with priority AFTER_DEFAULT
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Installed AtmosphereInterceptor SSE Interceptor Support with priority AFTER_DEFAULT
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Installed AtmosphereInterceptor JSONP Interceptor Support with priority AFTER_DEFAULT
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Installed AtmosphereInterceptor Atmosphere JavaScript Protocol with priority AFTER_DEFAULT
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Installed AtmosphereInterceptor org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor with priority AFTER_DEFAULT
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Installed AtmosphereInterceptor Browser disconnection detection with priority AFTER_DEFAULT
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Installed AtmosphereInterceptor org.atmosphere.interceptor.IdleResourceInterceptor with priority BEFORE_DEFAULT
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Using EndpointMapper class org.atmosphere.util.DefaultEndpointMapper
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Using BroadcasterCache: org.atmosphere.cache.UUIDBroadcasterCache
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Default Broadcaster Class: org.atmosphere.cpr.DefaultBroadcaster
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Broadcaster Shared List Resources: false
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Broadcaster Polling Wait Time 100
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Shared ExecutorService supported: true
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Messaging ExecutorService Pool Size unavailable - Not instance of ThreadPoolExecutor
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Async I/O Thread Pool Size: 200
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Using BroadcasterFactory: org.atmosphere.cpr.DefaultBroadcasterFactory
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Using AtmosphereResurceFactory: org.atmosphere.cpr.DefaultAtmosphereResourceFactory
2024-08-02 23:19:40,939 INFO  [org.atm.cpr.AtmosphereFramework] (main) Using WebSocketProcessor: org.atmosphere.websocket.DefaultWebSocketProcessor
2024-08-02 23:19:40,940 INFO  [org.atm.cpr.AtmosphereFramework] (main) Invoke AtmosphereInterceptor on WebSocket message true
2024-08-02 23:19:40,940 INFO  [org.atm.cpr.AtmosphereFramework] (main) HttpSession supported: true
2024-08-02 23:19:40,940 INFO  [org.atm.cpr.AtmosphereFramework] (main) Atmosphere is using org.atmosphere.inject.InjectableObjectFactory for dependency injection and object creation
2024-08-02 23:19:40,940 INFO  [org.atm.cpr.AtmosphereFramework] (main) Atmosphere is using async support: org.atmosphere.container.JSR356AsyncSupport running under container: Undertow - 5.2.2.Final using jakarta.servlet/3.0 and jsr356/WebSocket API
2024-08-02 23:19:40,940 INFO  [org.atm.cpr.AtmosphereFramework] (main) Atmosphere Framework 3.0.5.slf4jvaadin1 started.
2024-08-02 23:19:40,941 INFO  [org.atm.cpr.AtmosphereFramework] (main) Installed AtmosphereInterceptor  Track Message Size Interceptor using | with priority BEFORE_DEFAULT
2024-08-02 23:19:40,954 INFO  [com.vaa.flo.ser.DefaultDeploymentConfiguration] (main) Vaadin is running in production mode.
2024-08-02 23:19:40,963 INFO  [com.vaa.qua.QuarkusInstantiator] (main) Can't find any @VaadinServiceScoped bean implementing 'I18NProvider'. Cannot use CDI beans for I18N, falling back to the default behavior.
2024-08-02 23:19:41,114 INFO  [org.apa.cam.qua.cor.CamelBootstrapRecorder] (main) Bootstrap runtime: org.apache.camel.quarkus.main.CamelMainRuntime
2024-08-02 23:19:41,115 INFO  [org.apa.cam.mai.MainSupport] (main) Apache Camel (Main) 4.6.0 is starting
2024-08-02 23:19:41,146 INFO  [com.tfy.bam.cam.CamelController] (main) Configuring: id[myprinter1] as name[myprinter1]
2024-08-02 23:19:41,156 ERROR [com.tfy.bam.ssl.NoopTrustSocketFactory] (main) Using INSECURE com.tfyre.bambu.ssl.NoopTrustSocketFactory
2024-08-02 23:19:41,219 INFO  [com.tfy.bam.cam.CamelController] (main) configured
2024-08-02 23:19:41,241 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 4.6.0 (camel-1) is starting
2024-08-02 23:19:41,245 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Routes startup (total:2 started:0 disabled:2)
2024-08-02 23:19:41,245 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main)     Disabled producer-myprinter1 (direct://bambu-myprinter1)
2024-08-02 23:19:41,245 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main)     Disabled consumer-myprinter1 (paho://device/01P00A3C2200398/report)
2024-08-02 23:19:41,245 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 4.6.0 (camel-1) started in 3ms (build:0ms init:0ms start:3ms)
2024-08-02 23:19:41,249 INFO  [com.tfy.bam.pri.BambuPrintersImpl] (executor-thread-1) myprinter1: starting
2024-08-02 23:19:41,330 INFO  [io.quarkus] (main) bambu-web 1.2.1 on JVM (powered by Quarkus 3.11.2) started in 1.175s. Listening on: http://0.0.0.0:8080
2024-08-02 23:19:41,331 INFO  [io.quarkus] (main) Profile prod activated.
2024-08-02 23:19:41,331 INFO  [io.quarkus] (main) Installed features: [camel-core, camel-direct, camel-paho, cdi, rest, rest-jackson, scheduler, security, servlet, smallrye-context-propagation, vaadin-quarkus, vertx, websockets, websockets-client]
2024-08-02 23:19:44,645 ERROR [com.tfy.bam.pri.BambuPrintersImpl] (executor-thread-1) myprinter1: Unknown Exception: com.tfyre.bambu.printer.BambuPrinterException: myprinter1: Error starting route: consumer-myprinter1: com.tfyre.bambu.printer.BambuPrinterException: Unknown Exception: com.tfyre.bambu.printer.BambuPrinterException: myprinter1: Error starting route: consumer-myprinter1
	at com.tfyre.bambu.printer.BambuPrintersImpl.startPrinter(BambuPrintersImpl.java:117)
	at com.tfyre.bambu.printer.BambuPrintersImpl.stopStart(BambuPrintersImpl.java:174)
	at com.tfyre.bambu.printer.BambuPrintersImpl.startPrinters(BambuPrintersImpl.java:190)
	at com.tfyre.bambu.printer.BambuPrintersImpl_ClientProxy.startPrinters(Unknown Source)
	at com.tfyre.bambu.camel.CamelController.lambda$onCamelContextFullyStarted$0(CamelController.java:45)
	at io.smallrye.context.impl.wrappers.SlowContextualRunnable.run(SlowContextualRunnable.java:19)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:604)
	at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11)
	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: com.tfyre.bambu.printer.BambuPrinterException: myprinter1: Error starting route: consumer-myprinter1
	at com.tfyre.bambu.printer.BambuPrintersImpl.startPrinter(BambuPrintersImpl.java:107)
	... 15 more
Caused by: org.apache.camel.RuntimeCamelException: Not authorized to connect (5)
	at org.apache.camel.RuntimeCamelException.wrapRuntimeException(RuntimeCamelException.java:66)
	at org.apache.camel.support.service.BaseService.doFail(BaseService.java:407)
	at org.apache.camel.support.service.BaseService.fail(BaseService.java:336)
	at org.apache.camel.support.service.BaseService.start(BaseService.java:126)
	at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:126)
	at org.apache.camel.impl.engine.AbstractCamelContext.startService(AbstractCamelContext.java:3171)
	at org.apache.camel.impl.engine.InternalRouteStartupManager.doStartOrResumeRouteConsumers(InternalRouteStartupManager.java:416)
	at org.apache.camel.impl.engine.InternalRouteStartupManager.doStartRouteConsumers(InternalRouteStartupManager.java:332)
	at org.apache.camel.impl.engine.InternalRouteStartupManager.safelyStartRouteServices(InternalRouteStartupManager.java:217)
	at org.apache.camel.impl.engine.InternalRouteStartupManager.safelyStartRouteServices(InternalRouteStartupManager.java:245)
	at org.apache.camel.impl.engine.AbstractCamelContext.startRouteService(AbstractCamelContext.java:3218)
	at org.apache.camel.impl.engine.AbstractCamelContext.startRoute(AbstractCamelContext.java:1110)
	at org.apache.camel.impl.engine.InternalRouteController.startRoute(InternalRouteController.java:126)
	at org.apache.camel.impl.engine.DefaultRouteController.startRoute(DefaultRouteController.java:133)
	at com.tfyre.bambu.printer.BambuPrintersImpl.startPrinter(BambuPrintersImpl.java:105)
	... 15 more
Caused by: Not authorized to connect (5)
	at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:28)
	at org.eclipse.paho.client.mqttv3.internal.ClientState.notifyReceivedAck(ClientState.java:1053)
	at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:151)
	... 1 more

2024-08-02 23:19:44,647 ERROR [com.tfy.bam.cam.CamelController] (executor-thread-1) onCamelContextFullyStarted: Errors with stopStart: [myprinter1: Unknown Exception: com.tfyre.bambu.printer.BambuPrinterException: myprinter1: Error starting route: consumer-myprinter1]: com.tfyre.bambu.printer.BambuPrinterException: Errors with stopStart: [myprinter1: Unknown Exception: com.tfyre.bambu.printer.BambuPrinterException: myprinter1: Error starting route: consumer-myprinter1]
	at com.tfyre.bambu.printer.BambuPrintersImpl.stopStart(BambuPrintersImpl.java:185)
	at com.tfyre.bambu.printer.BambuPrintersImpl.startPrinters(BambuPrintersImpl.java:190)
	at com.tfyre.bambu.printer.BambuPrintersImpl_ClientProxy.startPrinters(Unknown Source)
	at com.tfyre.bambu.camel.CamelController.lambda$onCamelContextFullyStarted$0(CamelController.java:45)
	at io.smallrye.context.impl.wrappers.SlowContextualRunnable.run(SlowContextualRunnable.java:19)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:604)
	at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11)
	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:1583)

I am able to connect to the printer's IP on port 8883 with telnet. Any suggestion how else I can debug this?

ualinker avatar Aug 02 '24 20:08 ualinker

Please ensure you are using the correct access-code

TFyre avatar Aug 07 '24 17:08 TFyre

Closing due to inactivity

TFyre avatar Sep 07 '24 08:09 TFyre