Page 5 of 6

Re: Interesting ESP8266 WiFi Module

Posted: Thursday 09 April 2015 14:24
by jadijkstra2000
Hmmm, I am getting errors, does anybody seen this before?

Getting : PANIC : unprotected error in call to Lua API (domoticz.lua:19: attemt to concatenate global 't' (a nil value)

Any idea?

I tried the Integer firmware and the float firmware of nodeMCU, the newest version..tried everything but keeping up getting this error :(

Re: Interesting ESP8266 WiFi Module

Posted: Thursday 09 April 2015 15:14
by ThinkPad
Error in your script (on line 19), can you post it here?

Re: Interesting ESP8266 WiFi Module

Posted: Thursday 09 April 2015 17:34
by jadijkstra2000
I think I found it :P

Am using a DHT11 for it, that won't work :)

Have a script now, but it is not working as I want.

Re: Interesting ESP8266 WiFi Module

Posted: Thursday 09 April 2015 18:52
by ThinkPad
Found this forum: http://www.mikrocontroller.net/topic/349219
Also some nice ESP8266 based projects there (Roomba controller, WiFi-outlet).

Re: Interesting ESP8266 WiFi Module

Posted: Saturday 11 April 2015 17:25
by arun
Some project with the ESP8266 i find quite interesting for domotica purposes is this one:
http://homes-smart.ru/index.php/oborudo ... arodmon-ru
http://homes-smart.ru/index.php/compone ... 66-english

Re: Interesting ESP8266 WiFi Module

Posted: Sunday 19 April 2015 11:05
by ThinkPad
I have this sketch working: http://harizanov.com/2014/11/esp8266-po ... r-reading/
Reads out a DHT22 temperature + humidity sensor and displays data on a webpage that is hosted by the ESP8266. Quite nice i must say!
But ofcourse i want the data in Domoticz, so i created this script:

Code: Select all

#!/bin/bash
# This script retrieves the temperature and humidity from the webpage
# generated by the code running on ESP8266 that is posted here
# http://harizanov.com/2014/11/esp8266-powered-web-server-led-control-dht22-temperaturehumidity-sensor-reading/

# Fill in variables
ESP_IP="192.168.4.248"
DOMO_IP="192.168.4.4"
DOMO_PORT="8084"
DOMO_IDX="121"

# Retrieve webpage and strip out relevant information and put information (position 13 & 16) into two variables (temp, hum)
curl -s http://$ESP_IP/dht22.tpl | grep "reading is" | awk '{print $13, $16;}' | sed 's/*C,//g' | while read temp hum
do
if awk "BEGIN {exit $hum <= 25 ? 0 : 1}"
then
	#echo "Dry"
    hum_status="2"
elif awk "BEGIN {exit $hum > 60 ? 0 : 1}"
then
    #echo "Wet"
    hum_status="3"
elif awk "BEGIN {exit (($hum >= 25)&&($hum <= 60)) ? 0 : 1}"
then
   	#echo "Comfortable"
    hum_status="1"    
else
    #echo "Normal"
    hum_status='0'  
fi	
# Send data to virtual sensor in Domoticz ("Temp + Humidity").
OUTPUT=`curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$DOMO_IDX&nvalue=0&svalue=$temp;$hum;$hum_status"`
done
I'm going to put this in my cron to run every minute.

Seems to work, but comments about improvements that can be made are always welcome. The humidity status (when is it 'comfortable', 'wet' etc) is based on a piece of Domoticz code: https://github.com/contactless/domoticz ... XNames.cpp

Re: Interesting ESP8266 WiFi Module

Posted: Saturday 25 April 2015 15:00
by SweetPants
Build my first ESP8266 (ESP-01) project http://www.domoticz.com/forum/viewtopic.php?f=38&t=6252.
Works great :mrgreen: :mrgreen:

Re: Interesting ESP8266 WiFi Module

Posted: Saturday 25 April 2015 16:53
by Mediacj
ThinkPad wrote:I have this sketch working: http://harizanov.com/2014/11/esp8266-po ... r-reading/
Reads out a DHT22 temperature + humidity sensor and displays data on a webpage that is hosted by the ESP8266. Quite nice i must say!
But ofcourse i want the data in Domoticz, so i created this script:

Code: Select all

#!/bin/bash
# This script retrieves the temperature and humidity from the webpage
# generated by the code running on ESP8266 that is posted here
# http://harizanov.com/2014/11/esp8266-powered-web-server-led-control-dht22-temperaturehumidity-sensor-reading/

# Fill in variables
ESP_IP="192.168.4.248"
DOMO_IP="192.168.4.4"
DOMO_PORT="8084"
DOMO_IDX="121"

# Retrieve webpage and strip out relevant information and put information (position 13 & 16) into two variables (temp, hum)
curl -s http://$ESP_IP/dht22.tpl | grep "reading is" | awk '{print $13, $16;}' | sed 's/*C,//g' | while read temp hum
do
if awk "BEGIN {exit $hum <= 25 ? 0 : 1}"
then
	#echo "Dry"
    hum_status="2"
elif awk "BEGIN {exit $hum > 60 ? 0 : 1}"
then
    #echo "Wet"
    hum_status="3"
elif awk "BEGIN {exit (($hum >= 25)&&($hum <= 60)) ? 0 : 1}"
then
   	#echo "Comfortable"
    hum_status="1"    
else
    #echo "Normal"
    hum_status='0'  
fi	
# Send data to virtual sensor in Domoticz ("Temp + Humidity").
OUTPUT=`curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$DOMO_IDX&nvalue=0&svalue=$temp;$hum;$hum_status"`
done
I'm going to put this in my cron to run every minute.

Seems to work, but comments about improvements that can be made are always welcome. The humidity status (when is it 'comfortable', 'wet' etc) is based on a piece of Domoticz code: https://github.com/contactless/domoticz ... XNames.cpp
Nice done!

I had seen this project to and thought how do I get the data in Domoticz without a http possibility this is a creative solution! I am going to try it this weekend.

Re: Interesting ESP8266 WiFi Module

Posted: Saturday 25 April 2015 17:10
by ThinkPad
Nice, let me hear your results.
The temperature/humidity scraping part works fine, but i am not sure about the part that translates a humidity level to a state ('Comfortable', 'Wet').

Re: Interesting ESP8266 WiFi Module

Posted: Saturday 09 May 2015 10:56
by gizmocuz
ThinkPad wrote:Nice, let me hear your results.
The temperature/humidity scraping part works fine, but i am not sure about the part that translates a humidity level to a state ('Comfortable', 'Wet').
Maybe this works:

Code: Select all

unsigned char Get_Humidity_Level(const unsigned char hlevel)
{
	if (hlevel<25)
		return humstat_dry;
	if (hlevel>60)
		return humstat_wet;
	if ((hlevel>=25)&&(hlevel<=60))
		return humstat_comfort;
	return humstat_normal;
}
where

Code: Select all

#define humstat_normal 0x0
#define humstat_comfort 0x1
#define humstat_dry 0x2
#define humstat_wet 0x3
bdw, is it not possible to send the update values from the ESP module directly to domoticz ?
I think i have read somewhere that you can use it in combination with 'MySensors' ?
Like making one gateway that receives updates from all node/childs ?
And able to send commands back from the gateway to the ESP (to control a light switch for example)

Sure you do not want to poll/control 20 of these things via scripts?

https://github.com/iot-playground/Ardui ... 266EasyIoT

Re: Interesting ESP8266 WiFi Module

Posted: Saturday 09 May 2015 16:54
by beamzer
bdw, is it not possible to send the update values from the ESP module directly to domoticz ?
I think i have read somewhere that you can use it in combination with 'MySensors' ?
Like making one gateway that receives updates from all node/childs ?
And able to send commands back from the gateway to the ESP (to control a light switch for example)
That would definitely be the way to go,
that way you could also let the device enter deep sleep to conserver power between updates
and it would probably possible to run of a battery for a long time

Re: Interesting ESP8266 WiFi Module

Posted: Saturday 09 May 2015 18:18
by ThinkPad
MySensors project is much better than ESP8266 if you are aiming at a low power consumption. My script (including the dry/wet/comfortable status) seems to work fine i must say.
It only seems the DHT22 warms up or so, the reading is not accurate anymore (1 degree too high) after a few days of 24/7 usage.

Re: Interesting WiFi Module

Posted: Monday 17 August 2015 12:07
by LanWolf
ThinkPad wrote:Did you really make something to monitor your fridge? Or is it just to have an example :P


Oh and i found this: https://github.com/beckdac/ESP8266-transparent-bridge
This is really basic firmware for the ESP that creates a totally transparent TCP socket to ESP UART0 bridge. Characters come in on one interface and go out the other.

Do you already have a serial project to which you just want to add WiFi? This is your ticket. No more dealing with the AT command set.
I think when i connect the ESP8266 to my smartmeter' P1-port, i can install something like ser2net and have a wireless smart meter :o 8-) ?
Something to try soon :P
Anybody tried this already ? Got a few esp8266 incoming :)

Re: Interesting WiFi Module

Posted: Monday 17 August 2015 12:12
by ThinkPad
LanWolf wrote:
ThinkPad wrote:Did you really make something to monitor your fridge? Or is it just to have an example :P


Oh and i found this: https://github.com/beckdac/ESP8266-transparent-bridge
This is really basic firmware for the ESP that creates a totally transparent TCP socket to ESP UART0 bridge. Characters come in on one interface and go out the other.

Do you already have a serial project to which you just want to add WiFi? This is your ticket. No more dealing with the AT command set.
I think when i connect the ESP8266 to my smartmeter' P1-port, i can install something like ser2net and have a wireless smart meter :o 8-) ?
Something to try soon :P
Anybody tried this already ? Got a few esp8266 incoming :)
I don't know if it would work the right way round.

