Author Topic: Dynamically coding receiver ID  (Read 947 times)

Pixelmixer

  • NewMember
  • *
  • Posts: 3
Dynamically coding receiver ID
« on: October 17, 2017, 12:22:05 AM »
Hello - I'm in the process of learning how to program my arduinos to send/receive messages with RFM69s. So far I've got the example Node code running and see the sender and receiver IDs are set above the setup. My project involves taking midi messages which I want to use control remote robotic instruments I'm creating. I'm looking for some direction about achieving the following...
When midi note message is received it is "deconstructed" into a note value which could become the receiver's ID, and a packet created that would include an "on/off" command (could be a bit?), and a velocity value (1 byte). At the instrument end I would use the info to start/stop robot motors and indicate how hard drums or gongs should be hit.
I'm thinking that by setting the receiver's address when the packet is created would reduce network traffic compared to broadcasting all midi messages and letting the receiver figure out if the message is for them.
Many thanks in advance for advice or pointers to relevant code examples I could study...

Pixelmixer

  • NewMember
  • *
  • Posts: 3
Re: Dynamically coding receiver ID
« Reply #1 on: October 17, 2017, 07:43:27 AM »
Rereading my post from last night I realized I needed to make an edit - it was late... what I should have said was that I have got the SparkFun example code running. It shows Sender and Receiver IDs defined. The LowPowerLab node example seems close to what I need for the receivers (instruments), but I'm not sure which example would be closest to the sender code I would need. Suggestions welcome. Thanks

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Dynamically coding receiver ID
« Reply #2 on: October 17, 2017, 10:21:17 AM »
I'm thinking that by setting the receiver's address when the packet is created would reduce network traffic compared to broadcasting all midi messages and letting the receiver figure out if the message is for them.
If you use the same network ID, then all nodes do receive the package, but the library filters them out automatically.
To truly separate traffic, you need to use different frequencies, you can do that with void setFrequency(uint32_t freqHz)

Pixelmixer

  • NewMember
  • *
  • Posts: 3
Re: Dynamically coding receiver ID
« Reply #3 on: October 17, 2017, 02:39:59 PM »
Thanks for the explanation Felix - sounds like I could try my original idea and see how that goes. If that doesn't prove to be sufficient, it's good to know there are additional tools available. Will keep you posted...