WebSockets and UniPi Neuron
-
Hi All,
I have been tinkering with the UniPi Neuron for the past few days. I got to the point where I get everything working (REST, jsonrpc, tcp modbus) but I can't figure out the WebSocket implementation.
I had no experience with WebSockets but after some reading I managed to create a simple client - server example using Autobahn (Python implementation of WebSockets)
However modifying the client example and simply changing the remote address is not doing any tricks. I do receive a notification on the evok service when I am running it manually and I try to connect with my WebSocket client.
[I 170419 13:42:47 web:2063] 200 GET / (10.3.131.5) 19.47ms
The above line is what I get everytime I try to connect with the WebSocket client to the UniPi. Instead of polling, the WebSocket client immediately closes its connection.
reactor.connectTCP("10.3.129.17", 8088, factory)
reactor.run()Anyone has experience with WebSockets and the UniPi and has a clue what I am missing?
Thanks in advance! -
Hello @vvanouytsel,
I have not played with Autobahn yet. But the url should be different I think, like this: ws://your.unipi.ip.address/ws
The line [I 170419 13:42:47 web:2063] 200 GET / (10.3.131.5) 19.47ms means that evok receives a HTTP GET request from the your web browser. If you will sucessfully connect to websocket handler, than it will print something like: new websocket client connected.
-
Hi @tomas_hora
Thanks for your reply, I thought that might be the issue. Using the WebSocket example from the evok git page works perfectly so I will build on that example.
Thanks!