New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Garbage interfaces and port when comparing to local interfaces #1830
Comments
Regardless of what LWS says, does it actually work with an older LWS? 4.1.0 only just came out, and 4.0.x was broken on many target architectures. does LWS 3.1 work? or 2.4? Those are known to be functional LWS releases. |
Using LWS 3.1.0 and mosquitto 1.6.7 ( or 1.4.10 ) i get this: Starting program: /usr/local/sbin/mosquitto -v -c /etc/mosquitto/mosquitto.conf Program received signal SIGSEGV, Segmentation fault. |
libwebsockets8 is 2.0.0 to 2.0.3. It looks like you have that version installed in your OS and it is getting picked up before 3.2.0. The earliest good version was about 2.4. libwebsockets is very unstable from version to version with frequent breaking changes in behaviour, API, and ABI. Even a change in bugfix versions can introduce significant incompatibilities, e.g. from 3.0.0 to 3.0.1, so it is important that you use only the exact binary that you compiled against. |
Yup. I've removed ubuntu's libws-dev and ran ldconfig after. The app remains like this: The output of: I've added I've tried to access from my browser: localhost:9001 but nothing. Any suggestions ? |
What does "nothing" mean? It doesn't respond, a 404, or something else? Try using an mqtt websockets client to connect to that port and subscribe to |
I'm getting this: 1600687733: When running this: From the web it actually didn't responded. |
mosquitto_sub doesn't support websockets, you'll have to use something else. MQTT Explorer is worth a look. |
Is it normal for a second process to be spawned after i start mine manually as sudo ? root 4681 0.0 0.0 66396 4460 pts/3 S+ 18:18 0:00 sudo /usr/local/sbin/mosquitto -v -c /etc/mosquitto/mosquitto.conf |
The first command is your |
Should we use this version? In mosquitto log:
I've recompiled
With Using
|
@mrdc have you tried the packages from repo.mosquitto.org? |
@ralight Not yet - I've read somewhere that pre-build binaries are without websockets... |
Those packages have websockets support. |
Version from |
Great, I'm glad that worked. I'm closing this issue because it's solved for you and the original reporter was using a much older version. If it's still a problem elsewhere, please reopen and add more details. |
I'm using Ubuntu 18.04
OpenSSL 1.1.1g
mosquitto v1.6.9
libwebsockets 4.1.0
This is my configuration:
listener 9001
protocol websockets
log_type all
websockets_log_level 1023
connection_messages true
bind_interface eno1
This is what i get:
1600638792: mosquitto version 1.6.9 starting
1600638792: Config loaded from /etc/mosquitto/mosquitto.conf.
1600638792: Opening websockets listen socket on port 9001.
1600638792: Initial logging level 1023
1600638792: Libwebsockets version: 2.0.3 unknown-build-hash
1600638792: IPV6 not compiled in
1600638792: libev support compiled in but disabled
1600638792: libuv support compiled in but disabled
1600638792: LWS_DEF_HEADER_LEN : 1024
1600638792: LWS_MAX_PROTOCOLS : 5
1600638792: LWS_MAX_SMP : 32
1600638792: SPEC_LATEST_SUPPORTED : 13
1600638792: sizeof (*info) : 280
1600638792: SYSTEM_RANDOM_FILEPATH: '/dev/urandom'
1600638792: default timeout (secs): 20
1600638792: Threads: 1 each 1024 fds
1600638792: mem: context: 71488 bytes (67392 ctx + (1 thr x 4096))
1600638792: mem: http hdr rsvd: 68224 bytes (1 thr x (1024 + 3240) x 16))
1600638792: mem: pollfd map: 8192
1600638792: mem: platform fd map: 8192 bytes
1600638792: Compiled with OpenSSL support
1600638792: SSL disabled: no LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
1600638792: Creating Vhost 'default' port 0, 1 protocols
1600638792: interface lo vs B?_U
1600638792: interface eno1 vs B?_U
1600638792: interface wlp58s0 vs B?_U
1600638792: interface lo vs B?_U
1600638792: interface eno1 vs B?_U
1600638792: interface lo vs B?_U
1600638792: interface eno1 vs B?_U
1600638792: Unable to find interface B?_U
1600638792: Failed to create default vhost
1600638792: Error: Unable to create websockets listener on port 9001.
Keep in mind that i get various random data when comparing eno1 vs XXX and so on.
I just want to create a basic libwebsocket server using mosquitto.
I've initially opened a ticket on libwebsockets side, but it seems is ok on their side: warmcat/libwebsockets#2060
Thanks.
The text was updated successfully, but these errors were encountered: