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!
  • Reducing number of cpu cycles while sending lots of data

    6
    0 Votes
    6 Posts
    1k Views
    OitzuO
    Also contra: no signing
  • 0 Votes
    4 Posts
    2k Views
    hautomateH
    Ah yes... Thanks, folks! I got my sketches mixed up and was using a 1.5 version.
  • Beginner First node setup issue

    2
    0 Votes
    2 Posts
    630 Views
    mfalkviddM
    Hi @Cyberzoid Welcome to MySensors! A description of how ro read all the output is available at http://forum.mysensors.org/topic/666/debug-faq-and-how-ask-for-help
  • Arduino Sketch Help BPM180 and LCD output

    8
    0 Votes
    8 Posts
    4k Views
    microwhattM
    HAHAHA Thank you ! :)
  • How is a message from the controller written to a digital pin?

    12
    0 Votes
    12 Posts
    3k Views
    martinhjelmareM
    Well you could store the boolean variables for the valves in an array, and use the sensor child id as the index of the variables in the array. You can also use the setSensor setter on the message variable (MSG_V1) to change which sensor child id the message belongs to. That way, you only need to declare one message variable. You can use two setters on the same line like this: // Set child id 1 to 0 to simplify using it as index in an array #define CHILD_ID1 0 // Set child id 2 to 1 which is the next index after index 0. #define CHILD_ID2 1 // Declare an array of type boolean of size 2. boolean VALVES[2]; // Declare the message with CHILD_ID1. MyMessage MSG(CHILD_ID1, V_LIGHT); void setup() { ... } ... void incomingMessage(const MyMessage &message) { if (message.type == V_LIGHT) { // Set array element at index message.sensor to boolean value from message payload. VALVES[message.sensor] = message.getBool(); // Set child id to child id of message.sensor and payload to either 1 or 0 for message, and send message. gw.send(MSG.setSensor(message.sensor).set(message.getBool() ? 1 : 0)); } } Sorry... there was a lot of edits. Now I'm done.... :smile:
  • Can it be done? (Countdown timer that survives wait or sleep)

    21
    0 Votes
    21 Posts
    6k Views
    Mark SwiftM
    @TheoL With regards the LED's, I slightly changed the logic so they count down, rather than up, i.e. they extinguish as each hour passes until the 4th hour. I don't see an issue with the current rain sensor / moisture sensor logic, I'm ensuring a reading is taken, but not seeing it unless they've changed? The number you see there now is only because I was testing, normally they're either lastMoistureValue = moistureValue OR lastRainValue = rainValue The main issue I see is that I need to countdown to be in sync with if (lastMoistureValue == 0 || lastRainValue == 0) so if (lastMoistureValue == 0 || lastRainValue == 0) is true on each loop, then the countdown LED's are reset also. I'll no doubt change the loop wait to much longer once deployed.
  • MQTT Client gateway

    91
    3 Votes
    91 Posts
    52k Views
    rollercontainerR
    Got it to work. Removed serial.print lines and changed sleep() to wait().
  • energy pulse sketch for multiple s0-counters

    1
    0 Votes
    1 Posts
    587 Views
    No one has replied
  • Repeater not working?

    3
    0 Votes
    3 Posts
    1k Views
    ?
    Yeah @hek, i defined it after #include MySensor.h, so it was not properly defined :+1: Thanks!
  • Registered Temperature Sensors on Mysensors, need Help

    3
    0 Votes
    3 Posts
    686 Views
    hekH
    You could probably simplify this sketch a bit... Look in the debug log and check it sends any temp data... If not, add debug in some locations until you find the problem. For instance what temp value you actually get when reading it from the dallas sensor.
  • Is this possible? MQTT & Node request...

    5
    0 Votes
    5 Posts
    1k Views
    noelgeorgiN
    @Mark-Swift check this for node-to-node communication http://forum.mysensors.org/topic/3467/basic-setup-network/2 as @hek said setup a database in nodered to save the values received from node-1 and you could request that from node-2
  • [Solved] How disable sleep timer ?

    7
    0 Votes
    7 Posts
    2k Views
    carlierdC
    Hello @m26872 , I set some serial.print in the code and found that i need to add some node.sleep when an incorrect key is pushed. The problem was due to the fact that the interruption pin is still valid when i restart the loop function ! David.
  • only one arduino to domoticz without radio

    10
    0 Votes
    10 Posts
    6k Views
    M
    @Roland And does it work?
  • Pulse Sensor for electricity sketch question

    3
    0 Votes
    3 Posts
    717 Views
    Bert BroekB
    I think the result is a floating point number but the divider isn't. I'm going to rewrite the formula so it matches my old sketch which was working correctly.
  • Sending Message from SerialGateway Node to RelayActuator

    9
    0 Votes
    9 Posts
    5k Views
    سیدعظیم عباسس
    Thanks that really worked for me.
  • 2.0 beta, compatible with 1.5?

    7
    1 Votes
    7 Posts
    3k Views
    C
    @rollercontainer correct
  • Wireless Communication Message Format

    3
    0 Votes
    3 Posts
    1k Views
    hekH
    Look at the MyMessage.h, it contains the struct that is sent OTA.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    40 Views
    No one has replied
  • Sensors without a gateway..?

    4
    0 Votes
    4 Posts
    2k Views
    Nca78N
    @Brayton-Larson Hello, old topic but if anyone is interested it's simple to implement. You need to know the node ID of the receiving node, and send it a message from the gateway. In the development version use the receive method/event that will trigger every time your node or gateway receives a message, if the message is sent by the door node, then you can send a message to the receiving node, and use the same receive method in the node to display a message/use the buzzer/... void receive(const MyMessage &msg) { // here process the message, see API/examples } And you can even use the esp8266 gateway to ring the buzzer directly to make it even more simple, then you only need one esp8266 as gateway and arduino/nrf24 as node.
  • ESP NodeMcu in bootloop

    4
    0 Votes
    4 Posts
    2k Views
    gerritvG
    Hi, See the above mentioned topic, there is a solution to using esp8266/Arduino 2.1 library.

19

Online

11.7k

Users

11.2k

Topics

113.0k

Posts