ARDUINO & BLUE IRIS SERIAL digital i/o DIO

Just remember that Sonoff unbeknowns to the man in the street has changed its chipset over iterations of models.
Check the firmware matches the part number of your Sonoff. (MPN)