robotconscience/ofxLibwebsockets

Client connection failed linux32bit

frukostklubben opened this issue · 16 comments

Hi!

I recently got help with compiling the hello world example.
Well, running it on another computer gave birth to other issues.

I follow the same procedure as on the other computer but I now get this when running it:


roar@s2-linux:~/of_v0.9.3_linux_release/addons/ofxLibwebsockets/example_client_hello_world$ make RunRelease
HOST_OS=Linux
checking pkg-config libraries: cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libpulse-simple alsa gl glu glew gtk+-3.0
[verbose] [ofxLibwebsockets] connect: echo.websocket.org:80/:0
[verbose] [ofxLibwebsockets] LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS
[verbose] [ofxLibwebsockets] LWS_CALLBACK_PROTOCOL_DESTROY
[verbose] [ofxLibwebsockets] libwebsocket init success
[verbose] [ofxLibwebsockets] LWS_CALLBACK_UNLOCK_POLL
[ error ] [ofxLibwebsockets] client connection failed


The only difference is that the computer I'm trying to run it on now is running 32bit Linux, which I suspect might be the catch..
Is it possible to run it on 32bit?

Thank you
/Trykks

Hello! I'm surprised it's running at all, as I think there's only a 64-bit linux library?
You may need to recompile libwebsockets following the instructions in the readme. It should otherwise work, not sure on the mystery there!

Just so I'm not missing something.

I did recompile libwebsockets on the 32bit computer, but I didn't set any compile flags or anything. Is that necessary?

Where would the libwebsockets.a file go after? Putting it in the linux64 folder causes issues (as expected heh).

Thanks!

No problem!
1 - Make sure you're compiling from this version of libwebsockets:
https://github.com/warmcat/libwebsockets/releases/tag/v1.5-chrome47-firefox41
2 - It should be in a new linux32 folder. I believe the openFrameworks project generator should find it there for you!

Ah!
Got the correct version of libwebsockets, but I gambled on naming the folder linux. Will report back!

Thank you!

So I tried it again after naming the folder linux32 and it can't find libwebsockets (throws a lot of undefined references on running make in the example_client_hello_world). I believe linux is the correct name, something else must be wrong. hmmm.

Shoot! Hm.

Can you try the separate libwebsockets examples and see if the library by
itself works? And of course, that other network things on your machine
(Internet, firewalls, etc) are setup and working properly.

@quinkennedy are you on Linux 32 or 64? any ideas of what it could be?
On Wed, Apr 6, 2016 at 7:37 AM trykks notifications@github.com wrote:

So I tried it again after naming the folder linux32 and it can't find
libwebsockets (throws a lot of undefined references on running make in the
example_client_hello_world). I believe linux is the correct name, something
else must be wrong. hmmm.


You are receiving this because you commented.

Reply to this email directly or view it on GitHub
#86 (comment)

Brett Renfer
\ robotconscience.com
// tsps.cc

I tried running the test-server on both computers, it didn't work on any of them.

Just to be clear, there's nothing other than:

mkdir build
cd build
cmake ..
make
cp path/to/libblabla.a path/to/ofxLib/etc

That I need to do on the 32 bit computer?
No flags that need to be set or anything?
Read the README-build.md and it doesn't say anything about that.

Yep, you've got the build process right! For using their examples, make
sure you're passing args to the examples (I think the test client allows
you to pass a host, so you can try echo.websocket.org).

If the test-server and client aren't working, there's definitely something
else going on. You could try the next release for libwebsockets and see if
you can find one that works? The newest ones won't work with the library
(they changed a lot of stuff), but ones right after the version I posted
may. Also check through the issues on libwebsockets and see if there's
anyone else with this problem?

Sorry you having so much trouble!
On Wed, Apr 6, 2016 at 8:53 AM trykks notifications@github.com wrote:

I tried running the test-server on both computers, it didn't work on any
of them.

