Interesting ESP8266 WiFi Module Topic is solved

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

jadijkstra2000
Posts: 58
Joined: Monday 26 May 2014 10:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Interesting ESP8266 WiFi Module

Post 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 :(
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Interesting ESP8266 WiFi Module

Post by ThinkPad »

Error in your script (on line 19), can you post it here?
I am not active on this forum anymore.
jadijkstra2000
Posts: 58
Joined: Monday 26 May 2014 10:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Interesting ESP8266 WiFi Module

Post 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.
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Interesting ESP8266 WiFi Module

Post by ThinkPad »

Found this forum: http://www.mikrocontroller.net/topic/349219
Also some nice ESP8266 based projects there (Roomba controller, WiFi-outlet).
I am not active on this forum anymore.
arun
Posts: 1
Joined: Saturday 11 April 2015 17:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Yekaterinburg
Contact:

Re: Interesting ESP8266 WiFi Module

Post 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
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Interesting ESP8266 WiFi Module

Post 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
I am not active on this forum anymore.
SweetPants

Re: Interesting ESP8266 WiFi Module

Post by SweetPants »

Build my first ESP8266 (ESP-01) project http://www.domoticz.com/forum/viewtopic.php?f=38&t=6252.
Works great :mrgreen: :mrgreen:
User avatar
Mediacj
Posts: 74
Joined: Wednesday 11 February 2015 16:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Interesting ESP8266 WiFi Module

Post 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.
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Interesting ESP8266 WiFi Module

Post 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').
I am not active on this forum anymore.
User avatar
gizmocuz
Posts: 2350
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Interesting ESP8266 WiFi Module

Post 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
Quality outlives Quantity!
User avatar
beamzer
Posts: 19
Joined: Sunday 17 August 2014 20:18
Target OS: Raspberry Pi / ODroid
Domoticz version: stable
Contact:

Re: Interesting ESP8266 WiFi Module

Post 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
Domoticz stable on a Raspberry Pi 3
RFXtrx433E - RFLink - Smartmeter (through RasPi-Zero-W) - Hue - BMP180 - DHT22 - Wemos D1 Mini's with PIR
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Interesting ESP8266 WiFi Module

Post 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.
I am not active on this forum anymore.
LanWolf
Posts: 36
Joined: Wednesday 20 August 2014 10:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Interesting WiFi Module

Post 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 :)
*/ Just A Byte /*
ThinkPad
Posts: 890
Joined: Tuesday 30 September 2014 8:49
Target OS: Linux
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Interesting WiFi Module

Post 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.
I am not active on this forum anymore.
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Interesting ESP8266 WiFi Module

Post 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...
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
Raspberry Piet
Posts: 158
Joined: Saturday 11 January 2014 16:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: NL
Contact:

Re: Interesting ESP8266 WiFi Module

Post 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!
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Interesting ESP8266 WiFi Module

Post 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?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
Timdgr
Posts: 19
Joined: Tuesday 24 March 2015 8:26
Target OS: -
Domoticz version:
Contact:

Re: Interesting ESP8266 WiFi Module

Post 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.
Attachments
Blackboard.png
Blackboard.png (46.6 KiB) Viewed 7325 times
Raspberry Piet
Posts: 158
Joined: Saturday 11 January 2014 16:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: NL
Contact:

Re: Interesting ESP8266 WiFi Module

Post 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)
Timdgr
Posts: 19
Joined: Tuesday 24 March 2015 8:26
Target OS: -
Domoticz version:
Contact:

Re: Interesting ESP8266 WiFi Module

Post 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...
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest