[SOLVED] MyOpenhab Connection fails

Okay - after several weeks of trying to fix this myself by trawling through the collective wisdom of you sages without a successful resolution I come hat in hand.

My Openhab cloud connection times out with a 504 gateway error. OR the warning that OpenHAB is online but my OH is offline - even though it is fully functioning.

I strongly suspect that it is a gateway issue between my PFSense box and Openhab (Ver 2.4 in a up to date Debian Stretch install. Both of which are working nicely as VM’s within Proxmox.)

The Android app works perfectly inside my network and everything functions, all dashboards load, all switches work, etc. However when I drop from wifi to mobile I cannot connect. I did have it working in 2.3…

I am fairly sure that is a firewall issue in PFSense but have also read that I should not be opening ports for OH - but this is all that I seem to have left…

My installation =
OpenHAB2 2.4 installed within a Proxmox VM
OH install was apt-get based on Debian Stretch system fully up to date
Cloud Binding and a few incidental extras
MQTT working well
Operationally functional
System has Fixed IP and uses DNS via fully up to date PiHole that also hosts NTP

FYI Log Tail

2019-01-28 21:08:59.831 [ERROR] [io.openhabcloud.internal.CloudClient] - Socket.IO error: {}

io.socket.engineio.client.EngineIOException: websocket error

	at io.socket.engineio.client.Transport.onError(Transport.java:71) [245:org.openhab.io.openhabcloud:2.4.0]

	at io.socket.engineio.client.transports.WebSocket.access$500(WebSocket.java:28) [245:org.openhab.io.openhabcloud:2.4.0]

	at io.socket.engineio.client.transports.WebSocket$2$5.run(WebSocket.java:150) [245:org.openhab.io.openhabcloud:2.4.0]

	at io.socket.thread.EventThread$2.run(EventThread.java:80) [245:org.openhab.io.openhabcloud:2.4.0]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

	at java.lang.Thread.run(Thread.java:748) [?:?]

Caused by: java.io.EOFException

	at okio.RealBufferedSource.require(RealBufferedSource.java:59) ~[?:?]

	at okio.RealBufferedSource.readByte(RealBufferedSource.java:72) ~[?:?]

	at okhttp3.internal.ws.WebSocketReader.readHeader(WebSocketReader.java:115) ~[?:?]

	at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:104) ~[?:?]

	at okhttp3.internal.ws.RealWebSocket.readMessage(RealWebSocket.java:97) ~[?:?]

	at okhttp3.ws.WebSocketCall.createWebSocket(WebSocketCall.java:152) ~[?:?]

	at okhttp3.ws.WebSocketCall.access$000(WebSocketCall.java:41) ~[?:?]

	at okhttp3.ws.WebSocketCall$1.onResponse(WebSocketCall.java:97) ~[?:?]

	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:126) ~[?:?]

	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) ~[?:?]

	... 3 more

2019-01-28 21:08:59.842 [INFO ] [io.openhabcloud.internal.CloudClient] - Disconnected from the openHAB Cloud service (UUID = XXXXX, base URL = http://localhost:8080)


The XXXXX is my insert !

I have uninstalled, cleaned and reinstalled the binding
I have deleted all items and settings on the Cloud.
I have configured the service and exposed selected items.
I have added new and removed other items as a tester
I have re added UUID and Secret to the cloud install.
Everything went for about 30sec and then failed again.
… but I cannot recall if I was also working PFSense on the firewall at the time.

I am at a loss.

Can someone point me in the right direction?

Only if you set a rule to block your OH server from connecting to the myopenhab.org servers. You don’t need to set up a port forward because your OH instance initiates the connection. Try to ping myopenhab.org from your OH server. If it works then you know it’s not the firewall. If it fails to work then you know there is a rule in PFsense blocking the connection, or you have a rule in PiHole that is blocking the DNS requests.

Oh so painfully obvious now that you point it out… I never thought to ping from the OpenHAB2 install - kicking myself and face-palming at the same time - lol.

I had a misconfigured rule in PFSense and it was blocking everything OH.

So, so, painfully obvious… but I had to ask because I could no longer see the forest for the trees!.

Thanks @rlkoshak

@Tameion

1 Like