WebSocket Client Extension


#1

Buenos dias

comparto extensión

image

image

Metodos

image

Eventos

image

Test Node Red localhost

image

image

image

librerias

https://github.com/codebutler/android-websockets
https://nodered.org/
http://www.websocket.org/echo.html
image

Extension

co.com.dendritas.WebSocketCl.aix (32,4 KB)


HTTPS for Web Component
#2

Can you explain a bit more about the extension use? Thanks


#3

Hola amigo, podrias mostrar un ejemplo como funciona, me resulta interesante, saludos desde Argentina!


#4

Wonderful!
This is opening so many possibilities for IoT, but not only.

Unfortunately it runs into an error all the time:
The operation Text cannot accept the arguments: , [*nothing*]
It comes from the OnError method.
My Node Red server is working, tested with https://www.websocket.org/echo.html

Would you please update and/or post a valid connection workflow?


#5

#6

you can show your blocks


#7

Sure, thanks for replying so fast

I don’t expose the server name here :slight_smile: but it’s present in my tests.

On echo, using my server I get:
CONNECTED
SENT: Rock it with HTML5 WebSocket
RECEIVED: Rock it with HTML5 WebSocket
And the message shows up in NodeRed debug:

But the companion doesn’t reach the server at all. Both on ws and wss (secure websocket). Wifi and network is working though.

Error is when I send, not when I connect. I tried to connect with another button and didn’t get an error.


#8

I’m going to try, I had not found someone familiar, I do it in the afternoon while I build the server


#9

This is great!
Thank you.


#10

Hi Andres,
Any news?


#11

Hi Andres,
What’s up on websocket?


#12

Hi,
Should I let go? :slight_smile:


#13

Hi,
I can confirm the problems connecting to a server.
I tried with ws://echo.websocket.org on port 1880 and 80
tried wss://echo.websocket.org on port 443
but only ever onError is called after some period of time and no error can be extracted.

I would really love to use this extension.


#14

OK I found the problem. It did not work with the outdated companion. Everything is fine now.


#15

Hi @grexhh,
I checked my companion is the last version (as for Google Play) and tried again without luck.
To be more precise, the companion connection throws an empty error (but seems to connect), it can send a message to the server but it doesn’t get any reply from the server.
I don’t get this behavior when using wss://echo.websocket.org though, so I guess I’m missing something related to nodered / appybuilder setups.

Would you please show complete basic working blocks and nodered nodes?
Thank you very much :slight_smile:


#16

ws://echo.websocket.org


#17

@j2l sorry I guess I can’t help here. I switched to using UDP and do not have anything to show. I am also not using nodered.


#18

I made an arduino code that directly with websokets an esp32 that is the objective ??


#19

@Andres_Cotes
Coming back to this one because I think firebase sucks.
I made it kinda works after ignoring error totally BUT
I pinpoined 2 problems:

  • error message is empty (nothing) and fires even when connection is actually working.
  • the onMessage is never firing even when other clients receive a broadcast message.

I updated everything (clients, server (not localhost)) and tried with various clients (websocket chrome extension, web client, server’s injection). All receive messages from each other EXCEPT this extension’s onMessage.
I also tried to stringify the JSON object message, without luck.

Should I switch to the great tutorial about pubnub? It’s not 2015 anymore :slight_smile:


#20

No, I made my own websocket server.
No arduino in the loop this time :wink: (BTW, I just received components for my arduino water softener).