Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
NiklasON

NiklasO

@NiklasO
About
Posts
37
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • ClearEprom does not work for Sensebender GW
    NiklasON NiklasO

    I have the same problem:

    void setup()
    Serial.begin(MY_BAUD_RATE);
     while(!Serial);
      Serial.print("EEPROM_LOCAL_CONFIG_ADDRESS: ");
      Serial.println(EEPROM_LOCAL_CONFIG_ADDRESS);
    	Serial.println("Started clearing. Please wait...");
    	for (uint16_t i=0; i<EEPROM_LOCAL_CONFIG_ADDRESS; i++) {
        Serial.println("Clearing");
    		hwWriteConfig(i,0xFF);
    	}
    	Serial.println("Clearing done.");
    }
    

    Output:

    EEPROM_LOCAL_CONFIG_ADDRESS: 413
    Started clearing. Please wait...
    Clearing
    

    Edit:
    Changed to

    //#define MY_CORE_ONLY
    #define MY_RADIO_NRF24
    

    and added the code to before() and it works?

    Troubleshooting

  • 💬 Power Meter Pulse Sensor
    NiklasON NiklasO

    @gohan But Samuel235 had that problem? ;-) Edit: well, ok, he had a different setup. I need to read better. ;)

    Announcements

  • 💬 Power Meter Pulse Sensor
    NiklasON NiklasO

    Ah, I see. Well, I would like the sensor to send data even if it hasn't changed. What did you change?

    Announcements

  • 💬 Power Meter Pulse Sensor
    NiklasON NiklasO

    @Samuel235
    In the sketch, change this
    #define MAX_WATT 10000 // Max watt value to report. This filetrs outliers.
    I have it set to 20000, using 15 000 easily when it's cold outside. ;-) Just make sure that you use the right divider for your pulse/kWh count.

    Announcements

  • 💬 Power Meter Pulse Sensor
    NiklasON NiklasO

    Make sure that you don't reach your wattage limit in the sketch.

    Announcements

  • Sun / cloud sensor?
    NiklasON NiklasO

    Sure, that is another and later problem. ;)

    Hardware

  • Sun / cloud sensor?
    NiklasON NiklasO

    I am waiting for the sensors to arrive. Should be fun. ;)

    Hardware

  • 💬 Debugging Sensors and the Gateway
    NiklasON NiklasO

    Ah, I see. The "MySensors Debug" does only show data when you use the serial connection?

    Announcements

  • 💬 Debugging Sensors and the Gateway
    NiklasON NiklasO

    @hek Really? That's nice. I use Sensebender GW with #define MY_DEBUG and #define MY_GATEWAY_W5100. Maybe using MY_SPECIAL_DEBUG?

    Announcements

  • 💬 Sensebender Gateway
    NiklasON NiklasO

    Aaaand, it's up! Very good fit (the box).
    0_1491402196442_IMG_20170405_162045.jpg

    The box on top is just me trying out different colors of the case. ;)
    The one on top has better look. Different brands of PLA.

    OpenHardware.io mysensors gateway samd

  • 💬 Debugging Sensors and the Gateway
    NiklasON NiklasO

    Is it possible to get the debug data over ethernet? It would be nice if you could remote debug your gateway.

    Announcements

  • Sun / cloud sensor?
    NiklasON NiklasO

    With the light sensor you should be able to identify cloudy days (I clearly see cloudy days in the history).
    Some scripting and you could use the lux-value, sunset and sunrise times to figure it out. Maybe adding a UV-meter to the mix. Hmmmm...

    Something like this one does:
    http://diffractionlimited.com/product/portable-cloud-sensor/
    "The sky temperature".

    https://mynasadata.larc.nasa.gov/science_projects/measuring-the-temperature-of-the-sky-and-clouds/

    Edit:
    We could use MLX90614 sensor to measure the sky temperature and compare to ground temperature and in that way, detect cloudy or sunny days.
    http://www.ebay.com/itm/MLX90614ESF-BAA-000-TU-ND-Infrared-Thermometer-Module-IR-Sensor-for-Arduino-/201402795181?hash=item2ee48ac4ad:g:Pl8AAOSw32lYorlr

    or

    http://www.ebay.com/itm/MLX90614ESF-BAA-000-TU-ND-Infrared-Thermometer-Module-IR-Sensor-for-Arduino-MO-/152234019326?hash=item2371dac9fe:g:fEYAAOSw9IpX0Qsl

    Info about using with Arduino:
    In this link we even have the correction factor and code that use the info from sensors:
    https://indiduino.wordpress.com/2013/02/02/meteostation/

    I will order a sensor and try this out! Should be able to port that to MySensors.

    Hardware

  • 💬 The Sensor Network
    NiklasON NiklasO

    In the example sketch for the RepeaterNode it has this info:

    • It is important that nodes that has enabled repeater mode calls
    • process() frequently. Repeaters should never sleep.

    So, is this for older sketches for versions below 2?
    Do we need to add something more to the example sketch?

    Announcements

  • 💬 Sensebender Gateway
    NiklasON NiklasO

    Ordered from ITEAD. Nice to get rid of this stuff:
    0_1490290480771_IMG_20170323_180333.jpg
    Just nudging anything result in problems. ;-)
    Time to fire up the 3D-printer.

    OpenHardware.io mysensors gateway samd

  • 💬 Power Meter Pulse Sensor
    NiklasON NiklasO

    Just changed from 1-wire counter to MySensors for logging my power consumption. Using the same LED detector as I did when using 1-wire. Also changed watt limit to 20 000 (my heat pump likes to use 9-10kW sometimes). The wires from the old 1-wire net now provide power for the new MySensors-sensor. I have 10 000 led blinks per kWh. Had som crazy counter values with 1-wire that totally messed up the graphs and haven't seen anything like that with this sketch. Let's hope it stays that way. ;) Dumping data to Domoticz. This sensor gives me higher resolution as a bonus. The 1-wire counter was read every minute, this every 20-sec. ;-)

    0_1490286464866_Domoticz_-_Google_Chrome_2017-03-23_17-27-32_78641890.png

    0_1490286540285_Domoticz_-_Google_Chrome_2017-03-23_17-28-46_94994234.png

    My old 1-wire counter with one crazy value messing upp all the graphs:
    0_1490286637201_Domoticz_-_Google_Chrome_2017-03-23_17-30-09_29365468.png
    I know that you can hold shift and click the value that is crazy to make the graphs show up good but you loose the data for the full day. That's not good. ;-)

    Announcements

  • MYSBootloader 1.3pre2 testing
    NiklasON NiklasO

    @NiklasO
    Personally I set the node ID manually to avoid this
    #define MY_NODE_ID 30 // Sets a static id for a node
    And I group tens so all my 3X nodes are in kitchen, 4X in office, 11X in bedroom 1 and so on.

    Ah, yes. Setting static id sound like a solution to my problem. Thanks.

    Development ota myscontroller mysbootloader

  • MYSBootloader 1.3pre2 testing
    NiklasON NiklasO

    I have changed the fuse settings for my setup. I don't know if it makes any difference but there is a fuse for "Preserve EEPROM memory through the Chip Erase cycle". Was noticing that my sensors was getting a new id every time I did some changes in my sketches and flashed using "Upload with programmer". I have not succeeded with OTA flashing yet.
    I also use the external crystal present on the Pro Mini. Using 0xFF, 0xD2 and 0xFE.
    Probably only used when programming using ICSP.

    MYSBL13.menu.cpu.8MHzatmega328=ATmega328 8MHz (XTAL, BOD1V8)
    MYSBL13.menu.cpu.8MHzatmega328.upload.maximum_size=30720
    MYSBL13.menu.cpu.8MHzatmega328.upload.maximum_data_size=2048
    MYSBL13.menu.cpu.8MHzatmega328.upload.speed=38400
    MYSBL13.menu.cpu.8MHzatmega328.bootloader.low_fuses=0xFF
    MYSBL13.menu.cpu.8MHzatmega328.bootloader.high_fuses=0xD2
    MYSBL13.menu.cpu.8MHzatmega328.bootloader.extended_fuses=0xFE
    MYSBL13.menu.cpu.8MHzatmega328.bootloader.file=MYSBootloader/MYSBL13pre_atmega328_8Mhz.hex
    MYSBL13.menu.cpu.8MHzatmega328.build.mcu=atmega328p
    MYSBL13.menu.cpu.8MHzatmega328.build.f_cpu=8000000L
    
    Development ota myscontroller mysbootloader

  • 💬 Building a Raspberry Pi Gateway
    NiklasON NiklasO

    Thanks for adding signing.

    I want to use my rPi to generate random soft serials for my sensors.
    Could all three "gen" commands output the line to put in SecurityPersonalizer.ino like it does when using the "set" commands?

    Announcements

  • 💬 Sensebender Gateway
    NiklasON NiklasO

    Got this from one eBay seller when I asked why my order was delayed.
    "I am so sorry for the dalay. because of National Day in China, we were from 30th sep to 5th October on vacation."

    ;)

    OpenHardware.io mysensors gateway samd

  • LCD Clock and Text sensor node with new V_TEXT
    NiklasON NiklasO

    This is my test code. Not optimized, just testing. I have just started to play with arduino (got my first ever this month) so I can't say I know what I am doing. ;) Made som changes in the code below, not tested yet. It compiles, guess that's good. ;)

    I have commented out stuff related to line1 because that is always showing the time and date, in code, from GW/controller. Enable if you want to control all 4 lines from Domoticz.

    Update display by using the domoticz api:
    json.htm?type=command&param=udevice&idx=XXXX&nvalue=0&svalue=Banana
    Replace XXXX with the IDX for each of the 3 lines. You'll see it when adding the 3 text devices in Domoticz. Then use the Event-system in Domoticz to add Lua-script to update the display as example in this thread.

    //Credits: https://forum.mysensors.org/topic/1957/lcd-clock-and-text-sensor-node-with-new-v_text
    
    //Soft signing.
    //#define MY_SIGNING_SOFT
    //#define MY_SIGNING_REQUEST_SIGNATURES
    //#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7
    
    #define MY_RADIO_NRF24
    #define MY_REPEATER_FEATURE
    #define MY_DEBUG
    
    #include <TimeLib.h>
    #include <Wire.h>
    #include <LiquidCrystal_I2C.h>
    #include <SPI.h>
    #include <MySensors.h>
    
    //char lastLCD1[21] = "Line1"; //Line 1 always showing current time
    char lastLCD2[21] = "Line2";
    char lastLCD3[21] = "Line3";
    char lastLCD4[21] = "Line4";
    
    //20 whitespace characters used to clear your LCD line before printing to it.
    //Change to fit your LCD. Don't forget to change number of chars in the writeScreen function if needed.
    String LINE_BLANK = "                    ";
    
    boolean timeReceived = false ;
    unsigned long lastUpdate = 0, lastRequest = 0, lastDisplay = 0;
    
    //const byte LCD1_CHILD = 1;                          // Child ID for LCD line 1
    const byte LCD2_CHILD = 2;                          // Child ID for LCD line 2
    const byte LCD3_CHILD = 3;                          // Child ID for LCD line 3
    const byte LCD4_CHILD = 4;                          // Child ID for LCD line 4
    
    MyMessage textMsg(0, V_TEXT);
    
    // Initialize display. Google the correct settings for your display.
    // The follwoing setting should work for the recommended display in the MySensors "shop".
    LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
    
    void before() {
      Wire.begin();                                       // I2C.
      lcd.begin(20, 4);                                   // LCD with 20 chars, 4 lines.
      lcd.setBacklight(HIGH);                             // Make sure backlight is on.
      writeScreen(0, "Waiting for GW...");                // Print initial text before contact with GW.                 
    }
    
    void setup(void)
    {
      Serial.begin(115200);                               // Start serial.
      requestTime();                                      // Request time from controller.
    }
    
    void presentation()  {
    
      sendSketchInfo("Domoticz LCD", "1.0");                    // Send the sketch version information to the gateway and Controller
    
      //present(LCD1_CHILD, S_INFO, "LCD_line1");
      //wait(500);
      present(LCD2_CHILD, S_INFO, "LCD_line2");
      wait(500);
      present(LCD3_CHILD, S_INFO, "LCD_line3");
      wait(500);
      present(LCD4_CHILD, S_INFO, "LCD_line4");
      wait(500);
      //send(textMsg.setSensor(LCD1_CHILD).set("-"));      // initialize the V_TEXT at controller for sensor to none (trick for Domoticz)
      send(textMsg.setSensor(LCD2_CHILD).set("-"));
      send(textMsg.setSensor(LCD3_CHILD).set("-"));
      send(textMsg.setSensor(LCD4_CHILD).set("-"));
    }
    
    void loop()     {
      // timer for loop delays
      unsigned long now = millis();
      // If no time has been received yet, request it every 10 second from controller
      // When time has been received, request update every hour
      if ((!timeReceived && (now - lastRequest > 10 * 1000)) ||
          (now - lastRequest > 3600000UL)) {              // request update from GW every hour to keep in sync
        // Request time from controller.
        Serial.println("Requesting time...");
        timeReceived = false;
        requestTime();
        lastRequest = now;
      }
    
      // Update sensors every 5 seconds
      if (now - lastDisplay > 5000) {
        lastDisplay = now;
        //request(LCD1_CHILD, V_TEXT, 0);                  // request new values from controller
        request(LCD2_CHILD, V_TEXT, 0);                  // request new values from controller
        request(LCD3_CHILD, V_TEXT, 0);                  // request new values from controller
        request(LCD4_CHILD, V_TEXT, 0);                  // request new values from controller
      }
    
      // Update LCD time every second
      if (now - lastUpdate > 1000) {
        LCD_time();
        lastUpdate = now;
      }
    }
    
    // This is called when a message is received
    void receive(const MyMessage &message) {
      if (message.type == V_TEXT) {                       // Text messages only
        Serial.print("Message: "); Serial.print(message.sensor); Serial.print(", Message: "); Serial.println(message.getString());     // Write some debug info
        //if (message.sensor == LCD1_CHILD) {
        //  writeScreen(0, message.data);
        //}
    
    // Don't forget to change "if" to "else if" when controlling all 4 lines:
        if (message.sensor == LCD2_CHILD) {
          writeScreen(1, message.data);
        }
        else if (message.sensor == LCD3_CHILD) {
          writeScreen(2, message.data);
        }
        else if (message.sensor == LCD4_CHILD) {
          writeScreen(3, message.data);
        }
      }
    }
    
    void receiveTime(unsigned long ts) {
      setTime(ts);
      timeReceived = true;
    }
    
    void LCD_time(void) {
      lcd.setCursor(0, 0);
      if (timeReceived) {
        lcd.print(year());
        lcd.print("-");
        printDigits(month());
        lcd.print("-");
        printDigits(day());
        lcd.print("     ");
        printDigits(hour());
        lcd.print(":");
        printDigits(minute());
      } else {
        writeScreen(0, "Waiting for time...");
      }
    }
    
    void printDigits(int digits) {
    //add leading 0 if digit = 0-9
      if (digits < 10)
        lcd.print('0');
      lcd.print(digits);
    }
    
    void writeScreen(int line, String text)
    {
      // Remove anything over 20 char in text.
      if (text.length() > 19)
      {
        text.remove(20);
      }
    
      // Clear the line
      lcd.setCursor(0, line);
      lcd.print(LINE_BLANK);
    
      // Set Line
      lcd.setCursor(0, line);
      lcd.print(text);
    }
    
    My Project
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular