Skip to content

Relaying messages (node mesh/routing) questions #391

Answered by gioblu
Nume1977 asked this question in Q&A
Discussion options

You must be logged in to vote

Ciao @Nume1977, if you want to use the MAC feature you must define PJON_INCLUDE_MAC before including PJON, then you should call set_router(true) (which forces the device to receive all packets, also if not addressed to itself) and use the forward function to forward a packet to another device when that is received. If you use PJON in shared mode the hop count is included in the packet's meta-data, so when the maximum hop count is reached the packet is discarded (avoiding infinite loops in the network). Then it is your choice if to keep an array of known devices in each device or if using just flooding.

Here you find a MAC example:
https://github.com/gioblu/PJON/tree/master/examples/ARDUIN…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@Nume1977
Comment options

Answer selected by gioblu
Comment options

You must be logged in to vote
3 replies
@Nume1977
Comment options

@gioblu
Comment options

@gioblu
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants