Haven’t looked at the code, but perhaps the gateway code can be implemented in ESPimatic ?
-
Crossover topic: Mysensors wifi gateway using ESP8266
Like my projects and help? Consider donating electroneum etnjwAKGPqF6omQWRmpp9u2BPyVDG9VuyRQjNJ1S8yfBdfR9qeUQ46kRy8KS2CNqbpNLRrsgmNW6F2TMzxmZgPrh6KctrkrYbm
-
@Oitzu maybe, but I don’t have a lot of experience but I’m getting better at coffee script/pimatic.
Have to look how it works. It’s some kind of serial over TCP? Don’t know if there is a node library for it.
-
@sweebee said:
It’s some kind of serial over TCP? Don’t know if there is a node library for it.
Nah… i think it is just a simple plain TCP-Socket.
Maybe i also look at some point at it… the day i’m not totally frustrated with coffeescript… oh… wait. -
@Oitzu yea i had the same, but my editor (coda) was configured wrong so I got a lot of wrong indents. But now I can work fine with it.
-
mysensors has also a MQTT gateway which is essentially an ethernet gateway with an MQTT broker.
ESPEasy can easily use MQTT and so can pimatic. This might be an option as well. -
Never tried it, but If you use the mqtt version of mysensors. Does nodes like the pulsemeter(kWh) Work? The controller saves the pulsecount and the sensor asks for it.
-
And there is this: ESP Easy mysensors and ESP Easy MySensors Edition.
We are not the only ones.
-
Just found this: https://github.com/rakeshpai/mysensors-controller
This node library can use the Ethernet gateway. Let’s have a look at the code how he does it
-
FYI I think I got my solution working: I created 2 scripts to get a stable connection to my ESP8266 gateway.
First one is to get the status of my gateway. It simply checks for the serial device and is visualized by a shellpresencesensor.#!/bin/bash detect=$(ls /dev/tty* | grep ttyMS-Gateway) # check if detect is unset or empty if [ -z "$detect" ]; then echo "0" else echo "1" fi
Second is to restart pimatic, restart socat tunnel and check for succes.
#!/bin/bash pimatic.js stop for ((I=1; $I<=10;I++)); do /usr/bin/socat -d -d pty,link=/dev/ttyMS-Gateway,raw,echo=0,waitslave tcp:192.168.38.19:5003 & sleep 10 detect=$(ls /dev/tty* | grep ttyMS-Gateway) if [ -z "$detect" ]; then echo "Versuch $I erfolglos" else echo "geschafft! $I" break fi done pimatic.js start
I’m still testing this and those echos are only to tell me at which number of tries it was succesfull when doing it manually. I will add a dummyswitch in pimatic and do an auto-restart if the shellpresencesensor shows offline for too long.