Skip to content
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

MQTT over websocket not compiling (CA-24) #62

Open
liudr opened this issue Oct 3, 2019 · 10 comments
Open

MQTT over websocket not compiling (CA-24) #62

liudr opened this issue Oct 3, 2019 · 10 comments

Comments

@liudr
Copy link

liudr commented Oct 3, 2019

If I enable the SAMPLE_MQTT_OVER_WEBSOCKETS option, the device twin sample code fails to compile:

C:/Users/user/Downloads/msys32/home/user/esp/esp-azure/examples/iothub_devicetwin_samples_and_methods/build/main\libmain.a(iothub_client_device_twin_and_methods_sample.o):(.literal.iothub_client_device_twin_and_methods_sample_run+0x4): undefined reference to `MQTT_WebSocket_Protocol'
collect2.exe: error: ld returned 1 exit status
make: *** [C:/Users/user/Downloads/msys32/home/qk9446me/esp/esp-idf/make/project.mk:483: /home/user/esp/esp-azure/examples/iothub_devicetwin_samples_and_methods/build/iothub_devicetwin_samples_and_methods.elf] Error 1

Seems like this protocol is not found. What am I missing? Thanks.

@shahpiyushv
Copy link
Collaborator

@liudr , even I tried giving this a shot, trying to fix some compilation issues, but there seem to be quite some dependencies. We may take this up later.

@acheve
Copy link

acheve commented Oct 22, 2019

@shahpiyushv ,
It's really a problem for us to be stuck to a classical MQTT connection to port 8883.
Some corporate firewalls and home routers could block outbound traffic on "specific" ports.
It would be a true relief to be able to use MQTT over WebSocket (with output port : 443).
Do you have any plan to addd support of MQTT over WebSocket soon?
Thanks!!

@projectgus projectgus changed the title MQTT over websocket not compiling MQTT over websocket not compiling (CA-24) Jan 1, 2020
@daniel-grabner
Copy link

@shahpiyushv
For us this is also a huge problem as in many customer installations port 8883 is blocked. In countries such as Switzerland most ISPs have blocked this port by default and charge for opening it. Thus MQTT over websocket is an essential feature for us.

If the problem is not going to be solved in esp-azure port we need to look for alternatives. Talking about 20k of ESP32 per annum. Can you give an estimation of when MQTT over websockets is going to be implemented by Espressif?

@liudr
Copy link
Author

liudr commented Apr 14, 2020

Any update on the possibility of MQTT_OVER_WEBSOCKETS? Thanks.

@daniel-grabner
Copy link

Any update on the possibility of MQTT_OVER_WEBSOCKETS? Thanks.

+1
Urgently waiting for it too.

@Adamantinu
Copy link

+1
Would be great to have that feature here too, since many firewalls in various locations block the standard mqtt port per default and need to be opened then by a sysadmin if IoT Devices would like to operate there with the ESP azure sdk

@MartinTJDK
Copy link
Contributor

Fixing issue described in #90 and adding:

const IO_INTERFACE_DESCRIPTION* socketio_get_interface_description(void)
{
return wsio_get_interface_description();
}

to platform code fixes compilation, and allows MQTT over WebSocket.

@Lisa999
Copy link

Lisa999 commented Aug 14, 2020

const IO_INTERFACE_DESCRIPTION* socketio_get_interface_description(void)
{
return wsio_get_interface_description();
}

And #include "azure_c_shared_utility/wsio.h" ?

Still have the error "undefined reference to `Prov_Device_MQTT_WS_Protocol'" even with the esp-idf from today...

@giroudon
Copy link

MQTT over WebSocket now works on my cloned repo. Please see Pull request #68, which now includes "Upload to Blob" and "MQTT over WebSocket" features.

@jspngh
Copy link
Contributor

jspngh commented Jan 18, 2021

MQTT over websockets works for me when following @MartinTJDK's instructions
and adding some files to port/CMakeLists.txt:

"${AZURE_IOT_SDK}/iothub_client/src/iothubtransportmqtt_websockets.c"
"${AZURE_IOT_SDK}/c-utility/src/gb_rand.c"
"${AZURE_IOT_SDK}/c-utility/src/utf8_checker.c"
"${AZURE_IOT_SDK}/c-utility/src/uws_client.c"
"${AZURE_IOT_SDK}/c-utility/src/uws_frame_encoder.c"
"${AZURE_IOT_SDK}/c-utility/src/wsio.c"

Is there a reason these files are absent and am I supposed to add them somewhere else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants