I thought I'd share a part of my 'workshhop'. Only part of it due the rest being in a bit of a mess at the moment, so here is the 'good' bit......
@bc123 said in I am in need of some programming help.:
I have a cool project
So does everyone else
I hired someone to do about a year ago, but it never worked entirely.
Why is that?
need some help with the programming.
Then post your code and the issues you are facing and someone might help you out.
Project: Driveway alert system, looooong driveway.
So it's just a basic 'alert system' - good.
I have 4 sensor beams shooting across the driveway and they are spaced about 100' apart from each other.
That is good if that is what you want/need for your cool project.
Each can provide a NO or NC contact.
I have conduit running between all 4 points
Good idea if you don't want jammable RF.....
and was planning to run Ethernet wire between them
So only empty conduit at the moment then?
The board has a LORA radio on it
and is transmitting to my Arduino receiver, which is tied to a pi running Domoticz.
I hired someone a year ago to build a system for me using 4 transmitters (one for each sensor),
You already told us this bit.
but I don't think he knew what he was doing.
Why is that?
We got several running temperature/humidity data
That wasn't the original 'alert' spec was it? Or maybe it was? Maybe it is supposed to be a driveway alert system with temperature and humidity sensors 100 feet apart? Who knows? What are you 'really' wanting to do here?
but, the input pins don’t work like they’re supposed to.
So is this faulty hardware issue then?
Why 4 sensors on the driveway? Eventually I’ll install my railroad signals and be able to direct one way traffic up and down the driveway! How cool is that!
If you really have that much traffic on your driveway then it might be a better idea to have a 2-lane driveway.
Help anyone? Happy to compensate for your efforts!
How can we help? You posted an 'alert' dream that later included temperature and humidity. Then it morphed into a traffic control system (either automatic or manually controlled, we don't know which at this stage).
Then you ask for programming help and don't even post a single line of code.
Yes that was all a bit 'tounge-in-cheek' but hopefully you get the idea.
First define what you actually want.
Post code you are trying to get working.
Post drawings of how it is all connected up.
Post photos of the project.
Where is the project located on this once fine planet?
Where do I get my compensation from?
The current NRF24 set up is more secure than bluetooth or wifi from attack.
I say this based on the fact that anyone with a laptop, mobile etc can have software to crack/hack/spoof/inject into bluetooth or wifi. It is not that difficult for kids to do.
The NRF is another matter as to achieve this on that radio module would require acquiring a module, setting it up with a pc/phone and then getting software to attack it.
People often go the easiest route and I am less worried about nrf24 than I would be if the system used bluetooth/wifi or cloud.
Just my thoughts on a dark and wet Monday morning.....
@TheStaticTurtle You are using an older version of mysensors. 2.3.2 is current so first of all upgrade to that.
Second, looking at the node log it never finds the gateway. FPAR is "find parent" and it never does, so nowhere to send the data. The "!TSM:FPAR:FAIL" is also a clue as to no comms with the gateway.
Why this is I don't know as you haven't posted your code.
Your best bet is still to simply change to a different unused channel.
Nrf24l01+ has over 100 channels available, why insist on using one in use by someone else nearby?
Even if you do encrypt all data the radios will still suffer due the the high level of signals around swamping the receiver front ends and reducing sensitivity adn increasing liklihood of packet collisions.
Far better to find a clear channel and use that, but it's up to you at the end of the day.
There are 2 ways of doing this.
First is to have a 'dumb' node that sends data to the controller. Then the controller decides if the relay has to be on or off and sends a signal to make it happen. This is how many systems work.
The down side to this is that if the gateway becomes unavailable or the controller crashes, the relay state will not change.
Personally I prefer to make the node as smart as possible, collecting data, doing calaculations and performing actions while sending the results to the controller for display. The controller can still send commands to the node but if the gateway or controller fail the realy will still operate as expected.
You could even have the nodes request/send data to each other to confirm the status of the realy or anything else for that matter. That's really a third option
So I would approch it by haing node 1 get temp, send to controller and node 2. Have node 2 decide on realys status, switch relay and inform node 1 and controller of the status change. I am sure you can think of variations on this as well because you know best how you want things to work.
@NeverDie Here are some you might consider - but if you possibly can try them first or make sure you can send them back if they do not perform as you expect.
@NeverDie You could use a mp3 player board (there are some with built in amplifiers) so that is one option. See the usual sellers online for info on them.
The other would be a pi zero and a small dac/amp combo. If it is outdoors don't forget that the speaker needs to 'tropicalised' to resist moisture or it won't last long with fog or humidity around.
@chey Yes it would be a good start - have as few repeaters as you can and don't sleep them or run them on batteries unless it's the only way you can do it. Also worth making small movements of the NRF module to see if it will improve range as a move of 10-50mm can make quite a difference to the quality of the signal.
@chey As far as I understand this is alrady possible to make all nodes 'repeater; nodes. But the downside is that this will generate more RF 'network' traffice ans could be counter productive.
Better to try out the 'tree' network first and make repeaters where they are the only other option.
Seems like a nice thing to have for simple things like this - not good for my sensors as that needs a lot longer to set up and transmit, but interesting all the same - I wonder if it is one or more magnet/coil arrangements that generate the power? Still, nice to have light switches that don't need any mains or battery power.
@frapell neg board should have been reg board (as in the regulator to go from 5 to 3.3V - When I did this a lot of issues I had went away. Take the 5V supply from the power supply input to the raspberry pi board. This means any current surge will be provided by the power supply and not from the pi itselff. I hope that makes sense.
@frapell If you can, get some small coax cable for wifi use and use that instead of the track on the PCB- Make sure it is grounded at the sending end - As for the power, I strongly suggest making a 5v to 3.3V regulator as the pi 3.3v can be quite 'noisey' - a buck regulater will help reduve this a lot. Don't forget capacitors on the input and output of the neg board. I did this for my pi set up too as it has the advantage of the radio getting power from the psu and not cia the pi. A linear regulator like the AMS1117 will do the trick.