Thanks for confirming this.
I will have to be careful when swapping code for testing purposes. I restored the Domoticz database and all seems back to how it was.
I will probably create another post for the actual issue I am having with the node....will try and figure it out myself first. something not right with my code as about 15 unknown childs have been created and the node has high power consumption, like it is restarting constantly. I have ruled out hardware.
Posts made by grumpazoid
-
RE: Removed childs not being recognised again
-
Removed childs not being recognised again
I have a problematic sensor running PIR/Voltage/Temp/Hum
I uploaded some different code (PIR/Voltage Only) to test but it messed up the childs in Domoticz so I deleted them
Now when I restart the node they do not get re-recognized.I know that deleting the entire node causes Domoticz to forget it forever. Is this the same with child objects?
I will restore from backup for now. -
RE: void receive and while loop question.....
@Yveaux Makes sense now. Thanks again.
-
RE: void receive and while loop question.....
Thanks for that explanation. Understanding this, the bit I am still confused about is how I can use wait() and still able to listen for incoming messages. Is that an exception to the rule? What stops the processing being blocked in this case?
-
RE: void receive and while loop question.....
Hope ok to ask here as I am struggling a bit to understand wait() in context with loops. I have used it with success with a separate receive function but need a bit of clarification.
I have read on another post that wait is the same as using the millis method but can't get my head around how to use it.
If using millis I would use the state machine if else method as suggested by @scalzHow do I use wait in one place and then get another loop or process to run in the meantime?
-
MYSBoatloader burning confusion
I have watched the video and tried to follow along. here
My test board is a pro mini 3.3V 8Mhz
I can read the fuses with AVRDUDESS and I get
L FF
H DA
E FDThis does not seem to match with the recommended settings but there is no mention what to do on the video?
The text suggests burn other values.
I am guessing I have an external oscillator as I can see the crystal on the PCB? The instructions don't show settings for 8MHz external.Next I have copied over the necessary boards.txt information, but there are 2 options for 8MHZ. MYBL8 and MYSBLNRF.
Both show up in the arduino IDE as 8MHz RC in the boards/frequency section.
I dont't know which one to choose.Also if I want to to use a channel greater than 110, I need to compile the hex file.
Is there a guide on how this is done. I have searched but drawn a blank.Any guidance appreciated.
-
RE: 12v battery monitor
@trond-arntzen I just use a voltage divider with 1Megaohm and around 82K resistor for measuring my solar charged battery.
@Mustang65 That ups board looks good. I could do with something similar as a battery backup for my raspberry pi's. Of course they would need a 12V to 5V conversion.
-
RE: Sample sketch for test node including hardware and software acknowledgement
@mfalkvidd said in Sample sketch for test node including hardware and software acknowledgement:
char messagestring[100];
message.getString(messagestring);
Serial.println(messagestring);@mfalkvidd Fantasic. Thank you. That is what I was looking for . It works now !!!
-
RE: Sample sketch for test node including hardware and software acknowledgement
@BearWithBeard Thanks for confirming this. I had tried most of the options listed on the MyMessage page.
I have tried both ways you suggest again just now - getString() returns nothing and getUInt always returns zero.
At the moment it does not matter as I can see the value listed at the end of the echo(as posted previously) it would just be nice to be able to "harvest" it.
For now I will use the value that has just been sent - for resends etc. -
RE: Sample sketch for test node including hardware and software acknowledgement
@Yveaux Thanks for the link.
I'm not sure if I am missing something simple?So I can see the echo in the monitor :
173 TSF:MSG:READ,0-0-9,s=1,c=1,t=16,pt=2,l=2,sg=0:111 182 TSF:MSG:ECHO
In this case the original sent value was 111 and I can see it in the echo message.
If I do
Serial.println(message.isEcho());
I get a 1 printed. Is there a message.something that contains the original sent value?
-
RE: Sample sketch for test node including hardware and software acknowledgement
@Yveaux said in Sample sketch for test node including hardware and software acknowledgement:
@grumpazoid said in Sample sketch for test node including hardware and software acknowledgement:
Transportready seems to report good even when lots of hardware NACKS occur.
Transportready is just an indication that your radio is good to go. It does not depend on your link quality.
I've also seen the echo come back as good even though the ack did not.
Welcome to the wonderful world of radio communications!
Thanks. That explains why Transportready always reports good.
In my day job I work with wired and wireless networks that mostly use TCP/IP so as long as the radio link is there failed messages are handled automatically.
I've updated my sketch now and added an extra bool variable for when echo is received. So now the node can be set to only sleep when it hears an echo. Good stuff.A message can be correctly received by the target node, while the ack gets lost. The target node then echoes the message back to the source, which receives it correctly.
Perfectly viable scenario.Great that's what i thought was happening. Good to have it confirmed.
Is it possible to serial print (or store in a variable) the returned message payload? I can see how to print the other parameters but not the payload itself.
-
Sample sketch for test node including hardware and software acknowledgement
Recently, I have been trying to test out the quality of my node to gateway communication, as I know that occasionally messages from nodes don't make it through.
I could not find a simple test sketch that had examples of how to perform the different types of message delivery checks, so I have searched the forums and produced a simple sketch that may be of use to others.
The hardware is as simple as can be:
The sketch will send alternating 1 and 0 to simulate a switch. Each time it will check for :
Transportready
Radio Hardware ACK
Software Echo.Results are displayed in the debug serial window.
It it interesting to note that the results so far are different from what I expected.
Transportready seems to report good even when lots of hardware NACKS occur.
I've also seen the echo come back as good even though the ack did not.Here is the sketch
// Mysensors test sketch 1.3 by grumpazoid #define MY_DEBUG // Enable debug prints // #define MY_PARENT_NODE_ID 0 // use this to define next node on route e.g. a repeater // #define MY_PARENT_NODE_IS_STATIC // dont allow node to search for other repeaters // #define NODE_ID 200 // enable this if you want the node to have a specific ID #define MY_RADIO_RF24 //Enable and select radio type attached //#define MY_RADIO_NRF5_ESB //#define MY_RADIO_RFM69 //#define MY_RADIO_RFM95 #define MY_RF24_PA_LEVEL RF24_PA_MAX // Set Radio Power. Values can be MIN LOW HIGH MAX. FOR PA+LNA MODULE LOW CAN WORK BETTER!! #include <MySensors.h> #define CHILD_ID 1 int STATE = 0; // Initialize motion message MyMessage msg(CHILD_ID, V_TRIPPED); void setup() { sendSketchInfo("Test sensor", "1.3"); present(CHILD_ID, S_DOOR); } void loop() { //TEST FOR TRANSPORT READY if (isTransportReady()) { Serial.println (); Serial.println ("Tranport Ready"); } // SEND MESSAGE // send(msg.set(STATE),true); //TEST FOR HARDWARE ACK if (send(msg.set(STATE), true)) // This appears to also send the message { Serial.println("HARDWARE ACK----UPLINK AVAILABLE"); } else { Serial.println("HARDWARE ACK----UPLINK IS NOT AVAILABLE. NO HARDWARE ACK RECEIVED"); } #ifdef MY_DEBUG Serial.print("current vale of STATE = "); Serial.println(STATE); #endif; // Change state ready for next time if (STATE==0) { (STATE=1); } else if (STATE==1){ (STATE=0) ; } #ifdef MY_DEBUG Serial.println("Going to wait a few seconds for echo message"); #endif; wait(3000); // Wait 3 seconds // We shaould have WAITED long enough now for echo message so let's have a sleep. #ifdef MY_DEBUG Serial.println("Going to sleep for 10 seconds"); #endif; sleep(10000); // Sleep 10 seconds } // END OF MAIN LOOP //Listen for incoming messages void receive(const MyMessage &message) { if (message.isEcho()) { Serial.println("SOFTWARE ECHO RECEIVED---- from gateway"); } }
-
RE: What happens exactly after NRF24 gives up retrying and goes to sleep 2.3.x?
On my test node I have enabled Echo and am using if (message.isEcho())
It is working.I have searched and searched and looked at the API docs but am still unclear :
If the node sends a value, should it be able to read that same value back in the echoed message.
I know I can use message.sender , message.type etc, but how would I print the whole echoed message and/or the echoed value.
-
Getting Alexa to speak sensor values.
Here's a quick vid of this morning's project. Getting Alexa to speak the values from the node in my garden.
Alexa speaks arduino mysensors readings – 00:25
— GrumpazoidCredit goes to those who made the node red nodes to make it work!
-
RE: What happens exactly after NRF24 gives up retrying and goes to sleep 2.3.x?
@mfalkvidd Thanks. Yes that is indeed what I mean. I just wanted to make sure my understanding was correct before going any further. I am over obsessing really but it is now a bit of a challenge. I went about 24hrs without a a single missed message then just a couple of hours ago started getting lots. I am of course guessing as some local interference being the most likely. Will try another channel number when I can. I have however found a couple of errors in my sketches that need changing - I have been using delay instead of wait and also I have been pointlessly sending some serial prints.
-
RE: What happens exactly after NRF24 gives up retrying and goes to sleep 2.3.x?
I have cobbled together a simple test sketch that sends alternating values to the gateway every x seconds - Attached below (feel free to correct bad coding).
Are we saying that when I get a NACK response in the serial monitor such as :
37315 !TSF:MSG:SEND,9-9-0-0,s=1,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=NACK:20
That the sending radio has attempted to send its message AND listened for, but not heard, a response from the gateway 15 times?
I say this because what I observe is the code moving on to send the next message in the sequence.
// Enable debug prints #define MY_DEBUG #define MY_PARENT_NODE_ID 0 #define MY_PARENT_NODE_IS_STATIC // dont allow search for repeater // Enable and select radio type attached #define MY_RADIO_RF24 //#define MY_RADIO_NRF5_ESB //#define MY_RADIO_RFM69 //#define MY_RADIO_RFM95 #include <MySensors.h> #include <SPI.h> #define SENSOR_INFO "Test sensor" //#define NODE_ID 200 #define CHILD_ID 1 int STATE = 10; // Initialize motion message MyMessage msg(CHILD_ID, V_TRIPPED); void setup() { //begin(NULL, NODE_ID, false); sendSketchInfo(SENSOR_INFO, "1.1"); present(CHILD_ID, S_DOOR); } void loop() { if (isTransportReady()) { // uplink OK Serial.println ("Tranport Ready"); } send(msg.set(STATE)); #ifdef MY_DEBUG Serial.println(STATE); #endif; // Change state ready for next time if (STATE==10) { (STATE=20); } else if (STATE==20){ (STATE=10) ; } //pause delay(5000); // Wait 5 seconds }
-
RE: What happens exactly after NRF24 gives up retrying and goes to sleep 2.3.x?
@Yveaux Thanks. Yes behaviour is strange.
PIR messages that wake via interrupt seem to kick a node back into life somehow. Maybe because they are keeping it awake for communication to establish again? -
RE: What happens exactly after NRF24 gives up retrying and goes to sleep 2.3.x?
Thanks for the replies and info.
@Yveaux are you saying if the node did not achieve success after 2 or 3 attempts it would carry on and reach its limit of 15 attempts - then give up. i.e. it would never achieve a successful transmit at say attempt 10 or 11?
I may have do do some testing and experiments myself with a node connected to a laptop in debug mode.
-
What happens exactly after NRF24 gives up retrying and goes to sleep 2.3.x?
So this week, just for fun, I thought I would try and investigate why the occasional battery voltage (sent every 2 minutes) does not get through. I'd just like to understand the sequence of events a bit better as regards to node to gateway communication.
I am running 2.3.2 on gateway and some nodes, 2.3.1 on others. A lot of posts I have found date back to 2016 so am unsure if they are still valid.
Am I correct In thinking a node will retry 15 times before it gives up?
At this point the message is lost as I have no code to try and resend.All my battery nodes sleep for 2 minutes or until they are woken by PIR in some cases. At what point after wake up will the node try and establish communication again? I ask this because sometimes a node seems to stay offline for a long time even though it may be close to the gateway and all other nodes are reporting in fine.
is it still valid in 2.3.2 to use if(isTransportOK()) as seen in older posts to keep the node awake until it sends the message or is there a better way to do this?
-
RE: [SOLVED] 2.3.1 TO 2.3.2 MyConfig.h got changed
@Yveaux Yes I had manually changed MyConfig.h to reflect the channel number I use. I thought I had read that was the way to do it. Okay thanks for putting me straight. Good to know it was just normal behaviour. I'll add it to each of my sketches in future.
Thanks. -
RE: NRF24L01+ and NRF24L01+PA-LNA problems - testing in progress
I have two cheapo ebay NRF24L01+PA+LNA. As has been posted elsewhere nearly all are fake. I only use one at a time for my gateway. I had to do lots of fiddling to get them to communicate with my nodes . This included shielding and using an aluminium plate as a ground plane (someone criticized this but it worked for me). Ive posted about it somewhere on here. More recently I took delivery of a shielded Ebyte module and it has worked great. I have loads of the cheap NRF24L01+ modules in my nodes. Some I have added 12.5cm antennas and some dipole antennas. It does make a difference if drop outs are a problem on the more distant ones.
-
[SOLVED] 2.3.1 TO 2.3.2 MyConfig.h got changed
Finally got around to upgrading to the latest library using Arduino IDE -
I went into library manager and just selected upgrade to 2.3.2
I re-uploaded my code to the sensor I'm working on and no communication anymore. Long story short...the channel number has been reset to default in MyConfig.hJust curious if there was a particular reson for this?
All working well once I sussed what had happened. Thank goodness for backups. -
RE: Domoticz weather sensor presentation
I use a BME280 sensor for outside and some 18b20's for inside. Domoticz works with these without problems but I do not use OTA - not figured that out yet I had to cut out all the weather prediction code on for the BME280 to make it run on a pro mini 3.3 but Domoticz has basic prediction built in.
-
RE: Easy PCB Question
@sundberg84 Thanks for those regulator pics. Great service there - I don't even have to look up the pinouts.
@TRS-80 Totally agree what you say there - I've switched to open source solutions wherever able. -
RE: Easy PCB Question
@TRS-80 Those cases look good value. I have a quite a few PIRs. Luckily I have access to a 3D printer so printed off a few boxes for them with the appropriate hole cut out for the sensor. I've started addding temp sensors to them now as well. I don't actually need the regulators to be so small at all but I think price took over.
Think I'll get some PCBs ordered so I am ready next time I get the urge to build some more. I see latest version supports signing as well so that could be interested. I have tried to read the docs in the past on signing / encryption but still can't work out if it is easy or not. Thanks to @sundberg84 for all the hard work. -
RE: Easy PCB Question
@TRS-80 Thanks for the info. That is very useful especially about the regulator. I had found the open hardware page but am clearly feeling lazy today and hadn't seen the BOM part. I am a huge cheapskate so loved the fact I could get 50 x 662K for 99 pence delivered (before China put of their delivery prices). I am sure these could be made to work. Yes they are very fiddly! I have lost a few in the carpet I am sure
-
RE: Easy PCB Question
@mfalkvidd Thanks for that. Not sure if I worded my question well but I am more concerned that the PCB will take the required components such as 662K so I can still run 3.3 arduino with a LIPO battery. I didn't want to order a stack of them only to find I have missed something!
-
Easy PCB Question
I've only build build nodes so far using prototype board.
Mostly powered with 18650 lithium and 662K regulator for pro mini 3.3 with regulator and LED removed.
Voltage is measured with resistor divider.
I get great battery life - probably around 2 years.
Simply, will the easy PCB allow my to build this setup?? Looking to save some time.
Thanks -
RE: Get last update notification of Relay node within Domoticz
I have found a workaround by sending the heartbeat message as a separate V_MULTIMETER child. This then gives me a voltage reading of 0V every 30 seconds that I can use with the Domoticz last update feature
Would like to hear any better ways of doing this.
-
Get last update notification of Relay node within Domoticz
Re: Relay Actuator - send periodic status as heart beat.
I am creating a new post as the above thread is quite old and I think this is specific to Domoticz.
Thanks to @sundberg84 and also @Denis-Renaud for the code which I have used in my relay node.Domoticz now shows "last seen" every 30 seconds.
However, what I want to be able to do is get Domoticz to send me a notification when "last update" is greater than a certain value.
However "last update" is not available from the notifications tab - presumably because it is seen as a switch and that option is not available for switches.Any suggestions how to make this work? Could I send a status as some other sensor type/child ID that allows the last update message?
I use the MQTT plugin in Domoticz to send messages into Node Red - I only get a MQTT message when the switch is physically changed, not on the heartbeat interval.
-
RE: First voltage measurement reading is high
@NeverDie Excellent. Thank you.
-
RE: First voltage measurement reading is high
@sundberg84 Ah thanks good to know I am not alone.
I have already included a 1500ms delay before the battery code.
The array sounds a good idea. Any chance of pointing me at some code for that?
-
First voltage measurement reading is high
I've recently had to rebuild a node - I am using a pro mini 3.3V with a BME280 sensor.
Having tested it on the bench before putting outsideI have noticed that at every startup the first reported voltage reading is about 0.2V higher than it actually is(significant on my 3S Lipo battery). The next reading is then nearer to the true voltage.
I am using voltage divider with 1M and 82K resistors. I have a capacitor across the 82K. This allows a max voltage of 14.51 in case I go back to using a lead acid battery.
I have tried moving the voltage part of the code to a different location in the loop but still the same.
Has anyone else seen this behaviour or would know why it happens?? I don't get it on my other nodes that use a single 18650.
-
RE: Swap node ID to another arduino
@mfalkvidd Many thanks.
I didn't know about the replace feature....I will check it out.
-
Swap node ID to another arduino
This weekend I tore of the A4 / A5 pads on an pro mini.....This time I will be soldering pins on first !!!!!
I am in the process of building a new board but want to transfer the node ID from the old node to the new one - so I don't have to reprogram anything in Domoticz / Node red.
Can I just use define MY_NODE_ID ??
Thanks
-
RE: Ebyte nRF24 module comparison (2020)
@orhanyor A piece of aluminium fixed my problem (Well 99% better). The sensors I have report in every 2 minutes and I get an error alert if they do not. Without the sheet in place it is just non stop communication errors. there is a thread I posted all about it.
-
RE: Ebyte nRF24 module comparison (2020)
A lot of my NRF24 problems were solved when I used a sheet of metal for a groundplane on the +PA+LNA module I use on my gateway.
Will definitely try some Ebyte modules when its time to buy some more.
-
RE: 💬 Atmospheric Pressure Sensor
@mfalkvidd I've got it up and running now on the bench complete with measuring voltage. I found that removing all the serial print statements also free up a lot of memory. Thanks to all those involved for the provided code.
-
RE: 💬 Atmospheric Pressure Sensor
@mfalkvidd Thanks for that. This is going to be my outside weather node running off a 12V solar charged battery. I started wi a DHT22 but it failed after a few months.
-
RE: [SOLVED] Si7021 / Gy-21 with pro mini 3.3v
I have now received 2 new Si7021 ebay boards. One 3.3V and one 5V. Both happily working straight away.
I have incorporated one into one of my motion sensors so I now get motion, battery level, room temp and humidity.
At first my pro mini would not sleep and just kept looping in the serial monitor - but as soon as I removed the FTDI board it started to behave? Somehow the PIR kept getting triggered. maybe too much going on with everything connected on the 3.3V line.Anyway very happy with the finished sensor.
-
RE: 💬 Atmospheric Pressure Sensor
I have now had my delivery of the above ebay sensor. Everything looks good. It is a BME280 and reports temp, humidity and pressure.
I have used the sketch on the build page and it has worked without any editing. I just had to install the BME280 library as given in the example sketch. Everything is shown nicely in Domoticz.
Interesting to note that when compiling in arduino IDE I get the following error : Low memory available, stability problems may occur.
Wonder if there will be enough room to add my battery level monitoring code?
-
RE: WS2812B neopixel sketch help
@mfalkvidd This is good to know. This may well be the time for me to learn a bit of coding with the fastled library.
-
RE: WS2812B neopixel sketch help
@mfalkvidd
Thanks that was useful and I went ahead with the sketch shown here: https://www.domoticz.com/forum/viewtopic.php?f=42&t=8039&start=40#pIt works !!
-
WS2812B neopixel sketch help
Having searched the forum I can only find outdated information and links to old posts on the Domoticz forum.
i would like to be able to control my WS2812B LEDs using mysensors / domoticz / node red.
There are plenty of guides around for ESP8266 but I rally fancy adding this into one of my mysensors nodes.Does anyone have an up to date, simple sketch to get me started? ie somehing that will simply let me change the colours of all LEDs at once and hopefully control from Domoticz.
Thanks
-
RE: 💬 Atmospheric Pressure Sensor
@mfalkvidd I've just started to look into this sensor and the main page is still quite confusing as already stated by @skywatch
It seems the choice at present is between the BMP280 or BME280. the latter also includes humidity.
Maybe the title could say Temperature/Pressure/Humidity? I just ordered a replacement Si7021, not realising there was another all in one sensor available.
It is clear that most ebay sellers are also confused and are wrongly listing BMP devices as BME.
I found a good summary to the confusion here https://goughlui.com/2018/08/05/note-bosch-sensortec-bmp280-vs-bme280-sensor-confusion/
Hope this helps someone - Think I'll be going for a BME280 here as it as some positive reviews https://www.ebay.co.uk/itm/Breakout-Temperature-Humidity-Barometric-Pressure-BME280-Digital-Sensor-Module/401513062540 -
RE: [SOLVED] Si7021 / Gy-21 with pro mini 3.3v
Having spent some more time fault finding, it seemed that the logic level converter chip had been soldered on wonky and one of the pins was not connected.
Ive unfortunately damaged the PCB in an attempt to fix so a new one has been ordered from another chinese seller.Having now had time to read futher about the GY-21 is appears it will work with both 3.3 and 5V microcontrollers.
Interesting to see there is a GY-21P board that includes a pressure sensor. I would be interested to hear from anyone who has used this.
Edit 9/10/19 Just an update on this.
I now have new sensors on order Si7021 (both 3.3 and 5v boards) and also a BME280 which has temp, pressure and humidity. -
RE: [SOLVED] Si7021 / Gy-21 with pro mini 3.3v
@Yveaux I have just tested on a second board. This time a 5V arduino uno. Same result - as you say at "while (not sensor.begin())" call.
This board has SCL and SDA pins as well as A4 and A5. I have tried both.
Looks like a duff sensor then -
RE: [SOLVED] Si7021 / Gy-21 with pro mini 3.3v
@Yveaux That link seems to take me to the DHT22 guide....but yes I followed the Si7021 guide.
-
[SOLVED] Si7021 / Gy-21 with pro mini 3.3v
I have hooked up a GY-21 module as per the instructions to a pro mini 3.3V (Previously working with DHT22 sensor.
I just get "not recognized" message in the serial monitor. I have metered out A4 and A5 pins on my clone board and they are connected to the main IC.
This page http://www.guillier.org/blog/2015/07/sht21htu21d-humidity-and-temperature-sensor/ seems indicate that this board can be used on both 3.3 and 5V arduinos.
Am I missing something?
Thanks.
-
RE: [Solved] Repeater node causing Problems
@electrik Yes, I drilled a 6.5mm hole, just big enough for the SMA connector to fit through and then screwed the antenna back on. Because the plate sits inbetween the radio and antenna, and touches the outside of the SMA, it is connected to ground.
-
RE: [Solved] Repeater node causing Problems
So after some considerable time and loss of sanity I now appear to have a stable setup. I'd like to share what I have done in the hope it may save others a lot of time and frustration.
By enabling debug in the sketches, I eventually realised that I could not get any node to communicate reliably with the gateway. I was getting lots of NACKS even at short distances.
I was sure that the problems were radio related but after trying many NRF24 modules I was about to give up.
Then I read a post somewhere about ground planes.
As a last resort I added a piece of aluminium between my gateway antenna and the radio. (PA/LNA Version). Eureka!! This has pretty much solved the NACK issues.
Following this one or two nodes still intermittently lost contact after a few hours or days. What is strange is that even if moved close to the gateway, errors continue until the gateway is power cycled? I still don't know why this is.
I solved this problem by converting the Node PCB antennas into a dipole antenna as detailed at https://www.instructables.com/id/Enhanced-NRF24L01/.
Now all nodes stay connected.
Now after a couple more weeks of testing all is still good.I am using Domoticz with the MQTT output passed onto Node Red and now have some really cool things going on.
A big thanks to all that replied and pointed me in the right direction.
-
RE: Debugging with Myscontroller
@sundberg84 Thanks. I will aim to get both sets of logs. What I am asking is if this can be done with Myscontroller alone, or if I need to connect up my FTDI?
-
Debugging with Myscontroller
I am using ethernet gateway and can connect to it with Myscontroller.
Can I view debug logs of the remote nodes using this method or do I need to carry on debugging each one with usb/serial converter?
To debug the gateway with MyScontroller I guess I need to enable dubug in the gateway sketch?
I do not use OTA updates. Still trying to get reliable communication between nodes and gateway without NACKS. -
RE: [Solved] Nodes having trouble reconnecting to gateway
I think I have fixed the issue. I changed to the cap on the ethernet gateway from 47uF to 1uF. I have power cycled the gateway 4 times now and all the nodes came in. Looks like less is more! For whatever reason the breakout boards obviously don't work well for me.
I will keep testing for a few days. -
RE: [Solved] Nodes having trouble reconnecting to gateway
@mfalkvidd No I only use one at any time.
I started with serial and then built the ethernet gateway. To eliminate the ethernet gateway hardware I just reverted back to serial to test. -
RE: [Solved] Nodes having trouble reconnecting to gateway
@yveaux I have a serial gateway built on Arduino Uno connected to Pi. This is now just spare as I have W5100 / arduino nano ethernet gateway. Nodes are mostly 3.3V pro minis. One is 5V nano. All arduinos are clones.
Radios on nodes are NRF24L01+. On gateways I can use NRF24L01+ or amplified version (doesn't make a difference to this behaviour).As an example I switched off the gateway 2 hours ago. 2 nodes are came in straight away, the other 3 have no communication. Chances are the same 2 will connect again if I power cycle the gateway but the nodes that work straight away changes randomly. It seems like the gateway does not want to acknowledge certain nodes.
Behaviour is the same if I revert to stock motion sketch.
-
RE: [Solved] Nodes having trouble reconnecting to gateway
The parser says that no radio ACK has been received when the node tries to ping the gateway.
I have today built a replacement radio breakout board from scratch. The problem is still the same.
Some nodes connect, some randomly do not.
I have replaced every piece of gateway hardware, so this my be something within the Mysensors code.
Any suggestions please? -
RE: [Solved] Nodes having trouble reconnecting to gateway
@mfalkvidd Thanks for that.
F11 showed that the page was failing to resolve cdnjs.cloudflare.com
I run a pihole so just needed to add to my whitelist.Fixed. Thanks.
Now back to the node/gateway communication problem!
-
RE: [Solved] Nodes having trouble reconnecting to gateway
@flyingdomotic Ok So I have modified \Arduino\libraries\MySensors\hal\transport\RF24\driver\RF24.cpp and reuploaded my sketches to the gateway and a couple of nodes.
Unfortunately one of those nodes is still reluctant to connect. You can see the tx LED coming on for a long time while it tries.
There must be something in the underlying code not quite right?
-
RE: [Solved] Nodes having trouble reconnecting to gateway
@electrik Thanks for this.
I am on Windows 7. I will try another PC. EDIT HAve tried another windows 7 machine No output on IE Firefox Chrome or Opera?
As far as i know the breakout boards I am using have capacitors included on the. So I just apply a good 5V and plug in a radio.@FlyingDomotic Thanks. So would I put that code at the top of the sketch for both node and gateway? Before the loop?
-
[Solved] Nodes having trouble reconnecting to gateway
If I restart my gateway (tested with serial and ethernet gateways) some nodes connect straight away, but others can take minutes or hours to connect.
I am thinking this is the root of all my connection issues.
NRF24 modules of various types tried.
One day certain nodes will be problematic, another day other nodes. I have them all very near to the gateway.
I use breakout boards for the NRFs on the gateways without any extra capacitors/ Could that be it?
I cant get the log parser to work in any browser so not sure how to decode.
The node produces the following debug when it cannot connect:4130 TSM:ID 4132 TSM:ID:OK 4134 TSM:UPL 4171 !TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=NACK:1 6180 TSM:UPL 6217 !TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=1,st=NACK:1 8224 TSM:UPL 8261 !TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=2,st=NACK:1 10268 TSM:UPL 10305 !TSF:MSG:SEND,2-2-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=3,st=NACK:1 12314 !TSM:UPL:FAIL```
-
RE: [Solved] Repeater node causing Problems
@flopp As far as I know everything is running on 2.3.1
I now have all my nodes very close to the gateway. Will keep testing for a few days. -
RE: [Solved] Repeater node causing Problems
@sergio-rius Each node sends a battery voltage every 2 minutes. If the PIR is tripped then it wakes from sleep and sends PIR tripped and also the battery voltage.
I currently have Domoticz set to send me an email if it does not receive the battery voltage. I have tried MYScontroller but not sure how I would monitor all those messages over a few days? Does Domoticz have issues?I have currently taken the repeater out of the equation and replaced the NRF24L01+PA+NLA on the gateway with a NRF24L01+. So far only 2 errors in 24 hours from the furthest away sensor. Have moved it closer for testing.
Update - after 2 hours I got the first failed message. I can understand that nodes may try to send at the same time but there must be a way to keep retrying?
-
RE: [Solved] Repeater node causing Problems
Doh!!!!
So I have done some more testing. I am still getting intermittent data loss. I get this even if I eliminate the repeater. Every few hours a message from a sensor does not get through. I have tried reading up on how to get the node to resend but there does not seem to be an easy documented way.
This thread seems to sum it up.
-
RE: [Solved] Repeater node causing Problems
I am pleased to say that I have finally got all my sensors and repeater up and running without errors - All battery reports are coming in every 1 or 2 minutes as per my sketch.
The problems were definitely radio related.
Here is what I have done to get it running error free.- Start with all the sensors close to the gateway and see if there are any errors.
- I had one node that was powered with an LM2596 and dropped out after a few hours. Adding in a LC filter has fixed it. Strangely my ethernet gateway is also powered by a LM2596 but is running quite happily. That does however use an amplified NRF24 module on a breakout board.
- I powered up my repeater again and repositioned the sensors to where I wanted them. I have told the sensors closest to the repeater that they should use that as their parent node.
- It was unclear on MYSCONTROLLER, if the repeater was being used, but as soon as the repeater is powered down, sensors loose contact so I know it is working.
- My repeater radio is NRF24L01 with added wire antenna. Much improved range.
-
RE: Where do i start?
@reindier I discovered mysensors while also looking if it was possible to build my own alarm system.
I am pleased to report that it is quite possible if you don't mind the fun of building and fault finding.
I started a few months ago by building some PIR sensors and a serial gateway on a raspberry pi running Domoticz.
From there on I'm slowly adding to the system. I now have notifications for doorbell, outside temperature, solar panel voltage, sensor battery voltages, Sonoff light running Tasmota..... just this week I've swapped over to an ethernet gateway.All the information is available if you take the time to browse the site. Lots of help on the forum as well.
-
RE: Wipe/Change serial gateway arduino
I have my ethernet gateway up and running on a breadboard. It worked first time
If this is of use to anyone, all I did in Domoticz was go into Setup/Hardware and change the existing serial gateway to "Mysensors Gateway with LAN interface" and press update. All the sensors are then remembered as the Gateway IDX stays the same.
-
RE: Motion sensor(s) send false trigger a few minutes after motion occured.
@skywatch Thanks. Am using HC-SR-501. I have them set on lowest time so they trip for 1-2 seconds. My alarm code takes 15s to arm so they should all be back to off by then.
I read battery levels every 2 minutes as I also use this information to make sure the sensor is still alive. This works well for the most part however I do get intermittent sequences of missed battery reports. I think this is more to do with NRF24L01+.
I am using single 18650 cells and getting many months from them - I have all LEDs and regulators removed. Both arduino and PIR run directly on 3.3V from a 662K regulator.
Battery level is also sent when the PIR is triggered as both parts are in the sketch loop - but that is fine.I am currently using the serial gateway on a pi B, but plan to build an ethernet gateway and see if that helps with things. I also plan to relocate it to a more central point in the house.
@nagelc Thanks...that is food for thought. So would your code make the aduino sleep for 5ms, then wake, then sleep again until there is either an interrupt or the sleep time has elapsed? OR does it sleep for 5ms, then carry on sleeping?
I use a delay before my battery reading is taken to let thinks settle. Do you think delay would work here also?
I have tested the system today, and it has behaved perfectly. I am still thinking that something starts to run slow and messages get delayed somewhere.
-
Motion sensor(s) send false trigger a few minutes after motion occured.
I am using motion sensors combined with Domoticz on pi and an alarm relay.
The problem is intermittent false motion activation being sent just a few minutes after all rooms are vacated. If it gets past the first few minutes then everything works as expected.
I am using the standard motion sketch combined with battery level.void loop() { // Read digital motion value bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH; Serial.println(tripped); send(msg.set(tripped?"1":"0")); // Send tripped value to gw // Sleep until interrupt comes in on motion sensor. Send update every two minute. sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME); // get the battery Voltage delay(500); int sensorValue = analogRead(BATTERY_SENSE_PIN); #ifdef MY_DEBUG Serial.println(sensorValue); #endif
Battery levels get reported every 2 minutes. Occasionally battery reports do not get through. Sometimes a single sensor will just give up sending battery reports? (still working on this problem).
I am wondering if the motion trigger messages before I leave a room somehow get queued and then eventually get sent after the system is armed? Is that possible? What happens to a message if it cannot get through?
The only other think I have thought of is that the sleep happens inbetween the motion trigger message and the battery read.
-
RE: [Solved] Repeater node causing Problems
@electrik I tried it on its own 662K regulator and pretty sure I also tried direct 3.3V from my bench PSU. I'll maybe have one more go at that.
-
RE: [Solved] Repeater node causing Problems
@electrik Thanks for that. The first link there is another thread of mine!
I have now swapped the radio module on the serial gateway for the module I have with PA/LNA. (this module makes any arduino hang when set for MAX power so have to use on HIGH) So far things seem much more stable. battery reports from my sensors are getting through every time. Just had a false activation from one of my PIR sensors but I am guessing that is another issue.....
It is strange how the original radio module seems to have degraded over time. I think the jury is still out on NRF24's. -
RE: Wipe/Change serial gateway arduino
@mfalkvidd Thanks for that clarification. I am also thinking of swapping from serial to ethernet when I have time so I can use MQTT.
-
Wipe/Change serial gateway arduino
I have been having some communication issues and want to delete the routing table in the gateway.
I was thinking of erasing the EEPROM and re-uploading the gateway sketch or just starting afresh with another arduino.
Just wondering if this would wipe out all my current config in Domoticz? -
RE: [Solved] Repeater node causing Problems
@sergio-rius Thanks for the reply. Yes I have 3 NRF24 with good range but all other ones I have are significantly reduced.
I was almost ready to give up with them.However......
I put all my sensors near to the gateway for about a day. No errors produced.
I have now moved them all back to their original positions.....Now over 24 hours and fingers crossed no errors as yet. Actuator is back up and running but without repeater enabled.
Maybe some time was needed with strong signal for the routing to re adjust? -
RE: [Solved] Repeater node causing Problems
@electrik So I would enable debug and look at the serial output of a sensor node?
I am now suspecting a problem with my gateway
After this 3 sensors carried on reporting, one is still has not reported battery even after over an hour.
-
RE: [Solved] Repeater node causing Problems
@electrik Thanks for the reply.
After I left everything alone 3 out of 4 sensors started reporting in. Another half an hour had the fourth sensor working. Maybe the routing has now been updated?
Each motion sensor reports battery every 2 minutes. Randomly these do not get through. Sometimes all sensors at once, sometimes just one. I was not getting so many errors when I first set this up.
I have now taken the repeater offline to rule that out. Still getting missed readings.I have tried to read up on ACK but it is very confusing. Is there a way I can keep re-sending battery messages until the controller gets them? Domoticz does say ACK is enabled on the battery child.
The code parser seems to suggest NACK -
RE: [Solved] Repeater node causing Problems
Last night I was just about to give up and at the last minute the troublesome relay node (without repeater enabled) got recognised.
I switched it off to take it out the equation.This morning all my motion sensors had lost contact overnight - lots of emails. Despite an update and reboot of the pi they are still all reluctant to talk to the controller?
Has having a previous repeater node messed up their routing?
-
RE: [Solved] Repeater node causing Problems
Thanks for the advice about logging.
Ive gone from bad to worse......Have commented out //#define MY_REPEATER_FEATURE and reuploaded sketch
Now Domoticz will not see the relay child sensor.
Ive wiped eeprom and deleted old device from Domoticz. It just sees :
255 S_ARDUINO_NODE 2.3.1Was getting all sorts of errors from other sensors not responding but rebooting everything seems to have calmed that down a bit.
Output from debug is
16 MCO:BGN:INIT NODE,CP=RNNNA---,REL=255,VER=2.3.1
26 MCO:BGN:BFR
27 TSM:INIT
28 TSF:WUR:MS=0
35 TSM:INIT:TSP OK
37 TSF:SID:OK,ID=8
38 TSM:FPAR
75 TSF:MSG:SEND,8-8-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
81 TSF:MSG:READ,0-0-8,s=255,c=3,t=8,pt=1,l=1,sg=0:0
87 TSF:MSG:FPAR OK,ID=0,D=1
2082 TSM:FPAR:OK
2083 TSM:ID
2084 TSM:ID:OK
2086 TSM:UPL
2089 TSF:MSG:SEND,8-8-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
2101 TSF:MSG:READ,0-0-8,s=255,c=3,t=25,pt=1,l=1,sg=0:1
2106 TSF:MSG:PONG RECV,HP=1
2108 TSM:UPL:OK
2110 TSM:READY:ID=8,PAR=0,DIS=1
2114 TSF:MSG:SEND,8-8-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
2121 TSF:MSG:READ,0-0-8,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
2131 TSF:MSG:SEND,8-8-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.1
2140 TSF:MSG:SEND,8-8-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
2153 TSF:MSG:READ,0-0-8,s=255,c=3,t=6,pt=0,l=1,sg=0:M
2159 TSF:MSG:SEND,8-8-0-0,s=255,c=3,t=11,pt=0,l=5,sg=0,ft=0,st=OK:Relay
2168 TSF:MSG:SEND,8-8-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.0
2177 TSF:MSG:SEND,8-8-0-0,s=1,c=0,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
2182 MCO:REG:REQ
2188 TSF:MSG:SEND,8-8-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
2195 TSF:MSG:READ,0-0-8,s=255,c=3,t=27,pt=1,l=1,sg=0:1
2200 MCO:PIM:NODE REG=1
2202 MCO:BGN:STP
2203 MCO:BGN:INIT OK,TSP=1 -
RE: [Solved] Repeater node causing Problems
@mfalkvidd Thanks. Are we talking enabling logging on the controller (Domoticz) or is there a better way?
-
RE: [Solved] Repeater node causing Problems
@electrik Sketch is as detailed here https://www.mysensors.org/build/relay
Using NRF24L01
Mysensors library is up to date. -
[Solved] Repeater node causing Problems
I have recently constructed a relay actuator node that has repeater enabled.
Since then I get random lost communication messages from my other nodes. About once a day some or all my nodes report they have lost communication. This is done by reporting battery level every 2 mins. If they have not reported in after 4 mins I generate an error from Domoticz.The repeater is located once room away from the gateway. It is powered with a good 240AC to 12VDC adapter, going into a breadboard PSU to supply the necessary voltages.
I could of course just disable the repeater function, but it would be nice to know what is wrong.
-
RE: NRF24L01+ SI24R1
@guillermo-schimmel It is interesting that the "tip" method did not work for me. Maybe the antenna tracks on my PCBs are not too good.
-
RE: NRF24L01+ SI24R1
Today I have conducted some experiments with the antenna on one of my "bad" modules.
First I extended the length of the antenna as detailed in the youtube video by @petewill . No improvement to speak of.Having noted that the antenna tracks on all my bad modules are thicker than the ones that work, I cut the track to the on board antenna and soldered on a 125mm piece of cat5 wire.
The improvement was immediate. I can now reach from one end of my house to the other.
Interestingly there were still a couple of dead spots right at the far ends, but bending the wire at right angles, 2 or 3 cm form the end got everything working.I have yet more modules on order from ebay so will see what they look like - CDEBYTE ones still at a high price
-
Relay actuator alarm siren acknowledgment
I have built the relay actuator using the stock sketch in examples.
I think because I am using one of my "bad" NRF24L01 radios, sometimes the signal to switch it on does not get through.
Domoticz knows that it has not switched and puts the software switch to match.
This has really got me thinking and I'm struggling to put all the pieces of the puzzle together.Questions:
Does Domoticz know if the switch request has happened or not because ACK is enabled at the Domoticz end? Child S_LIGHT/S_BINARY is set to ACK true by default. (I have not enabled ack in the sketch)
Will enabling ack in the sketch change anything?
Is there a way to keep sending the turn on request until it switches on?
If I use signing, is that another way of checking communication?
I am currently trying to learn MQTT/Node Red. Would using MQTT and QoS2 be a better way to get the signal through.I guess the aim here is to get communication between gateway and siren guaranteed.
-
RE: Siren build
Parts arrived.
Used the default relay sketch. Works great. Nice and loud.
-
RE: NRF24L01+ SI24R1
@yveaux Some useful info there. Thanks. Will keep an eye on those modules to see if the price drops a bit.
-
RE: NRF24L01+ SI24R1
Latest update.
Another 4 boards arrived from ebay. They looked like the bad batch I had in that the tracks on the PCB antenna are slightly thicker.
Sure enough......terrible range.I have also received the NRF24L01+PA+LNA from the link on the Mysensors store.
This refuses to work in MAX power mode - yes I am using separate 3.3V supply for it. Everything just locks up. Range in other power modes is no better. The printing on the PCB is different to that pictured. Pin 0 is not marked. Confusingly there is a dot next to pin 8 !!!so so far 3 good radios. 8 Bad ones.
I have asked Banggood if they are still shipping the radios that worked.
Anybody bought any recently that work ok? Maybe time to change to another band? -
RE: Resettable fuses.
@skywatch Appreciate the reply. I have made up some 500mA quick blow fuses that I already have from a trusted source.
-
Resettable fuses.
I have now built 3 motion sensors running from a single 18650 and a 3.3V 662K regulator.
I am thinking that I really need a fuse between the 18650 and the board in case anything shorts.
I have discovered the resettable fuses very cheap on Ebay.
https://www.ebay.co.uk/itm/50Pcs-500MA-6V-MT-SMD-Resettable-Fuse-PPTC-PolySwitch-Self-Recovery-Fuses-FY/183334221115Would these be OK or is there something better?
Thanks
-
RE: MQTT Protocol Question
@wimd Thanks.
Why would I want a non presented node?
I am guessing a Mysensors MQTT gateway will let me send and receive MQTT messages direct to/from the Mysensors network without having to rely on Domoticz? -
RE: Erratic battery reading when powering via RAW pin
@affordabletech Have been busy soldering today. Used pro mini with regulator and LED removed + HC-SR501 with regulator and diode removed. 18650 cell for power.
The NRF24 radio us one of the bad ones from with poor range.On TX it used about 4mA but only 42uA while sleeping.
Battery reporting is working well. -
RE: Siren build
@mfalkvidd Sounds reasonable. I am thinking a small UPS would be a good idea so I could keep my raspberry pi's, router, switch etc going as well.
Time to look at that relay node then! -
Siren build
I would like to build a battery powered siren for alarm activations. There are commercial products that claim a battery life of 3 years.
I have read that for a mysensors node to act as an actuator, it cannot sleep?
I've searched the forum but there is not a lot of info in the past couple of years.
Just wondered if anyone has any tips for what I am trying to achieve.So far I have ordered this: siren
-
RE: MQTT Protocol Question
Update so far:
Still using Domoticz with MS serial gateway, but have installed Mosquitto and in Domoticz I have added "MQTT Client Gateway with LAN interface".
This allows me to control my sonoff over MQTT. Some progress at least.
I notice that all the MySensors data is pushed out on the domoticz/out topic.
So do I really need a MySensors MQTT gateway? I guess that would allow interception if MQTT topics for processing with something such as Node Red.
I have just installed Node Red but have only managed to process some earthquake data (as per the example). -
RE: Erratic battery reading when powering via RAW pin
@affordabletech Thanks for the advice.
I have some 3.3V 662K regulators on order. So my plan would be to go from 18650 to regulator and then power everything from that supply.
I have indeed been running a couple of motion test nodes straight from the battery. I started to get some false activations somewhere around 3.6V
I had read that the regulator on the HC-SR501 could either be removed or bypassed, and will look into the possibility of doing this with a jumper.
Yesterday, I removed the LED and regulator from one of my pro minis so hopefully this will reduce power consumption to a minimum.I use the sleep statement from the standard motion sketch as follows:
sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
Hopefully that is correct?
-
RE: Erratic battery reading when powering via RAW pin
Thanks to all your replies I think I've got it fixed.
I tried another pro mini....still eratic.
I then used that second pro mini and built an identical node on another breadboard. Result was perfect readings.
I then rewired the problematic one and gave it another battery for good measure. It is now more than acceptable although still not as smooth a graph as the second node.
At the moment, running direct from 18650 and not boosting to 5V does not seem to be an issue for the HC-SR501's.
Maybe I will run into problems as the battery voltage lowers.
Node2
Node1
-
RE: Erratic battery reading when powering via RAW pin
I had tried moving the battery reading part around in the sketch but it didn't seem to make much of a difference. It's strange that it is only when powered via RAW. I used my PSU instead of a battery with the same result.
I'll maybe try another arduino first just in case. -
RE: Erratic battery reading when powering via RAW pin
Ok here is my feeble attempt at showing the circuit. I have omitted sensor and radio data cables.
Not too sure what I did but it seems to be stabalizing.
-
Erratic battery reading when powering via RAW pin
I have pro mini 3.3 running with motion/battery sketch. I am using voltage divider and have a capacitor across R2.
I am using a single cell 18650 for power with 5V step up regulator connected to Raw pin.
The battery readings are pretty erratic even if remove power from the PIR sensor. Now and again it reports the correct voltage. I have tried the 18650 (4.1V) without the regulator direct to RAW....still the sameNow the strange bit. If I remove battery power (just leaving battery connected to voltage divider) and power via 3.3VFTDI the readings stabilize and I get readings correct within 0.02V
Maybe a noisy regulator on the pro mini?
Maybe I should be stepping down to 3.3V rather than up to 5V. I was doing this in order to provide 5V to the PIR.