Just to be clear, there's nothing other than:

mkdir build
cd build
cmake ..
make
cp path/to/libblabla.a path/to/ofxLib/etc

That I need to do on the 32 bit computer?
No flags that need to be set or anything?
Read the README-build.md and it doesn't say anything about that.


You are receiving this because you commented.

Reply to this email directly or view it on GitHub
#86 (comment)

Brett Renfer
\ robotconscience.com
// tsps.cc

So neither client, server or echo examples work on any of the computers. But the computer running 64bit runs the ofxLibwebsockets example_client_hello_world just fine anyway.
Super weird.

Using later versions (the ones right after 1.5) of libwebsockets causes compilation errors (undefined references).

What I find really strange is that the 32bit and the 64bit give different verbose messages on run.

32bit gives:
roar@s2-linux:~/of_v0.9.3_linux_release/addons/ofxLibwebsockets/example_client_hello_world$ make RunRelease
HOST_OS=Linux
checking pkg-config libraries: cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123
[verbose] [ofxLibwebsockets] connect: echo.websocket.org:80/:0
[verbose] [ofxLibwebsockets] LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS
[verbose] [ofxLibwebsockets] LWS_CALLBACK_PROTOCOL_DESTROY
[verbose] [ofxLibwebsockets] libwebsocket init success
[verbose] [ofxLibwebsockets] LWS_CALLBACK_UNLOCK_POLL
[ error ] [ofxLibwebsockets] client connection failed

and the 64bit:

trykks@trykks-UX32A:~/of_v0.9.3_linux64_release/addons/ofxLibwebsockets/example_client_hello_world$ make RunRelease
HOST_OS=Linux
checking pkg-config libraries: cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123
[verbose] [ofxLibwebsockets] connect: echo.websocket.org:80/:0
[verbose] [ofxLibwebsockets] LWS_CALLBACK_CONFIRM_EXTENSION_OKAY
[verbose] [ofxLibwebsockets] LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION
[verbose] [ofxLibwebsockets] libwebsocket init success
[verbose] [ofxLibwebsockets] LWS_CALLBACK_CONFIRM_EXTENSION_OKAY
[verbose] [ofxLibwebsockets] LWS_CALLBACK_PROTOCOL_INIT
[verbose] [ofxLibwebsockets] Connection successfully created. Connecting.

How come the first few lines (LWS_CALLBACK_) differ? It doesn't fail to connect until after, so those should be the same I guess?

It's alright, trouble comes hand in hand with coding haha

EDIT:

When trying to run the example_server_echo I get an error saying that "Transport endpoint is not connected", this and hello_world are probably very related.

To be clear, have you tried the examples that come with libwebsockets (i.e. not the openframeworks ofxLibwebsockets ones)?

When you build the library, there should be a bin folder with a bunch of stuff (including libwebsockets-test-client).

If you run the above like so, you should be able to test that:

cd /path/to/libwebsockets/bin
./libwebsockets-test-echo --client echo.websocket.org

I haven't run the example with that extra option --client because I read stuff wrong, meh.

Assuming it's supposed to receive a bunch of hellos from the server it works on the 64bit!
Will have to check on the 32bit tomorrow (school vs private computer)!

Thanks, sorry if this all is very basic, started with Linux and C++ 3 months ago and still learning! :)

I just tried the example on the 32bit computer and it works there as well...
libwebsockets does not seem to be the problem, the connection between that and ofxLibwebsockets however seems to be struggling.

Ah geez, just looked: i think part of it is I have the wrong libwebsockets version written in the Readme. Can you try this instead?
https://github.com/warmcat/libwebsockets/releases/tag/v1.4-chrome43-firefox-36

And no worries on the getting started, looking like it's my bad! :)

This worked perfectly! Thanks :)

Phew! So sorry about this, hard to manage all of these platforms :)

@trykks just fixed the readme, so others don't have the same problem. Sorry again, so glad it's working now!!