Navigation

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

    lassivv

    @lassivv

    1
    Reputation
    8
    Posts
    290
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    lassivv Follow

    Best posts made by lassivv

    • RE: 💬 Building a Raspberry Pi Gateway

      Sorry see this topic after i post my own topic, thinks this is better topic to my problems. But i continue my own topic.

      posted in Announcements
      lassivv
      lassivv

    Latest posts made by lassivv

    • RE: Multi Node project (MySensors noob) =RASPBERRY GATEWAY PROBLEM=

      @sineverba Many thanks to your hint. I do same everything starts working perfectly. No can use raspi serial nrf and not need to but not necessary Arduino nano to do gateway things.

      Many thanks one more time.

      This kind configure i put, everything works now ok. Tx rx and er led not work, but i can live with that 🙂

      ./configure --my-transport=nrf24 --my-gateway=serial --my-serial-is-pty --my-serial-pty=/dev/ttyUSB020 --my-transport=nrf24 --my-rf24-irq-pin=15 --my-rf24-channel=108 --my-leds-err-pin=12 --my-leds-rx-pin=16 --my-leds-tx-pin=18
      

      Can someone tell why mysensors sketch take so much size on program memory. And i but debug // out commented first row and after that still printing serial monitor.

      Here my code now. Can i do simpler that code because i know i use 3-5 ds1820 sensors not need to scan everytime what sensors there are and now they are harder rename.

      Try to search some examples, but almost all use this ds1820 example code. I think code is more and more simpler if just do 3pcs ds1820 sensors and name that temps allready with some name. After that see directly on Domoticz what sensor is what.

      Everyhints with this is ok, that works ok right now with this example code, but code is quite big (big sketch) and have that sensor scan system what i not needed.

      What i can do that 30000ms sleep, if i but relay and switch systems in this same node.

      Only edit is now couple rows code to use my oled display to show one ds1820 sensor temp. I understand that do this sketch little bit bigger, but sketch is quite big before that oled display.

      /**
       * 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.
       *
       *******************************
       *
       * DESCRIPTION
       *
       * Example sketch showing how to send in DS1820B OneWire temperature readings back to the controller
       * http://www.mysensors.org/build/temp
       */
      
      
      
      
      
      
      
      // Enable debug prints to serial monitor
      //#define MY_DEBUG 
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      
      #include <SPI.h>
      #include <MySensors.h>  
      #include <DallasTemperature.h>
      #include <OneWire.h>
      
       // NÄYTTÖ INCLUDET!
      #include <Wire.h>              
      #include <Adafruit_GFX.h>
      #include <Adafruit_SSD1306.h>
      
      #define OLED_RESET 4
      Adafruit_SSD1306 display(OLED_RESET);
      
      #define NUMFLAKES 10
      #define XPOS 0
      #define YPOS 1
      #define DELTAY 2
      
      #if (SSD1306_LCDHEIGHT != 32)
      #error("Height incorrect, please fix Adafruit_SSD1306.h!");
      #endif
       // NÄYTTÖ INCLUDET LOPPU!
      
      
      
      #define COMPARE_TEMP 1 // Send temperature only if changed? 1 = Yes 0 = No
      
      #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected 
      #define MAX_ATTACHED_DS18B20 8
      
      #define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      #define MY_DEFAULT_ERR_LED_PIN 4
      #define MY_DEFAULT_TX_LED_PIN 7
      #define MY_DEFAULT_RX_LED_PIN 8
      
      float temperature = 0;
      
      unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
      OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
      DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature. 
      float lastTemperature[MAX_ATTACHED_DS18B20];
      int numSensors=0;
      bool receivedConfig = false;
      bool metric = true;
      // Initialize temperature message
      MyMessage msg(0,V_TEMP);
      
      void before()
      {
        // Startup up the OneWire library
        sensors.begin();
        
      }
      
      void setup()  
      { 
        // requestTemperatures() will not block current thread
        sensors.setWaitForConversion(false);
      
        display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
        delay(500);
        display.clearDisplay();
      }
      
      void presentation() {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Garage Node", "1.1");
      
        // Fetch the number of attached temperature sensors  
        numSensors = sensors.getDeviceCount();
      
        // Present all sensors to controller
        for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {   
           present(i, S_TEMP);
        }
      }
      
      void loop()     
      {     
        // Fetch temperatures from Dallas sensors
        sensors.requestTemperatures();
      
        // query conversion time and sleep until conversion completed
        int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution());
        // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater)
        sleep(conversionTime);
      
        // Read temperatures and send them to controller 
        for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
      
          // Fetch and round temperature to one decimal
          temperature = static_cast<float>(static_cast<int>((getControllerConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
      
          // Only send data if temperature has changed and no error
          #if COMPARE_TEMP == 1
          if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) {
          #else
          if (temperature != -127.00 && temperature != 85.00) {
          #endif
      
            // Send in the new temperature
            //Serial.print("xxxx"); Serial.print(temperature); // omaa debuggausta..
            send(msg.setSensor(i).set(temperature,1));
            // Save new temperatures for next compare
            lastTemperature[i]=temperature;
      
          oledNaytto();
          }
        }
        sleep(SLEEP_TIME);
      }
      
      ////////////////OLED NÄYTÖN OHJAUS .. TEMPERATURE OTETAAN VALMIISTAJA MUUTTUJASTA JA INDEKSIN MUKAAN (1 on tällä hetkellä ainakin room temp)///////
      int oledNaytto(){
              display.clearDisplay();
              display.setTextSize(3);
              display.setTextColor(WHITE);
              display.setCursor(0,0);
              display.println(lastTemperature[1]);
              display.display();
      }
      
      posted in My Project
      lassivv
      lassivv
    • RE: Multi Node project (MySensors noob) =RASPBERRY GATEWAY PROBLEM=

      Thx for info @sineverba but not help anything, same error message still.

      I try with his kind configure:

      ./configure --my-transport=nrf24 --my-gateway=serial --my-serial-is-pty --my-serial-pty=/dev/ttyMySensorsGateway --my-transport=nrf24 --my-rf24-irq-pin=15
      

      Get this error back

      mysgw: Starting gateway...
      mysgw: Protocol version - 2.1.1
      mysgw: MCO:BGN:INIT GW,CP=RNNG--Q,VER=2.1.1
      mysgw: TSM:INIT
      mysgw: TSF:WUR:MS=0
      mysgw: !TSM:INIT:TSP FAIL
      mysgw: TSM:FAIL:CNT=1
      mysgw: TSM:FAIL:PDT
      

      Now i testing my node and (serial arduino gateway) and that seems work perfect every nrf24 modules what i have. Not understand why raspberry not work directly.

      Couple questions to do that node system.

      I understand to start little more and more style. But i think you have good tips what kind code is best example to do something bigger node. (many temps, many relays and many swithches).

      Because now if i only try edit some simple sketch to that kind "big" node i think that not best way to do that kind of node.

      Other question i try to put, this kind code my sketch. (i copied that to myconfig file.) I understand if i put that command my sketch that overdrive myconfig -file values?

      I try to get diagnostic leds work my node, but nothing happen. Anyone know do that leds works ok nowadays?

      #define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      #define MY_DEFAULT_ERR_LED_PIN 4
      #define MY_DEFAULT_TX_LED_PIN 7
      #define MY_DEFAULT_RX_LED_PIN 8
      
      posted in My Project
      lassivv
      lassivv
    • RE: Multi Node project (MySensors noob) =RASPBERRY GATEWAY PROBLEM=

      Not find any short circuit that i allready of course checked but checked them again.

      Here is node debug info.

      0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
      3 TSM:INIT
      4 TSF:WUR:MS=0
      11 TSM:INIT:TSP OK
      12 TSM:FPAR
      15 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      2022 !TSM:FPAR:NO REPLY
      2024 TSM:FPAR
      2026 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      4034 !TSM:FPAR:NO REPLY
      4036 TSM:FPAR
      4038 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      6046 !TSM:FPAR:NO REPLY
      6048 TSM:FPAR
      6050 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      8058 !TSM:FPAR:FAIL
      8059 TSM:FAIL:CNT=1
      8061 TSM:FAIL:PDT
      18065 TSM:FAIL:RE-INIT
      18067 TSM:INIT
      18074 TSM:INIT:TSP OK
      18076 TSM:FPAR
      18078 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      20086 !TSM:FPAR:NO REPLY
      20088 TSM:FPAR
      20090 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      22099 !TSM:FPAR:NO REPLY
      22102 TSM:FPAR
      22104 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      24112 !TSM:FPAR:NO REPLY
      24114 TSM:FPAR
      24116 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      26124 !TSM:FPAR:FAIL
      26125 TSM:FAIL:CNT=2
      26127 TSM:FAIL:PDT
      

      EDIT: I try to jumper cabel only Nrf24 module to rasbperry but get same error message like this:

      pi@raspberrypi:~/MySensors $ sudo ./bin/mysgw -d
      mysgw: Starting gateway...
      mysgw: Protocol version - 2.1.1
      mysgw: MCO:BGN:INIT GW,CP=RNNG--Q,VER=2.1.1
      mysgw: TSM:INIT
      mysgw: TSF:WUR:MS=0
      mysgw: !TSM:INIT:TSP FAIL
      mysgw: TSM:FAIL:CNT=1
      mysgw: TSM:FAIL:PDT
      mysgw: TSM:FAIL:RE-INIT
      mysgw: TSM:INIT
      mysgw: !TSM:INIT:TSP FAIL
      mysgw: TSM:FAIL:CNT=2
      mysgw: TSM:FAIL:PDT
      mysgw: TSM:FAIL:RE-INIT
      mysgw: TSM:INIT
      mysgw: !TSM:INIT:TSP FAIL
      mysgw: TSM:FAIL:CNT=3
      mysgw: TSM:FAIL:PDT
      

      EDIT2: Try to take 15pin IRQ disconnect and make without that. Not help anything.

      How i can delete all mysensors files and do new installation? Something better link than this?
      git clone https://github.com/mysensors/MySensors.git --branch master

      EDIT3:
      I put gateway serial in my node. Upload skecth and open serial. Is this working gateway messages? This debug goes, but after that not coming any more messages:

      0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.1
      0;255;3;0;9;TSM:INIT
      0;255;3;0;9;TSF:WUR:MS=0
      0;255;3;0;9;TSM:INIT:TSP OK
      0;255;3;0;9;TSM:INIT:GW MODE
      0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
      0;255;3;0;9;MCO:REG:NOT NEEDED
      0;255;3;0;14;Gateway startup complete.
      0;255;0;0;18;2.1.1
      0;255;3;0;9;MCO:BGN:STP
      0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
      
      posted in My Project
      lassivv
      lassivv
    • RE: 💬 Building a Raspberry Pi Gateway

      Sorry see this topic after i post my own topic, thinks this is better topic to my problems. But i continue my own topic.

      posted in Announcements
      lassivv
      lassivv
    • RE: Multi Node project (MySensors noob) =RASPBERRY GATEWAY PROBLEM=

      Hi mfalkvidd

      Yeah i know that, but some instructions have some notice linux give back "bad wiring" but maybe that is some other module or system what i read about.

      Anyway i tested 2pcs radio modems same thing with both. I have node ready, but not have gateway not know do i can test my node working without gateway.

      Here is post to wirings, some places not show every photo but i write explains where wirings goes. Hope this helps to seem what i do wrong.

      http://i.imgur.com/CvvvmFx.jpg
      http://i.imgur.com/a6b5tSf.jpg

      edit: Leds are connected 3.3v power --> led --> 510ohm resistor --> other end are attached pins 12, 16 and 18.

      posted in My Project
      lassivv
      lassivv
    • RE: 💬 Building a Raspberry Pi Gateway

      Hi all

      Hope someone can help MySensors noob 🙂 I try to do Raspberry pi 3 gateway with nrf24 module.

      Hardware:
      Raspberry pi 3
      nrf24 module
      3.3v 0.5A regulator.
      status leds (3pcs)
      Domoticz Beta

      I start with this instructions:
      https://www.mysensors.org/build/raspberry#improving-throughput-for-nrf24

      commands what i use:
      git clone https://github.com/mysensors/MySensors.git --branch master
      cd MySensors
      ./configure --my-transport=nrf24
      ./configure --my-gateway=serial --my-serial-is-pty --my-serial-pty=/dev/ttyMySensorsGateway (try ttyUSBMySensorsGateway too, but now help)
      ./configure --my-transport=nrf24 --my-rf24-irq-pin=15
      ./configure --my-leds-err-pin=12 --my-leds-rx-pin=16 --my-leds-tx-pin=18

      make
      sudo ./bin/mysgw -d

      After that i get error what is same to that instruction site:
      http://i.imgur.com/jpiaMdC.png

      I douple check wiring that seems to be all right. I think Linux console tell wrong wiring, if wiring is problem? But anyway i douple checked that wiring.

      Hope someone can help me with this problem.

      I try many times different settings, dont know do i need delete some old files or can i try again and again do configure and give "make" command.

      posted in Announcements
      lassivv
      lassivv
    • RE: Multi Node project (MySensors noob) =RASPBERRY GATEWAY PROBLEM=

      Thx for info. I try to start do gateway work on my raspberry pi 3. I do this kind of wiring: https://www.mysensors.org/build/raspberry#improving-throughput-for-nrf24 (Only edit i use 3.3v regulator to 2.4rf module and take voltage 5voltage line of course).

      I try to do all settings like that url tells me. Here couple last things i change many different things that tty place, but not help, i also try network gateway, but not helped same error coming.

      http://i.imgur.com/jpiaMdC.png

      I check wirings two times and that is ok. And i think this make -command tells if i have wrong wiring.

      Any hints what i do now. Not want do arduino gateway and plug that with usb on raspberry, because more hardware.

      Hope someone can help me. Any hints and tips are welcome.

      posted in My Project
      lassivv
      lassivv
    • Multi Node project (MySensors noob) =RASPBERRY GATEWAY PROBLEM=

      Hi All

      I start my "first" MySensors node project. (i built one temp sensor 3years ago, but just do that only with some tutorial explain).

      I have quite good knowing Arduino systems, but MySensors are new thing to me. I think to build 3pcs nodes to my house. I use Arduino nano, rf24 with external antenna, i design node circuit boards with eagle and do that on china.

      Node boards are quite simple..
      -couple capasitators 3.3v and 5v power lines.
      -3.3v 0.5A regulator
      -connector 2.4rf
      -connector arduino nano
      -connector ds1820 temperature sensors.
      -Tx, Rx, Err leds. (not know still mysensors use that leds?)
      -Other space is just normal test circuit board where can build what want.
      -Use normal cellphones 5v/1-2A chargers to power this nodes.
      -128x32 Oled display (SSD1306)
      +Controller is Raspberry pi 3 + Aeon Zwave stick + MySensors gateway (i take recommends what kind gateway is best built to Raspberry) + Domoticz Beta software.

      Couple pictures node:
      https://www.dropbox.com/s/92qujf14czxgqtz/IMG_20170623_124513.jpg?dl=0
      https://www.dropbox.com/s/08eyobxwoub4hzl/IMG_20170623_124618.jpg?dl=0

      After that i need help with software, of course take hints to hardware too if someone want to gives.

      I think to do nodes what include: relay control (2-4pcs), ds1820 sensors (2-10pcs), maybe some switch info (couple door switches) and oled display show one temperature and maybe use tx rx and err one corner of dipslay and take that leds out.

      What is best software example where i start to build this kind of node. I allready check ds1820 temperature node, but maybe is easiest if i find some code where is allready some my features or maybe all my features and i edit that suitable to my use?

      If i do example 2pcs relay outs, 3pcs ds1820 sensors, 2pcs door switches, can i get every outs, switch and temps see seperate to my domoticz?

      posted in My Project
      lassivv
      lassivv