Mesh Network implementation with RFM69 library?

Started by Whamodyne, September 12, 2014, 04:46:04 PM

Whamodyne

All,

I'm looking to make a wireless sensor mesh network and love the Moteino as a building block to start with.  Has anyone put together a decent mesh network using Moteinos or the new RFM69 library?  I'm looking at covering various sensors with as many as 5 or 6 hops before getting back to the base unit.  Would also like it to try different routing options if not ACK signal comes back.   Just starting to put the pieces together and there is a bunch of things out there but it is always good to look at what others have done.

Thanks!
- Ray

Felix

It can be done. I have built a tree mesh with intermediate routers that need to be awake for routing messages, but it's closed source. It's more complex and I think in most cases (95%?) you don't need a mesh. It's probably easier to just tweak the bitrate and bandwidth and get a very long range rather than complicating your life with meshing which has many more requirements and assumptions. The only advantage is you can cover many acres of land. But you have to be ready to invest in solar panels for those routers or sacrifice uptime of the routers. It's all a tradeoff between reliability, ease of use and power requirements.

bauderline

Quote from: Felix on September 14, 2014, 04:08:30 PM
It can be done. I have built a tree mesh with intermediate routers that need to be awake for routing messages, but it's closed source. It's more complex and I think in most cases (95%?) you don't need a mesh. It's probably easier to just tweak the bitrate and bandwidth and get a very long range rather than complicating your life with meshing which has many more requirements and assumptions. The only advantage is you can cover many acres of land. But you have to be ready to invest in solar panels for those routers or sacrifice uptime of the routers. It's all a tradeoff between reliability, ease of use and power requirements.

Hi Felix,

Why is it closed source ?

The use case for this functionality may not be limited as you might think, some buildings have dense insulation in the walls and floors that may make it difficult for the gateway node to reach all of the remote nodes even if the bitrate/bandwidth is tuned. A mesh/multihop functionality would be very useful for such applications and is certainly something that should be in a future release of your lib. Consider this a formal enhancement request from one of your customers....  ;D

The RF24 had a lib RF24Network which provided such functionality, it was a real pain in the rear to get it to work properly but it does work well once you have it up and running.

P.

Felix

It is licensed commercially at the moment, not sure if/when it will become open source, my guess is not since I don't want to deal with the extra complications and support generated from that. The RFM69 library is free and a lot of people use it without limitations. It can be a building block for such meshing protocols by the way.
I know RFM69 is very suitable for most cases. There are threads in this forum where people tweaked the settings and got several stories of reinforced concrete penetration with just point to point. That is great. My guess is those clients that want to cover acres of land/farm/forest or more complex infrastructure in buildings/factories have a whole different budget that can/should support such a commercial license and the additional hardware cost that comes with it.

bauderline

Quote from: Felix on September 15, 2014, 08:27:54 AM
It is licensed commercially at the moment, not sure if/when it will become open source, my guess is not since I don't want to deal with the extra complications and support generated from that. The RFM69 library is free and a lot of people use it without limitations. It can be a building block for such meshing protocols by the way.
I know RFM69 is very suitable for most cases. There are threads in this forum where people tweaked the settings and got several stories of reinforced concrete penetration with just point to point. That is great. My guess is those clients that want to cover acres of land/farm/forest or more complex infrastructure in buildings/factories have a whole different budget that can/should support such a commercial license and the additional hardware cost that comes with it.

That's a shame, although if you have a commercial product you think you can make coin on I won't hold it against you. I think I will sit down and code something up as I think it would be a useful facility to have the ability to "route" traffic across multiple nodes on occasion. It should be an interesting exercise to see if I can get it to work well....

P.

Felix

Yes, I have actually put a lot of hours into coding that. The issue is if I release that in the wild it will generate lots and lots of support and nobody will take that burden upon themselves, but guess who ... me. Without the RFM69 lib the Moteino hardware would be useless so it needed to be as easy to use as possible and open, yet even that produces loads of support, just look in this forum.
The concept is not hard but the details are what you will burn the time on.

Whamodyne

Quote from: Felix on September 14, 2014, 04:08:30 PM
It can be done. I have built a tree mesh with intermediate routers that need to be awake for routing messages, but it's closed source. It's more complex and I think in most cases (95%?) you don't need a mesh. It's probably easier to just tweak the bitrate and bandwidth and get a very long range rather than complicating your life with meshing which has many more requirements and assumptions. The only advantage is you can cover many acres of land. But you have to be ready to invest in solar panels for those routers or sacrifice uptime of the routers. It's all a tradeoff between reliability, ease of use and power requirements.

Good to know it can be done, any pointers on where to look?  My application is just that, acres of land, multiple locations, and we have always designed in a solar cell/battery supply from the start.  "Install and forget" nodes that can last for years in the field with no visitation.   Over the air firmware upgrades, of course.  That part can be a pain in a mesh situation but we'll make it work.   

This has been done a bunch of times and there a number of  mesh designs out there but I was wondering if there was any existing ones to start with.   Always best not to reinvent the wheel if you can.

Felix

I've designed this tree-mesh for a client that wanted just what you're describing. Over the air updates will be possible but with a tweaked version of the WirelessHEX69 library to fit the mesh topology, and only within the range of a target node, not over multiple hops. The latencies of hopping makes it very difficult. Also sleepy nodes would need a custom programming scheme, perhaps poll for updates because they are OFF most of the time.

ColinR

I'll definitely be interested to see if somebody comes up with something.

How is the mesh defined to determine proximity to a destination? Sounds complicated.

C
CuPID Controls :: Open Source browser-based sensor and device control
Interfaceinnovations.org/cupidcontrols.html
cupidcontrols.com

nightsight01

The other option to consider is using a moteino as a repeater to get you extra distance.  It would seem to me that this is far easier to program than a mesh network.

ColinR

Even that isn't so simple. You have to have handling for duplicate messages at the gateway in case they're both in range, and multiple repeaters need to recognize them as well, or else they'd just send the same message back and forth forever.

C
CuPID Controls :: Open Source browser-based sensor and device control
Interfaceinnovations.org/cupidcontrols.html
cupidcontrols.com

Felix

Right, the "mesh"'s job is to organize in such a way that messages only get forwarded through the nodes that have "sync-ed". When a node joins or re-joins it looks for the closest neighbor that is willing to route messages to its intended destination. Broadcast messages are only used for sync-ing purposes.

kiwisincebirth

Mesh Networking has been discussed before on this forum. See last post on this thread  https://lowpowerlab.com/forum/index.php/topic,512.msg2857.html#msg2857 which refers to a Complete (and well documented) RFM69 library that supports mesh networking. This would replace the RFM libraries supplied by Felix

http://www.airspayce.com/mikem/arduino/RadioHead/


KanyonKris

Pinoccio is a wireless mesh system that based their code on some reference code from Atmel. They released their open source code. Perhaps it could be ported to the Moteino.

https://github.com/Pinoccio/firmware-pinoccio