I’m mobile app developer (not native, HTML5 hybrid app, based on IonicFramework) and I develop IoT Manager mobile app based on exchange data between any devices and MQTT brokers (discuss about this app on ESP8266.com).
All hybrid app, based on WebView, can’t establish TCP/IP connections to brokers standart port 1883 via mqtt protocol (mqtt://), but support connections to brokers via WebSockets (ws:// and wss://).
Reconfigure broker for supporting WebSockets very simplest, just add several lines to .conf file.
Can you add supporting WebSockets API for thethingsnetwork MQTT broker?
for who wants to play with websockets … I have a mosquitto to websocket proxy listening at ws://vme-1.automation-du.de:80/mosquitto - feel free to give it a go.
ps: use a random client-id multiple sessions with the same id will not work.
This is a great idea, but I wouldn’t recommend accepting websocket connections directly on the TNN MQTT brokers. Those are needed to route core network backend and if a popular web-site started to overload it with Websocket requests, wouldn’t be good.
Putting a proxy or something in the middle to handle that client-load and keep it separated from the core network would be best IMO. But like others mentioned, it’s not too hard to spin up an AWS or DigitalOcean VM and just put an websocket-to-MQTT gateway for your websocket users.
Realy good point, never connect a website to it. Didnt thought about that. But a free solution is the cloudmqtt Bridge without touching your ec2 you can connect with a websocket for free… cloudmqtt its on mosquitto