To communicate with MySensors WiFi/Ethernet gateway I’m using Python script which run as cron job on my controller (Raspberry pi). Python script is used to receive all incoming and sending all out going commands through serial gateway to all MySensors nodes.

PiHome WiFi Gateway Starting-up

PiHome WiFi Gateway Starting-up

PiHome Message sending and receiving

PiHome Message sending and receiving

MySQL Table to For Incoming Messages

First you need to create table in MySQL database so we can save all incoming messages from wireless sensors to MySQL database. Simply create table or copy and past this script to create table.

MySQL Table to For Out-Going Messages

To send out commands to remote relays/nodes you need to create following table. This table and columns are self explanatory but if you need more deep knowledge you can refer to MySensors Serial Protocole

Python Script To Communicate with Serial Gateway

Python script runs in loop to capture all in incoming messages and check database base for any outgoing messages.