-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interactive router acting as a switch or router but also as a device #242
Comments
Ciao @drtrigon yes absolutely, can be "interactive" and so act also as a device reacting to a packet through its receiver callback. I dont think the class supports multiple ids as you say, but it could be easily implemented on top of the existing classes if required, |
How can I assign an ID to a switch? I think having multiple ids could be useful - eg. having a very simple temperature sensor device that has 1 value. When having multiple temperatures it would be useful if that would only need to increase the number of devices as no further change to "api" (commands send to device) would be needed. |
Ciao @drtrigon if I understood correctly, you mean to assign a device id to a certain output present on the same device, instead of relating to different devices? That is a hack, generally device ids are device network addresses. |
What I think of is a microprocessor (AVR in my case) that runs code that acts like (a) a switch AND (b) as a device (with own id) at the same time. This is why I also asked for different ids and act as multiple devices. |
Ciao @drtrigon I am sorry I misunderstood your question, sorry if my answers are not detailed as usual but I am in vacation in a place where wireless and electricity are available as much as water in the sahara :0 I will be back fully available 24 of august. |
No problem - enjoy your holidays and answer when you have time again... I will shift to another project during that time! |
@drtrigon The PJONAny constructor takes the device id of that bus as a second parameter. The default device id is PJON_NOT_ASSIGNED, making the switch "invisible" on that bus. You can assign a unique device id to each attached bus. You cannot assign multiple device ids per physical bus to a switch, but have to add this logic yourself, by checking the receiver id of each incoming packet and replying with send_from_id if you want the device to fake multiple devices. |
Ciao @drtrigon I am back available so I am at your disposal if required. |
So I modified the SWBB-TL tunneler like this
that makes sense - then when replying as a device on bus1 I had to use
It does work. The thing is whenever I got an answer from this device - all other devices do not answer anymore for several seconds. Gives me the impression something wrong/bad is happens. Ideas? Bugs in the code posted? |
According to https://github.com/gioblu/PJON/blob/master/documentation/routing.md#interactive-router an
Interactive router routes packets as a switch or router but it is also able to act as a device
. So that would mean this router can at the same time have an id and be addressed as device? That would be useful to return values and that way get status and debug info from router/switch/tunnels via bus.Another question aiming into this direction is, can a single program (on an arduino eg.) have 2 or more (n) different ids and act as multiple devices?
The text was updated successfully, but these errors were encountered: