Disclaimer

Please, proceed carefully following the tips published in this blog, specially when Main Power is involved. I'm not responsible for any damages caused by what is written in this blog.
Thank you
Showing posts with label sonoff pow. Show all posts
Showing posts with label sonoff pow. Show all posts

Wednesday, 26 July 2017

Home Automation System - Configuring the SONOFF with Tasmota Firmware




I'm ready to test TASMOTA firmware, just uploaded on my SONOFF POW.

You can find the upload procedure in my last post (http://domoticsduino.blogspot.it/2017/07/home-automation-system-first-sonoff.html). It was fine...From now on we couldn't restore the original firmware and we couldn't use the EWeLink App anymore

Hoping that the SONOFF will power up :)

Now, I will plug all the things together...paying attention to the Main Power

I use the following diagram (thanks to the official site...):


To perform the first test, I used a plug connected to the INPUT terminals of the SONOFF (L = Line, N = Neutral, E = Earth). Then I took an old lamp holder, connected to the OUTPUT terminals. Last thing to do...find a load...here is it...an old 100W bulb.






I connected the plug and the SONOFF powered up. The blue led flashed a couple of times and then shut off.

The first thing to do is configure the WIFI connection; there are two ways to do this task: the one I followed is performed using the web console; the second one is performed writing the WIFI SSID and PASSWORD on a config file, prior to compile and upload the firmware (here you can find more detail https://github.com/arendst/Sonoff-Tasmota/wiki/Upload#preliminary-configuration)

So, I use the capabilities of the push button to transform the SONOFF into an Access Point and access it through the web console

Following this guide


I discover how to use the button. In particular, the "4 short presses" procedure permits me to activate the access point and the integrated web server, so it becomes reachable and configurable.

Then I push the button 4 times and a new Wifi connection brings on...SONOFF XXXX...I join this network using a PC and browse http://192.168.4.1 on a browser. The configuration panel is in front of my eyes

I typed the WiFi details, named the device, saved and restart.

After a couple of seconds, the SONOFF joined my home WIFI network and takes a DHCP assigned local IP.

Through this IP, I could get the configuration panel again.

Here is it:



Clicking on Toggle SWITCH the bulb lights up...the web page display the current power consumption...another click and the bulb turns off. The device is working as expected...thanks god :)





Reading the TASMOTA docs, I found a procedure to calibrate it.

See https://github.com/arendst/Sonoff-Tasmota/wiki/Sonoff-Pow#calibration

In the next step I'll try the MQTT protocol.

Stay tuned

Sunday, 23 July 2017

Home Automation System - The first SONOFF - Uploading firmware




Ladies and Gentlemen, I'm glad to introduce you my first sonoff: the SONOFF POW



After a rapid test with EWeLink App I'm sure the device is working well; I'm ready to upload the TASMOTA firmware, to enhance the sonoff functionalities, in particular the MQTT protocol.

I borrow from Piero the USB-Serial adapter, because mine is still "in transit"...

Here is it: one thing to check is the jumper near the 4 serial pin...it has to be in the 3.3V position...


I open the website https://github.com/arendst/Sonoff-Tasmota/wiki, download the software and follow the step-by-step procedure.

I like Arduino IDE and so I decided to use it, instead of PlatformIO, so I follow the section "Arduino IDE Preparation" on wiki (https://github.com/arendst/Sonoff-Tasmota/wiki/Prerequisite#arduino-ide-preparation).

Now, it's time to solder the serial pins on the sonoff, so the board will be removed from the plastic case. In the Sonoff POW the serial interface is at the end of fhe board, near the phisical button.

See Hardware Preparation


You have to pay attention at the serial connections between adapter and board...

VCC -> VCC
TX -> RX
RX -> TX
GND -> GND

Thanks to Piero again, I can use a connector with colored cables which is already configured for the sonoff mapping



Using a MicroUSB - USB cable, I plug the adapter in the PC and install the FTDI driver. The sonoff must be restarted in "programming mode", keeping its button pushed for 2 or 3 seconds.

During this phase (and everytime the serial connection is plugged), the sonoff MUST BE disconnected from Main Voltage

If everything is OK, the device is ready for the firmware upload process.

Using the Arduino IDE, in just a couple of minutes the firmware will be uploaded on device (see Upload).

Now we are ready to play the game :)