Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. cranky
    3. Topics
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by cranky

    • cranky

      Flow to turn SerialGateway with MQTT-FLOW to EthernetGateway
      Node-RED • • cranky  

      2
      1
      Votes
      2
      Posts
      2381
      Views

      fets

    • cranky

      "Sketch Config" (I_CONFIG) Handler
      Node-RED • • cranky  

      3
      0
      Votes
      3
      Posts
      1867
      Views

      cranky

      Not yet, but that was my goal tomorrow. My GH account is https://github.com/jwcrawley It'll be obvious when I add in the repo I'll also mention it here. Sincerely, Cranky
    • cranky

      "Sketch Time" (I_TIME) Handler
      Node-RED • • cranky  

      5
      0
      Votes
      5
      Posts
      2503
      Views

      cranky

      Ah cool So yes, make the user do it. I like the sound of that. Time stinks. Only thing I can say about that is, "Never again."
    • cranky

      "Sketch Version" (I_SKETCH_VERSION) Handler
      Node-RED • • cranky  

      1
      0
      Votes
      1
      Posts
      1040
      Views

      No one has replied

    • cranky

      "Sketch Name" (I_SKETCH_NAME) Handler
      Node-RED • • cranky  

      2
      1
      Votes
      2
      Posts
      1530
      Views

      cranky

      Debugged, changelog 13 jan2016. Added 3rd field, for version. Fixed \n being passed and messing up CSV file. [{"id":"8e3e8f02.7fd0c","type":"mqtt-broker","z":"63842e72.893f78","broker":"localhost","port":"8883","clientid":"","usetls":false,"verifyservercert":true,"compatmode":true,"keepalive":"15","cleansession":true,"willTopic":"","willQos":"0","willRetain":null,"willPayload":"","birthTopic":"","birthQos":"0","birthRetain":null,"birthPayload":""},{"id":"2b18ee58.b63042","type":"mqtt in","z":"63842e72.893f78","name":"Rename sensor in file","topic":"MySensors/+/255/3/0/11","broker":"8e3e8f02.7fd0c","x":147,"y":347,"wires":[["34a4252.48ed9da"]]},{"id":"34a4252.48ed9da","type":"function","z":"63842e72.893f78","name":"message to edit","func":"var splitTopic= msg.topic.split(\"\\/\");\nmsg.edit = {col1:splitTopic[1] , col2:msg.payload}; \n// msg.edit carries over the next 2 nodes to \"find edit and replace\" function node\nreturn msg;","outputs":1,"noerr":0,"x":349,"y":346,"wires":[["2032129a.b17cfe"]]},{"id":"2032129a.b17cfe","type":"file in","z":"63842e72.893f78","name":"","filename":"/root/leases.file","format":"utf8","x":525,"y":347,"wires":[["2c70d9c7.e8d2ee"]]},{"id":"2c70d9c7.e8d2ee","type":"csv","z":"63842e72.893f78","name":"","sep":",","hdrin":"","hdrout":"","multi":"mult","ret":"\\n","temp":"col1,col2,col3","x":110,"y":418,"wires":[["f17d2f12.1254c8"]]},{"id":"f17d2f12.1254c8","type":"function","z":"63842e72.893f78","name":"find edit and replace","func":"for(var i = 0; i < msg.payload.length; i++){\n if( msg.payload[i].col1 == msg.edit.col1 ){\n msg.payload[i].col2 = msg.edit.col2;\n return msg;\n }\n if( msg.payload[i].col1 > msg.edit.col1 ){\n msg.payload.splice(i,0, {col1: (i-1), col2: msg.edit.col2, col3: \"\"}) ;\n }\n}\nreturn msg;","outputs":1,"noerr":0,"x":279,"y":418,"wires":[["c2871f53.c8caa"]]},{"id":"55feab8a.9176ac","type":"file","z":"63842e72.893f78","name":"","filename":"/root/leases.file","appendNewline":true,"createDir":false,"overwriteFile":"true","x":641,"y":419,"wires":[]},{"id":"7263dd71.ca4b94","type":"debug","z":"63842e72.893f78","name":"","active":true,"console":"false","complete":"false","x":631,"y":458,"wires":[]},{"id":"c2871f53.c8caa","type":"csv","z":"63842e72.893f78","name":"","sep":",","hdrin":"","hdrout":"","multi":"one","ret":"\\n","temp":"col1,col2,col3","x":446,"y":418,"wires":[["55feab8a.9176ac","7263dd71.ca4b94"]]},{"id":"852f49a7.0d18c","type":"comment","z":"63842e72.893f78","name":"I_SKETCH_NAME handler ([0-255];255;3;0;11;[name])","info":"Whenever a sensor announces itself to the network as [any];255;3;0;11;[name from presentation],\nit modifies field 2 for that appropriate sensor. \n\nThe resulting modification is then saved.","x":310,"y":456,"wires":[]}]
    • cranky

      "DHCP" (I_ID_REQUEST) Handler
      Node-RED • • cranky  

      2
      2
      Votes
      2
      Posts
      1533
      Views

      chris021

      This looks awsome and exactly what i was after. I use ESP8266's with NRF24L01+'s as relay nodes connecting back to a cloud mqtt server but have had to statically assign id's. Thanks!!!
    • cranky

      Flow to turn SerialGateway into MQTT-SerialGateway
      Node-RED • • cranky  

      13
      4
      Votes
      13
      Posts
      7729
      Views

      Mathieu Chambon

      I think you made one mistake in the flow, you need to remove "To MQTT" in the Topic item and put "To MQTT" in the Name item else all the message go in "To MQTT" topic. I have start to make the same flow and I found this post, thanks for the job.
    • cranky

      FastLED / Neopixel (ws2811) Node, From Arduino code to Web page (with API)
      Node-RED • • cranky  

      7
      2
      Votes
      7
      Posts
      9037
      Views

      peerkersezuuker

      Hello, I know this is an old post. But i am trying the script getting to work in combination with Domoticz. A did a little rebuild to 2.1.0, and i am getting a RGD light which i can switch to dimmable in Domoticz. I can select color and dim the strip but i am struggeling with the Speed (V_VAR2) and Mode (V_VAR1). How can I adress these two in Domoticz so it is picked up by the node? So i want to set the mode and or the speed from Domoticz to. // 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 // Enabled repeater feature for this node #define MY_REPEATER_FEATURE #define MY_NODE_ID 9 #include <MySensors.h> #include <DHT.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 60 CRGB leds[NUM_LEDS]; uint8_t gHue = 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", true); } 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) {addGlitter(80);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 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; } } With Regards, and thanks in advance. Peter
    • cranky

      Neopixel Node, using 1.6.0 Beta
      My Project • arduino nodered ws2312 neopixels • • cranky  

      7
      4
      Votes
      7
      Posts
      4943
      Views

      cranky

      Oh, @msebbe @AWI , I have a FastLED version with a decent web API and web interface available here: http://forum.mysensors.org/topic/2705/fastled-neopixel-ws2811-node-from-arduino-code-to-web-page-with-api It's working pretty damn well Still working on my front end interface, since I'm not a designer (well, I am a 3d cad designer, not web dev). Oh, and if you knew my controller's name, you could communicate with it via TOR. Just like corporate solutions, I can communicate and control my gateway from anywhere in the world!
    • cranky

      Errors with Custom MySensors actuator (Neopixel/ws2812 Node)
      Development • • cranky  

      1
      0
      Votes
      1
      Posts
      1160
      Views

      No one has replied