I have a pump monitor which I would like to ring a buzzer at a remote location. I had hoped that ESP-NOW would allow me to do so.
Can anyone see why this would not work? Is it possible to use UDP (if not ESP-NOW) from one ESP8266 to ESP8266 while one is connected to WIFI?
Thanks
Zim
Advice on a remote buzzer alarm
Advice on a remote buzzer alarm
You do not have the required permissions to view the files attached to this post.
Re: Advice on a remote buzzer alarm
Hi Zim,
I believe what you want to do should work OK.
I have two modules talking to each other via ESP-NOW at the same time they are connected to my local wifi.
Receiver module...
Sender module...
notice in my sample code I have chosen to change the mac address of the receiving module.
If you change the mac address of a module this will cause your home router to issue a NEW IP address to that module which will likely be a different IP than it is initially assigned before running the code where the mac is changed.
I am only sending messages one way via espnow but I'm pretty sure you can use it bi-directionally.
Changing the mac address allows you to drop the code into various test modules and not have to change the mac address where the sender is sending its message to. EspNow uses mac addresses as the identifier.
This code is just partial from my system so if you need working code post back for more help.
cheers
dwight
I believe what you want to do should work OK.
I have two modules talking to each other via ESP-NOW at the same time they are connected to my local wifi.
Receiver module...
Code: [Local Link Removed for Guests]
option.mac "60:01:94:1E:EF:77" 'assign a new mac address, will cause router to assign a new IP
onEspNowMsg espMSG
gosub WebPage ' draw the webpage
espnow.begin
wait
espMSG:
Code here to act on incomming esp-now data
return
Code: [Local Link Removed for Guests]
Cap_MAC$ = "60:01:94:1E:EF:77" 'mac address of far end receiver
espnow.begin
espnow.add_peer Cap_MAC$ ' set the address of the receiver
onEspNowError status ' set the place where jump in case of TX error
gosub WebPage
wait
sendMessage:
espnow.write msg$ ' send the message to other module
return
If you change the mac address of a module this will cause your home router to issue a NEW IP address to that module which will likely be a different IP than it is initially assigned before running the code where the mac is changed.
I am only sending messages one way via espnow but I'm pretty sure you can use it bi-directionally.
Changing the mac address allows you to drop the code into various test modules and not have to change the mac address where the sender is sending its message to. EspNow uses mac addresses as the identifier.
This code is just partial from my system so if you need working code post back for more help.
cheers
dwight