When reading the description, it looks like it is from wifi --> serial, not serial --> wifi like we would need. But maybe it works, i haven't tried it.

Re: Interesting ESP8266 WiFi Module

Posted: Monday 17 August 2015 21:56
by Derik
I have 2 of this Esp modules...
Only 1 problem..
No windows drivers..
http://nl.aliexpress.com/item/ESP8266-s ... 33472.html
And:
http://nl.aliexpress.com/item/1PCS-ESP8 ... 18927.html

The idea was to run the easpeasy on this boards...
https://sourceforge.net/projects/espeasy/

Only i do not get it to work......

Some?

I have the board
I have the ide for arduino with loaded espaeasy.
I have sensors
I now how to compile and upload, to the board.
I do not how i set the boards in to the upload mode..

I mis the driver [ s] :-(
I run windows 8.

And for my help a sample sketch for espeasy give me a smile...

Re: Interesting ESP8266 WiFi Module

Posted: Tuesday 18 August 2015 0:16
by Raspberry Piet
Derik wrote:
The idea was to run the easpeasy on this boards...
https://sourceforge.net/projects/espeasy/

Only i do not get it to work......

Some?

I have the board
I have the ide for arduino with loaded espaeasy.
I have sensors
I now how to compile and upload, to the board.
I do not how i set the boards in to the upload mode..

I mis the driver [ s] :-(
I run windows 8.

And for my help a sample sketch for espeasy give me a smile...
Just tried it, successfully uploaded the sketch to an nodemcu board.
You have to add a specific url, see this tutorial:
https://github.com/esp8266/Arduino/blob ... ds-manager

Looks great this ESP Easy project!

Re: Interesting ESP8266 WiFi Module

Posted: Tuesday 18 August 2015 6:54
by Derik
Raspberry Piet wrote:
Derik wrote: Just tried it, successfully uploaded the sketch to an nodemcu board.
You have to add a specific url, see this tutorial:
https://github.com/esp8266/Arduino/blob ... ds-manager

Looks great this ESP Easy project!
Piet,

What board od you have?
And what driver you did install?

And the line you mean is the for the install of the esp. [ that is n problem.]
And how do you get the board in upload mode?

Re: Interesting ESP8266 WiFi Module

Posted: Tuesday 18 August 2015 14:36
by Timdgr
Derik wrote:http://nl.aliexpress.com/item/1PCS-ESP8 ... 18927.html
The idea was to run the easpeasy on this boards...
https://sourceforge.net/projects/espeasy/
As far as i know, many of these cheap chinese development boards use the ESP8266 only for Wifi and have a different chip to do the IO and other stuff. It can be hard to find schematics from these boards, but i've found one for a similar board. As you can see on that board, there's an STC 15L2K16S MCU that does the IO and other stuff. The ESP is only connected with this chip through the serial interface. So in order to change its prebuild function, you would need to reprogram the STC chip. I guess that the ESP is running stock AT firmware.

Your board is different but may also have a STC MCU... Try to find the schematics. It if has an STC MCU chip, running the ESP Easy firmware will likely not work with the onboard DHT11 etc, because they are not connected on the PCB to the ESP module.

Re: Interesting ESP8266 WiFi Module

Posted: Tuesday 18 August 2015 20:22
by Raspberry Piet
Derik wrote:
Raspberry Piet wrote:
Derik wrote: Just tried it, successfully uploaded the sketch to an nodemcu board.
You have to add a specific url, see this tutorial:
https://github.com/esp8266/Arduino/blob ... ds-manager

Looks great this ESP Easy project!
Piet,

What board od you have?
And what driver you did install?

And the line you mean is the for the install of the esp. [ that is n problem.]
And how do you get the board in upload mode?
I've uploaded the sketch to this NodeMcu board : link
This board has a CH340G chip for the usb connection.
Don't know if i ever downloaded a driver for it (already have arduino boards with same chip for a while)

Re: Interesting ESP8266 WiFi Module

Posted: Wednesday 19 August 2015 22:00
by Timdgr
Running the ESP Easy R13 sketch on a NodeMCU V1.0 board (ESP12E) with the CP2102 uart. Using Windows 7. No issues here...