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!

    1
    0 Votes
    1 Posts
    45 Views
    No one has replied
  • MQTT Gateway retained flag

    3
    0 Votes
    3 Posts
    1k Views
    M
    I did not work too much with github and still find it somehow a little bit annoying for me, but I was trying to do this. I also have updated the new inserted constant as you advice. The new definition should be moved to the MyConfig.h , but now it was easier to modify only one file. My tests were done on MQTT Gateway made by Arduino Uno (clone) + Ethernet shield 5100 and it works very nice.
  • Home Gas measuring..

    2
    2 Votes
    2 Posts
    1k Views
    JurikJ
    Hi @MarkV, I will try to answer your questions as i am also using these meters. Pulse counts correspond to the #define PULSE_FACTOR 100 The value in the upper right corner is the usage of that day (in your case 0.230m3 or 230 liters) yes, you could edit the meter in the utility tab of Domoticz to add an offset but i don't use it so not sure. Correct! the SEND_FREQUENCY is the interval in milliseconds (so 300000 is 5 minutes). You could lower it. I am currently working on a more instant update for the flow rate. I will test that after i calibrated the sensors and implemented the new library. I am not sure, but I think this is something of Domoticz and not MySensors. Maybe there is no gas flow widget and the water widget is reused. The edit and offset option also works for the kWh meter and Water meter. Hope it helps.
  • Send RelayActuator state back to gateway

    wifi vera relay sonoff
    4
    0 Votes
    4 Posts
    2k Views
    hekH
    The send-function is used to send updates to the controller, in your case the physical-button-switch-change. Doing the send, does not control anything on the node itself.
  • This topic is deleted!

    20
    0 Votes
    20 Posts
    296 Views
  • This topic is deleted!

    5
    0 Votes
    5 Posts
    151 Views
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    38 Views
    No one has replied
  • RFM95 Soil Moisture Sensor

    1
    3 Votes
    1 Posts
    911 Views
    No one has replied
  • RS485/RS232/Serial transport class for mysensors.org

    rs485 serial rs485
    143
    6 Votes
    143 Posts
    103k Views
    skatunS
    Today the new rs485 shield arrived, i will solder it up over the weekend and start testing early next week:)
  • Monitoring battery charging

    3
    0 Votes
    3 Posts
    1k Views
    Boots33B
    @phill21 Have a look at this project i did a while back. you may get some inspiration from there :)
  • Upgrade to 2.1.0

    3
    1 Votes
    3 Posts
    2k Views
    jimbolayaJ
    Good news. Thx!
  • Distance / Time measure and clock tuning

    5
    0 Votes
    5 Posts
    1k Views
    qqlapralineQ
    I will publish my voltage curve once I get enough history. And yes, I do shut down the sensor (and the booster, and the logic level adapter) between measures ;) Qq.
  • Report relay state back to the controller

    vera relay sonoff
    1
    0 Votes
    1 Posts
    852 Views
    No one has replied
  • No forward link or gateway feature activated, but I did.

    sonoff esp8266 library
    7
    0 Votes
    7 Posts
    3k Views
    nicomediaN
    @hek That did it! I included the library with the Arduino IDE and it put it on the top. Didn't know that, thanks!
  • How to Disable / Enable Radio within Loop

    2
    1 Votes
    2 Posts
    990 Views
    scalzS
    you can use transportInit() and transportPowerDown()
  • Using before()

    9
    0 Votes
    9 Posts
    3k Views
    YveauxY
    @Japio I think I've seen the esp start some wifi stuff in parallel to the arduino startup code. Could be that if the gateway setup is delayed the wifi will not start as expected. You could use a timer, initialized from before() to cycle the leds during startup. Just wondering, do you call some form of yield() during the led setup?
  • SPI.h is missing in the examples

    2
    0 Votes
    2 Posts
    2k Views
    mfalkviddM
    @LastSamurai looks like there was a bug in thr Arduino IDE, see https://github.com/mysensors/MySensors/issues/601 Try upgrading the IDE and see if it helps.
  • Fastled library and RGB LED Strip Driver Module

    2
    0 Votes
    2 Posts
    2k Views
    ?
    i found this code from node red but i cant see device in domticz #define MY_DEBUG #define MY_RADIO_NRF24 #define MY_NODE_ID 9 #include <SPI.h> #include <MySensor.h> #include "FastLED.h" FASTLED_USING_NAMESPACE #if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000) #warning "Requires FastLED 3.1 or later; check github for latest code." #endif #define DATA_PIN 3 //#define CLK_PIN 4 #define LED_TYPE WS2811 #define COLOR_ORDER GRB #define NUM_LEDS 38 CRGB leds[NUM_LEDS]; // globals for cool color functions uint8_t gHue = 0; uint8_t colour ; int step = -1; int center = 0; unsigned int currentSpeed = 0 ; int brightness = 96; unsigned int requestedMode = 0 ; int messageType = 0 ; int previousMessageType = -1; String hexColor = "000000" ; unsigned long previousTime = 0 ; void setup() { delay(1000); Serial.begin(115200); FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip); FastLED.setBrightness(brightness); FastLED.show(); } void presentation() { sendSketchInfo("FastLED Node", "1.0"); present(0, S_RGB_LIGHT, "Makes strip said color", false); } void loop() { switch (messageType) { //************** CASE 1 ************** case (1): Serial.print("Hex color override: "); Serial.println(hexColor); colorWipe(); messageType = 0 ; break; //************** CASE 2 ************** case (2): if ( (previousTime + (long) currentSpeed ) < millis() ) { if (requestedMode == 2) {rainbow(); FastLED.show(); } if (requestedMode == 3) {rainbowWithGlitter();FastLED.show(); } if (requestedMode == 4) {ripple();FastLED.show(); } if (requestedMode == 5) {confetti();FastLED.show(); } if (requestedMode == 6) {sinelon();FastLED.show(); } if (requestedMode == 7) {bpm();FastLED.show(); } if (requestedMode == 8) {juggle();FastLED.show(); } previousTime = millis(); } break; //************** CASE 3 ************** case (3): // Adjust timing of case 2 using non-blocking code (no DELAYs) Serial.print("Case 3 received. Speed set to: "); Serial.print(currentSpeed); Serial.println(" ms."); messageType = 2; break; //************** CASE 4 ************** case (4): // Adjust brightness of whole strip of case 2 using non-blocking code (no DELAYs) Serial.print("Case 4 received. Brightness set to: "); Serial.println(brightness); FastLED.setBrightness(brightness); FastLED.show(); messageType = previousMessageType ; // We get off type 4 ASAP break; } } void receive(const MyMessage &message) { Serial.println("Message received: "); if (message.type == V_RGB) { messageType = 1 ; hexColor = message.getString(); Serial.print("RGB color: "); Serial.println(hexColor); } if (message.type == V_VAR1) { requestedMode = message.getInt(); Serial.println(requestedMode); messageType = 2 ; Serial.print("Neo mode: "); Serial.println(requestedMode); } if (message.type == V_VAR2) { // This line is for the speed of said mode currentSpeed = message.getInt() ; Serial.println(currentSpeed); messageType = 3 ; Serial.print("Neo speed: "); Serial.println(currentSpeed); } if (message.type == V_VAR3) { // This line is for the brightness of said mode brightness = message.getInt() ; //if(brightness > 255) {brightness = 255;} //if(brightness < 0) {brightness = 0;} Serial.println(brightness); previousMessageType = messageType; messageType = 4 ; Serial.print("Neo brightness: "); Serial.println(brightness); } } //********************** FastLED FUNCTIONS *********************** void colorWipe() { for (int i = 0; i < NUM_LEDS ; i++) { leds[i] = strtol( &hexColor[0], NULL, 16); FastLED.show(); } } void rainbow() { // FastLED's built-in rainbow generator fill_rainbow( leds, NUM_LEDS, gHue++, 7); } void rainbowWithGlitter() { // built-in FastLED rainbow, plus some random sparkly glitter fill_rainbow( leds, NUM_LEDS, gHue++, 7); FastLED.show(); addGlitter(80); } void ripple() { for (int i = 0; i < NUM_LEDS; i++) leds[i] = CHSV(gHue++, 255, 15); // Rotate background colour. switch (step) { case -1: // Initialize ripple variables. center = random(NUM_LEDS); colour = random8(); step = 0; break; case 0: leds[center] = CHSV(colour, 255, 255); // Display the first pixel of the ripple. step ++; break; case 16: step = -1; break; default: leds[(center + step + NUM_LEDS) % NUM_LEDS] += CHSV(colour, 255, 255/step*2); leds[(center - step + NUM_LEDS) % NUM_LEDS] += CHSV(colour, 255, 255/step*2); step ++; break; } } void addGlitter( fract8 chanceOfGlitter) { if ( random8() < chanceOfGlitter) { leds[ random16(NUM_LEDS) ] += CRGB::White; } } void confetti() { // random colored speckles that blink in and fade smoothly fadeToBlackBy( leds, NUM_LEDS, 10); int pos = random16(NUM_LEDS); leds[pos] += CHSV( gHue + random8(64), 200, 255); } void sinelon() { // a colored dot sweeping back and forth, with fading trails fadeToBlackBy( leds, NUM_LEDS, 20); int pos = beatsin16(13, 0, NUM_LEDS); leds[pos] += CHSV( gHue, 255, 192); } void bpm() { // colored stripes pulsing at a defined Beats-Per-Minute (BPM) uint8_t BeatsPerMinute = 62; CRGBPalette16 palette = PartyColors_p; uint8_t beat = beatsin8( BeatsPerMinute, 64, 255); for ( int i = 0; i < NUM_LEDS; i++) { //9948 leds[i] = ColorFromPalette(palette, gHue + (i * 2), beat - gHue + (i * 10)); } } void juggle() { // eight colored dots, weaving in and out of sync with each other fadeToBlackBy( leds, NUM_LEDS, 20); byte dothue = 0; for ( int i = 0; i < 8; i++) { leds[beatsin16(i + 7, 0, NUM_LEDS)] |= CHSV(dothue, 200, 255); dothue += 32; } }
  • [2.1 Beta] Program 'chapter' order changed since 2.0

    4
    0 Votes
    4 Posts
    1k Views
    mfalkviddM
    @DavidZH you're welcome. No worries, everyone can't keep track of everything :)
  • [PlatformIO] How to build a library to share across projects?

    1
    2 Votes
    1 Posts
    855 Views
    No one has replied

12

Online

11.7k

Users

11.2k

Topics

113.1k

Posts