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!
  • Is MY_DEBUG a watchdog ?

    1
    0 Votes
    1 Posts
    494 Views
    No one has replied
  • Remote debug messages with V_TEXT

    4
    8 Votes
    4 Posts
    2k Views
    karl261K
    @AWI This sounds extremely cool. I will try it asap! Thanks for sharing!
  • How to auto reboot node every 24 hours ?

    15
    0 Votes
    15 Posts
    8k Views
    carlekiC
    I finally have found the problem : I had only Vcc.h in my VCC folder ... So the .cpp file was misisng !! --> noob alert :)
  • Chamberlain Garage Door Appliances Controller

    1
    0 Votes
    1 Posts
    694 Views
    No one has replied
  • Parameters and settings

    10
    1 Votes
    10 Posts
    3k Views
    stefaanvS
    @pjr V_HVAC_SETPOINT_HEAT comes closest to what I need but is still related to the sensor/actuator variable that is being controlled. I also need to send parameters that are totally unrelated to any of the sensor/actuator variables. This could f.i. be the cycle time of the measurements, whether or not sleep mode is used, ... I launched a feature request in meantime.
  • setup ir sensor with domoticz !

    18
    0 Votes
    18 Posts
    13k Views
    R
    @hek ok thank you , sorry :(
  • distance + relay node

    6
    0 Votes
    6 Posts
    2k Views
    carlekiC
    @carmelo24 it's ok now :) here is my sketch : // Sketch pour commander un relai en mode impultionnel. #include <MySensor.h> #include <SPI.h> #include <NewPing.h> #define node_id 66 #define RELAY_1 3 // Arduino Digital I/O pin number for first relay (second on pin+1 etc) #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 #define CHILD_ID 1 #define TRIGGER_PIN 6 // Arduino pin tied to trigger pin on the ultrasonic sensor. #define ECHO_PIN 5 // Arduino pin tied to echo pin on the ultrasonic sensor. #define MAX_DISTANCE 300 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm. unsigned long SLEEP_TIME = 500; // Sleep time between reads (in milliseconds) MySensor gw; NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance. MyMessage msg(CHILD_ID, V_DISTANCE); boolean metric = true; long temps; void setup() { // Initialize library and add callback for incoming messages gw.begin(incomingMessage, node_id, true); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo("RelayDistance", "1.1"); // Fetch relay status // Register all sensors to gw (they will be created as child devices) gw.present(RELAY_1, S_LIGHT); gw.present(CHILD_ID, S_DISTANCE); boolean metric = gw.getConfig().isMetric; // Then set relay pins in output mode pinMode(RELAY_1, OUTPUT); // Set relay to last known state (using eeprom storage) digitalWrite(RELAY_1, RELAY_OFF); temps = millis(); } void loop() { // Alway process incoming messages whenever possible gw.process(); // mesure de la distance si ça fait plus de 10 secondes qu'on ne l'a pas fait if((millis() - temps) > 10000) { int dist = metric?sonar.ping_cm():sonar.ping_in(); gw.send(msg.set(dist)); Serial.print(dist); Serial.print("toto"); temps = millis(); } } void incomingMessage(const MyMessage &message) { // action du relais (avec impulsion, pour action comme un bouton poussoir) if (message.type==V_LIGHT) { // Change relay state digitalWrite(RELAY_1, RELAY_ON); delay(100); digitalWrite(RELAY_1, RELAY_OFF); delay(100); } }
  • RF24 PA LOW or HIGH

    8
    0 Votes
    8 Posts
    7k Views
    sundberg84S
    @Affe - And use a good 3.3v regulator, that can feed alof of mA. The standard LE33A we suggest for the normal radio at Mysensors.org might be a bit weak. ld1117v33 for example.
  • Reset node from gateway

    1
    0 Votes
    1 Posts
    979 Views
    No one has replied
  • Multi RF433 Switches Node

    8
    0 Votes
    8 Posts
    3k Views
    OliverDogO
    Perfect @BartE !!! Great job you did... you contributed greatly to a breakthrough in inexpensive home automation. Now we can buy the cheapest good finished glass RF in-wall home switches from Livolo and got total integration with All Home Automation Controllers, using one mysensors node. here is the final code, I added the remote code var // This skecth was created by @BartE from mysensors forum. // it was created to control 9 switches // livolo.h library necessary to work. // Just use a simple node + chinese cheap RF433 transmitter DATA plugged on Pin D8. #define MY_DEBUG #define MY_RADIO_NRF24 #include <SPI.h> #include <MySensors.h> #include <livolo.h> #define CHILD_ID 1 Livolo livolo(8); //Digital pin you plugged your transmitter // now config your remote and button codes. Livolo codes are composed by "remote code, button code" // There are many codes already discovered, and you can test new codes or get your remote's code using the daleldalel skectch bool initValSent[] = {false, false, false, false, false, false, false, false, false}; //as many as your switch number int livoloRemCode[] = {5504, 5504, 5504, 7849, 7849, 7849, 17035, 17035, 17035}; //set remote livolo codes here int livoloSensCode[] = {16, 56, 8, 16, 8, 56, 16, 56, 8}; // Set buttons livolo codes here MyMessage msg(CHILD_ID, V_STATUS); void setup() { } void presentation() { sendSketchInfo("Livolo", "1.0"); for (int sensor=1; sensor<=9; sensor++) { // change number 9 for the total switches number you want // (presents each sensor, S_BINARY type) present(sensor, S_BINARY); } } void loop() { for (int sensor=1; sensor<=9; sensor++) { // change number 9 for the total switches number you want if (!initValSent[sensor-1]) { msg.setSensor(sensor); send(msg.set(false)); Serial.print("Requesting initial value for sensor: "); Serial.println(sensor); request(sensor, V_STATUS); wait(2000, C_SET, V_STATUS); } } } void receive(const MyMessage &message) { switch (message.type) { case V_LIGHT: if (!initValSent[message.sensor-1]) { Serial.print("Receiving initial value from controller for sensor: "); initValSent[message.sensor-1] = true; } else { Serial.print("Receiving new value for sensor: "); livolo.sendButton(livoloRemCode[message.sensor-1], livoloSensCode[message.sensor-1]); // coded for each switch } Serial.println(message.sensor); break; } }
  • Multiple Gateway Interference

    7
    1 Votes
    7 Posts
    3k Views
    foad62F
    @tbowmo Thank you :smiley: Network address and radio channels were what I was looking for. Using network address and changing radio channel I can make my network unique and enabling signing option secures my network.
  • question about change frequency (channel) in WSN mysensors

    3
    0 Votes
    3 Posts
    2k Views
    R
    @scalz :) i'm so sorry again :) thannnnnnnnk you
  • how add watchdog to my sensors?

    10
    0 Votes
    10 Posts
    4k Views
    R
    @Hermann-Kaiser ok .this is true . so where i add this ? after sleep(SLEEP_TIME); ??? also this is for radio ? is this right ? so for sensor and arduino !! there are not any function in mysensors?
  • ESP8266 RFM69 gateway

    21
    0 Votes
    21 Posts
    8k Views
    YveauxY
    @chrille the fact that it works for nrf24, but not for rfm69 seems very strange as there are no indication-related calls in either radio code. The gw_rx and gw_rx indications are generated for valid message exchange on the gateway interface (Ethernet, serial, mqtt), while regular TX and rx indications are for valid message exchange by the connected radio (nrf24, rfm69).
  • Openhab2 + MySensors MQTTClientGateway + discovery

    mqtt openahb2
    2
    0 Votes
    2 Posts
    1k Views
    Q
    Ive started out with openHAB2. I was using a Ethernet gateway and tested the mysensors binding but found the combo was too limited. I much prefer having the MQTT gateway and the data be accessible to anything that subscribes, although I also now use openHAB to republish its item changes to MQTT as well which is probably a better approach. I don't think the main new features in version 2 are very mature at the moment as well, discovered things for example get put in to a non human readable database and the web ui's are not fully functional. With that being said I'm using node red to provide node ID's and configuring items manually and since beta3 it's been solid as a rock.
  • some problem in sensor + repeater !

    15
    0 Votes
    15 Posts
    3k Views
    R
    @scalz so i test with wait :) thank you my friend
  • [ESP8266] use soft signing

    5
    0 Votes
    5 Posts
    2k Views
    AndurilA
    ok so // Select soft/hardware signing method #define MY_SIGNING_SOFT //!< Software signing //#define MY_SIGNING_ATSHA204 //!< Hardware signing using ATSHA204A // SETTINGS FOR MY_SIGNING_SOFT #define MY_SIGNING_SOFT_RANDOMSEED_PIN A0 //!< Unconnected analog pin for random seed should give a good random signing.
  • Serial Gateway with Sensors

    8
    0 Votes
    8 Posts
    3k Views
    mfalkviddM
    @alfredocdmiranda you're wlecome. We're happy to be of assistance.
  • Using Sleep RISING mode with momentary switch?

    sleep
    2
    0 Votes
    2 Posts
    991 Views
    mfalkviddM
    @Sergio-Rius delay is actually the easiest way to do it :) Either that, or build a hardware debouncer. See also https://www.mysensors.org/build/binary for how to use the bounce2 library to handle debouncing. That solution doesn't support interrupts though, so delay is probably a better solution for your node.
  • Maybe a new controller

    1
    1 Votes
    1 Posts
    562 Views
    No one has replied

12

Online

11.7k

Users

11.2k

Topics

113.1k

Posts