Project basics
(1) Particle Electron + nRF24L01 as server
(up to 6) Pro Mini + nRF24L01 + sensor as client
Server TX to client, turn on sensor. Client monitors sensor. When sensor threshold is reached, TX data to server. When message received by server, TX instructions back to client (i.e.-turn on LED).
So, the radios will change TX/RX roles depending on what is happening. I would like to handle serial commands (TX/RX) by pushing button widget. I have seen references to using virtual pins. If user pushes button app it sends T serial command to Electron and R serial command to Pro Mini and tells sensor to turn on. Then once ACK is received from Pro Mini they reverse rolls.
I have already read too much so can someone tell me if this is even possible using a button widget and virtual pin (or some other method other then terminal widget)? If so, point me in the direction please.
Thank you
Yes, that I understand. All 6 clients do the same thing. So the Electron could send out a global broadcast on one pipe for the clients to RX and so they know to wake up and start monitoring. Then the devices switch rolls after ACK received and the clients TX sensor data (when threshold reached) back to Electron via a second pipe. A second button could be used to reset or acknowledge the threshold condition and thus the roles would switch again which can apparently happen via button widget and virtual pins based on your confirmation. Sounds easy, LOL
So do you have a refernce that I can look at on how to accomplish the original question?
Thank you
as i have 0 (zero) experience in nrf, i can not help you with this part. but if all slaves have to do the same thing, probably you can use the same firmware on all slaves. and this could simplify the effort.
for the button widget and virtual pin just study the sketch builder or the included examples in the blynk library + read the official docs. it is very detailed and easy to use.
i would reccomend to split the work in 2 parts:
write and test the code for communication between blynk and particle, and after thats working relaible
write a separate sketch for communication between slaves and particle. this will need 2 sketch: one for the particle and one for the arduinos. after this works, independently from blynk, merge the 2 points into one big sketch.
I have these parts already. I can RX and TX back and forth between the devices, no problem (now that is, do not want to discuss how many hours it took!) I also can control a pin on electron via blynk while the other part is going on. I have a code that works the way I want it to on the clients.
What I need to do
A) write code that allows for electron to tell pro mini what to do
B) write code that allows for role changes on devices using virtual pins (somehow)
Understood. I only have bits and pieces so far. Nothing that would be worth sharing at this point. When I get a bit further and have something more complete.
I appreciate your replies and explanation on the serial commands.
Thank you