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
A

alop

@alop
Unfollow Follow
About
Posts
13
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Raspberry Gateway + Arduino pro mini (atmega328p) NRF24L01 (without plus +)
    A alop
    Troubleshooting atmega328p arduino pro mini raspberry serial gateway home assistant nrf24l01

    @gohan said in Raspberry Gateway + Arduino pro mini (atmega328p) NRF24L01 (without plus +):

    choose to configure it as ethernet, .

    But if I understand right, I need ethernet gateway hardware, or am I missing something?


  • Raspberry Gateway + Arduino pro mini (atmega328p) NRF24L01 (without plus +)
    A alop
    Troubleshooting atmega328p arduino pro mini raspberry serial gateway home assistant nrf24l01

    @gohan I do not have ethernet hardware. I just wanted to connect radio directly to RPI


  • Raspberry Gateway + Arduino pro mini (atmega328p) NRF24L01 (without plus +)
    A alop
    Troubleshooting atmega328p arduino pro mini raspberry serial gateway home assistant nrf24l01

    @gohan As described above, there was no connection between serial gateway on RPi und sensor nodes.
    Above is the whole setup described. Wiring is taken from the mysensors web site.


  • Raspberry Gateway + Arduino pro mini (atmega328p) NRF24L01 (without plus +)
    A alop
    Troubleshooting atmega328p arduino pro mini raspberry serial gateway home assistant nrf24l01

    It's a workaroud, but not "nice".
    Since I have no problem on creating gateway on another arduino pro mini, I just connected per USB the arduino to RP3 and everything is working fine.
    So sensors can be read by a controller (home assistant).
    Big downside is, that for pro mini I have to use usb to ttl convertor in between.
    Maybe the code for raspberry is with bugs, since to be able to see my rf radio on raspberry I had to install the "development" branch.


  • Mqtt + sensors
    A alop
    General Discussion

    @mfalkvidd no communication

    653955 TSF:SID:OK,ID=66
    653958 TSM:FPAR
    653977 TSF:MSG:SEND,66-66-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    655984 !TSM:FPAR:NO REPLY
    655986 TSM:FPAR
    656006 TSF:MSG:SEND,66-66-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    658014 !TSM:FPAR:NO REPLY
    658016 TSM:FPAR
    658035 TSF:MSG:SEND,66-66-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    

    This here is another try to solve issues as in this post LINK


  • Mqtt + sensors
    A alop
    General Discussion

    I have now trying the setup where I have on raspberry 3 mosquitto as MQTT running and mysensors gateway also setup there. As controller I'm using home assistant.
    I can see that mqtt receives data from gateway.
    But how do I send data from my sensors (atmega328p) over nrf24l01+ to gateway?
    What do I need to add in the skatch?

    gateway:

    mysgw: Starting gateway...
    mysgw: Protocol version - 2.2.0-beta
    mysgw: MCO:BGN:INIT GW,CP=RNNG----,VER=2.2.0-beta
    mysgw: TSF:LRT:OK
    mysgw: TSM:INIT
    mysgw: TSF:WUR:MS=0
    mysgw: TSM:INIT:TSP OK
    mysgw: TSM:INIT:GW MODE
    mysgw: TSM:READY:ID=0,PAR=0,DIS=0
    mysgw: MCO:REG:NOT NEEDED
    mysgw: MCO:BGN:STP
    mysgw: MCO:BGN:INIT OK,TSP=1
    mysgw: Attempting MQTT connection...
    mysgw: connected to 127.0.0.1
    mysgw: MQTT connected
    mysgw: Sending message on topic: mysensors-out/0/255/0/0/18
    

    skatch:

    /**
     * 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.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - Henrik EKblad
     *
     * DESCRIPTION
     * Example sketch showing how to measue light level using a LM393 photo-resistor
     * http://www.mysensors.org/build/light
     */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    #define MY_NODE_ID 66
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    #define MY_MQTT_TOPIC_PREFIX "mygateway"
    
    #include <MySensors.h>
    
    #define CHILD_ID_LIGHT 15
    #define LIGHT_SENSOR_ANALOG_PIN 0
    
    unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
    
    MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
    int lastLightLevel;
    
    
    void presentation()
    {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Light Sensor", "1.0");
    
        // Register all sensors to gateway (they will be created as child devices)
        present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
    }
    
    void loop()
    {
        int16_t lightLevel = (1023-analogRead(LIGHT_SENSOR_ANALOG_PIN))/10.23;
        Serial.println(lightLevel);
        if (lightLevel != lastLightLevel) {
            send(msg.set(lightLevel));
            lastLightLevel = lightLevel;
        }
        sleep(SLEEP_TIME);
    }
    

  • Raspberry Gateway + Arduino pro mini (atmega328p) NRF24L01 (without plus +)
    A alop
    Troubleshooting atmega328p arduino pro mini raspberry serial gateway home assistant nrf24l01

    @mfalkvidd
    Unfortunatelly no change after adding capacitor :(
    Now I have bought NRF24L01 WITH Plus and I'm trying with them.
    I have reinstalled from skratch everything.
    Gateway and sensor are now ca. 3-4 meters appart.

    Sketch on atmega328p (light sensor)

    /**
     * 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.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - Henrik EKblad
     *
     * DESCRIPTION
     * Example sketch showing how to measue light level using a LM393 photo-resistor
     * http://www.mysensors.org/build/light
     */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    #include <MySensors.h>
    
    #define CHILD_ID_LIGHT 15
    #define LIGHT_SENSOR_ANALOG_PIN 0
    
    unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
    
    MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
    int lastLightLevel;
    
    
    void presentation()
    {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Light Sensor", "1.0");
    
        // Register all sensors to gateway (they will be created as child devices)
        present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
    }
    
    void loop()
    {
        int16_t lightLevel = (1023-analogRead(LIGHT_SENSOR_ANALOG_PIN))/10.23;
        Serial.println(lightLevel);
        if (lightLevel != lastLightLevel) {
            send(msg.set(lightLevel));
            lastLightLevel = lightLevel;
        }
        sleep(SLEEP_TIME);
    }
    

    On raspberry

    ./configure --my-transport=nrf24 --my-gateway=serial --my-serial-is-pty --my-serial-pty=/dev/ttyUSB020
    

    Serial on the sensor

    114445 !TSM:FPAR:NO REPLY
    114447 TSM:FPAR
    114449 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    116457 !TSM:FPAR:FAIL
    116459 TSM:FAIL:CNT=7
    116461 TSM:FAIL:DIS
    116463 TSF:TDI:TSL
    176465 TSM:FAIL:RE-INIT
    176467 TSM:INIT
    176475 TSM:INIT:TSP OK
    176477 TSM:FPAR
    176479 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    178487 !TSM:FPAR:NO REPLY
    178489 TSM:FPAR
    178491 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    180499 !TSM:FPAR:NO REPLY
    180501 TSM:FPAR
    180503 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    182511 !TSM:FPAR:NO REPLY
    182513 TSM:FPAR
    182515 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    

    on raspberry

    
    pi@RP3HA:~/MySensors $ sudo ./bin/mysgw -d
    mysgw: Starting gateway...
    mysgw: Protocol version - 2.2.0-beta
    mysgw: MCO:BGN:INIT GW,CP=RNNG----,VER=2.2.0-beta
    mysgw: TSF:LRT:OK
    mysgw: TSM:INIT
    mysgw: TSF:WUR:MS=0
    mysgw: TSM:INIT:TSP OK
    mysgw: TSM:INIT:GW MODE
    mysgw: TSM:READY:ID=0,PAR=0,DIS=0
    mysgw: MCO:REG:NOT NEEDED
    mysgw: MCO:BGN:STP
    mysgw: MCO:BGN:INIT OK,TSP=1
    

    And on my home automation (home assistant)

    2017-07-22 13:00:19 ERROR (Thread-13) [mysensors.gateway_serial] Unable to connect to /dev/ttyUSB020
    

    Update:
    After 15-20 minutes running the gateway I received following lines:

    mysgw: TSF:SAN:OK
    mysgw: TSM:READY:NWD REQ
    mysgw: TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
    

  • Raspberry Gateway + Arduino pro mini (atmega328p) NRF24L01 (without plus +)
    A alop
    Troubleshooting atmega328p arduino pro mini raspberry serial gateway home assistant nrf24l01

    @mfalkvidd Ok, so far :)
    But do I need to "compile", "build", "make" something so that changes in MyConfig.h will be taken?


  • Raspberry Gateway + Arduino pro mini (atmega328p) NRF24L01 (without plus +)
    A alop
    Troubleshooting atmega328p arduino pro mini raspberry serial gateway home assistant nrf24l01

    @mfalkvidd
    Just in general: What is the procedure if I change the MyConfig.h on raspberry?


  • Raspberry Gateway + Arduino pro mini (atmega328p) NRF24L01 (without plus +)
    A alop
    Troubleshooting atmega328p arduino pro mini raspberry serial gateway home assistant nrf24l01

    @mfalkvidd OK. I just bought some 4.7 capacitors :)
    I'll make the setup with them.

    @mfalkvidd said in Raspberry Gateway + Arduino pro mini (atmega328p) NRF24L01 (without plus +):

    https://www.mysensors.org/build/raspberry#advanced shows how to set defines if you don't want to modify MyConfig.h, but modifying MyConfig.h also works. I prefer the -D variant because then I can easily switch MySensors versions in git without having to re-apply the changes.

    Just to clerify, if I change MyConfig.h on raspberry it is not enough just to save the file and "build" the gateway with other parameters?
    Maybe this is why I dont receive any signal.


  • Raspberry Gateway + Arduino pro mini (atmega328p) NRF24L01 (without plus +)
    A alop
    Troubleshooting atmega328p arduino pro mini raspberry serial gateway home assistant nrf24l01

    @sundberg84
    I dont have capacitors on radios.
    The distance between radios is 20-30 cm.
    Raspberry radio is powered from raspberry.
    On Arduino i have additional power supply 5v for the motion sensor.
    Arduino is powered through USB.

    Am I assuming right, that on raspberry when there is no configure parameter for something, I just change it in MyConfig.h and "make" again?

    I had the same hardware setup tested with gettingstarted and the communication was established.


  • Raspberry Gateway + Arduino pro mini (atmega328p) NRF24L01 (without plus +)
    A alop
    Troubleshooting atmega328p arduino pro mini raspberry serial gateway home assistant nrf24l01

    Unfortunatelly not.
    Same result

    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
    3 TSM:INIT
    4 TSF:WUR:MS=0
    11 TSM:INIT:TSP OK
    13 TSF:SID:OK,ID=1
    14 TSM:FPAR
    1613 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    3621 !TSM:FPAR:NO REPLY
    3623 TSM:FPAR
    5223 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    7230 !TSM:FPAR:NO REPLY
    7232 TSM:FPAR
    8832 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    10839 !TSM:FPAR:NO REPLY
    

    And here is the code:

    /**
     * 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.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - Henrik Ekblad
     *
     * DESCRIPTION
     * Motion Sensor example using HC-SR501
     * http://www.mysensors.org/build/motion
     *
     */
    
    // Enable debug prints
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    
    
    #define MY_RF24_CE_PIN 6
    #define MY_RF24_CS_PIN 10
    //#define MY_RF24_PA_LEVEL RF24_PA_LOW
    #define MY_RF24_DATARATE RF24_2MBPS
    
    unsigned long SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
    #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
    #define CHILD_ID 11   // Id of the sensor child
    
    #include <SPI.h>
    #include <MySensors.h>
    #include <MyConfig.h>
    
    // Initialize motion message
    MyMessage msg(CHILD_ID, V_TRIPPED);
    
    void setup()
    {
      Serial.begin(115200);
      pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
      Serial.println(F("Setup"));
    }
    
    void presentation()
    {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Motion Sensor", "1.0");
    
      // Register all sensors to gw (they will be created as child devices)
      present(CHILD_ID, S_MOTION);
      Serial.println(F("Presentation"));
    }
    
    void loop()
    {
      Serial.println(F("loop"));
      // Read digital motion value
      bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
    
      Serial.println(tripped);
      send(msg.set(tripped?"1":"0"));  // Send tripped value to gw
    
      // Sleep until interrupt comes in on motion sensor. Send update every two minute.
      sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
    }
    
    

  • Raspberry Gateway + Arduino pro mini (atmega328p) NRF24L01 (without plus +)
    A alop
    Troubleshooting atmega328p arduino pro mini raspberry serial gateway home assistant nrf24l01

    I have difficulties about following setup:
    I have a controller home assisitant.
    It runs on raspbery pi 3.
    On the same I have a serial gateway MySensors (just attached NRF24L01 (without plus!) on it.
    I have an (atmega328p) like arduino pro mini as node with a motion sensor attached.
    I'm trying to "connect" the node to the gateway but without success.
    Btw I have tested other different gettingstarted scripts with this radios and they are working fine.

    Here is the output of the gateway:

    pi@RP3HA:~/MySensors $ sudo ./bin/mysgw -d
    mysgw: Starting gateway...
    mysgw: Protocol version - 2.2.0-beta
    mysgw: MCO:BGN:INIT GW,CP=RNNG----,VER=2.2.0-beta
    mysgw: TSF:LRT:OK
    mysgw: TSM:INIT
    mysgw: TSF:WUR:MS=0
    mysgw: TSM:INIT:TSP OK
    mysgw: TSM:INIT:GW MODE
    mysgw: TSM:READY:ID=0,PAR=0,DIS=0
    mysgw: MCO:REG:NOT NEEDED
    mysgw: MCO:BGN:STP
    mysgw: MCO:BGN:INIT OK,TSP=1
    

    Here is the serial output of the node:

    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
    3 TSM:INIT
    4 TSF:WUR:MS=0
    11 TSM:INIT:TSP OK
    13 TSM:FPAR
    1611 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    3619 !TSM:FPAR:NO REPLY
    3621 TSM:FPAR
    5221 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    7229 !TSM:FPAR:NO REPLY
    7231 TSM:FPAR
    

    On Raspberry only change that I have done is in MyConfig.h

    #define MY_RF24_DATARATE				RF24_2MBPS
    

    Here is the code on the node:

    /**
     * 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.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - Henrik Ekblad
     *
     * DESCRIPTION
     * Motion Sensor example using HC-SR501
     * http://www.mysensors.org/build/motion
     *
     */
    
    // Enable debug prints
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    
    #include <SPI.h>
    #include <MySensors.h>
    #include <MyConfig.h>
    #define MY_RF24_CE_PIN 6
    #define MY_RF24_CS_PIN 10
    //#define MY_RF24_PA_LEVEL RF24_PA_LOW
    #define MY_RF24_DATARATE RF24_2MBPS
    
    //unsigned long SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds)
    #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
    #define CHILD_ID 11   // Id of the sensor child
    
    // Initialize motion message
    MyMessage msg(CHILD_ID, V_TRIPPED);
    
    void setup()
    {
      Serial.begin(115200);
      pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
      Serial.println(F("Setup"));
    }
    
    void presentation()
    {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Motion Sensor", "1.0");
    
      // Register all sensors to gw (they will be created as child devices)
      present(CHILD_ID, S_MOTION);
      Serial.println(F("Presentation"));
    }
    
    void loop()
    {
      Serial.println(F("loop"));
      // Read digital motion value
      bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
    
      Serial.println(tripped);
      send(msg.set(tripped?"1":"0"));  // Send tripped value to gw
    
      // Sleep until interrupt comes in on motion sensor. Send update every two minute.
    //  sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);
    }
    
    

    I want to see some serial print, but there is nothing comming ever with this code.
    On getting started, I receive the serial print.

  • Login

  • Don't have an account? Register

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