Comments (5)
I just found the solution: the first listener seems to always be related to the mqtt protocol. My working configureation specifies two listeners this way:
listener 1883 192.168.222.54
protocol mqtt
listener 8883 192.168.222.54
protocol websockets
and now, it starts with these messages:
1706523693: mosquitto version 2.0.11 starting
1706523693: Config loaded from /etc/mosquitto/mosquitto.conf.
1706523693: Opening ipv4 listen socket on port 1883.
1706523693: Opening websockets listen socket on port 8883.
1706523693: mosquitto version 2.0.11 running
Thank you again for your help.
from android.
You appear to be trying to connect to a mosquito server with OT in HTTP mode?
HTTP mode is for talking to HTTP servers, like OT recorder. MQTT mode is for talking to MQTT brokers, like mosquitto.
from android.
Yes, you are right. I now corrected the connector to MQTT on the client and configured it for using websocket.
But I am still not able to connect to the server. The new exception is:
2024-01-29 10:36:14.670 I MQTTReconnectWorker: MQTTReconnectWorker started on threadID: Thread[androidx.work-3,5,main]
2024-01-29 10:36:14.838 E MessageProcessorEndpointMqtt: Failed to reconnect to MQTT broker
org.owntracks.android.services.MqttConnectionException: (0) - java.io.IOException: WebSocket Response header: Invalid response from Server, It may not support WebSockets.
at org.owntracks.android.services.MessageProcessorEndpointMqtt.connectToBroker(SourceFile:243)
at org.owntracks.android.services.MessageProcessorEndpointMqtt.reconnect(SourceFile:46)
at org.owntracks.android.services.MessageProcessorEndpointMqtt.lambda$reconnect$1(Unknown Source:0)
at org.owntracks.android.services.MessageProcessorEndpointMqtt.$r8$lambda$3UR4gQL2b_UbF_ekJLIMhafolpU(Unknown Source:0)
at org.owntracks.android.services.MessageProcessorEndpointMqtt$$ExternalSyntheticLambda0.run(Unknown Source:18)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:344)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: (0) - java.io.IOException: WebSocket Response header: Invalid response from Server, It may not support WebSockets.
at androidx.work.impl.utils.WorkForegroundUpdater$1.run(SourceFile:433)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.io.IOException: WebSocket Response header: Invalid response from Server, It may not support WebSockets.
at androidx.core.provider.FontRequest.execute(SourceFile:544)
at org.eclipse.paho.client.mqttv3.internal.websocket.WebSocketSecureNetworkModule.start(SourceFile:26)
at androidx.work.impl.utils.WorkForegroundUpdater$1.run(SourceFile:174)
... 1 more
so, I double checked my server configuration and it is configured for websocket, but maybe it is running on a different port. The mosquitto log contents are:
1706521211: mosquitto version 2.0.11 starting
1706521211: Config loaded from /etc/mosquitto/mosquitto.conf.
1706521211: Opening ipv4 listen socket on port 8883.
1706521211: Opening websockets listen socket on port 1883.
1706521211: mosquitto version 2.0.11 running
in my configuration I heve these lines:
protocol websockets
listener 8883 192.168.222.54
interesting enough is that if I switch these lines, mosquitto does not start anymore. It gives error message:
1706521555: mosquitto version 2.0.11 starting
1706521555: Config loaded from /etc/mosquitto/mosquitto.conf.
1706521555: Opening websockets listen socket on port 8883.
1706521555: Error: Unable to start any listening sockets, exiting.
So, do the configuration lines require to be put in a specifi order in order to let MQTT use websocket on port 8883?
Thank you very much
from android.
The protocol
line specifies the listener's protocol, and you define the order as you like.
from android.
Thank you. I am closing the issue.
from android.
Related Issues (20)
- Tasker integration
- Imperial Units in Android GUI
- Notifications for Friends arriving and departing Regions HOT 6
- owntracks doesn't have location permission "allow all the time" HOT 3
- location provider ping-pong? HOT 3
- Fully reset configuration when changing mode and/or host/port HOT 2
- Couldn't attach file when sharing log via gmail HOT 3
- MQTTv5 support
- Russian translation (2.5.0) HOT 15
- "Tap here to request notification permission" in 2.5.0 not working HOT 4
- Extend metrics with smartphone others sensors HOT 7
- No map visible on new install HOT 3
- [Feature Request] Support multiple groups of friends using one MQTT server HOT 2
- Expanding the extended data field to contain settings that may be non-optimal for operation HOT 23
- Return blank location packet for ping/manual location even though there is no location or accuracy is poor HOT 6
- Connection to HiveMQ dropping with an error HOT 12
- MQTT Exception delivering message (32000) HOT 8
- pubExtendedData / extendedData config setting HOT 2
- Reverse-geo ratelimit pauses location publishes HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android.