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!
  • DHT22 - switched sensor types?

    5
    0 Votes
    5 Posts
    1k Views
    gohanG
    dht sensors are not very accurate anyway 😅
  • help me here

    4
    0 Votes
    4 Posts
    912 Views
    mfalkviddM
    @Victor this one https://www.mysensors.org/build/irrigation ? In that case it looks like you'll need MySensors 1.4.1. From the sketch: May 31, 2015 *** Version 2.0 *** Upgraded to http://MySensors.org version 1.4.1 *** Expanded for up to 16 Valves
  • Heatpump Sketch Help

    7
    0 Votes
    7 Posts
    2k Views
    M
    I can see the topic is quite old but myabe a complete sensor 2.1 example? I can see that this code for openhab is quite popular. But i'm facing an issue constructing the proper MQTT topic As on my set up all my control messages look like topic: "mys-in/41/2/1/0/2" payload: "0" So wonder which ones to use with this sketch?
  • Gateway just another sensor node?

    11
    0 Votes
    11 Posts
    3k Views
    core_cC
    @hek I found that out while testing my very first/current gateway. Also, it is no good idea to define MY_DISABLED_SERIAL. (sssst, don't tell anyone i did that). ..but still, it's assuring to have my findings confirmed by an expert.
  • Gateway ethernet Raspberry + sensors

    6
    0 Votes
    6 Posts
    2k Views
    gohanG
    All you are looking for is the examples and in the build page of the main site
  • 0 Votes
    6 Posts
    2k Views
    mfalkviddM
    Thanks @marceloaqno, the gateway compiles fine now (at fa673bdb3e5) In case anyone else runs into this problem, this is what I did: pi@raspberrypi ~ $ sudo apt-cache policy linux-libc-dev linux-libc-dev: Installed: 3.2.51-1+rpi1 Candidate: 3.2.51-1+rpi1 Version table: 3.16.39-1+deb8u1~bpo70+1 0 100 http://http.debian.net/debian/ wheezy-backports/main armhf Packages *** 3.2.51-1+rpi1 0 500 http://mirrordirector.raspbian.org/raspbian/ wheezy/main armhf Packages 100 /var/lib/dpkg/status pi@raspberrypi ~ $ sudo apt-get install linux-libc-dev=3.16.39-1+deb8u1~bpo70+1 Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be upgraded: linux-libc-dev 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 1,027 kB of archives. After this operation, 490 kB of additional disk space will be used. Get:1 http://http.debian.net/debian/ wheezy-backports/main linux-libc-dev armhf 3.16.39-1+deb8u1~bpo70+1 [1,027 kB] Fetched 1,027 kB in 0s (1,259 kB/s) (Reading database ... 63731 files and directories currently installed.) Preparing to replace linux-libc-dev:armhf 3.2.51-1+rpi1 (using .../linux-libc-dev_3.16.39-1+deb8u1~bpo70+1_armhf.deb) ... Unpacking replacement linux-libc-dev:armhf ... Setting up linux-libc-dev:armhf (3.16.39-1+deb8u1~bpo70+1) ...
  • Need help with building my first simple mesh

    4
    0 Votes
    4 Posts
    1k Views
    mfalkviddM
    @pansen they can be used as repeater, yes. But each node would only have a tree topology in its routing table, so there would be no mesh. And updates of routing tables would probably be even slower, since all nodes on the path to the gateway would need to re-build its routing table when nodes move.
  • help to build a RF315 transmitter with NRF and mysensors

    6
    1
    0 Votes
    6 Posts
    1k Views
    R
    this is sketch of nrf node : #define MY_DEBUG #define MY_RADIO_NRF24 #define MY_RF24_CHANNEL 0 #define MY_REPEATER_FEATURE #define MY_NODE_ID 6 #define MY_RF24_PA_LEVEL RF24_PA_MAX #define MY_TRANSPORT_WAIT_READY_MS 10000 #include <SPI.h> #include <MySensors.h> #include <VirtualWire.h> int rx = 3; int tx = 4; bool stateA = false; bool stateB = false; #define CHILD_IDA 1 #define CHILD_IDB 2 MyMessage msgA(CHILD_IDA, V_STATUS ); MyMessage msgB(CHILD_IDB, V_STATUS ); void setup() { vw_set_rx_pin(rx); vw_set_tx_pin(tx); vw_set_ptt_inverted(true); vw_setup(2000); vw_rx_start(); send(msgA.set(false)); send(msgB.set(false)); } void presentation() { sendSketchInfo("RF315", "1.0"); present(CHILD_IDA, S_LIGHT); present(CHILD_IDB, S_LIGHT); } void loop() { uint8_t buf[VW_MAX_MESSAGE_LEN]; uint8_t buflen = VW_MAX_MESSAGE_LEN; if (vw_get_message(buf, &buflen)) { if ((buf[0] == '1') && (buf[1] == '0') && (buf[2] == '1')) { send(msgA.set(true)); } if ((buf[0] == '1') && (buf[1] == '0') && (buf[2] == '3') ) { send(msgA.set(false)); } if ((buf[0] == '1') && (buf[1] == '0') && (buf[2] == '5') ) { send(msgB.set(true)); } if ((buf[0] == '1') && (buf[1] == '0') && (buf[2] == '7') ) { send(msgB.set(false)); } else { for (int i = 0; i < 10; i++) buf [i] = ' ' ; } } } void receive(const MyMessage &message) { if (message.type == V_STATUS) { switch (message.sensor) { case 1: stateA = message.getBool(); if ( stateA == true) { send(msgA.set(false)); const char *msg = "100"; vw_send((uint8_t *)msg, strlen(msg)); vw_wait_tx(); } if (stateA == false) { send(msgA.set(true)); const char *msg = "102"; vw_send((uint8_t *)msg, strlen(msg)); vw_wait_tx(); } break; case 2: stateB = message.getBool(); if ( stateB == true) { send(msgB.set(false)); const char *msg = "104"; vw_send((uint8_t *)msg, strlen(msg)); vw_wait_tx(); } if (stateB == false) { send(msgB.set(true)); const char *msg = "106"; vw_send((uint8_t *)msg, strlen(msg)); vw_wait_tx(); } break; } } } and this is for receiver: #include <VirtualWire.h> int rx = 3; int tx = 4; int relay1 = 5; int relay2 = 6; int key1 = 7; int key2 = 8; void setup() { Serial.begin(115200); Serial.println("setup"); vw_set_rx_pin(rx); vw_set_tx_pin(tx); vw_set_ptt_inverted(true); vw_setup(2000); vw_rx_start(); pinMode(key1, INPUT_PULLUP); pinMode(key2, INPUT_PULLUP); pinMode(relay1, OUTPUT); pinMode(relay2, OUTPUT); digitalWrite(relay1, HIGH); digitalWrite(relay2, HIGH); } void loop() { uint8_t buf[VW_MAX_MESSAGE_LEN]; uint8_t buflen = VW_MAX_MESSAGE_LEN; if (vw_get_message(buf, &buflen)) { if ((buf[0] == '1') && (buf[1] == '0') && (buf[2] == '0') ) { digitalWrite(relay1, LOW); delay(100); const char *msg = "101"; vw_send((uint8_t *)msg, strlen(msg)); vw_wait_tx(); delay(100); } if ((buf[0] == '1') && (buf[1] == '0') && (buf[2] == '2')) { digitalWrite(relay1, HIGH); delay(100); const char *msg = "103"; vw_send((uint8_t *)msg, strlen(msg)); vw_wait_tx(); delay(100); } if ((buf[0] == '1') && (buf[1] == '0') && (buf[2] == '4')) { digitalWrite(relay2, LOW); delay(100); const char *msg = "105"; vw_send((uint8_t *)msg, strlen(msg)); vw_wait_tx(); delay(100); } if ((buf[0] == '1') && (buf[1] == '0') && (buf[2] == '6')) { digitalWrite(relay2, HIGH); delay(100); const char *msg = "107"; vw_send((uint8_t *)msg, strlen(msg)); vw_wait_tx(); delay(100); } else { for (int i = 0; i < 10; i++) buf [i] = ' ' ; } } } this code was worked. but there is some problem that i can not found ! some code sent and some dont send. also some time for many time can not work just with reset or power off/on. @hek please tag some members and programmer here that they can repair this code. this code is very efficient... then you can use this sketch in site for RF 315 and 433 mhz device... this code can solve some problem about short range of NRF. we can define many child id that every child can control many device with RF315 or RF433. for example for more distance we can use this node. with 315mhz and long distance...
  • Security System - send message like TCP/with confirmation

    1
    0 Votes
    1 Posts
    505 Views
    No one has replied
  • Randomness

    12
    1 Votes
    12 Posts
    3k Views
    d00616D
    I have checked the hwGetentropy() on my x86 Linux. When https://github.com/mysensors/MySensors/pull/830 is merged, I create a new Pull Request.
  • My sensors 2.1.1

    11
    0 Votes
    11 Posts
    3k Views
    petewillP
    Wow, a lot has changed since that video. I probably should just remake it. YouTube is getting rid of annotations soon so that wouldn't really work that well. Now I just need to find some time to remake the video...
  • Status Display Based on WS2812b LEDS

    8
    1 Votes
    8 Posts
    2k Views
    AWIA
    @kallii Sure, all you need is in the MySensors and FastLed libraries..
  • Bluetooth proximity sensor

    14
    0 Votes
    14 Posts
    4k Views
    gohanG
    Integration with mysensors it's up to you, you need to work with strings
  • ESP8266 as Node via MQTT

    4
    0 Votes
    4 Posts
    2k Views
    mfalkviddM
    @blacksheepinc said in ESP8266 as Node via MQTT: would it be too difficult to modify as I mentioned? I don't know
  • MYSBootloader 1.3

    6
    0 Votes
    6 Posts
    2k Views
    dpressleD
    @MLs this is working great for me link text
  • Fail presentation to gateway

    4
    0 Votes
    4 Posts
    959 Views
    keldandorinK
    @korttoma Thx the wait(50) did the trick :)
  • Using debounce twice in the same sketch

    10
    0 Votes
    10 Posts
    2k Views
    breimannB
    @pansen I uploaded it last week, and it all works great!!! Thankyou Heaps!!
  • Irrigation Controller sketch 1.6.8

    8
    0 Votes
    8 Posts
    3k Views
    Y
    @gohan Ok. Thanks for your time. I will give your suggestions a try and keep plugging away at this.
  • Can a Node Send json?

    7
    0 Votes
    7 Posts
    2k Views
    dpcrD
    @AWI Thanks for all your information, it gives me some direction. So from what I have read it sounds like MySensors can't send a json command to Domoticz.
  • Simplifying MySensors security: the third option.

    19
    0 Votes
    19 Posts
    4k Views
    AnticimexA
    @alowhum whenever you like. Code logic should be done. Whitelisting is also supported. Doxygen docs need more work. Thanks!

17

Online

11.7k

Users

11.2k

Topics

113.0k

Posts