@AWI Darn you are right!!!!! Thanks! Have been dealing with rpi and upwards lately so assumed it has some kind of internal clock.
Thanks again!
Moshe Livne
Posts
-
[SOLVED] strange problem with millis() -
[SOLVED] strange problem with millis()@AWI as it should.... but - it should show a very long number.... not a 4 digit one. and not the same values each time i run the code.
this is a test code, just to show the problem. in the original code there was static var, etc and the difference was checked.
-
[SOLVED] strange problem with millis()It has been a long time but i am back... however, I must have lost it!
Millis now return 4 digits results and I can find the reason. It might be the update of the libraries the arduino IDE asked me to do. Anyways, here is the code:
#define MY_DEBUG #define MY_RADIO_NRF24 #include <SPI.h> #include <MySensors.h> // Mysensor network void setup() { // put your setup code here, to run once: } void loop() { unsigned long now; Serial.println("entering loop"); now=millis(); Serial.print("now="); Serial.println((unsigned long)now); sleep(5000); }couldn't be simpler....
now the result:
x00 x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x00x000 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1 3 TSM:INIT 4 TSF:WUR:MS=0 11 TSM:INIT:TSP OK 13 TSF:SID:OK,ID=28 14 TSM:FPAR 33 TSF:MSG:SEND,28-28-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 272 TSF:MSG:READ,0-0-28,s=255,c=3,t=8,pt=1,l=1,sg=0:0 277 TSF:MSG:FPAR OK,ID=0,D=1 2040 TSM:FPAR:OK 2041 TSM:ID 2042 TSM:ID:OK 2044 TSM:UPL 2046 TSF:MSG:SEND,28-28-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1 2054 TSF:MSG:READ,0-0-28,s=255,c=3,t=25,pt=1,l=1,sg=0:1 2059 TSF:MSG:PONG RECV,HP=1 2061 TSM:UPL:OK 2063 TSM:READY:ID=28,PAR=0,DIS=1 2067 TSF:MSG:SEND,28-28-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100 2073 TSF:MSG:READ,0-0-28,s=255,c=3,t=15,pt=6,l=2,sg=0:0100 2080 TSF:MSG:SEND,28-28-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.1.1 2088 TSF:MSG:SEND,28-28-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0 2095 TSF:MSG:READ,0-0-28,s=255,c=3,t=6,pt=0,l=1,sg=0:M 2100 MCO:REG:REQ 2103 TSF:MSG:SEND,28-28-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2 2109 TSF:MSG:READ,0-0-28,s=255,c=3,t=27,pt=1,l=1,sg=0:1 2114 MCO:PIM:NODE REG=1 2116 MCO:BGN:STP 2118 MCO:BGN:INIT OK,TSP=1 entering loop now=2120 2121 MCO:SLP:MS=5000,SMS=0,I1=255,M1=255,I2=255,M2=255 2127 MCO:SLP:TPD 2129 MCO:SLP:WUP=-1 entering loop now=2131 2131 MCO:SLP:MS=5000,SMS=0,I1=255,M1=255,I2=255,M2=255 2138 MCO:SLP:TPD 2140 MCO:SLP:WUP=-1 entering loop now=2142 2142 MCO:SLP:MS=5000,SMS=0,I1=255,M1=255,I2=255,M2=255 2148 MCO:SLP:TPDI have been staring at this for the last two hours... Any help will be appreciated. I am sure it is something ultra stupid
Regards,
Moshe -
"Washing machine ended" sensor@JahFyahh it was mostly trial and error. I was lucky and my initial setup was good but these sensors have very sensitive adjustment (all cheap sensors do, i think) and sometimes a fraction of a turn is enough to change things. I think I wrote a simple "read in a loop" sketch and shaked it a bit (like a washing machine, small shakes) to see if i have a read. Hope that helps. I think top of the machine vibrates a bit more than back. if you put on the back, maybe try to mount it high as the upper part moves more than the lower part.
-
"Washing machine ended" sensor@JahFyahh yes, still using it. I never get false readings although lately I started getting the notifications half way through the cycle. Need to check the glue.
-
"Washing machine ended" sensor@chuckconnors I seriously doubt that. the washing machine has much move violent movements. For the dryer I think I would go with current as it is continuously drawing current (lots of current!) while working. In retrospect I would do the same with the washing machine if it was not under warranty. get a small junction box, expose about 3cm of the cable and use non invasive current sensor, all inside the box. Problem is, as always, power for the arduino.
another option that I considered is taking a good quality power strip, with lots of space in it and putting the sensor and the arduino inside it or only the current sensor (as the wires are exposed usually inside the strip) and the arduino device and charger on the outside. many modern strips have good quality USB sockets so no need for charger.
just my 2c... not saying you should touch mains, etc bla bla bla.... -
How To - Doorbell Automation Hack@petewill My original plan was to unintrusively detect the ring and trigger the arduino without effecting the bell circuit. However, it proved to be a bit more complicated and 2 dead arduinos and several other fried components later I gave up.
-
How To - Doorbell Automation Hack@petewill ummmm you could still cut the ring even if it was the other way around with a relay. Sorry to be a pain :-) can't fight my mold hehehe. generally I find the reliability of dorrbells (especially the old wired kind) to be excellent. mine has been working flawlessly for at least 35 years.
-
How To - Doorbell Automation HackHello all - sorry I have been away for so long...
This bring back memories http://forum.mysensors.org/topic/1620/mysensored-doorbell
I wish I found a way of triggering the notification from the ring and not the other way around, as this way when something happen to your arduino the doorbell will not ring. Didn't happen yet - it works perfectly for 6 months but I would feel more relaxed if it was the other way around. Oh well... -
"Washing machine ended" sensor@Cliff-Karlsson sorry for the delayed reply.
It needs to be set just on the verge.... So, turn it slowly until it is 0,give it slight turn back. These sensors do not have good signal amplification (its ok for the price i guess) so they work in a vwry narrow ranfe -
Safe In-Wall AC to DC Transformers??@Didi, did you end up doing horrible things to these? You said something about flashbox?
-
Which are the *best* NRF24L01+ modules?@NeverDie oh come on! Do it! Do it! :smile:
-
Help needed@MarkV are you using rf69? did you follow the instructions for downloading the libraries and installing them in the arduino IDE (see http://www.mysensors.org/about/arduino, scroll down a little)
-
ATtiny supported?@NeverDie I have no idea!!!! maybe digikey are selling counterfeits? hihihi
that is not a bad price. -
ATtiny supported?@NeverDie very cool chip but a bit dear.... even on aliexpress (assuming it is not a counterfeit - Oh no! here we go again!)
-
Which is better: RFM69 or NRF24L01+?@NeverDie I mean in reality... people here measured 30uA compared to 3uA in similar nrf setup. could be the result of many things, might be just a kink that has to be ironed in the software.
-
Which is better: RFM69 or NRF24L01+?@Francois darn, by now i can wire the nrf from memory. Now to learn new wiring....
The power consumption in idle is still something to consider -
Sound Sensor@epierre Osrry, forgot to mention that the killer was the lack of amplification on the cheap modules. The diff between silence and hand clap few cm from the mic was only a few numbers on the reading. When you have amplification it stretch it across the 1023 range, I think.
-
Sound Sensor@epierre I have ordered almost any kind of sound sensor on aliexpress for my washing machine sensor (at first I thought to get the beeps). They were all really bad.... I went the vibration way, but if I had to start all over again I think I would get https://www.sparkfun.com/products/9964
-
Parking Sensor@hek Ultra cool!!!!