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!
  • NodeId position on the eprom

    4
    0 Votes
    4 Posts
    935 Views
    HeinzH
    see also http://forum.mysensors.org/topic/2680/data-stored-in-the-eeprom
  • Platformio and MySensors development branch

    6
    0 Votes
    6 Posts
    3k Views
    Iyad NahasI
    Well, after some trial and error I ended up with just adding the build_flags option with the path to the MySensors library and now building works fine. Here's my final platform.ini: [env:nodemcu] platform = espressif framework = arduino board = nodemcu build_flags = -I../lib/libraries/MySensors Now to figure out why the auto upload doesn't work. If I upload manually it works fine, but when I add "targets = upload" it keeps trying to connect then times out with an error. No big deal though. I don't mind uploading manually. Thank you for your help.
  • Modify Node ID?

    8
    0 Votes
    8 Posts
    3k Views
    T
    Yeah, I dug through the .h files and found the right spellings and got it to finally work... Thanks...
  • Arduino and NRF24 Mesh Code

    9
    0 Votes
    9 Posts
    7k Views
    سیدعظیم عباسس
    /** * 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 */ #include <MySigningNone.h> #include <MyTransportNRF24.h> #include <MyTransportRFM69.h> #include <MyHwATMega328.h> #include <MySensor.h> #include <SPI.h> #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 1 // GPIO value to write to turn on attached relay #define RELAY_OFF 0 // GPIO value to write to turn off attached relay // NRFRF24L01 radio driver (set low transmit power by default) MyTransportNRF24 radio(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW); //MyTransportRFM69 radio; // Message signing driver (none default) //MySigningNone signer; // Select AtMega328 hardware profile MyHwATMega328 hw; // Construct MySensors library MySensor gw(radio, hw); void setup() { // Initialize library and add callback for incoming messages gw.begin(incomingMessage, AUTO, true); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo("Relay", "1.0"); // Fetch relay status 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) gw.present(sensor, S_LIGHT); // Then set relay pins in output mode pinMode(pin, OUTPUT); // Set relay to last known state (using eeprom storage) digitalWrite(pin, gw.loadState(sensor)?RELAY_ON:RELAY_OFF); } } void loop() { // Alway process incoming messages whenever possible gw.process(); } void incomingMessage(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 gw.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()); } } above i have shared a sample code of RelayActuator can i treat it as one sensor node controlling one relay switch from pin 3.Please guide me i am new to mysensor library.
  • Auto Node ID Setting?

    7
    0 Votes
    7 Posts
    2k Views
    mfalkviddM
    Please don't post the same question in different threads. An answer is available at http://forum.mysensors.org/topic/3577/modify-node-id/3
  • GATEWAYW5100 with 2.0 beta working?

    1
    0 Votes
    1 Posts
    718 Views
    No one has replied
  • Node.js module to talk to the gateway

    9
    5 Votes
    9 Posts
    2k Views
    epierreE
    Hello, I did made one in perl for my experiments: https://github.com/empierre/domoticz/blob/master/mysensors-gw1.4.pl If you are interested in having an interface to Imperihome, or just for continuous test/delivery/packaging for all PI and more on node JS, I can help (this is the project taking me time at the moment, full rewrite from perl to node js of an app used by more than 100 people): https://github.com/empierre/MyDomoAtHome
  • Adding WebConfig to ESP8266 Gateway

    2
    0 Votes
    2 Posts
    1k Views
    YveauxY
    @Iyad-Nahas This is a feature I've been dreaming about since I ported MySensors to ESP! I had a quick look at the code and it seems doable. The biggest issue you'll probably encounter is that all the WiFi stuff is hidden since MySensors 2.0beta. Maybe @hek can point you in the right direction?
  • Message Length

    message length development rfm69
    3
    0 Votes
    3 Posts
    1k Views
    mfalkviddM
    The nrf24l01+ accepts a maximum of 32 bytes payload. Other transmission protocols (for example rfm69) supports longer messages, but MySensors has standardized on the lowest common denominator, to make sure it works on all popular transmission protocols.
  • Mysensors on Mega ?

    2
    0 Votes
    2 Posts
    1k Views
    hekH
    In the 2.0.0-beta development branch you just define the following in sketch: #define MY_RF24_CE_PIN xx #define MY_RF24_CS_PIN yy In 1.6 you have to create a Transport class with the pin definitions https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/MyTransportNRF24.h You can see an example of this here: https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/examples/SerialGateway/SerialGateway.ino#L62
  • battery level doesn't appear ?

    25
    0 Votes
    25 Posts
    6k Views
    flylowgofastF
    Hello @sundberg84, I already considered this idea but my node have been running perfectly for two days before failed. So I think, power consideration are not the problem. I can trigg on and off my shutters many and many times without problem.
  • New ESP

    2
    0 Votes
    2 Posts
    948 Views
    F
    Hi Hoffan looks like they working on it http://www.esp8266.nu/forum/viewtopic.php?f=6&t=427
  • ESP8266 gateway - where are SPI pins defined?

    4
    0 Votes
    4 Posts
    4k Views
    KrisJacobsK
    Awesome, exactly what I was looking for, thank you Yveaux!
  • Relay actuator as pulse

    4
    0 Votes
    4 Posts
    976 Views
    PetjepetP
    Thank! I'll give it a try. I'm new in the Arduino world and hoping to learn from more experienced users.
  • M_ACK_VARIABLE or M_SET_VARIABLE

    3
    0 Votes
    3 Posts
    822 Views
    LyubomyrL
    Thank You very much!
  • Round-about way to make a sleepable relay node

    3
    0 Votes
    3 Posts
    796 Views
    dsieeD
    @BartE Thanks so much! That explains just about everything i needed. Glad the see that message.sender exists as it was integral to my plan of attack! Thanks again, I really appreciate it!
  • MQTTClientGateway broken after upgrade - signature failure

    38
    0 Votes
    38 Posts
    7k Views
    noelgeorgiN
    @tomkxy there's an android app named wifi analyser and use that to check the crowded wifi channels and set the rf24 channel to the least crowded one.... wish i had an SDR for more hacking and learning:disappointed_relieved:
  • What is the current status of ota wireless programming?

    1
    0 Votes
    1 Posts
    587 Views
    No one has replied
  • Changing Node Id of Serial Gateway

    7
    0 Votes
    7 Posts
    2k Views
    LyubomyrL
    I've seen the security link, but sniffer is very interesting indeed. Thank You!
  • Binary Switch Timer

    6
    0 Votes
    6 Posts
    2k Views
    mikeg291M
    @mikeg291 Arduino: 1.6.7 (Windows 7), Board: "Arduino Nano, ATmega328" C:\Users\repair\AppData\Local\Temp\arduino_9fa690567122ca1856b95eff67fbf9b8\pump_cycle_time_2.5.ino: In function 'void loop()': pump_cycle_time_2.5:66: error: expected primary-expression before '==' token if (value < == alarmtime ); ^ pump_cycle_time_2.5:67: error: expected ')' before numeric constant gw.send(msg.set(value==HIGH 1)); ^ pump_cycle_time_2.5:68: error: expected '}' before 'else' else ^ pump_cycle_time_2.5:69: error: expected ')' before numeric constant gw.send(msg.set(value=LOW 0)); ^ C:\Users\repair\AppData\Local\Temp\arduino_9fa690567122ca1856b95eff67fbf9b8\pump_cycle_time_2.5.ino: At global scope: pump_cycle_time_2.5:73: error: expected declaration before '}' token } ^ exit status 1 expected primary-expression before '==' token This report would have more information with "Show verbose output during compilation" enabled in File > Preferences.

13

Online

11.7k

Users

11.2k

Topics

113.0k

Posts