Could not reliably control the 3CH Wifi Relay Control Board

Hi,

Recently I bought the 3 CH Wifi Relay Control Board so that I could switch on / off a pump of my central heating system using a browser on a mobile phone or desktop.  I also installed node-red  on my raspberry pi and created a flow to switch on / off the pump using the MQTT interface.

The annoying thing is that all the approaches I tried to switch the relay worked sometimes but not all of the time. Pretty frustrating.

So I have tried to control the relay using the relay control page :

  • http://<IP address of my relaly/control/relay.html

But in many cases I couldn't access that page or I get "not connected".   When I had this problem and I tried the same from another machine it sometimes worked from that other machine.

I also tried the same using the MQTT interface from node-red (installed on my raspberry pi).  Also this approach worked sometimes but not all of the time.

I was thinking about a poor wifi signal problem but I don't think that is really the problem.  As on Node-Red I have also created a flow that polls every minute the status of the Wifi Relay (using a http get request) and log an error in case the http get request didn't return status code 200.  It did report errors (see extract below)  but knowing that it is polling every minute this worked 99% of the time which is much more reliable than the switching which worked about 50% of the time.  So in many cases node-red could get the relay status while we couldn't switch during the same period the relay using MQTT or the relay control page.

Any idea how I can fix this ?  Any idea how I can pin down the root cause  ?

many thanks for any help.

Jan.

PS. Here below an extract of the node-red log file where I have filtered out the http get errors for the last 4 days.

...
21 Jan 01:42:00 - [error] [function:extract cv pump state] Unexpected http get status code (=EHOSTUNREACH)
21 Jan 07:07:06 - [error] [function:extract cv pump state] Unexpected http get status code (=EHOSTUNREACH)
21 Jan 07:07:09 - [error] [function:extract cv pump state] Unexpected http get status code (=EHOSTUNREACH)
21 Jan 07:08:06 - [error] [function:extract cv pump state] Unexpected http get status code (=EHOSTUNREACH)
21 Jan 07:39:11 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
21 Jan 07:39:16 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
21 Jan 07:39:25 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
21 Jan 07:40:11 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
21 Jan 08:27:38 - [error] [function:extract cv pump state] Unexpected http get status code (=EHOSTUNREACH)
21 Jan 08:28:23 - [error] [function:extract cv pump state] Unexpected http get status code (=EHOSTUNREACH)
21 Jan 22:14:38 - [error] [function:extract cv pump state] Unexpected http get status code (=EHOSTUNREACH)
21 Jan 22:24:41 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
21 Jan 22:40:41 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
21 Jan 23:30:41 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
22 Jan 17:55:05 - [error] [function:extract cv pump state] Unexpected http get status code (=EHOSTUNREACH)
22 Jan 17:55:08 - [error] [function:extract cv pump state] Unexpected http get status code (=EHOSTUNREACH)
22 Jan 19:33:09 - [error] [function:extract cv pump state] Unexpected http get status code (=EHOSTUNREACH)
22 Jan 19:33:12 - [error] [function:extract cv pump state] Unexpected http get status code (=EHOSTUNREACH)
23 Jan 06:29:36 - [error] [function:extract cv pump state] Unexpected http get status code (=EHOSTUNREACH)
23 Jan 12:55:18 - [error] [function:extract cv pump state] Unexpected http get status code (=ECONNRESET)
23 Jan 13:10:29 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
23 Jan 15:53:26 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
23 Jan 15:54:26 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
23 Jan 16:41:27 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
23 Jan 16:42:27 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
23 Jan 16:43:27 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
23 Jan 17:34:28 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
23 Jan 17:35:28 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
23 Jan 17:36:28 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
24 Jan 13:27:38 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
24 Jan 14:19:41 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
24 Jan 15:20:48 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
24 Jan 16:21:53 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
24 Jan 16:22:53 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
24 Jan 16:23:53 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
24 Jan 16:24:57 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
24 Jan 17:22:57 - [error] [function:extract cv pump state] Unexpected http get status code (=ETIMEDOUT)
pi@raspberrypi:/var/log $ 

 

Robert Wall's picture

Re: Could not reliably control the 3CH Wifi Relay Control Board

I have not seen any mention of this board since the first announcement, so there may be very few people here who know anything about it - have you tried contacting Martin Harizanov?

glyn.hudson's picture

Re: Could not reliably control the 3CH Wifi Relay Control Board

Do you have access to and FTDI / USB to UART cable? If possible could you try and capture a serial debug output from the relay unit. You will have to attach an 6-pin FTDI header. Default baud is 115200. 

We should be able to see what's going on from the serial debug output.  

jvda's picture

Re: Could not reliably control the 3CH Wifi Relay Control Board

Hi Robert and Glyn, thanks for your fast response.

@Robert, I will try to contact Martin later.

@Glyn, I do have a FTDI /USB to UART cable but it requires unmounting the device and some other steps which I am not really comfortable with: maybe I will try this later.  I also think that the Wifi reception is not optimal (router is located in living room while the device is located in the basement) which might explain the occasional drop outs so the only way to have 100% reliability would mean that I need to add another wifi access point near the device which I want to avoid (I can live with 99% reliability).

I am also thinking that due to the occasional network problems the connection with the MQTT broker gets interrupted and the device is not automatically reconnecting which causes that I can no longer switch using MQTT.  To fix this I have to restart (reboot) the device.

So I have changed my node-red flow so that it no longer uses the MQTT interface but the HTTP GET interface to activate/deactivate the relay.  My first experience is that this is much more reliable.  I still need to check how it behaves after a day.

kr
jan

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.