Arduino Sensor 1.3 Beta 1

Ok, call for beta testers.

Download zip:
http://code.mios.com/git_public/mios/arduino-sensor.git/snapshot/HEAD.zip?js=1
Browse tree:
mios/arduino-sensor (gitweb)

CHANGES 1.3

[ul][li]More debug info is printed to serial monitor in sensors (can be turned off).[/li]
[li]Nodes that receive messages from vera don’t need to busy wait. New API methods. See new example code in RelayActuator sketch.[/li]
[li]Increased transfer speed (1MBPS) between radios.[/li]
[li]Sent time to sensors uses vera configured timezone[/li]
[li]Radio protocol updated. from/to/version/crc/binary added in message header. This change requires sensors to update their (1.2) library version.[/li]
[li]Variables in vera only gets updated if changed.[/li]
[li]Increased baudrate between vera gateway and vera.[/li]
[li]Message can be sent between sensors without being processed by vera.[/li]
[li]Vera library is now a subclass of RF24 .[/li]
[li]Remove gateway specific code from vera library. New class hierarchy RF24->Node->Relay->Gateway.[/li]
[li]Preserve memory by placing static strings in PROGMEM[/li]
[li]Inclusion mode. Can be started from the Arduino Vera plugin or by using digital input pin on vera gateway (inclusion button). All found devices during inclusion time will be created at once (no multi vera reload/restart cycle needed anymore).[/li]
[li]ArduinoGateway support blinking leds for RX/TX/ERR and a special blink when inclusion mode is activated.[/li]
[li]Dimmer support[/li]
[li]Lastupdate-variable is set in vera for all changes.[/li]
[li]A new device is created in vera for each physical arduino/radio This device will hold info about node, such as library version, battery info and relay information.[/li]
[li]Support for message relaying. All nodes can act as relay. This functionality can be used for communicating with sensors far away. An relay node forwards messages between sensors and vera gateway. Multiple relays (message hops) is also supported. [/li][li]See RelayActuator sketch for an example how to create an relay node.[/li]
[li]Relay node for a sensor (could be GW) is dynamically located each time a sensor is losing connection. This information is also sent to vera and can be seen in radio node device.[/li]
[li]Unit system can be configured in vera plugin (metric/imperial). Sensors can fetch this setting (isMetricSystem()) and send in data in the correct unit.[/li][/ul]

Awesome… Thanks Hek . will be trying this out later!

Sent from my Nexus 5 using Tapatalk

Greate news hek!!

If only my ordered parts would get here.

Hi Hek,

Just a quick update…
I have setup 3 sensors ( different nodes) and one gateway.

  • DallasTemperature
  • RelayActuator
  • LightSensor
    and the Veragatway - all with the 1.3b1 code/libraries.

Ive just loaded the examples, unmodified, except for in the DallasTemperature sketch where ive put the DS18B20 on Pin3 ( as pin2 is used by radio )

All seems to be working correctly except for the relay actuator stops responding after a few minutes… In UI5 clicking the On/Off buttons do nothing, and the serial output from the RelayActuator stops updating.
During this time the values from the light and temp sensors continue to be sent and received, so it would appear to be the relayactuator hardware/sketch.
If i press the reset button on the relayactuator, it works again…for a while.

See the log output below… I think that the sketch fails on a “Send failed. No ack received”

Have you seen this before?

Incoming change for relay on pin:5, New status: 1 Received message: from=0, to=9, childId=5, mtype=1, type=2, crc=20, payload='0 ' Message crc ok. Message addressed for this node. Relaying message back to gateway. Sending message: from=9, to=0, childId=5, mtype=1, type=2, crc=197, payload='0 ', sent via 0 Sent successfully Incoming change for relay on pin:5, New status: 0 Received message: from=105, to=0, childId=0, mtype=1, type=23, crc=30, payload='56' Message crc ok. Routing message to child node. Sending message: from=105, to=0, childId=0, mtype=1, type=23, crc=238, payload='56', sent via 14 Send failed. No ack received.

Should probably change the DS18B20 example sketch…

[quote=“gregl, post:4, topic:177651”]All seems to be working correctly except for the relay actuator stops responding after a few minutes… In UI5 clicking the On/Off buttons do nothing, and the serial output from the RelayActuator stops updating.
During this time the values from the light and temp sensors continue to be sent and received, so it would appear to be the relayactuator hardware/sketch.
If i press the reset button on the relayactuator, it works again…for a while.

See the log output below… I think that the sketch fails on a “Send failed. No ack received”

Have you seen this before?[/quote]
No… Interesting… I don’t think i’ve had it running for more than a couple of minutes.

Are you relaying light level (type 23) values from another sensor throught this relay node?

I wonder why it sends it over to node 14 before it “dies”?

I got the rest of my parts a week ago. Just need to find time to build some sensors. I’ll try to get this build onto the test devices I have now.

  • Garrett

I have had the following setup running for an hour now without any freeze.

Temp sensor <-> GW <-> Relaying Actuator Node <-> Motion Sensor

