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!
  • This topic is deleted!

    3
    0 Votes
    3 Posts
    137 Views
  • This topic is deleted!

    17
    0 Votes
    17 Posts
    361 Views
  • This topic is deleted!

    39
    0 Votes
    39 Posts
    888 Views
  • This topic is deleted!

    19
    0 Votes
    19 Posts
    531 Views
  • How does the mesh network work with MySensors ?

    5
    0 Votes
    5 Posts
    2k Views
    mfalkviddM
    A conceptual drawing of the network is available at https://www.mysensors.org/about/network in case you haven't found it already.
  • WDT doesn't work well

    5
    0 Votes
    5 Posts
    1k Views
    logger02L
    Thank you to confirm it
  • send alert from sensor

    4
    0 Votes
    4 Posts
    1k Views
    Q
    I was wondering about this but currently don't have any nodes that need to report errors. I thought though I would wrap the error in a string including a prefix as well as importance of the error and send it back to the controller via S_VAR I use MQTT gateway and I would have NodeRed listen out for any string with the prefix and send me an alert or log the event depending on the importance. Just an idea at the moment but might help you.
  • Extending the Range of MySensor GateWay

    4
    0 Votes
    4 Posts
    2k Views
    mfalkviddM
    @sghazagh yes. It can be a wifi gateway with a sensor (for example a temperature sensor) wired directly to it, without any nrf or rfm radio.
  • partial upgrade of nodes to v2.0 library?

    api mysx2.0 update library
    7
    0 Votes
    7 Posts
    2k Views
    A
    @pbcstudios Well, that's my opinion also about Android version - sometimes it can make things worse with new bugs that overcome the few new features that's been added. @tandobkhcm Well, i didn't try any sketch for now with the v2 version so i can't tell. Also my humidity sketch is one of the sketches i didn't modify. My mods include combining several sensors into one node (e.g. 2 door sensor , one dht, one dallas temp), Or reading industrial sensors of pressure and EC through 4-20ma protocol and sending them as "temperature" readings because they have the longest log in domoticz.
  • Relay and Light Node

    3
    0 Votes
    3 Posts
    2k Views
    Marek BělušaM
    Hi! Thanks for help, now it works perfect :-) Posting updated code: /** 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 - idefix DESCRIPTION Arduino BH1750FVI Light sensor communicate using I2C Protocol this library enable 2 slave device addresses Main address 0x23 secondary address 0x5C connect the sensor as follows : VCC >>> 5V Gnd >>> Gnd ADDR >>> NC or GND SCL >>> A5 SDA >>> A4 http://www.mysensors.org/build/light */ #define MY_NODE_ID 9 // Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 #define MY_RF24_PA_LEVEL RF24_PA_MAX #include <SPI.h> #include <MySensors.h> #include <BH1750.h> #include <Wire.h> #define CHILD_ID_LIGHT 10 unsigned long lastTime = millis(); #define RELAY_1 3 // Arduino Digital I/O pin number for first relay (second on pin+1 etc) #define NUMBER_OF_RELAYS 1 // Total number of attached relays #define RELAY_ON 0 // GPIO value to write to turn on attached relay #define RELAY_OFF 1 // GPIO value to write to turn off attached relay BH1750 lightSensor; // transmitting LUX light level. MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL); // MyMessage msg(CHILD_ID_LIGHT, V_LEVEL); uint16_t lastlux; 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() { lightSensor.begin(); 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 presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Relays and Light Lux Sensor node", "1.0"); // Register all sensors to gateway (they will be created as child devices) present(CHILD_ID_LIGHT, S_LIGHT_LEVEL); 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_LIGHT); } } void loop() { unsigned long currentTime = millis(); if (currentTime > lastTime + 60000) { lastTime = currentTime; uint16_t lux = lightSensor.readLightLevel(); Serial.println(lux); if (lux != lastlux) send(msg.set(lux)); lastlux = lux; } } void receive(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.type==V_LIGHT) { // 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()); } }
  • radio check for BinarySwitch nodes

    1
    0 Votes
    1 Posts
    495 Views
    No one has replied
  • This topic is deleted!

    5
    0 Votes
    5 Posts
    56 Views
  • Clear EEPROM - sketch after that not working-HELP

    3
    0 Votes
    3 Posts
    4k Views
    hekH
    @pepson said: https://www.arduino.cc/en/Tutorial/EEPROMClear That sketch initialises EEPROm to zeroes which isn't the factory value, 0xff. Use the MySensors provided sketch instead: https://www.mysensors.org/build/debug#clearing-eeprom
  • Need help with arduino BlueTooth coding

    1
    0 Votes
    1 Posts
    657 Views
    No one has replied
  • This topic is deleted!

    11
    0 Votes
    11 Posts
    452 Views
  • i want information about repeater feature

    1
    0 Votes
    1 Posts
    476 Views
    No one has replied
  • How can you change the node description OTA

    1
    0 Votes
    1 Posts
    539 Views
    No one has replied
  • S_INFO NODE with OLED Display - Solved -

    4
    0 Votes
    4 Posts
    2k Views
    scribere8146S
    Made small update .....X,Y Pos Fontsize...
  • ESP8266 MQTT client dynamically changing MQTT broker settings

    1
    0 Votes
    1 Posts
    940 Views
    No one has replied
  • Basic project setup from start to finish

    17
    0 Votes
    17 Posts
    5k Views
    mfalkviddM
    @toddsantoro170 using the example file without modification is usually the best way to start.

13

Online

11.7k

Users

11.2k

Topics

113.1k

Posts