remote relay using two esp8266 via device AP

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
joelmnz
New user
Posts: 2
Joined: 30 Oct 2018, 04:36

remote relay using two esp8266 via device AP

#1 Post by joelmnz » 30 Oct 2018, 04:50

Hi, apologies if there is already something on this form similar but there is allot on this form but I'm having trouble finding exactly what I need.

Goal / Requirements:
  • to have 2 devices connected to each other using an AP on one of the devices (AP host + client, they will NOT be connected to WiFi via a router, direct p2p is needed, needs to be stand alone)
  • Device One - (probably the host) will be connected to a voltage sensor (Analog pin A0)
  • Device Two - will be connected to a relay (most likely a SonOff or something).
  • When Device One reads the voltage and it gets over a defined value it will turn ON the realy on the 2nd device
  • When the voltage gets below a defined value it will turn OFF the relay on the 2nd device
I have tried a few firmware & I really like ESP Easy, can anyone suggest how I might do this using ESP Easy running on both devices (preferably) or I could code one of the devices (probably the server) to be the AP with voltage sensor and submit commands to the Sonoff (second device).

Any feedback is much appreciated.

norbertweber
New user
Posts: 1
Joined: 09 Jul 2016, 11:46

Re: remote relay using two esp8266 via device AP

#2 Post by norbertweber » 02 Nov 2018, 09:24

Hello Joël

I think what best would fit your needs is to have a look at the mesh networking capabilities of the ESP8266 / ESP32

https://github.com/Coopdis/easyMesh

User avatar
enesbcs
Normal user
Posts: 587
Joined: 18 Jun 2017, 11:02
Location: Békéscsaba, Hungary
Contact:

Re: remote relay using two esp8266 via device AP

#3 Post by enesbcs » 02 Nov 2018, 18:37

joelmnz wrote: 30 Oct 2018, 04:50 Goal / Requirements:
  • to have 2 devices connected to each other using an AP on one of the devices (AP host + client, they will NOT be connected to WiFi via a router, direct p2p is needed, needs to be stand alone)
  • Device One - (probably the host) will be connected to a voltage sensor (Analog pin A0)
  • Device Two - will be connected to a relay (most likely a SonOff or something).
  • When Device One reads the voltage and it gets over a defined value it will turn ON the realy on the 2nd device
  • When the voltage gets below a defined value it will turn OFF the relay on the 2nd device
I have tried a few firmware & I really like ESP Easy, can anyone suggest how I might do this using ESP Easy running on both devices (preferably) or I could code one of the devices (probably the server) to be the AP with voltage sensor and submit commands to the Sonoff (second device).

Any feedback is much appreciated.
It can be done with ESPEasy.

You can select one ESP with ESPEasy, and do not configure it's wifi, than it is remaining permanently in soft-AP mode, another ESP can join this soft-AP, and each one can controll the other one, if "ESPEasy P2P Networking" configured on them, and each of them numbered differently. (Unit1,Unit2...)
Look after at: SendTo <unit nr>, <command>
I've made a wireless bell extension in a very similar way with two NodeMCU, two relay and a 12V sounder.

joelmnz
New user
Posts: 2
Joined: 30 Oct 2018, 04:36

Re: remote relay using two esp8266 via device AP

#4 Post by joelmnz » 06 Nov 2018, 01:58

Thanks for the suggestions, I did manage to get 2 devices talking to each other but I don't want to leave the AP open in config mode, had to connect the device to my wifi to configure the AP password as I was unable to find a serial command for that and now cant force it to go into AP mode on boot.

As a test, I setup one device with the JustWiFi library acting as an AP & the other with esp easy and a OLED screen out putting the signal strength to test the distance I could get, unfortunately its no where enough so might have to go with an RF relay or something, really was looking forward to two way communication so I could tell if the client was offline (2 RF chips...).

Will keep trying, thanks.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: remote relay using two esp8266 via device AP

#5 Post by grovkillen » 06 Nov 2018, 05:50

Using rules you can set the unit into AP mode with this wifiapmode. You can use timers if you want it to only be active as AP for a certain amount of time.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests