430 ESPnow and LoRa Network (incl. Repeaters and Gateways). A TTN replacement?
HTML-код
- Опубликовано: 19 авг 2024
- Today, I can present you a diamond: The Farm Data Relay System. A network using LoRa and ESPnow that does not rely on infrastructure like TTN. And it is not only for farms. It is universal.
My second channel: / @hb9bla
Links:
Farm Data Relay System: github.com/tim...
LoRa32 Board (SMA connector) : s.click.aliexp... or amzn.to/39WLmYb
T-Beam: s.click.aliexp... or amzn.to/39YmyPd
ESP8266 Development Board: s.click.aliexp... or amzn.to/3MQiak9
ESP-01: amzn.to/39T7hzk or s.click.aliexp...
The links above usually are affiliate links that support the channel (no additional cost for you).
Supporting Material and Blog Page: www.sensorsiot.org
Github: www.github.com...
My Patreon Page: / andreasspiess
Discord: / discord
If you want to support the channel, please use the links below to start your shopping. No additional charges for you, but I get a commission on your purchases to buy new stuff for the channel
My Amazon.com shop: www.amazon.com...
For Banggood bit.ly/2jAQEf4
For AliExpress: bit.ly/2B0yTLL
For Amazon.de: amzn.to/2r0ZCYI
For Amazon UK: amzn.to/2mxBaJf
For ebay.com: ebay.to/2DuYXBp
www.facebook.c...
/ spiessa
www.instructab...
Please do not try to email me. This communication channel is reserved for my primary job
As an Amazon Associate, I earn from qualifying purchases
#no#midroll#ads
Hello everyone, and thank you for the kind feedback on my project!
I'll be doing my best to address any questions that are asked here over the next couple days.
Cheers!
Great work Tim. I have a small farm in Australia and have implemented a similar LORA solution to get water tank readings displayed in the house. Your solution seems very robust and adaptable. I will definitely be learning from your example. Very well done.
Hi Timm! We need to join forces ! We have been working in similar approach for quite a while + ability to mix sensors from multiple vendors - use own platform. (locally)
Hi Tim, consider how MODBUS could be used as well.
Cool project. I never really liked automatic meshes. Too many tings that can go wrong.
May I recommend implementing one single simple config file for the whole network (probably in JSON) and each node simple picks the important things using it's id?
You could also define the routes that traffic should take that way (e.g. "node 2 via ESP-NOW to node 4", "node 4 via LORA to node 6", etc.)
@@MoritzvonSchweinitz I've been thinking somewhat similarly for a while. I think an outside application that allows you to configure the whole system would be just the beginning, my dream is a drag-and-drop interface built on top of satellite imagery like google maps. It could even crunch topographical data between the points you drop to estimate signal strengths and ranges. Then on the other end, the application guides you through flashing them and helps you keep track of which is which.
One day...
I love when people much smarter than me do all the heavy lifting and then share it. ♥
Agreed. Then I can hack it for my own situation.
I agree!
We stand on the shoulders of giants. And I am thankful for it ever day!
Well done Andreas, very usefull. I am busy developing a greenhouse control system for home / agriculture use. I was initially tinkering with lorawan, but a bit put off by gateway cost for each site. This looks much better.
Maybe you can join forces with Timm?
Dear Andreas ! Thank you for the interesting video. In fact we have been working with similar approach for quite a while (LOCAL MQTT + cloud MQTT talking to each other) - Francois - We need to meet/zoom discuss all together and join forces with Timm! (maybe through EU project as well!)
Now I have to learn how to parse all the data I'm going to generate, I'm not to hot with JSON but you and Timm have given me reason to study up a bit. Thank God for Steve Cope's tutorials. Thank you both.
JSON knowledge is very valuable and well worth to learn...
I made a similar project a few years ago, however I just used LoRa with two different configurations, long range but slow communication and short range but fast communication (LoRa can be configured for that too). The system was later integrated into the Home Assistant. It worked very well, only the Gateway (Raspberry pi with the Home Assistant) had access to the internet and the remaining devices (sensors and actuators) communicated to gateway through LoRa communication.
@Deon du Plooy Well the documentation is available online, but the document is in portuguese. If that's not a problem for you I can give you the link. There are more than 100 pages about the project.
Beyond that, there is a library that I modified for the project, I added encryption to the communication for example. Search for "pyLora". I hope it's useful to you, but note that I don't provide support for that.
The integration into HA can be a benefit for certain applications. I think with this project it can be done using MQTT. Or somebody writes a gateway which is integrated into HA…
@@AndreasSpiess Right, that's what I did. I created a custom module for HA. So the Raspberry Pi served as a HA server and also as the Lora gateway. A totally independent network but the HA could be connected to the internet of course.
The gateway could receive 1 message per second on fast communication and 1 message every 5 seconds on slow communication (includes ACK). The messages received directly by the HA. All communication was encrypted and confirmed with ACK messages. And it worked not only with sensors but also actuators. So it was pretty cool.
The MQTT configuration would certainly be simple than this...
Another great video, needs some further studies. Thanks for that! And my wife shouts HI from the background.. Have a gr8 Sunday and keep cool...
Thank you. And greetings to your wife!
Interesting project! Andreas, thanks for sharing your insights. This will definitely remain on my watchlist. 😀
Glad it was helpful!
And another interesting project, I did learn a lot of new things again, Thanks! And so cool to see the ESP01 used again, these little wonders never get the attention the deserve;)
I agree. They do not have a lot of pins, though…
Very good video and interesting project. Another thing to add to the to do list is security. This is becoming a great concern for all IOT.
its not so bad in remote areas (its a farm) and no connection to the internet. Not a very attractive target. What info to steal? Temperature and humidity? Not much to secure here. Its good for use case scenarios
what would you add in that scenario? A SSL connection at most.
As mentioned, incoming sensor data only needs to be secured in a few scenarios. When bi-directional communication is better implemented, I'll be looking into how security can be improved. Suggestions are encouraged!
This was a great one! Thank you very much. Looks like another project I need to investigate!
I will also try to replace TTN for my mailbox notifier…
I think localised LoRa would work fantastic for a high-head micro-hydro projects. Typically you have some long pipe going up a hill to a tank collecting water from a small stream. That could be a few hundred metres away. To maximise the energy produced, you'd have different sized nozzles at your turbine controlled by solenoid valves letting more or less water through while maintaining the full head pressure. A liquid level sensor on a LoRa board could be used to transmit the level in the tank at the top of the hill, opening more or less valves.
Joe Malovich and Land to House have the right setups to integrate this sort of sensor.
I was randomly popping in on these comments and I wanna say this is one of the coolest use-cases anyone's brought up for FDRS. If you or the folks you mentioned do something like this, please please send some info to the address in the FDRS readme. Thanks!👍
Thank You! This is the same type of project I am currently designing for my renewable energy system.
Cool. Maybe you can contribute to Timms project.
Very interesting video, I was about to try to do something similar myself for an apiary but didn't even know where to start. Thank you so much!
You are welcome!
unbelievable - I just finalized my project: "move out from WiFi to ESPnow". Similar approach (without LoRa) and observations:
1 - gateway: 1x ESP32 can do both: ESPnow and WiFi but not at the same time (no need for Serial), but:
- ESPnow message sending takes < 15ms (from start modem till receive confirmation) and if 2 messages come at the same time you either do queue on gateway or discard second one
- sending WiFi message from gateway to Home Assistant MQTT broker takes < 20ms
- ESPnow sensor wakes up, collects data, sends message to GW:
- ESP32 < 0.6s
- ESP32-S2 < 0.2s much faster so less battery consumption
- GW is always on, both way communication with HA
- since ESPnow sensors only talk 1 way: to GW, no commands to them, so OTA on routine basis: once a day it connects to web server where new Firmware might be and if found, it will perform OTA
2- ESPnow sensors:
- ESP32 - 180s hibernate (not deep sleep!), average current 4.5uA, work time: 0.6s with average 50mA, overall average consumption: 200uA
- ESP32-s2- 180s hibernate (not deep sleep!), average current 22uA, work time: 0.2s with average 38mA, overall average consumption: 80uA
so ESP32-S2 gives 16 months for 1000mAh battery - ESP32 "only" 5.5 months
CONCLUSION: better to work fast (0.2s vs 0.6s) than sleep current (22uA vs 4.5uA) to save battery
and for battery: no voltage - use MAX17048 to get real performance of the battery, i.e. from here: www.ebay.co.uk/sch/i.html?_from=R40&_trksid=p2512315.m570.l1313&_nkw=max17048&_sacat=0
EDIT:
ESPnow in UNICAST re-sends data to receiver if failed and returns the real outcome (success if received and confirmed by receiver), in BROADCAST mode it only confirms "message sent" - irrespective if received (for obvious reasons: broadcast)
If you use HA.... wait a while.... i do a more modular verstion of my WIFINow Module... INCLUDING OTA (and othe IP stuff for convinience)
@@emmoemminghaus6455 the "problem" is: if the ESPnow devices work for too long, the battery goes depleted fast, so I opted for "interval" OTA (once per 24h) rather than to force the device to wait for the command. But I will test also command from gateway to the sender in case OTA has been requested by HA for the specific device (command sent to gateway for specific device, and if the device sent data to gateway the order from gateway to the sender: "hey, do OTA ASAP please") - let me check how much more time it will be for the sender to stay ON. BTW HA makes it much easier than standalone MQTT broker and Node Red (I think)
ESP Now and Wifi at the same time is theoretically possible, but I had problems with channel selection. ESP Now always did channel 1 on the sender, no matter what I tried to set. If the home wifi wasn't on 1 the receiver was on a different channel than the sender which I couldn't change.
You can easily check ESP NOW with Wireshark if it sends on Channel 1 or any other. Just make sure your connected Wifi is on the channel you want to monitor.
@@drstefankrank
try this one then (on sender):
#define WIFI_CHANNEL 8
WiFi.mode(WIFI_MODE_STA);
esp_wifi_set_channel(WIFI_CHANNEL, WIFI_SECOND_CHAN_NONE);
and you don't need wireshark to confirm - receiver (if set up on that channel as well) will tell you the same
@@drstefankrank If Wifi now where locked to channel 1 then it would be forbidden to use it in asia.... Only because there are a few dumb devices this does not mean that you cant use other channels. As i sad in another post here the problem is the channel the AP connection selects.
Very interesting project Andreas! Thank you. 2 years ago when I played with my Ebyte LoRa modules I tried to build a mesh network (those devices are cheap but can't use LoRaWAN). You set them on individual addresses and let them decide the communication paths by the dB level they measure. It worked well for a few but I assumed at that time the messages to keep the network alive might spam the airtime and didn't pursue it. This is a star network as you explained so a different idea. 👍
You are right. Mesh network algorithms are not easy…
@@AndreasSpiess With "star" networks you can develop your own security and hierarchy. Otherwise it can become a big mesh. (sorry, couldn't resist)
@@hippie-io7225 Yesh!
Great find, and informative video, thanks for sharing
You are welcome!
Excellent and very promising for the future !
I agree!
I live in a rural area and several of my neighbours passed retirement several years ago. With at least 15 minutes for fire department or ambulance to get here I've pondered some kind of "neighbour aid" system for a while, I'll be looking into this project. (Need to cover an area of about 1x2 km and 20 houses if all are interested)
Should be possible if you find a point for the LoRa gateway where all houses have line of sight. Or you need a combination of nodes and repeaters.
@@AndreasSpiess
Line of sight definitely not possible, from some houses one sees nothing but forest. Up to about 300m between houses.
My spontaneous thought is to use a message-ID created by the event, broadcast that for a while and also have receiving stations repeat the same.
Perhaps a bit "talky" but this is after all a very important message that rarely (ideally never) gets used.
Line of sight can include woods. But no hills. You have to test.
I think I generally agree with your "talky" idea. Send out to everyone in range. You can technically have a repeater send every packet it receives back out over broadcast, though I think this could cause feedback loops 🤔 I haven't tried... Still it would tell you if a loved one is in trouble though. Very interesting application, btw. Keep in touch!
@@timmb2512 My thinking is to use a message-ID to avoid feedback loops. Probably something like "house number + event type + counter/time stamp". That way a receiving unit would only re-broadcast even if it gets the same message from several units.
Likely a good idea to include an "all good" message once a day or so - that way a faulty device can be noticed.
Currently I'm thinking three "triggers"
* Fire alarm (linked to commercial alarm, that sensing and responsibility I prefer to leave to pro's).
* Urgent help needed (First aid needed until ambulance arrives)
* Need aid (only triggers selected neighbours)
Again a very interesting and as usual well-made video!
Thank you!
Beautiful! Something like this integrated with the Meshtastic project would be great, they're working on MQTT integration and would also provide that command and control capability 🙂
Meshtastic expands in the right direction. It is more an adhoc network while this one is more for standard sensor applications, I think.
I'm building the exact same thing (for single grow room), but using just ESP between sensor modules, relay modules, and good old wifi routers for connecting to the internet. Though mine is on a small scale, so MQTT seems like it just adds indirection. I'm using a just sensor and controller modules, no repeater gateways. It's super simple and highly configurable using a regular computer web browser for the UI
Seems to be a good project for you needs!
Dear Andreas, you are a Genius !!! Thanks very much !
You are welcome!
Damn! I'm doing it (started 2 months ago). I thought how aren't people doing it.
Now you know that you are not alone ;-)
Clever! I really like ESPnow, has not occured to me to couple it with LoRa.
I thought it is a good idea because they are complimentary.
Nice. I wrote this for my home network but it's nowhere near as nicely engineered as yours. I went complex with platformio and esp-idf freertos though... Maybe I should swap to yours! Very well made video as always :)
Or maybe you can contribute some of your ideas to Timms project?
I am soon building an ESPnow product for farms, so this video caught my eye :)
Perfect! Maybe you join forces with Timm?
@@AndreasSpiess He and I are going slightly different directions, and my code is mostly finished, but I might browse his code for ideas. For one, I'm using MicroPy. But I might pick through his code looking at the repeater bit.
@@cdevidalDid they ever get ESP-NOW to work with MicroPy? I've often considered that you could make FDRS (my project) useful as an ESP-NOW modem attached to MicroPython devices via serial.
@@timmb2512 Glenn20 has a patch and it’s almost ready to be merged into the mainline. Another difference between yours and mine, I’m doing bidirectional comms. That may prevent me from using repeaters, I don’t know. Can the AT mode issue ESPnow commands? I know the new ESP32 AT firmwares are quite advanced. Then you could use them as a modem.
@@cdevidal I don't think it's supported in AT mode, unless it happened recently.
Can you make a follow up video with the latest update of the project, like the controller , and maybe some node red flows to that
So far I have no such plans.
Great video as always 👍
Thanks for sharing your expirence with all of us:-)
You are welcome!
Instant like! I hope you had fun on your motorcycle tour.
Yes, we had a lot of fun. I returned three days ago.
Excellent. You really do a great job!
It was mainly Timms work.
@@AndreasSpiess I think you might be a little confused about "work" versus "value" which is analogous to "features" versus "benefits." If you'd like me to explain in more detail, please let me know.
this looks like it could have a lot of potential for (other than farms) managing large plots of land or woodland like for instance having thermal and smoke sensors using small solar panels and a battery scattered around woodland to make catching fires early easier. also could be cool building one of these networks out over a town or city that tracks roughly how busy areas are and also trafic using things like millimeter wave and radar sensors all going to a central node that publishes a heat map of an area that is independent of company like google or even independent of weather people are carrying phones
Exactly! These are the kinds of applications I dreamt of while designing the system. I used to have a radar motion detector sketch included, I just need to update it and re-upload.
What cool would be if you could have different recievers. So that you could communicate similar how internet works over different range extenders to the board that needs the information. But that's probably difficult to put into practice. Would probably need to know the localization of the recievers to connect over the most efficient way to them. Maybe could test always when a new sensor adds to the network testing the shortest connection to it like counting how many range extenders it has taken to reach the destination. The strength of the signal could also be clue but probably is not needed. But when the sensor is a moving target it's different locations all the time
Hi @Andeas one more comment about the range of espnow Vs WiFi. I think practically it is not right to say that they both are the same. I know they operate on the same freq but then the connection process for both of them is vastly different due to which the range gets affected. To give an example, I have one ESP gateway for my espnow sensors placed on the first floor and all sensors from my roof (at G+2 level) to ground floor can easily reach it. The total time it takes for a sensor to wake up, do its thing and transmit is barely 80ms. Comparing this to a WiFi connection - even if there is weak signal present , it can never make a connection and hence considered out of range. So in my experience espnow has an excellent range as compared to WiFi.
Thank you for sharing your experience. I will have to do some tests.
Hi @Andreas , Very nice video and very nice concept. I will be watching this space as I also switched from wifi to to espnow for all my sensors. Also, to let you know , it is possible to run both espnow and WiFi Station on the same ESP at the same time. I run my setup where an ESP01 (yes, you read it right !!) acts as a gateway to receive espnow messages and relays them to a MQTT server. It has been running without issues since the last 4-5 months. Forgot to mention that the only limitation on it is that the gateway ESP (and hence the other nodes) has to be on the same channel as the WiFi SSID which is just one extra piece of code to determine the same.
Interesting to only use an ESP-01 as a gateway. Maybe Timm has a look at your comment!
WiFi and ESP-NOW work if they are both on the same channel. If the user were to set all sensors and gateways to run on the channel that their WiFi router is on then that would work. From my perspective, this would have been too much to ask of a new user who is less knowledgeable about networking. I could imagine a lot of beginners contacting me asking why their system stopped working when their WiFi router switched channels on them.
However: I'm planning to make the WiFi channel modifiable as a global soon.
@@timmb2512 I solved this issue on the sensor node by taking the SSID of the WiFi router , and scanning the same to obtain the channel. also a retry mechanism where if message delivery fails, it again scans to see if the channel has changed from last time. I also store the channel in EEPROM to avoid wasting ~2 sec in scanning every time. You can view my code in the repo here : github.com/vks007/public-projects/blob/master/include/espnowUtil.h
@@vks002 This is one of my favorite workarounds, the other way being to cycle through all of the channels and see what gets a response. However, what would happen if a sensor is separated from the gateway by a repeater? You could have every single gateway/repeater broadcast an AP, but keeping them all updated will lead to overhead that I'm just not ready for right now. I definitely won't rule it out forever, I just want to focus on other aspects of development for now. You are more than welcome to try adding your method to FDRS and reporting back/submitting a pull request.
Very very usefull, but as you mentioned adding support to send commands to eg. run actuator, and msg recieved confirmation would complete this wounder full idea.
We all should contribute in completing this project.
as I explained in the above comment, ESPnow in unicast configuration gets the "message received" confirmation and you can check it on callback_on_sent function. Problem is with broadcast only. Btw the question is what to do with the "sent failed": repeat instead of going to sleep or go to sleep and try the next time - the answer probably depends what is more important: regular temperature/humidity update (then repeat) or "let me see the values next time" so go to sleep
@@zyghom sure, It woul be more important in sending commands, where you want to know if some engine or light or something is switched or not. But there comes question of waking up from sleep.
@@kzstmla for critical situations like this, forget sleeping then. The "only" ways to wake up ESP32 are: timer or gpio, right? So when it sleeps you cannot do much unless you can "touch it" this way or another or wait for the timer to expire. But then how to touch it if it is remote? Another receiver? That is too much I think. Light sleep? Hmm, still in mA so not much of battery saving. Just thinking loudly but if you find a way let us know ;-)
@@zyghom I am not sure how good solution is timing, as i doubt its precision, unless you have some wide time slot when you expect something and then to sync times every time something happens
@@kzstmla I got lost: which timing you are talking about?
It's nice and solves problems, but limited to highly static building of the library by defines (No dynamic configuration of any).
However if that's not a real case, it's not needed.
Maybe you add your knowledge to improve it?
Good one..clear explanation
Thank you!
Thanks, a wonderful lesson!
Glad you liked it!
Great video, as usual. I am a heavy user of ESP-NOW, as compared to standard WiFi+MQTT it saves a lot of battery time, 0.5s vs 5s wake-up to sleep time, in my case. The ESP-receiver and MQTT gateway are on a power supply, of course. It does not seem popular, who knows why…
I can confirm that a single ESP mcu cannot work on both ESP-NOW and WiFi networks, or at least I could not manage to do so. 😅
It seems it is possible, but only on one channel (see other comments). This is why I will not do it.
I think the better solution will be a ZigBee network sensors are production level and not DIY, Routers can be powered externally with solar panels. And all sensors would use the same protocol. It will be more costly but with less caviets.
Zigbee is a very good protocol. However I do not know how to build my own sensors for the moment. And Zigbee has a very limited range similar to BLE. LoRa has a very big range.
@@AndreasSpiess You don't have to build your own sensors that's the whole idea :) 💡
However for ranging issue ZigBee routers costs about 6$ each + another 13$ for solar and 5v converters and since they work as mesh you can put as many as needed, and message guarantee to arrive ( or at least you can watch network health ).
You can have wifi and espnow running at the same time. I do this in a esp32 motion detector talking to a esp32 light switch which is connected to the router as well.
Thank you. Maybe Timm has a look if he can live with the restriction of using the same channel.
Thank you. Maybe Timm has a look if he can live with the restriction of using the same channel.
Very nice I wish I would have seen this before I designed this system in micropython.
I am sure you learned a lot!
Super fun! Love it. Thanks!
You are welcome!
you and your videos are the best
Thank you!
Hello Mr Spiess
many thanks for info and advises. Actually i am in direct contact with Timm Bogner, he has quite a lot of experience with different hardware. Also his software repository is now capable to do bi-directional communication between nodes. I ordered new hardware and will do some additional tests soon. Best regards and a good time wishes Peter
Cool. So I can start the remodeling of my mailbox sensor. I waited for the bi-directional feature...
@@AndreasSpiess Yes, according Timm, the job is done, the new code uploaded to the github repository and he was already testing the latest solution. I am looking forward to do the tests with my new hardware, perhaps next week. Please let us know about the success of your postbox application for (walking) lazy developers ;-)
Thank you.
You are welcome!
Impressive! I wonder if it is possible to use esp-now directly on a sonoff basic.
Why not?
Wow, what a great tool :) The test setup runs smoothly so far. For a productive environment, it would be important that MQTT-credentials can be defined. Is this in the backlog?
Thanks! Glad to hear! This was recently implemented. In fdrs_config.h:
#define MQTT_USER
#define MQTT_PASS
You can also edit them in the globals file.
@@timmb2512 Perfect 👍Thank you very much!
FDRS + Mosquitto (MQTT broker) + Home Assistant (Dashboard & Logic) is a real dream team 😊
Looking forward to an update regarding commands / controllers & to have another accompanying video would be great 😉
You're on the right track. Now rediscover UWB and ATM and bingo...you're there...and even way beyond there.
What is ATM (other than a money machine)?
You can use both ESPNOW and WiFi at the same time. I use it in my ESPNOW weather station. The trick is both the WiFi and ESPNOW must use the same channel, and when my AP restarts, it just picks a random channel, so when my ESPNOW to WiFi gateway reconnects to WiFi, it is no longer listening on the same channel as the weather station is transmitting on. My solution is to have the gateway broadcast an SSID (which contains the channel info), and every 1/2 the weather station looks for that SSID, and sets the channel to what the gateway is currently using. I could have just hard coded my channel in the AP, gateway and weather station, but I like to avoid hard coding configurations like that.
Thank you for the info! I new that there are some restrictions. So it is probably easier to spend an ESP-01 to avoid any hassle….
What a great invention! I was wondering, can mqtt data from the gateway be sent with auto discovery format for home assistant?
You have to ask the creator. However, auto discovery is only a nice feature. You easily can add any MQTT signal to HA.
Hi Andreas, I don't understand how you can configure the same gateway to interpret LoRa messages and also ESP_NOW. Please, could you give me a hint with that?
Maybe you ask on the project Github page. There you should get help. I do not know all details :-(
I hope my question does not sound too stupid: I'm finally back from sea (working as a merchant mariner) and trying to better understand this whole concept. Everytime I leave, I miss so much and forget a lot. I am trying to come up with a way to transmit sensor data in real time from an amateur (hobby) rocket to a ground station. I'd like to be able to receive sensor data from altimeter(s), GPS, temperature, camera video (possibly), etc.
So, I am wondering if this application could fill the bill. ANd, I suppose this is at the 2.4 gHz area. Am I right?
I do not know the distance and if ESPnow would work. You have to test. ESPnow of course is faster and easier than LoRa. If the distance is too big, LoRa is the way to go. Start with SF7 which is the fastest mode. That should work in any case. You only need a sensor (which you have to program) and a gateway (either one or two modules) as described in the video
Do I understand correctly that it is not possible to send a switching command to a remote microcontroller over LoRa. Why is that?
AFAIK it is now implemented.
Very interesting approach would like to find out if the data buffers would work for the the following. If you were to connect a GPS to a UART is there enough space to program it with the ability to parse the data and transmit only selected data i.e. position data? Would be nice for my hobby of flying model airplanes where sometimes things don't always work out as planned and you can spend days looking for them in the woods. Thanks
There's a GPS sketch that was recently added to the Sensors folder of the repo.
I'd like to get into model aircraft one day. The RUclips channel "rctestflight" has always been one of my faves and he sort of inspired me to take this project public.
Using FDRS for an itsy bitsy black box would be pretty cool. The trick would be to conserve battery once a crash has occurred. Find the location once and save it, then transmit it at intervals without reconnecting to the satellite. Perhaps even better to have the GPS run all the time off of the motor battery, but feed location into the "black box" which has its own transmitter battery as a failsafe.
Model rocketeers may be into this general idea too!
@@timmb2512 I've been flying them for many years. I need to begin with testing since most of my planes use Lipo batteries would need to see if power from a 5V UBEC/SBEC connected to the on-board battery is clean enough to operate the ESP32. Next would be RF testing since both the RC receiver and the Lora device operate in the 2.4 ghz range. Hope to get started testing soon still putting stuff away from field day (last weekend) I'm into Ham radio too.
I am doing the same, but with nRf24 in mesh config... with MQTT gateway from nRF to Wifi. nRF mesh is pretty cool, since it 'configures' it self when nodes come and go or move around.
Cool project! I found that the NRFs were pretty limited compared to todays possibilities. Meshes are very easy for the application. However not easy to make them stable and keep the overhead under control. Good you were able to get these things solved.
@@AndreasSpiess Not sure, I found the capability not less than what an MQTT end client / server would require. You need to plan a bit more structured when it comes to the protocol, or data exchange over nRF. I am packing my data into a struct{x,y,z} and have the nRF handle the transmission. A bit of timeout/retry handling vs. node reboots and it becomes a nearly self healing system. ESPnow I never tried, but rather stick to a MQTT layer on a ESP.
@@SarahKchannel If you are sure you stay below the 32 bytes or so, you are right. I also used structs for this purpose.
Good video
Thanks!
8:44 ESP-Now and WiFi can work on the same board. They have to be on the same channel. It's easy to configure a channel on an ESP device but configuring a WiFi channel depends upon Admin access. I have used ESP Soft-AP as a WiFi and set the ESP-Now and WiFi channel. It works flawlessly. If you are going to use a WiFi connected to the internet, even being on the same channel it is possible that packets get lost. I will try to fix this issue, if it works I'll tell you.
Thank you for your info. So I will keep it simple with my ESP-01 to avoid this limitation…
Great video! 73! 🙂
Thank you!
@Andreas: ESPNow and Wifi run togeather...
To be exact ESPNow simple usese Wifi "manufacturer message" packets.
The only problem i discovered so far is the Wifi Channel must be the same for Wifi and ESP Now receive (Channel of Wifi AP rules here).
you are right: channels must be the same (which should not be a problem - you control your AP). But I am not sure if you can do 2 things at the same EXACT time: talk/listen to ESPnow and talk/listen to WiFi - probably not. So when WiFi is on AND in use (send/receive message) then ESPnow incoming message probably is lost (I did not check it thoroughly yet but my observation shows this)
Maybe somebody takes care of that part of the project and writes an integrated gateway. For the moment the addition of an ESP-01 is cheap and it worked…
@@zyghom There is no Problem listening or sending both (except the Channels i mention). ESP now _IS_ Wifi, but w/o the need for a managing AP
@@emmoemminghaus6455 that is what I just said ;-) But can 1 radio talk to 2 devices at the SAME time? (sensor sends data over ESPnow and Gateway sends data to MQTT server at the same millisecond)
This is the precise issue. All devices need to be on the same channel, but the MQTT gateway changes channels to match the WiFi router it is paired with. Trying to match every device in the system to the channel that the first one is using would add too much complexity and overhead. Eventually I may add an option to choose what channel everything runs on as you are flashing the devices, but I haven't had a chance to test that.
I tried to use Espnow but the signal was very poor. Only for couple meters.
Does anybody know how to fix this?
Strange. It should be similar to WiFi.
Great video!
Indeed a diamond of a topic!
Question: The esp-now protocol provides a callback function -- esp_now_register_send_cb() -- which returns an ACK.
Can you opine on what that ACK can possibly tell the sending device and what it does NOT tell the sending device?
Best.
Maybe Timm can answer this question. I would create an issue in his project.
hanks I'm working on some espnow blind motors as needs to be battery powered WIFI is to power hungry
I am not sure if ESPnow solves your problem because the ESP32 consumes quite some power if it is always on...
Thanks for another interesting video Andreas.
I used the MySensors project to do this job. It was based on the NRF24 for short range (2.4GHz) and also can do LoRa with the RF95 type boards at both 433 MHz and 868/915MHz.
One advantage of MySensors is that is is a tree network (relays) and it can do actuator commands etc.
I like ESP-Now but I reckon BLE is actually better as most smartphones are equipped for BLE these days so they can be included in the sensor network as well as a sensor and/or a controller if you feel like creating an android app for it!
Patrick
I like BLE too. But for me it is still quite complex and I do not understand most of it. ESP-Now is easier for me...
Hi Andreas. Excellent video... Do you think it would be possible unify sensor values on gateway and send it to TTN gateway?
Why not? Maybe you can add a new Transport like Serial.
I've thought about this, but I don't have a TTN gateway nearby to test things with. If I did, this project may not exist 😁
Nice, I developed a very similar comunication protocol for a Wide area sensor network base don LoRa only. I’m using an apikey to discard all the messages not generated from my network’s node. How do you manage this problem? Do you encript your data? Your videos are always inspiring. Thanks
Maybe Timm can give you an answer?
No encryption is used. I created a 5-byte header for LoRa packets in which the first 3 bytes of the LoRa packet contain the recipient's address, and the next two are the sender's address. The device only responds to packets that start with its own address.
I use one node as gateway, that also does WiFi. I have a D1 Mini Pro in my mailbox, which sends the ESP-NOW message to my gateway. When my gateway has received a message, it will restart the ESP, connect to WiFi, send MQTT message, reboot the ESP, and go back into ESP-NOW gateway state. Whole process takes ~3 seconds.
Good project! You just have to be sure than no other message arrives during the downtime…
@@AndreasSpiess Only got 1 slave and 1 master, so no worries. Not the best for reusability, but it's ok
Nice video again with nice framework for low power network. Can you please provide some power profile data for sensor node device? I do not have Nordic power profiler which you have.
Thank you.
I made some videos about LoRa and ESP nodes.
Great job , I succeed to build a couple of Sensor but i can't use the data because I can't split the json format with node red , any one help me to do it ? Thanks
Just google. You only have to set a tick mark...
Dear Mr Spiess, great video again.
Nice tutorial, i was testing it with my LoRa GPS Modules, time keeping works great so far ! For sensor gate detection, i do some tests with radar sensors, many thanks for those tutorials too! As you mentioned it, there are two restrictions in this kind of sensor-network: no bi-directional communication with commands and no acknowledgement of the correct delivery of a data package. The time gates have also the task to communicate with the competitors , when the can start the run. Do You have any hints or ideas, about to solve this ?
Many thanks and best regards, Peter
I hope that Timm will introduce the backchannel and the acknowledgements. AFAIK he already works on it. Maybe you check the project from time-to-time.
Concerning your question: I do not understand what communication and which competitors you mean.
In the examples at 9:40 & 9:50 where ESPnow is not being used, am I correct in assuming that just a LoRa32 board alone could be used as the gateway that bridges between LoRa and MQTT?
Yep! If you aren't planning to use ESP-NOW, you can use LoRa and MQTT together. I haven't done this yet, tbh, so I'd love to hear how it goes.
@@timmb2512 I can confirm that it works perfectly with just the single LoRa32 board if ESPnow is not being used. The only little problem I ran into was that my MQTT broker needed a username and password. I added them into both the global and local definitions. I read you are considering using something like WiFiManager to manage WiFi credentials instead of hard coding them. MQTT Username and password might be another couple variables that could be managed in the same way.
I have a use case I am working on where I need to report sensor values along a river 5 miles. One sensor each mile. I think I needed to use a mesh network for the farthest node to connect to the gateway. Do you know if the repeater can also send its own sensor data with this approach?
At the moment, there isn't a way to have gateways report their own sensor readings.
I would recommend linking the gateways via LoRa and using ESP-NOW to communicate between the gateway and a nearby sensor.
You just gave me a great idea though: I'm going to add serial as an output option for the sensor sketch, then it could be hard-wired to a gateway, thus eliminating the ESP-NOW jump between sensor and gateway.
Can I use ESP-NOW to listen "non-stop"? I want to control it via alexa. So I am looking to have it working as a receiver.
The ESPnow connection should be on as long as both devices are powered.
Do you have any information on the RYLR998 and ESP32 usage? I am having a hell of a time trying to get it working on the RX2 and TX2 pins and can't figure out what I am doing wrong. I would happily boy you a set and send them to you.
I never used them (they are quite pricey for what they are). So I do not think many of my viewers would be interested.
Grate project and great idea.How to send analog data from place where is no wifi by Lora ebyte UART E22 or E32 series to esp 8266 or esp32 to manual switch relays on and off?
You have to figure this out yourself. I do not know :-(
@@AndreasSpiess Thanks for help;(
Sir can we create a similar network and send not just sensor data but low size images with espnow or some other method without wifi ? Maybe I am getting too ambitious ?
With ESP-Now you should have some capacity. You just have to chop the picture and re-assemble it at the receiver.
Hi Andreas, how can we make use use of old WIFI antennas to detect radio signals and track them on our 💻?
I mean.. you kinda can only detect Wifi very well with an Wifi Antenna.
And what kind of tracking? There are different kinds. Location, direction, just if its there, what its sending..
You connect the antenna to a receiver as always.
Good one
Thank you!
Very cool!
I agree!
hey how about Swarm technologies?sounds cool to me..
Maybe too big for a maker like me...
They should talk to the MySensors people. There's at least 75% overlap.
Others mentioned also MySensors. I never used it.
Valeu!
Thank you for your support!
Brilliant. Can’t run WiFi and BLE at the same time? Just use two devices. They’re cheap.
Only change, when hams hear LoRa they need to say APRS.
I made a video on my second channel about LoRa APRS…
Awesome!!
Thank you!
Great video and an exciting project. I was wondering if Andreas or others could provide a hand. I've recently made a weather station project consisting of an IR, light sensor, and ESP32 MCU to monitor sky conditions, especially skies impacted by light pollution, a type of Sky Quality Meter. The plan is to place this several of these SQM sensors to monitor the sky quality in our local, national park and measure the developing light pollution, which you may already know impacts flora and fauna. That way, factual data can be recorded and presented to the local authorities to take action. As you can imagine, the sensors are needed to be placed in remote areas in different places where Wifi is not available, and Lora seems to provide that solution. Any help or ideas is highly appreciated. 😊
LoRa sounds perfect!
Just select the sensor you need an create the sketch to read it. The rest is using the LoRa example of this library.
I like to see more of ESP NOW and its limitations. It says max peers is 20, but is that only for the sender to send to max 20 devices or does it also affect a receiver which wants to get data from more than 20 devices? I only have to add a peer to the sender. Documentation is sparse on this.
Also encryption limits that even further and example code is even less available.
Documentation is definitely a little hazy regarding ESP-NOW peers. The 20 device limit isn't relevant in the way that FDRS uses ESP-NOW.
Thank you very much for your video. Just have a couple questions, Gateway(4) can be either ESP8266, ESP32 or LoRa? and also in your example Gateway(4) communicates to Gateway(5)/ESP01 via a serial connection and from the ESP01 to the router via WIFI? thank you!
You first decide on the communication protocol. If it is LoRa you need a board with such a module on both sides. They only come with the ESP32. If you use Serial, ESP-Now, or MQTT you can use any ESP32 or ESP8266 with the limitation that the ESP8266 only has one Serial port.
@@AndreasSpiess Sir, Thank you VERY much for your explanation!
2:10 I don't remember if you've tested the range in a video. But I've seen others reach 500m easily with ESP-Now in LR mode.
I don't get why he is using two solutions, did he need the higher bandwidth of ESP-Now? Or could he use LoRa for all sensors, simplifying things?
LoRa has many km of range. ESP-Now is WiFi with a very limited range.
@@AndreasSpiess I know but why doesn't he use LoRa exclusively? That would seem simpler and easier to maintain
@@NicksStuff because ESP-now can be used with cheaper boards
Hi Andreas and fans, I need help, my wife is hard of hearing mainly in the low frequencies l am having problems with my damaged vocal chords and my voice is husky. She is unable to use a hearing aid because of a nasal problem. My idea is to raise the frequency of my voice frequency and volume level, while talking or change the acoustics somehow. I am 83 and my wife is 91.
Maybe you can use the audio toolbox presented a few videos back? I did not check if it provides such a function.
ESPNOW have more range than normal wifi. 300 to 500m in long-range mode
Thank you for your info!
With your examples I cannot connect esp8266 as mqtt_gateway with another esp8266 as UART_gateway. Is there anything to change in the code?
Very good work, I give you my D's
Maybe you create an issue on the project page? I am sure you will get help there.
Andreas, I am interested in capturing LoRa packets. Specifically, I am interested in trying to merge the existing LoraTap code in Wireshark into the radiotap code which already has mechanisms to handle pretty much all the info that can be captured from LoRa phys and chips. That will involve a capture tool that can generate the correct radiotap header etc. Do you have any recommendations on which LoRa environments I should purchase to get started on this?
I do not know these products. So I have no idea :-(
Cool and very usefull, and i will this idea Test for my bee hive Project. Du you have an idee to use modbus ?
I think you can extend the architecture to modbus (similar to Serial)
I'm sure ACK was available at the time of this vid....10:27
I was in close collaboration with the creator.
Why use ESPNow for this farmer scenario given that LoRa can do short range too? Thanks!
Because it is cheaper (already built-in in the ESPs)
@@AndreasSpiess ah that makes sense. Thanks Andreas!
Do the ESPs use less power than for WiFi while they‘re running LoRa and/or ESPnow? I had the impression that the high power consumption for WiFi comes not only from the use of the radio (which is presumably no different for the other protocols), but also from what‘s required for WiFi communication - some messages that have to be exchanged with the AP, and a bit of waiting. If LoRa or ESPnow are simpler protocols (I have no idea if they are), then there could be less power consumption and longer battery life.
the maximum current I measured for WiFi vs ESPnow is not that different, but the overall consumption comes from the time when radio is ON. For ESPnow you can get into the range of 15ms - there is no way to get even connected to the AP (WiFi) in such short time - my best time for AP connection was around 100ms (and not always of course as it depends what happens on AP at the time you try to connect) - with WiFi sensors I was never below 1s total time (measure, connect, send, go to sleep) while on ESPnow, including measuring temp/hum/light I can get into 200ms (with ESP32-S2)
@@zyghom that‘s impressive. Reduce the time spent using high power to 20%, and you can run devices like these from a coin cell battery that only needs to be replaced a few times in a year.
@@slimhazard "the only" problem is: I am not sure how to make ESP32 even start on the coin cell ;-) I am using 1000mAh LiPo for indoor if the device is not connected to the power (with ESPnow it should last for 1y - still 11.5 months to make sure it is true) and less capacity for the outdoor sensors that have solar panels. Nowadays in southern England the charging start at around 4:30am (and sun finishes after 9pm) so battery is full again within 1h but during the winter it wasn't so easy ;-) (but last winter my sensors were "old versions = WiFi" so they did not consume so little like today - we will see next winter)
If you need low power sensors I would use LoRa and a simple Atmega processor also shown on the channel. Gateways have to be connected to the grid or solar because they are always on.
Hi Andreas,
Did you ever use the W-MBUS in your projects ?
No.
What is the failover method? If an ESP or lora goes down what takes over?
I have built in my project the logic: "if X number of consecutive messages are not sent, switch to WiFi, send the message to HA: "EMERGENCY, PLEASE ACT FAST"" ;-) But Andreas was showing similar methods on his channel: "redundancy for the redundancy" if I am not mistaken
There is no failover for the moment. LoRa and ESP-NOW cannot be used for that. Too different
why is this video unlisted :(
So basically EnigmaIOT but no encryption?
I am not sure. EnigmaIOT only uses ESP-NOW and its focus is encryption.
Hi Andreas, i love your videos, i have learned a lot watching them. I need your help. I have tried to use an EPS32 to control the start and stop of an AC motor, with a MOC3041 and a TRIAC BT13, but the ESP32 is resets itself just when the motor is started or stopped. In the circuit I'm also using a load cell and an oled 0.91" display. Could you please give me an idea of why the ESP32 is resets itelf. Could I sent you the circuit via e-mail?
It usually has to do with an unstable power supply.
@@AndreasSpiess thank hoy forma your time. I"ll check it. I've been powering the esp32 with my laptop's usb 3.0 port.
@@chuchinmc Motors can create a lot of noise on power lines…
@@AndreasSpiess Hi Andreas. I have found the solution. I've made the the same circuit, but working with a PIC18F26k22. The Oled display didn't work on the PIC without pull-up resistors on SCL and SDA pins, so i had to use them to make it work. On the ESP32, the oled display worked fine without these resistors and even people on the tutorials I've had seen, doesn't use them. So, i put the pull-up resistors on the ESP32 oled display circuit and ¡magic happened!, now ESP32 works excellent, it doesn't reset anymore when starting or stopping the AC motor.
Thank you for your time and thanks for your videos.