I am facing issue in setting up a mqtt over websocket.
May I ask you what the specific question is?
i am setting up the mqtt connection over websocket for example ws://broker.hivemq.com/8000 and I have to publish the data over particular topic.
What exact steps are you performing ?
Standard MQTT works over TCP / TLS
Websocket delivers over an HTTP(S) bearer
Both are supported with HiveMQ
But for anyone to advise yo on how to do this we would need to know what commands you have tried so far.
so i have been trying
MQTTClient(“umqtt_client”, “ws://broker.hivemq.com”, 8000)
I have made some assumptions. You have a known system with which you are developing, that you have a basic knowledge of cellular communications and that you have an active SIM card,
Since it seems you are using QuecPython, have you activated a NIC first ?
There is nothing in the QuecPython documentation that indicates that MQTT over Websocket is supported.
If basic websockets were available I would expect to see this in the Network Protocol section and at worst hidden in the HTTP documentation since a Websocket connection starts of an and HTTP session and is then upgraded to websocket.
Typically MQTT runs natively over TCP (can use TLS for encryption). This model is supported. The documentation doesn’t seem to talk about installing certificates etc, encryption is a must with any IoT application and its easy when the module does all the work for you,
In the past when I have used WebSockets with Quectel devices (EG915U) I have had to write my own websocket handler again using TCP as the HTTP engine within the module didn’t support it. So it wouldn’t be a surprise if the same wasn’t true in this case.
Firstly, if someone from Quectel can advise re WS support on the EC200u, specifically when using the QuecPython support.
Alternatively just use a TCP connection
Oh and provide a lot more detail on what steps you have and have not done so people on this forum can understand your level of experience etc and respond appropriately
Thanks for the pointer. In my case with e EG915U I wasn’t actually using QuecPython as I was running a low power 8 bit micro collecting lots of serial data from devices and I needed to push it via at commands to a websocket host. None of the AT commands interfaces supported Websocket (confirmed by Quectel) so I had to write my own websocket using TCP / TLS AT commands
So the question is this, using QuecPython can you layer the network stacks to create what Vaibhav wants to use ?
Vaibhav wants to use MTQQ over Websocket to HiveMQ.
The MQTT API documents in no way suggest that it handles this scenario
If you use the Websocket API you’ll probably need to write you own MQTT client.
Ok for a basic implementation but a fair amount of work for a robust and more complete client
to write my own stack i have to set mqtt path while making mqtt client over websocket. but there is no document to guide through it.
It would probably be a lot easier for you to just use standard MQTT into Hive and avoid using the websocket layer
When I say write your own MQTT client I mean you would have to write all of the payload handling and packet construction following the the MQTT protocol specification. I’m not sure what you mean by “set mqtt path”. If you refer to the URL when you say path, that’s a step you would do before starting your MQTT client as that’s only required for the TCP/TLC//Websocket transport session.
i know it will be lot easier and i have done it already .i want to send a data on a particular topic by setting up the mqtt over websocket