[SOLVED] G-Homa Wifi Smart Socket “EMW302WF“ and “EMW302WFO” with OpenHAB2

Hello Alex,

i tried to add a EMW302WF socket. But my controlserver server is crashing when the smart socket tries to connect.
Error:

ghoma express example app start listening on port 3000 for http requests.

/etc/node_modules/ghoma/ghoma.js:197
    var prefixPos = buffer.indexOf(PREFIX);
                           ^
TypeError: Object Z�

My firmware is 1.8.26.

Any ideas?

@Brain0verflow

It seems that ghoma.js got a TypeError.

I’m sorry, but I’m not the author of ghoma.js, maybe you can contact him? see here:
https://www.npmjs.com/~rodney42

Did you follow ALL the steps 1-11 and 13-19 ?? I have two EMW302WFO with firmware 1.8.26, they are both running!

Did you made an allow rule in your firewall? Ports 3000, 4196 ? I have Windows and I was asked when I started ghoma-listeningserver at first time…(“Allow it in the firewall?” --> (Yes/No).

The error occurs on my Raspberry PI.
Tested under windows -> works.

I wrote an email to the author.

Edit: My NodeJS Version on the RPi was too old, it’s running now.

1 Like

@Brain0verflow
Ok, good to hear. Is above “Tutorial” easy to understand or is there something missing or not clear enough?

@Celaeno1
The tutorial is clear enough, good work.

1 Like

Hi.

Yesterday I bought an EMW302WFO and tried to use it with your solution. The firmware version of the socket is 1.8.26. I followed steps 1-11 and 13-14. Everything seems to be fine. However, when I open http://IP-Address:3000/list I only get an empty list: []

I configured the socket using this command:

root@d56ec58570a3:/ghoma/node_modules/ghoma# node config.js 192.168.178.48 192.168.178.43 3000
SEND      : HF-A11ASSISTHREAD
LISTENING : 0.0.0.0:37142
RECEIVE   : 192.168.178.48,ACCF23DBEC30,HF-LPB100
SEND      : +ok
SEND      : AT+VER
SEND      : AT+NETP=TCP,Client,3000,192.168.178.43
SEND      : AT+NETP
RECEIVE   : +ok=GAO,Outdoor,1.8.26


RECEIVE   : +ok


RECEIVE   : +ok=TCP,Client,3000,192.168.178.43


CLOSING

192.168.178.43 is the address where the server is running on port 3000. 192.168.178.48 is the ip of the socket.

The blue LED of the socket is blinking slowly.

The server is running within a Docker container. The only open port is TCP 3000.

Thanks for any help,
Dirk

Ok, I found the error. For me it wasn’t clear that the server opens two ports, 3000 as a web API server and 4196 as the G-Homa server. Therefore I has to set port 4196 as the control port using config.js.

Now, it works.

Dirk

Hi,

Use Port 4196 for the socket config.
Like in the example:
node config.js 192.168.100.55 192.168.100.44 4196

Thanks. It’s working now.

Dirk

1 Like

This topic has a Solution

Great work on here - I had a problem with the latest ghoma nodejs module and openhab. It appears to need a better filter to get the state updating correctly.

Anyway, if it helps anyone else I have a JavaScript transform and a docker container that encapsulates all the work by others.

Transform and docker file here. https://github.com/opulentrich/ghoma-docker

Docker container can run like this :
docker run -d -p 3000:3000 -p 4196:4196 -n ghoma-proxy opulentrich/ghoma-proxy

The config commands in this thread can be run like this
docker exec ghoma-proxy nodejs /node_modules/ghoma/config.js …

1 Like

This tutorial is very clear.

I’ve just set up this configuration for a plug with firmware 1.8.26.
It runs on a raspberry PI 2 without any issue.

Thanks a lot for your work.

1 Like

Hello everybody,
yesterday I had my first try on openhab. I installed it on my regular computer under win10 for first try.

I´ve (until now) only some G-Homa Sockets, so I used this tutorial to bring them up with openhab. It really works fine!! So thank you for your work.

But now, i want to get the socket working again with the original App of G-Homa until I have my raspi and some other items. I thought by resetting the socket with holding the knob until the led blinks fast would make it possible, but that doesn´t work.

Asking google for an “original” config brought me no solution. So could someone help me to get it work again?

Thank you!

@AlexS77

Press and hold the ON / OFF button on the WiFi power outlet for at least 20 seconds. All made
Settings are deleted. The LED flashes fast, you can add the deleted WiFi Smart Socket again.

I used to do this about 20 times today, but it doesn´t work…

Ironically it works after having sent my question here.
So the problem is solved!!

Thank you, @Celaeno1 !!

Hi, i just got this Outlet because the owner does not want to deal with it anymore… I tried to setup, could not with Android 10 Phone, and Then i tried with Android 8 phone, has some issues, meanwhile i found out the admin/admin login because the G Homa App did not want to show me the Outlet. The current state is that the G Homa app shows the outlet and i can switch it via local and remote network connection. Nice to have, just i would like to understand why the heck does the factory reset not reset the admin/admin password ? I cannot login after I changed the password for admin in the http webinterface of the Outlet… does someone of you know why a factory reset does not initialize the admin/admin login possibility anymore to the web frontend? or did this beast make a firmware update and now it has another password?
when i check at firmware update it states its the latest firmware but it does not show a mac address and no firmware version, both fields are empty???
any ideas are welcome and thank you!!! Anton

@ant0nwax

The webinterface is only visible with firmware lower or equal to 1.0.06.

I only know the login: admin/admin.

To reset the plug press 20 sec or longer on the button.

i get a login requester but even after resetting (20 sec) the admin admin combination does not work

@ant0nwax

If configuration via html-configuration (web interface) is not possible, then see steps 1-11 and 13-19.

Thanks, I would just like to change the password to admin admin :slight_smile:
i am not keen (YET) on using openhab