nice idea. this obsoletes about 50% of my mysenors related bookmarks
dakky
@dakky
Best posts made by dakky
-
RE: OpenHardware.io
-
RE: openHAB 2.0 binding
Dammit ... found the error
created a pull request: https://github.com/tobof/openhab2-addons/pull/18
Greetings
Dakky -
RE: Guide: Setting up and testing MQTT Client Gateway
@dakky said:
The gateway tries to open a lot of connections and all of them seem to die after a short while
Any idea?Narghs!
Seems to be a hardware problem. I changed the w5100 module with an w5100 arduino shield and now it works fine:
0;0;3;0;9;Starting gateway (RNNGA-, 1.6.0-beta) 0;0;3;0;9;Radio init successful. IP: 192.168.100.10 0;0;3;0;9;Attempting MQTT connection... 0;0;3;0;9;MQTT connected 0;0;3;0;9;Init complete, id=0, parent=0, distance=0
I'm still interested in the reason. Hardware broken or wiring fail?
- pinging the arduino worked
- i can see the connections on the broker
=> basic networking seems to work, but "delivering content" failed. Any guesses?
Strange fact: with the "broken" hardware:
0;0;3;0;9;Radio init successful. IP: 0.40.68.10
with the shield:
0;0;3;0;9;Radio init successful. IP: 192.168.100.10
Same sketch, 192.168.100.10 is the correct Ip (obviously)
Greeting
Dakky -
RE: Relay turns on when input is LOW?!
Ah that explains it for me. Thanks for the dettailed answer. I will @mfalkvidd's and switch the defines. thank you all
Greetings
-
RE: Simple irrigation setup based on pro mini
@mfalkvidd said:
- Yes you can use analog input as digital input if you like (but not as output). A5, A6 and A7 don't have internal pullups though so you might need to solder external pullups. EDIT: The distance sensor doesn't need pullups so you don't need to add any in this case. However, the TRIG signal to the HC-SR04 needs to be an output pin so you can't move that. You can move the moisture sensors, if you add external pullups (or buy sensors with built-in pullups).
Ok sounds reasonable. Have to read more about that pullup/pulldown thing
- There is no way you can power everything through the voltage regulator on the Pro Mini. The absolute maximum total power rating for the Pro Mini is 150mA when powering through raw. Also note that most Arduino clones do not survive 12V raw input, and that the nrf radio needs approximately 3.3V.
Ok I'll use one LM2596 in order to power all components directly + another 5V=>3V voltage regulator for the radio. This should work
- The relays are controlled by the output pins on the Arduino. The relays control power (12V in your case) that is coming from elsewhere. Relays often consume quite a lot of power (from the Arduino) when switching so make sure you add capacitors. You could also consider using FETs instead of relays. We've seen many threads on relay problems that were caused by power issues.
Is that a problem too, when powering the relay directly from the LM2596? Otherwise i have to learn something about FETs
- Probably But the best way to learn is to try
So true the problem is the "lost" time when waiting for another china package
An alternative to getting 8 pumps is to get 1 pump and 8 valves. That will probably be cheaper.
Hmm I did not find any cheap valves. One of the pumps is about $6. And valves cause one problem imho: they need pressure in order to work and this requires to activate the pump some seconds bevor triggering the valve => increased complexity
@dbemowsk said:
Are you aware of this project that is in the build section of the site?
https://www.mysensors.org/build/irrigationI saw this one, but it's more a "standalone" solution imho. quite complex. I wanted just a stupid "tell me the moisture values and switch a relay"-solution
@rest:
hmm interesting. I will read something about these components, although I'm a little bit afraid of the required code changes
Latest posts made by dakky
-
RE: Problems with develop branch
Distance 10cm
BUt the second hint was useful. There seemed to be something "broken"/agile/in development yesterday which was fixed today. As far as I remember this was a fresh merge from development but nevertheless: now it is working again thanks 4 the hint.
Greetings
Dakky -
Problems with develop branch
Hello
I used the develop branch quite a while and everthing was fine.
But now i can't get the communication up between controller and node. I didn't change something on the hardware side, so I think there is an error on the software part.This is what I can see on the node:
Starting sensor (RNNNA-, 2.0.0-beta) TSM:INIT RADIO:OK assign node ID=1 TSM:PARENT send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: TSM:PARENT send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: TSM:PARENT send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: TSM:PARENT send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: read: 0-0-1 s=255,c=3,t=8,pt=1,l=1,sg=0:0 node 0 replied, d=0, _nc.distance=255 parent=0, d=1 TSM:ID node ID=1 pinging node 0 send: 1-1-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,st=ok:1 TSM:PARENT send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: TSM:PARENT send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: TSM:PARENT send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: TSM:PARENT send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: !TSM:FAILURE TSM:PDT TSM:INIT RADIO:OK assign node ID=1 TSM:PARENT send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: read: 0-0-1 s=255,c=3,t=8,pt=1,l=1,sg=0:0 node 0 replied, d=0, _nc.distance=255 parent=0, d=1 TSM:ID node ID=1 pinging node 0 send: 1-1-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,st=ok:1 TSM:PARENT send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: TSM:PARENT send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: read: 0-0-1 s=255,c=3,t=8,pt=1,l=1,sg=0:0 node 0 replied, d=0, _nc.distance=255 parent=0, d=1 TSM:ID node ID=1 TSM:PARENT send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: TSM:PARENT send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: TSM:PARENT send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: TSM:PARENT send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: !TSM:FAILURE TSM:PDT
On the gateway side i can see:
0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0-beta) IP: 192.168.100.10 0;255;3;0;9;TSM:INIT 0;255;3;0;9;RADIO:OK 0;255;3;0;9;TSM:GW MODE 0;255;3;0;9;TSM:OK 0;255;3;0;9;No registration required 0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1 0;255;3;0;9;read: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0: 0;255;3;0;9;MSG:BC 0;255;3;0;9;FPREQ from 1 0;255;3;0;9;GWL ok, FPRES to 1 0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=ok:0 0;255;3;0;9;read: 1-1-0 s=255,c=3,t=24,pt=1,l=1,sg=0:1 0;255;3;0;9;node pinged by 1, hops=1 0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=25,pt=1,l=1,sg=0,st=fail:1 0;255;3;0;9;read: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0: 0;255;3;0;9;MSG:BC 0;255;3;0;9;FPREQ from 1 0;255;3;0;9;GWL ok, FPRES to 1 0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=ok:0 0;255;3;0;9;read: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0: 0;255;3;0;9;MSG:BC 0;255;3;0;9;FPREQ from 1 0;255;3;0;9;GWL ok, FPRES to 1 0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=ok:0 0;255;3;0;9;read: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0: 0;255;3;0;9;MSG:BC 0;255;3;0;9;FPREQ from 1 0;255;3;0;9;GWL ok, FPRES to 1 0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=ok:0 0;255;3;0;9;read: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0: 0;255;3;0;9;MSG:BC 0;255;3;0;9;FPREQ from 1 0;255;3;0;9;GWL ok, FPRES to 1 0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=ok:0 0;255;3;0;9;read: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0: 0;255;3;0;9;MSG:BC 0;255;3;0;9;FPREQ from 1 0;255;3;0;9;GWL ok, FPRES to 1 0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=fail:0 0;255;3;0;9;read: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0: 0;255;3;0;9;MSG:BC 0;255;3;0;9;FPREQ from 1 0;255;3;0;9;GWL ok, FPRES to 1 0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=ok:0 0;255;3;0;9;read: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0: 0;255;3;0;9;MSG:BC 0;255;3;0;9;FPREQ from 1 0;255;3;0;9;GWL ok, FPRES to 1 0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=ok:0 0;255;3;0;9;read: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0: 0;255;3;0;9;MSG:BC 0;255;3;0;9;FPREQ from 1 0;255;3;0;9;GWL ok, FPRES to 1 0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=ok:0 0;255;3;0;9;read: 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0: 0;255;3;0;9;MSG:BC 0;255;3;0;9;FPREQ from 1 0;255;3;0;9;GWL ok, FPRES to 1 0;255;3;0;9;send: 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,st=fail:0
Any idea whats wrong here? is there a place, where I can read about the "new" output format/messages?
EDIT: I don't even come the the setup() part of my sketch. the node is looping around with the log messages above.
-
RE: Simple irrigation setup based on pro mini
@mfalkvidd said:
- Yes you can use analog input as digital input if you like (but not as output). A5, A6 and A7 don't have internal pullups though so you might need to solder external pullups. EDIT: The distance sensor doesn't need pullups so you don't need to add any in this case. However, the TRIG signal to the HC-SR04 needs to be an output pin so you can't move that. You can move the moisture sensors, if you add external pullups (or buy sensors with built-in pullups).
Ok sounds reasonable. Have to read more about that pullup/pulldown thing
- There is no way you can power everything through the voltage regulator on the Pro Mini. The absolute maximum total power rating for the Pro Mini is 150mA when powering through raw. Also note that most Arduino clones do not survive 12V raw input, and that the nrf radio needs approximately 3.3V.
Ok I'll use one LM2596 in order to power all components directly + another 5V=>3V voltage regulator for the radio. This should work
- The relays are controlled by the output pins on the Arduino. The relays control power (12V in your case) that is coming from elsewhere. Relays often consume quite a lot of power (from the Arduino) when switching so make sure you add capacitors. You could also consider using FETs instead of relays. We've seen many threads on relay problems that were caused by power issues.
Is that a problem too, when powering the relay directly from the LM2596? Otherwise i have to learn something about FETs
- Probably But the best way to learn is to try
So true the problem is the "lost" time when waiting for another china package
An alternative to getting 8 pumps is to get 1 pump and 8 valves. That will probably be cheaper.
Hmm I did not find any cheap valves. One of the pumps is about $6. And valves cause one problem imho: they need pressure in order to work and this requires to activate the pump some seconds bevor triggering the valve => increased complexity
@dbemowsk said:
Are you aware of this project that is in the build section of the site?
https://www.mysensors.org/build/irrigationI saw this one, but it's more a "standalone" solution imho. quite complex. I wanted just a stupid "tell me the moisture values and switch a relay"-solution
@rest:
hmm interesting. I will read something about these components, although I'm a little bit afraid of the required code changes -
Simple irrigation setup based on pro mini
Hello again
I'm planning to water some of my plants with a quite simple setup.
Basically I want to use a pro mini with a nrf module and a moisture sensor and pump per plant.This leads me to the following "wiring" (sry for the humble presentation )
The arduino clone has a strange pin layout, but thats not the problem at the moment.
Basically a want to know: will this hardware setup work?Some hard facts:
- 12v input because of the pumps are 12V powered
- arduino pro mini 5v
- 8x relay 5v
- HC-SR04 distance sensor for measuring water supply
- Soil Moisture Sensors
- 12V peristaltic pumps with max 0.8A
There are some "problems" IMHO:
- too few digitial pins even when i use D2 as output/relay and not as IRQ for the radio i only have 5 pins for switching the pumps/relays. On the opposite side I can have 8 moisture sensors Or can i use analog pins as digital INPUT? Then i'd move the distance sensor to A5/A6 which results in 7 relay control pins and 6 moisture sensors => 6 plants instead of 5.
- too much current on vcc/GND? not sure if its a good idea to power the 8x relay, the radio, up to 8 moisture sensors and the distance sensor from the tiny pro mini. maybe i should use an external 12V to 5V voltage regulator in order to power all 5V tolerant devices (sensors and relay)
- can i connect the pumps directly to the relay? It should protect the arduino from power peaks when switching the pumps? I read something about "neverever power engines directly from the arduino"
- Anything i forgot?
I know there are some "ready2use" irrigation setups, but i want to keep it as simple as possible and want all the logic on the controller side (except some "emergency stop mechanisms )
-
RE: openHAB 2.0 binding
I'm using a ethernet gateway.
the problem is: if the sensors gateway gets restarted/disconnected/updated/whatever the binding does not reconnect. The only way to fix that, is to restart openhab in order to force the binding to connect again.
Detecting an disconnect is really that hard? in the worst case, what about simply reconnecting timebased? not as cute as only reconnect when nessecary but a dirty quickfix. -
RE: openHAB 2.0 binding
@TimO do you plan to implement the reconnect thing? I often have to struggle with that and the only solution is the restart the openhab service :S Is there a problem with the reconnect or is it just "another task on the todo list"?
Greetings
Dakky -
RE: Relay turns on when input is LOW?!
Ah that explains it for me. Thanks for the dettailed answer. I will @mfalkvidd's and switch the defines. thank you all
Greetings
-
Relay turns on when input is LOW?!
The title says it all: I have connected a relay to my network and it switches power on (led on the relay lights up), when the input pin goes low and vice versa.
Thats a little bit confusing, when switching off something in the controller UI and the device is switching on and i don't think, that zwitching the state in the arduino code is the way to go
any idea whats wrong here? Wiring is straight forward (vcc & gnd with corresponding pins on relay + D2 to I1 on the relay).
The code is the the one from the examples (as far as I remember ).
I inserted some debug statements to prevent stupid errors on my side
Serial.print("arduino pin: "); Serial.println(message.sensor + FIRST_DIGITAL_RELAY_OUTPUT); Serial.print("message.bool: "); Serial.println(message.getBool()); digitalWrite(message.sensor + FIRST_DIGITAL_RELAY_OUTPUT, message.getBool() ? RELAY_ON : RELAY_OFF);
=>
arduino pin: 2 message.bool: 1
results in switched off relay.
Thanks for helping
EDIT: maybe "hardware" is the wrong section and "Troubleshooting" a better location If thats the case: please move the thread if possible
-
RE: openHAB 2.0 binding
Dammit ... found the error
created a pull request: https://github.com/tobof/openhab2-addons/pull/18
Greetings
Dakky -
RE: openHAB 2.0 binding
@dakky said:
I think i need some help. I am not shure, if my problem lies on the openHab2 side or if there is a problem with the mysensors addon.
No idea anyone? i'm stucked here and I'd really like to continue
EDIT: MAybe this helps debugging: it seem there is no "link" between things and items. The rest endpoints reveals, that the thing has no item:
[ { "statusInfo": { "status": "ONLINE", "statusDetail": "NONE" }, "link": "http://autohome:8080/rest/things/mysensors:bridge-eth:gateway", "configuration": { "tcpPort": 5003, "ipAddress": "192.168.100.10", "skipStartupCheck": false, "imperial": false, "sendDelay": 200 }, "properties": {}, "UID": "mysensors:bridge-eth:gateway", "channels": [ { "linkedItems": [], "id": "n1c0", "itemType": "light", "properties": {} }, { "linkedItems": [], "id": "n1c1", "itemType": "light", "properties": {} }, { "linkedItems": [], "id": "n1c2", "itemType": "humidity", "properties": {} }, { "linkedItems": [], "id": "n1c3", "itemType": "humidity", "properties": {} }, { "linkedItems": [], "id": "n1c4", "itemType": "humidity", "properties": {} } ] } ]
Greetings