mdopp / simple-sonoff-server

Emulates the original sonoff-cloud-servers within your local network.
BSD 2-Clause "Simplified" License
144 stars 47 forks source link

server stops with error when Sonoff disconnected from mains power #5

Closed gerardwr closed 6 years ago

gerardwr commented 6 years ago

Hi, Your setup and server code runs great, thanks for sharing. I created a Python plugin for the Domoticz Homeautomation software that communicates with your Sonoff server, works great! https://github.com/gerardwr/Sonoff-Domoticz

I would like to mention a problem I had with the server. When I started using the server with just 1 Sonoff configured I had the problem that the server suddenly stopped when I powered the Sonof switch fully off (so disconnect from mains). This was a repeating problem.

Running the server on the commandline showed that an error occurred and the serversoftware was stopped. I'm afraid I lost the exact error text, but it was rather short, and seemed rather undescriptive (to me).

I tried to reproduce the error for you today, but it did not occur, maybe the weather ;-)

I saw this topic where 1 other user also experienced this problem: https://www.domoticz.com/forum/viewtopic.php?f=4&t=18470&p=163095&hilit=sonoff+remember+too#p163095

Not a very detailed "issue" I'm sure, but I thought I would mention it here anyway

Thx, keep up the good work :-)

mdopp commented 6 years ago

Hi, @creeble and @saryn did some refactoring, which seam to solve some bugs in the implementation, and made it more robust. And a Node-Red implementation was also added. With this change it should now be possible to use "sonoff.server.modules.js" and write your own wrapper that support listeners, without changing the core code (if you dont want to)

mdopp commented 6 years ago

@gerardwr any news?