I’ve been watching what is passing through “Relaying Actuator Node”. Saw some bursts of garbage messages a couple of times but the new CRC check worked and nothing was processed. I will keep it running for some more time and see what is happening.

Just some questions gregl. What arduino board are you using? Do you use a regulator for the radio module? I had some problems to get the radio work with my SOT-23 regulator before a put a small capacitor over 3.3V-GND.

I bought one of these to try out:

  • Garrett

First and most importantly - thank you Hek and everyone else that has worked on this project and the 1.3 beta! Awesome!

I’ve done the upgrade and started primarily testing. In general, very good experience so far. One oddly I noticed which may be a bug. My old deleted node and devices reappear in Vera GUI when adding a new node. Here’s what happened:

  1. deleted my old node & devices in Vera GUI
  2. cleared EEPROM config using provided sketch, then reloaded my sensor sketch
  3. turned on “inclusion” in Vera GUI
  4. reset my sensor sketch and Vera GUI reported correct number of devices added
  5. turned off “inclusion” in Vera GUI
  6. Vera GUI shows new node and devices (with new incremented node number)
  7. problem is ALL the old deleted nodes & devices are also added back into the Vera GUI

Hope that helped some!

Cheers!

Joe

@joek.
I think this is a bug in vera. Vera seems to remember the deleted devices even after removal (in luup.devices) and you have to restart vera (hard) to get rid of them. It is also a bit intermittent… sometimes they really gets removed.

Sorry for the fuzzy answer…

I can confirm this behavior now. My relay sketch also freezes now. The strange thing is that gateway uses much of the same code as relay… But I don’t see any freezes over there…

Thanks, working great for me. Currently have a pro mini with 1x relay & another pro mini with 1x distance sensor. No long term testing yet as not quite setup with the needed power supplies.

Hi guys - with respect to my relayactuator hanging…i have tried several things tonight.

if i only have the relay actuator connected - all seems well, but if i turn on the dallas temp or the lightsensor, it shortly crashes last line as per the log from yesterday - ive no idea what “14” is…

So,I have deleted all entries in Vera (+ hard reboot), and readded. Issue returns.

I then built another relayactuator and it too had the issue,… i also discovered one of the radio boards seems to be faulty!!! luckily after swapping it out with a new one, it worked as it should…

Given these are all on my desk, i moved one of the relayactuators into another room and so far 20odd minutes all is well!!!

Will keep monitoring and advise if issue returns…

Hek, does any routing config get stored in the vera? im just trying to understand what the “14” was… given i was mucking around with your unfinished code, if there was something remaining in Vera perhaps??

Any routing info stored in vera devices-variables is not used for anything except debug purposes. The tables is stored in gw and relay nodes eeprom memory and should be kept up to date by itself :wink:
I’ve created a “clear” command that can be called from vera to force a clear of routing info in an relay-node. But if should not be necessary to call normally.

I still had freezes yesterday… maybe we have some leak/buffer problem somewhere that manifestst itself randomly.

Hi Hek,
This morning( I’m in Australia) I was still able to use both relay actuators. Neither had locked up.
I’ll try tonight running them all in the same room and see if the issue returns.

How close are your devices to one another?

Sent from my Nexus 5 using Tapatalk

Ok, small update checked into master branch.

I had missed to store distance for relaying nodes in eeprom. So after powercut this resulted in wrongful replies to pink-ack messages from other nodes looking for a relay back to gateway.

Also found bug in gateway (relay-class) that resulted in strange behavior after 20 send failures (gw started looking for relay node, which only shall happen in relaying nodes…).

Hopefully this weekend I can play with this!

  • Garrett

Added a couple of new example sketches to master.

  1. Relaying node. Shows how to create a node the relays messages from other nodes far from gateway back.

  2. Very simple IrSensor. Sends and receives ir commands controllable from vera. Note that this is a hardcoded example controlling volume of my tv. Also all received ir commands is passed back to vera and is stored in VAR_1 of the created device (so it is possible to kick start scenes etc from any ir remote). The ir-sensor code should probably be made more general but someone need to explain how vera-ir-devices/pronto code works for me.

I will create a wiki page for the IrSensor explaining what hardware to buy and how to connect it eventually…

Used this hardware:
http://www.aliexpress.com/item/2PCS-Digital-38KHz-Infrared-IR-Sensor-Transmitter-Kit-for-Arduino-M3AO/1178542936.html

Really nice work hek!!

I really can?t wait to get my hands dirty with this, why does China need to be so far away?

Btw, I stumbled upon a NFC/RFID reader writer on AliExpress → http://www.aliexpress.com/item/Free-shipping-PN532-NFC-RFID-module-User-Kits-Arduino-compatible/921645633.html
Anybody considered one of these? Is there any chance that this could work? Would be really nice to get it integrated with Vera.

Br,
Tomas

@korttoma
Considered yes, but as I don’t really have any use for it they have fallen out of my budget for this project. Feel free to send me one :wink: