adrianromero / myhelloiot

MYHELLOIOT is a MQTT dashboard and client application
https://adrianromero.github.io/myhelloiot/
GNU General Public License v3.0
34 stars 6 forks source link

How to connect to non ssl mqtt broker? ( ws://free.mqtt.iyoti.id ) #9

Open TeguhTeknisi opened 4 months ago

TeguhTeknisi commented 4 months ago

Hi Mr. Adrianromero

Thanks for the app, i have install https://adrianromero.github.io/myhelloiot to google chrome.

But when i want to use it with ws://free.mqtt.iyoti.id But i got error "failed to construct 'WebSocket': An insecure Websocket connection may not be initiated from a page loader over HTTPS."

I have try to open the web page without https ( http://adrianromero.github.io/myhelloiot ) but its still go to https.

Best Regrads, Teguh

mhaberler commented 4 months ago

change the protocol to ws://

TeguhTeknisi commented 4 months ago

change the protocol to ws://

Thanks for the reply.

Using ip adress with ws:// not working. And ofcourse using domain name free.mqtt.iyoti.id is not working.

Here the screenshot that using ip adress is not working

This free.mqtt.iyoti.id ip adress Screenshot_20240507-011627.png

This the error when i connect it Screenshot_20240507-010954.png

adrianromero commented 4 months ago

Hello

It looks like https://iyoti.id/ does not support secure websockets MQTT connectivity, only plain unsecure websockets, so any web browser will prevent to establish an unsecure websocket connection from a secure web page like https://adrianromero.github.io/myhelloiot/

You can try other MQTT free public brokers that provide secure websockets connections like wss://broker.hivemq.com:8884/mqtt, wss://broker.emqx.io:8084/mqtt or wss://test.mosquitto.org:8081.

I tried from my local development environment running at http://localhost:5173/myhelloiot/ and I can connect to the plain websockets url ws://free.mqtt.iyoti.id:8083/mqtt but as I wrote in the previous paragraph it is not possible to connect from https://adrianromero.github.io/myhelloiot/

image

TeguhTeknisi commented 4 months ago

Hello

It looks like https://iyoti.id/ does not support secure websockets MQTT connectivity, only plain unsecure websockets, so any web browser will prevent to establish an unsecure websocket connection from a secure web page like https://adrianromero.github.io/myhelloiot/

You can try other MQTT free public brokers that provide secure websockets connections like wss://broker.hivemq.com:8884/mqtt, wss://broker.emqx.io:8084/mqtt or wss://test.mosquitto.org:8081.

I tried from my local development environment running at http://localhost:5173/myhelloiot/ and I can connect to the plain websockets url ws://free.mqtt.iyoti.id:8083/mqtt but as I wrote in the previous paragraph it is not possible to connect from https://adrianromero.github.io/myhelloiot/

image

Thanks for the reply.

I have read the documentation, try the example, i can connect it. But, i want to use free.mqtt.iyoti.id because it from my country, so it will fast. And its free without need for sign up, and i can create user and password from their web dashboard.

Is it posible to run myhelloit from android? I dont know about yarn and the posibily to run in on android.

Edit: I just try it using termux-app from github, here mystep termux-change-repo pkg install yarn nodejs pkg upgrade git clone https://github.com/adrianromero/myhelloiot cd myhelloit/ yarn install

but i got this error, and take alot of space Screenshot_20240507-075031.png

Best regrads, Teguh.

adrianromero commented 3 months ago

Hello Teguh.

One of the development dependencies used for generating the assets: @vite-pwa/assets-generator and sharp depends on the https://www.libvips.org/ that it looks like there are no packages for Android.

This depencency is used only to generate new images and icons for the application but not needed to run the project from sources. Try removing this two dependency lines from the package.json file and try again.

"@vite-pwa/assets-generator": "^0.2.4",
"sharp": "^0.33.3",

Hope it helps