Skip to content

Development

Discuss Arduino programming, library tips, share example sketches and post your general programming questions.
1.5k Topics 13.5k Posts

Subcategories


  • 56 578
    56 Topics
    578 Posts
    HJ_SKH
    Hi2All! Surprising is here. After about 24hours I refresh HA and suddenly my motion sensor was integrated. There is also second entity > battery : 0 , have to look deeper into that for understanding. Need to change little in the sketch, because don't want every short time 'no movement' so only when there is motion and maybe once a hour indication sensor is alive. Meantime I found 3 other good threats: https://forum.mysensors.org/topic/11200/finally-progress-evidence-based-radio-testing-method-and-capacitors https://forum.mysensors.org/topic/1664/which-are-the-best-nrf24l01-modules/27 https://forum.mysensors.org/topic/9550/build-a-reliable-power-supply-chain Very usefull for me also finally progress because of lacking time in the past. Great jobs are done here! Thanks for this all of you guys or girls!
  • Multi Motion Detectors

    10
    0 Votes
    10 Posts
    4k Views
    D
    @drock1985 Hi good to hear that you found it out. I just made a third channel and in the message handler i react on both dimmer channels if a message with the third sensor is incoming (in my case sensor 0 for both channels; 1/2 for sepearte channels) However maybe its better to do the coupling of the channels in your home-automation.. I did it this way because maybe I want to build a remote and it should have the possiblity to set both channels with one mysensors message. regards DirkH
  • Device library

    2
    1 Votes
    2 Posts
    2k Views
    hekH
    Interesting.. Fits into this discussion http://forum.mysensors.org/topic/2464/sketch-generator
  • WITH_LEDS_BLINKING - for gateways only?

    5
    0 Votes
    5 Posts
    2k Views
    H
    MySensors 1.5.1 Controller: Domoticz I'm using a simpel test sensor with the "blinking led's" to find "dead zones" in my house. The "blinking led's" are a big help for this and works flawlessly all the time. /** * 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. * ******************************* */ #include <SPI.h> #include <MySensor.h> #define CHILD_ID_BUTTON 0 //pushbutton attached to interrupt 0 (= pin 2). #define CHILD_ID_LED 1 //LED that is switch on/off by the controller (Domoticz). MySensor gw; MyMessage msg(CHILD_ID_LED, V_LIGHT); MyMessage msg2(CHILD_ID_BUTTON, V_STATUS); byte firstTime = 1; //make sure that the mcu is going to sleep for the first time (no loop) void setup() { gw.begin(incomingMessage); gw.sendSketchInfo("Test sensor","1.0"); gw.present(CHILD_ID_LED, S_LIGHT); gw.present(CHILD_ID_BUTTON, S_BINARY); pinMode(2, INPUT_PULLUP); //interrupt = 0; pinMode(7, OUTPUT); //LED is attached to pin 7 digitalWrite(7, LOW); //make sure that the LED is off } void loop() { if(firstTime == 0) { gw.process(); gw.send(msg2.set(1)); // send to controller a message that the button has been pushed. The controller then swithes the LED on (incomingMessage) gw.wait(2000); if(digitalRead(7) == HIGH) digitalWrite(7, LOW); // switch the LED off after 2 seconds gw.send(msg.set(0)); // let the controller know that the mcu has switched off the LED gw.wait(2000); } firstTime = 0; gw.sleep(0,FALLING); // go to sleep and wait for the next button push } void incomingMessage(const MyMessage &message) { if (message.type == V_LIGHT) { if (message.getInt() == 1) digitalWrite(7, HIGH); } }
  • Extract Variable Data Within SerialGateway

    4
    0 Votes
    4 Posts
    1k Views
    HopWorksH
    Thank you both for the reply. I will look at both solutions because time is running out and I don't want to complicate things any further. I am actually looking at adding the door wreath to the project though, and that is going to have a BeagleBone Black or single core RPi in it. I see there are open-source controllers out there that run on Linux so I am optimistic about that. I would imagine that I need to have a Pro Mini attached to whichever I use that functions as a gateway? Maybe a ESP8266 but that would probably be overkill considering a BBB or RPi can use a wifi dongle. hek - do you have any links to info about how to set that repeater up? Thanks again! I appreciate the replies!
  • Help with 2 LED Dimmer Sketch. Can't compile, not sure why exactly

    5
    0 Votes
    5 Posts
    2k Views
    D
    Ok, figured out and it's my stupid. Didn't put the second LED on a PWM pin, therefore, no modulation!
  • Extract MySensors data to another system?

    3
    0 Votes
    3 Posts
    2k Views
    B
    You can send weather data from Domoticz to Weather Underground. So use Domoticz to collect data from your (my)sensors.
  • Relay with switch

    relay switch
    5
    0 Votes
    5 Posts
    3k Views
    D
    Thanks for this input, please can you share which kind of relay i have to use ?
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    26 Views
    No one has replied
  • Arduino Mega 2560 Can we use more interrupts than 2?

    3
    0 Votes
    3 Posts
    2k Views
    R
    You can have CHANGE interrupts in any pins in the atmega328. See http://playground.arduino.cc/Main/PinChangeInterrupt I haven't actually tested it, but it's in my list of things to try, as I want to have door/window sensors that monitor 4+ doors. Edit: I went ahead and tested, it worked just copy and pasting the code from that page. The interrupt will wake up a atmega328p. You just will need to figure out what pin actually changed by remembering state.
  • LED Dimming library

    1
    2 Votes
    1 Posts
    1k Views
    No one has replied
  • REQUEST: Anyone have a sketch for temp/humidity logging?

    10
    0 Votes
    10 Posts
    3k Views
    hekH
    IMHO, DHT sensors isn't exactly famous for being accurate.
  • Atypical use of MySensors library some questions...

    5
    0 Votes
    5 Posts
    1k Views
    mfalkviddM
    Nice! There is a parking garage nerby where I live with a similar solution. Don't know what technology they use though.
  • Help getting started with MQTT gateway

    22
    0 Votes
    22 Posts
    7k Views
    S
    I now feel like a very big silly idiot. Let this be a lesson to anyone thats developing any sort of project. Document everything in some way, pen and paper or in a file. I had refreshed the sketch and used the same clientID as the raspberrypi was using when i had my old automation server running there.
  • Digital Poti on same Pins as NRF24L01+ how can I solve this?

    6
    0 Votes
    6 Posts
    2k Views
    M
    sorry... I'm blind... maybe I can change it here: int CS = 10; sorry again
  • OpenHAB Controller, MQTT Broker and Gateway all in one machine.

    11
    0 Votes
    11 Posts
    7k Views
    S
    @Yveaux Absolutely fantastic. I will get to work on that today and will be back to update this thread a little later on during my progress for others to realize they can follow the route i am when they firstly just wanted one machine.
  • Raspberry Pi Gateway

    11
    0 Votes
    11 Posts
    7k Views
    S
    I currently have a RaspberryPi running OpenHAB and Mosquitto working perfect with a sample 'MQTTController.cpp' file where it can identify a few nodes, publish their readings from sensors and display it in OpenHAB. However, i need to expand my development now and that is where MySensors comes into play. So, if i delete this MQTTController file and its compiled program and MakeFile, install the Raspberry Pi files, these, would this then make my RaspberryPi the Controller(OpenHAB), MQTT Broker(Mosquitto) and Gateway(PiGateway) all in one system? If it matters, all of my sensors will be using RF Radios (nRF24L01).
  • Itead RBoard and RMini Example Sketch

    itead actuator rmini rboard relay
    2
    0 Votes
    2 Posts
    2k Views
    DwaltD
    @Alphalove I highly recommend itead products, especially for those just getting into MySensors. They remove alot of the pitfalls that electronic noobs (such as myself) encounter when building their first sensor nodes. I used the RMini to build my first relay and it could not have been easier. Many of the troubleshooting problems posted on the forum have to do with setting up relays and these boards eliminate many of those issues. I also recommend the nano shield from itead to any entry level electronics noobs for setting up early sensor nodes who are not ready for intricate soldering. It provides a nRf socket and a power jack and breaks out all of the nano pins with individual power and ground headers. Just plug in a nano and nRf and program from USB and power the entire setup through a single jack - perfect for beginners.
  • RFM69 support on ethernet gateway

    11
    0 Votes
    11 Posts
    5k Views
    carlierdC
    I tried the SoftSPI without success !! As I am MySensors newbie I decided to get more experience on setting my network (Some nodes with serial gateway connected to Jeedom using the current branch) and then I will come back with the dev branch. I am not to far as the serial gateway is working fine with RFM69 and nodes are working with Arduino bootloader. @hek: I think I tried everithing (3 differrent lib for softspi or hard spi) but the debug mode need to be improved to understand where is the problem. It's just what I think, I could be wrong ;)
  • Compilation error in IDE as well as Codebender

    code bender err
    8
    0 Votes
    8 Posts
    2k Views
    S
    Solved! Thanks!
  • Python module

    3
    2 Votes
    3 Posts
    2k Views
    A
    Hey @finge thanks for your interest and your suggestions. I am developing my controller based on Home Assistant, which is also written in Python in have a lot of interesting features. However, I think they leak a little bit about user settings (you have to set all stuffs inside the configuration file in your server) and they don't have a very good support to MySensors (just support sensors, you can't turn on/off lights, ... So, yeah, I want to implement all that stuffs which you said. :D

16

Online

11.7k

Users

11.2k

Topics

113.0k

Posts