Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
T

timg

@timg
About
Posts
5
Topics
2
Shares
0
Groups
0
Followers
0
Following
1

Posts

Recent Best Controversial

  • [SOLVED] Itead Rboard 2.1.1
    T timg

    This page helped me solve the problem.

    Regards,
    Tim

    https://www.mysensors.org/download/sensor_api_20

    /**
     * The MySensors Arduino library handles the wireless radio link and protocol
     * between your home built sensors/actuators and HA controller of choice.
     * The sensors forms a self healing radio network with optional repeaters. Each
     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
     * network topology allowing messages to be routed to nodes.
     *
     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
     * Copyright (C) 2013-2015 Sensnology AB
     * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
     *
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * version 2 as published by the Free Software Foundation.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - Henrik Ekblad
     *
     * DESCRIPTION
     * Example sketch showing how to control physical relays.
     * This example will remember relay state after power failure.
     * http://www.mysensors.org/build/relay
     */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    //CE/CS Pins
    #define MY_RF24_CE_PIN 8
    #define MY_RF24_CS_PIN 9
    
    // Enable repeater functionality for this node
    #define MY_REPEATER_FEATURE
    
    #include <MySensors.h>
    
    #define RELAY_1  4  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
    #define NUMBER_OF_RELAYS 4 // Total number of attached relays
    #define RELAY_ON 1  // GPIO value to write to turn on attached relay
    #define RELAY_OFF 0 // GPIO value to write to turn off attached relay
    
    
    void before()
    {
    	for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
    		// Then set relay pins in output mode
    		pinMode(pin, OUTPUT);
    		// Set relay to last known state (using eeprom storage)
    		digitalWrite(pin, loadState(sensor)?RELAY_ON:RELAY_OFF);
    	}
    }
    
    void setup()
    {
    
    }
    
    void presentation()
    {
    	// Send the sketch version information to the gateway and Controller
    	sendSketchInfo("Relay", "1.0");
    
    	for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
    		// Register all sensors to gw (they will be created as child devices)
    		present(sensor, S_BINARY);
    	}
    }
    
    
    void loop()
    {
    
    }
    
    void receive(const MyMessage &message)
    {
    	// We only expect one type of message from controller. But we better check anyway.
    	if (message.type==V_STATUS) {
    		// Change relay state
    		digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF);
    		// Store state in eeprom
    		saveState(message.sensor, message.getBool());
    		// Write some debug info
    		Serial.print("Incoming change for sensor:");
    		Serial.print(message.sensor);
    		Serial.print(", New status: ");
    		Serial.println(message.getBool());
    	}
    }
    
    
    Hardware

  • [SOLVED] Itead Rboard 2.1.1
    T timg

    Hi,

    I've been using Mysensors for a long time without need to update from version 1.4! :)

    Most of my nodes are mains powered and use relay's for switching lots of different stuff. Recently I have updated my serial gateway, uno's and nano's to 2.1 without problem, however, not so lucky with the Itead Rboard. @gregl helped me last time by showing me how to reference pins 8 & 9 for CE/CS. Could someone please help me understand what I must modify in a sketch using version 2.1.1?

    Thanks,
    Tim

    Re: ITEAD RBoard (4 relay)

    Hardware

  • ITEAD RBoard (4 relay)
    T timg

    Just reading this post from @gregl. Iboard - Cheap Single board Ethernet Arduino with Radio. This may be helpful !

    Hardware

  • ITEAD RBoard (4 relay)
    T timg

    I cross referenced the (working) single relay board with the radio mapping on the Uno's and they are the same.

    So my problem is mapping of the radio on the 4 relay unit. Could someone advise what I need to edit in the sketch or config file to map the pins that are required by the 4 relay unit (as detailed above)?

    Thanks in advance,
    Tim

    Hardware

  • ITEAD RBoard (4 relay)
    T timg

    Hi Everyone!

    I saw a couple of posts on the site in relation to boards from ITEAD STUDIO. I purchased the single relay unit and the 4 relay unit.

    I was able to easily get the single relay unit working through Vera (like @gregl) :) Although I still get some sync issues with Vera, like I have with relay units built on Uno'S. Not so much luck with the 4 relay unit, I'm getting the check wire error in the serial monitor (have tried other radios). I wonder if my problem is with the mapping of the radio?

    http://imall.iteadstudio.com/im120618001.html
    ftp://imall.iteadstudio.com/IM120618001_RBoard/DS_IM120618001_RBoard.pdf

    Here is the pinout of the 4 relay unit:

    Pin of Arduino Description
    D0 = RxD
    D1 = TxD
    D2 = XBee Reset
    D3 = nRF24L01+_IRQ
    D4 = R0
    D5 = R1
    D6 = R2
    D7 = R3
    D8 = nRF24L01+_CE
    D9 = nRF24L01+_CS
    D10 = SD_CS
    D11 = SPI_MOSI
    D12 = SPI_MISO
    D13 = SPI_SCK
    A0 = AD0
    A1 = AD1
    A2 = AD2
    A3 = AD3
    A4 = AD4/IIC_SCL
    A5 = AD5/IIC_SDA

    Any suggestions? If it is related to radio pin mapping what would I need to edit?

    Thanks,
    Tim

    Hardware
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular