HarringayMakerSpace / ESP-Now

ESP-Now Examples
300 stars 48 forks source link

ESP-Now with one master device #1

Open JoniR opened 7 years ago

JoniR commented 7 years ago

Hi, Thank you for good examples. I am just wondering before jumping extensive implementation. Do you guys think that this kind of scenario would be possible to implement with ESP-Now? So that I have various amount of battery powered ESP-Now enabled sensors which are sending data to one usb powered ESP-Now, from that one "master" ESP-Now, I can then push data over the Software Serial to "normal" ESP8266 which can then connect to normal wi-fi and for instance push values to MQTT.

What I am wondering, is it possible to have this kind of one "master" ESP-Now which then receive values from all others?

image

torntrousers commented 7 years ago

Yes thats exactly the kind of scenario thats suitable for ESP-Now, and the EspNowWatsonRestartingGateway in Github is written to support multiple remote sensors with the remote ESP's mac address used as part of the MQTT topic.

If there are lots of the battery powered sensors and they send readings often then there may be the odd collision causing a read to get lost, but the send is very quick - just milliseconds - so you'd need a lot sending often for that to be a significant issue.

YBIacous commented 6 years ago

Hello JoniR and torntrousers,

First: I'm a noob at programming.

I'd like to do the same schema as JoniR:

Now: I've difficulty to define the IP of the raspberry (on the sketch EspNowFromSerialGateway.ino) and also the fact that it as to be a MQTT message.

So I would be gratful to know if JoniR succeded and any help to do the same would be very appreciated.

Sorry for my English.

JoniR commented 6 years ago

Hi, Unfortunately I never implemented my idea. In fact, I am using Wemos D1 mini devices and for some reason (what I never investigated) chip crashed every time when message was received. This didn't happen with ESP-01 if I remember right. Anyway I think you should take an look at EspNowWatsonRestartingGateway.ino, there is code for MQTT

YBIacous commented 6 years ago

Thanks a lot, Yes, the EspNowWatsonRestartingGateway.ino contain the MQTT sketch.

As I have 8 sensors and transmission set to each minute, I like to implement the WIFIGateway solution rather than the EspNowWatsonRestartingGateway.ino as to not loose to much measure. And for that I have another question, how do you do the wiring between the two ESP8266 (ESPnow receiver and WIFI Gateway) for the serial communication? (just the TX and RX is not working for me)

Thank you