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......
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.
@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.
@frapell I have the same network/phone cable tester as in the phto!- Hahaha.....
Back to the probem it does sound as if something is changing over time, that is why I suspect power supply, cables or connections. I guess you checked for dry joints on the pcb, vut it would be worth checking ecery pin has a firm connection with a multimeter and a spare dupont pin. Temperature difference can make a bigger difference then most people think.
Is the radion module connected to 5V on pi or 3.3V? this is another possible area to look at but I need to know this first...
finally, with good dupont cables, remove your pcb from the pi and connect it again using dupont wires 150mm or more away from the pi and try that. I am wondering if the RF path to the antenna being close to the gpio and cpu might perhaps be possible culprit. Is there any screening on the back of the pcb ?
I would look at 2 things here -
One, test all dupont connecters at both ends for a secure connection - I spent a loooong time chasing my tail due to dupont cables that were loose. Crimp them up with pliers if you have to.
Two, what power supply are you using? 'how are you powering the gateway and pi? What voltages do you get and are there any fluctuations when the GW radio is transmitting?
@Ethan-Chua Some photos of the wiring and set up would be of help here along with a link tothe radio modules you are using. Maybe try moving them further apart, counter-intuitive I know but it might be receiving module being swamped with the power of the TX one. You could also try a different channel (use nrf doctor to find where there are 'quiet' areas) and see if that helps.
Do you have a lot of bluetooth/wifi in the building? anything else in the 2.4GHz band like cameras, keyboard,mouse etc?
I remember that here (UK) they recommend that to balance a radiator you need to aim for 12C difference between flow and return pipes on the radiator. A couple od DS18B20s should do the trick. I have monitored flow and return to the gas boiler for many years now in this way.
@kacper_zet Try moving this code from receive to void loop and add a check to see if the status has changed from it's last state. Maybe then it will work for you.
digitalWrite(message.getSensor()-1+RELAY_PIN, message.getBool()?RELAY_ON:RELAY_OFF); // Store state in eeprom //saveState(message.getSensor(), message.getBool()); // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.getSensor()); Serial.print(", New status: "); Serial.println(message.getBool());
If not then it might be HA relsted and I can't help with that.
@topgun78 2 things to consider...
printing in PLA may not be a good idea for this as heating pipes can get to <70C and will softern the material and make it more brittle.
Use a stepper motor so that you can control it in microsteps to get 0-100% as sometimes it needs to be on at a lower level all the time. If just using open/closed you will get cycles of hot and colder room, not ideal.
@benhub When the UK left EU they immediately made aliexpress and others charge 20% VAT on top of the prices. AT about that time free shipping stopped being the norm and prices from China have been climbing in recent years.
It all adds up to more expensive hobby and me ordering fewer parts than I used to.
Ebay or similar sites might be an option as small sellers are not required to collect tax unless registered to do so.
Considering the chances of fake or 'failed test' components being sold makes it even more of a risk than when things were much cheaper.
I'd hate to caoculate how much I have had from China over the years that went quickly to recycling or landfill.
I guess in the end you could buy less from reuptable EU companies, at least you should get genuine items that way.