ESP8266 Projects Blog
Home of CBDB / MPDMv4 /SmartMon Development boards (ESP-12/ESP-07).
Guidelines and ESP8266 programming examples using LUA, Eclipse and Arduino IDE, ESP Basic and many more!
Part 4 of the MPRSx8 + ESPEasy Tutorial - After having all the bits & pieces in place, ESPEasy Formware properly uploaded and configured, now is time for the Domoticz setup and testing the Control interface!
Part 3 of the MPRSx8 + ESPEasy Tutorial - This time we will take a deeper look on the ESPEasy Firmware configuration and preparing the MPRSx8 Board for Domoticz integration:
Part 2 of the series, ESPEasy Firmware Upload tutorial using a simple standard USB-to-Serial Adapter:
The story behind: Somebody was asking if is really possible to upload firmware with a simple USB to serial adapter, as the ones that are available all over the place. As you can see from the above step-by-step tutorial it is possible and is working very smooth. You are loosing the autoreset and autoupload capabilities of the USBProg board, but as long as you are doing rarely the firmware upload is not so bad. On the other hand, if you want to use it with Arduino IDE or anything else that means frequent upload then I think you will start looking after that functions sooner or later, I think more sooner than later :)
The install process is pretty straight forward so I will not insist to much on it:
1. Install Domoticz 2. Install CURL 3. Save LUA script in Domoticz \scripts\lua folder 4.
Check that you don't have any Firewall/AV/Whatever program blocking the
Network IN/OUT traffic for the needed programs and Ports !
For the used version of CURL for Windows installed I was forced to change a bit the sintax, nothing fancy, just see below:
UPDATE !! If you are using Domoticz under Windows, please take a look also at the PART3
Part 2 of the ESPEasy Series. This time we will go further and complete a full ESP8266 / Domoticz Dimmer setup on a RPi2 Board using the MPDMv4 Universal AC Dimmer Board.
commandArray = {} DomDevice = 'MPDMv4_Dimmer'; IP = '192.168.1.169'; PIN = "5"; if devicechanged[DomDevice] then if(devicechanged[DomDevice]=='Off') then print ("OFF dimm = "..uservariables['dimm']); CalcValue = 890; else if(devicechanged[DomDevice]=='On') then DomValue = uservariables['dimm']; print ("ON dimm = "..uservariables['dimm']); CalcValue = DomValue; else print("Other"); DomValue = otherdevices_svalues[DomDevice]; CalcValue = 900-(DomValue*9); commandArray['Variable:dimm'] = tostring(CalcValue); print ("dimm Level = "..uservariables['dimm']); end end runcommand = "curl 'http://" .. IP .. "/control?cmd=PWM," ..PIN.. "," .. CalcValue .. "'"; os.execute(runcommand); print("PWM calculated value= "..CalcValue); end return commandArray
You need to save it in your Domoticz folder under "/scripts/lua/" subfolder as "script_device_MPDMv4_Dimmer.lua"
If followed step-by-step setup as done in the Youtube Video Tutorial above and all OK, you should end up with a working MPDMv4 AC Dimmer interface as below:
In Part 3 you can find details about changes that need to be done for a Domoticz for Windows installation.
Happy Breadboarding!!
ESP Easy Series, Part 1: Firmware upload and MPDMv4 driver simple test
The ESP Easy firmware can be used to turn the ESP module into an easy
to use multifunction sensor device for Home Automation solutions, been easy to integrate it in setups based on Domoticz, OpenHUB, etc.
The configuration process of the ESP Easy is entirely web based, so once you've got
the firmware loaded, you don't need any other tool besides a common web
browser.
First thing that I want to mention, as I found that a lot of people
sometime forget about this simple one: You DAC/ADC/PWM, etc Input/Output
is as good as your Power Supply/Voltage regulator!! If you have a crap
power supply/regulator output with bad filtering & stuff, don't expect
miracles happening!
It is working OK as long as you don't have any blocking process running
on the ESP8266 that can badly interrupt your PWM signal (1/2 second and
more). With a bit of attention to some details and also for not to
complicated lighting setup scenarios is working very nice.
I will do also a more complicated setup example Youtube Video showing you the MPDMv4 AC Dimmer working OK driven directly by
ESP8266 PWM pin, connected as a daughter board on the MPRSx8 Home Automation board.
From Domoticz you can drive thru ESPEasy the MPRSx8 8ON/OFF AC Relays
AND MPDMv4 AC Dimmer channel without any problems at all!
MPDMv4 AC Dimmer board has a first order filter on the VCNT input so can handle even noisy PWM and decent level of duty cycle skipping/derating.
2.Dedicated PWM IC.
I have used with a lot of success the PCA9685, working very smooth and has no
problem related with ESP8266 workload process, etc. You can find more
about a PCA9685 Board here. Probably the best solution for multiple AC Dimmer boards (upto 16 per each PCA9685 Extension Board).
3. Digital driver using a dedicated DAC IC.
VCNT input voltage driven from a MCP4726 12 bit DAC output is working very smooth and has no problem related
with ESP8266 workload process, etc, same as with PCA9685.
As been a 12 Bit DAC it's giving you
very fine VCNT control. I have designed also a Dimmer board with
integrated DAC and digital control, but that's another story.