meshtastic / Repeater_old

Small repeater node for the meshtastic project.
GNU General Public License v3.0
1 stars 0 forks source link

Need to manage hops and sent message ids #6

Open mc-hamster opened 2 years ago

mc-hamster commented 2 years ago

Looked over the repeater code. We don’t decrement the hop count nor track which messages we’ve already sent out.

This would lead to circular routing.

caveman99 commented 2 years ago

The README document says "Packets will be repeated only once per packet ID, to prevent flooding.". I think the old code deliberately didn't decrease the hop counter (Repeater vs. Router behaviour) to act just as a kind of range extender. We need to define what we want it to do exactly from now on. I'd vote vor a Router-light like behaviour, decrementing the packet counter and relaying once.

caveman99 commented 2 years ago

Ahem ... The 'no repeat' code is very basic. Look for uint32_t lastreceivedID. It will remember the ONE packet id it last sent out and won't send that out again. If there's another packet in between... 💥 goes the mesh.