Author Topic: Arduino Sensor Plugin - Build your own wireless sensors!  (Read 236288 times)

Offline watou

  • Hero Member
  • *****
  • Posts: 870
  • Karma: +43/-12
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #15 on: September 07, 2013, 10:11:00 am »
@watou
Yes that would probably preferable. I don't think the Vera can have this logic in the plugin part. I'm a bit worried about having too large buffers with unsent data hanging around in the "attached nano"  (hereafter called ArduinoGateway) though.

Maybe the ArduinoGateway could timeout messages after 2-3 minutes back to vera plugin.

And when a sleeping node wakes up it could probably poll the ArduinoGateway for new commands.

You could use a fixed buffer of outstanding commands in the ArduinoGateway, and when it's full the next command pushed on the queue would discard the oldest one pushed and NAK the sender of that command.  Otherwise it would ACK the sender once it's been delivered to the sensor node.  Since there would be no backing storage of this command queue, command senders should not expect to receive ACKs or NAKs in case of reboots, power outages, etc.


Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #16 on: September 07, 2013, 10:19:18 am »
Yup. will probably implement it like that. I already have a "queue" for incoming messages partly received (if they consist of more than one 32 byte fragment).
 
« Last Edit: September 09, 2013, 04:34:52 am by hek »

Offline mitekdg

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +0/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #17 on: September 07, 2013, 11:08:49 am »

Note that the sensors that receives data probably cannot be battery driven as they will consume too much power when radio is always on.

sound interesting.
Why don't u use sleep mode in arduino with INT signal from NRF24 to wake-up for sensor?

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #18 on: September 07, 2013, 11:16:45 am »
@mitekdg
So true.  Much better.

Is it possible to get interrupts on more than one digital pin? Maybe an attached sensor also needs to trigger?

Offline mitekdg

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +0/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #19 on: September 07, 2013, 11:28:01 am »
Now i'm working on my project "arduino ethernet-NRF24 gateway".

http://maniacbug.wordpress.com/2011/10/19/sensor-node/ - here the info about power cons. and "battery driven feat."  (INT and sleep mode)
http://maniacbug.wordpress.com/2012/03/30/rf24network/ - about NRF24 network


Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #20 on: September 07, 2013, 12:26:03 pm »
Yes those are great pages. Especially the battery feature is cool and should probably be incorporated ;)
RF24 network will have to wait a while...

One thing I find annoying with arduino is that there are no unique id that can be used as radio-id. Now you have to update the sketch for each new sensor.

Offline mitekdg

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +0/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #21 on: September 07, 2013, 12:39:15 pm »
your project is really interesting and i'm looking to change my project and exclude ethernet, and "replace" it by usb
Waiting for "switch sketch" ))
thx!

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #22 on: September 07, 2013, 01:00:30 pm »

Offline mitekdg

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +0/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #23 on: September 08, 2013, 12:11:40 pm »
just test your solution:
1. did u analyze cpu load of vera in VeraGate use?
2. don't why but i have a very poor nrf24 connection ("Error: No ack received") on every data send

thx

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #24 on: September 08, 2013, 01:11:13 pm »
Just updated soil sensor to use interrupt instead. Which means faster response and more sleeptime...

@mitekdg
1. No. How do I do that? And why? The ArduinoGateway is mostly waiting for radiotraffic doing nothing... Or did you find some problem?

2. I have really good reception 25+ meters indoors.  Maybe you have something disturbing the radio channels? You can perhaps do a radio.setChannel() to set a explicit channel with little disturbance in your ArduinoGateway and sensor sketch (in setup).

Also ... In the example sketeches for RF24 library (in the libraries folder) there is a scanner program that checks all channels available for how good reception there is. Maybe you could try this to see which channel to choose?

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1

Offline mitekdg

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +0/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #26 on: September 09, 2013, 12:11:14 pm »
@hek
1. hmm.. don't know why but i feel ... some slow-down. So i set-up system monitor + dataminer. Will check! )
2. Took another arduino + nrf24. Experiment two.

Did u make some test of power consumer?  its interesting how long will it works. I'm going to use 18650 acc
what about two-way solution?

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #27 on: September 09, 2013, 01:48:31 pm »
Please do try to debug. Mine is superfast. When I started using interrupts on sensor its feels much faster than z-wave devices.

I have not tested power consumption yet. Will do that but I am still waiting for my new nano boards to arrive.

My first sensors will be mains feed.

Offline mitekdg

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +0/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #28 on: September 15, 2013, 02:08:00 pm »
test done.
1. cpu usege - ok
2. poor nrf connection. Problem was in power supply.

what about two-way connection?
did u try to use a RF24Network? 

Offline hek

  • Moderator
  • Hero Member
  • *****
  • Posts: 714
  • Karma: +60/-1
Re: [CODE] Arduino Sensor Plugin - Build your own wireless sensors!
« Reply #29 on: September 15, 2013, 02:35:51 pm »
I received an relay a couple of days ago but have had little time programming. Will do some nighthacking when the kids are in bed tonight.

Sorry have not tested the RF24network stuff...