Navigation

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

    maos

    @maos

    3
    Reputation
    10
    Posts
    204
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    maos Follow

    Best posts made by maos

    • RE: NRF24l01 Sensor_id aleatory

      This??

      Basic gateway :

      // Enable debug prints to serial monitor
      #define MY_DEBUG

      // Use a bit lower baudrate for serial prints on ESP8266 than default in MyConfig.h
      #define MY_BAUD_RATE 115200

      // Enables and select radio type (if attached)
      #define MY_RADIO_RF24
      //#define MY_RADIO_RFM69
      //#define MY_RADIO_RFM95

      #define MY_GATEWAY_MQTT_CLIENT
      #define MY_GATEWAY_ESP8266

      // Set this node's subscribe and publish topic prefix
      #define MY_MQTT_PUBLISH_TOPIC_PREFIX "mygateway1-out"
      #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "mygateway1-in"

      // Set MQTT client id
      #define MY_MQTT_CLIENT_ID "mysensors-1"

      // Enable these if your MQTT broker requires username/password
      //#define MY_MQTT_USER "username"
      //#define MY_MQTT_PASSWORD "password"

      // Set WIFI SSID and password
      #define MY_WIFI_SSID "xxx"
      #define MY_WIFI_PASSWORD "xxx"

      // Set the hostname for the WiFi Client. This is the hostname
      // it will pass to the DHCP server if not static.
      // #define MY_HOSTNAME "mqtt-sensor-gateway"

      // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
      //#define MY_IP_ADDRESS 192,168,178,87

      // If using static ip you can define Gateway and Subnet address as well
      //#define MY_IP_GATEWAY_ADDRESS 192,168,178,1
      //#define MY_IP_SUBNET_ADDRESS 255,255,255,0

      // MQTT broker ip address.
      #define MY_CONTROLLER_IP_ADDRESS 192, 168, 1, 211

      //MQTT broker if using URL instead of ip address.
      //#define MY_CONTROLLER_URL_ADDRESS "192.168.1.211"

      // The MQTT broker port to to open
      #define MY_PORT 1883

      // Enable inclusion mode
      //#define MY_INCLUSION_MODE_FEATURE
      // Enable Inclusion mode button on gateway
      //#define MY_INCLUSION_BUTTON_FEATURE
      // Set inclusion mode duration (in seconds)
      //#define MY_INCLUSION_MODE_DURATION 60
      // Digital pin used for inclusion mode button
      //#define MY_INCLUSION_MODE_BUTTON_PIN D1

      // Set blinking period
      //#define MY_DEFAULT_LED_BLINK_PERIOD 300

      // Flash leds on rx/tx/err
      //#define MY_DEFAULT_ERR_LED_PIN 16 // Error led pin
      //#define MY_DEFAULT_RX_LED_PIN 16 // Receive led pin
      //#define MY_DEFAULT_TX_LED_PIN 16 // the PCB, on board LED

      #include <ESP8266WiFi.h>
      #include <MySensors.h>

      void setup()
      {
      // Setup locally attached sensors

      }

      void presentation()
      {
      // Present locally attached sensors here
      }

      void loop()
      {
      // Send locally attached sensors data here
      }

      Client, simple sketch to send only simple values like temperature a humidity :

      // Enable debug prints
      #define MY_DEBUG

      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      //#define MY_RS485

      #include <SPI.h>
      #include <MySensors.h>

      // Set this offset if the sensor has a permanent small offset to the real temperatures
      //#define SENSOR_TEMP_OFFSET 0

      // Sleep time between sensor updates (in milliseconds)
      // Must be >1000ms for DHT22 and >2000ms for DHT11
      static const uint64_t UPDATE_INTERVAL = 5000;

      // Force sending an update of the temperature after n sensor reads, so a controller showing the
      // timestamp of the last update doesn't show something like 3 hours in the unlikely case, that
      // the value didn't change since;
      // i.e. the sensor would force sending an update every UPDATE_INTERVAL*FORCE_UPDATE_N_READS [ms]
      //static const uint8_t FORCE_UPDATE_N_READS = 10;

      #define CHILD_ID_HUM 0
      #define CHILD_ID_TEMP 1

      bool metric = true;

      MyMessage msgHum(CHILD_ID_HUM, V_HUM);
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);

      void presentation()
      {
      // Send the sketch version information to the gateway
      sendSketchInfo("TemperatureAndHumidity", "1.1");

      // Register all sensors to gw (they will be created as child devices)
      present(CHILD_ID_HUM, S_HUM);
      present(CHILD_ID_TEMP, S_TEMP);

      metric = getControllerConfig().isMetric;
      }

      void setup()
      {

      }

      void loop()
      {

      send(msgTemp.set(12, 1));

      send(msgHum.set(66, 1));

      // Sleep for a while to save energy
      //sleep(UPDATE_INTERVAL);
      delay(UPDATE_INTERVAL);

      }

      0_1559485704664_ef06d18f-fdd9-489b-9358-cb7500661c70-image.png

      posted in Development
      maos
      maos
    • RE: NRF24l01 Sensor_id aleatory

      I think that is a insufficient current. A mini is a 3.3v. Now a use a pro mini 5v, and work....

      posted in Development
      maos
      maos
    • RE: NRF24l01 Sensor_id aleatory

      Stupid.....
      mygateway1-in / 3/0/1/0/1, to publish .....
      I'm going to study the library gradually, so far I think top

      posted in Development
      maos
      maos

    Latest posts made by maos

    • no matching function for call to 'present(int, mysensors_data_t)'

      Hello, after some time, a need rebuild my sketch.
      Now I have this error, I don't now whats is :

      no matching function for call to 'present(int, mysensors_data_t)'

      #define CHILD_ID_MOISTURE 0
      MyMessage msgMoisture(CHILD_ID_MOISTURE, V_LEVEL);

      void presentation()
      {
      sendSketchInfo("TemperatureAndHumidity", "1.1");
      present(CHILD_ID_MOISTURE, V_LEVEL);
      metric = getControllerConfig().isMetric;
      }

      I spent many hours knowing what it is, I can't find the problem.
      Anyone with any tips?

      posted in Development
      maos
      maos
    • RE: NRF24l01 Sensor_id aleatory

      Stupid.....
      mygateway1-in / 3/0/1/0/1, to publish .....
      I'm going to study the library gradually, so far I think top

      posted in Development
      maos
      maos
    • RE: NRF24l01 Sensor_id aleatory

      Sorry, I guess I was not very clear. At this point would be to just send to another nearby node 3 or 4.
      I do not want to send it to everyone at the same time.
      From gateway to another node.

      posted in Development
      maos
      maos
    • RE: NRF24l01 Sensor_id aleatory

      @mfalkvidd said in NRF24l01 Sensor_id aleatory:

      _NODE_ID 3 (or whatever nu

      Yes, it does. This is the first time I work with this livrary. Thank you for taking the time to help me.

      I have this scenario. Have a gateway with mqtt and others to send to this gateway. However I also need to send some information to the gateways. I have control receive (const MyMessage & message) {
      However can I, send this information to all the clients that are sending to this gateway?

      posted in Development
      maos
      maos
    • RE: NRF24l01 Sensor_id aleatory

      NRF24 can work with wemos d1 mini as client? I try but the result is the sensor_id in topic, in gateway is aleatory .

      posted in Development
      maos
      maos
    • RE: NRF24l01 Sensor_id aleatory

      I think that is a insufficient current. A mini is a 3.3v. Now a use a pro mini 5v, and work....

      posted in Development
      maos
      maos
    • RE: NRF24l01 Sensor_id aleatory

      Forget, i use node-red, the message arrives, but of course empty, because i subscribe : mygateway1-out/#...

      posted in Development
      maos
      maos
    • RE: NRF24l01 Sensor_id aleatory

      This??

      Basic gateway :

      // Enable debug prints to serial monitor
      #define MY_DEBUG

      // Use a bit lower baudrate for serial prints on ESP8266 than default in MyConfig.h
      #define MY_BAUD_RATE 115200

      // Enables and select radio type (if attached)
      #define MY_RADIO_RF24
      //#define MY_RADIO_RFM69
      //#define MY_RADIO_RFM95

      #define MY_GATEWAY_MQTT_CLIENT
      #define MY_GATEWAY_ESP8266

      // Set this node's subscribe and publish topic prefix
      #define MY_MQTT_PUBLISH_TOPIC_PREFIX "mygateway1-out"
      #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "mygateway1-in"

      // Set MQTT client id
      #define MY_MQTT_CLIENT_ID "mysensors-1"

      // Enable these if your MQTT broker requires username/password
      //#define MY_MQTT_USER "username"
      //#define MY_MQTT_PASSWORD "password"

      // Set WIFI SSID and password
      #define MY_WIFI_SSID "xxx"
      #define MY_WIFI_PASSWORD "xxx"

      // Set the hostname for the WiFi Client. This is the hostname
      // it will pass to the DHCP server if not static.
      // #define MY_HOSTNAME "mqtt-sensor-gateway"

      // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
      //#define MY_IP_ADDRESS 192,168,178,87

      // If using static ip you can define Gateway and Subnet address as well
      //#define MY_IP_GATEWAY_ADDRESS 192,168,178,1
      //#define MY_IP_SUBNET_ADDRESS 255,255,255,0

      // MQTT broker ip address.
      #define MY_CONTROLLER_IP_ADDRESS 192, 168, 1, 211

      //MQTT broker if using URL instead of ip address.
      //#define MY_CONTROLLER_URL_ADDRESS "192.168.1.211"

      // The MQTT broker port to to open
      #define MY_PORT 1883

      // Enable inclusion mode
      //#define MY_INCLUSION_MODE_FEATURE
      // Enable Inclusion mode button on gateway
      //#define MY_INCLUSION_BUTTON_FEATURE
      // Set inclusion mode duration (in seconds)
      //#define MY_INCLUSION_MODE_DURATION 60
      // Digital pin used for inclusion mode button
      //#define MY_INCLUSION_MODE_BUTTON_PIN D1

      // Set blinking period
      //#define MY_DEFAULT_LED_BLINK_PERIOD 300

      // Flash leds on rx/tx/err
      //#define MY_DEFAULT_ERR_LED_PIN 16 // Error led pin
      //#define MY_DEFAULT_RX_LED_PIN 16 // Receive led pin
      //#define MY_DEFAULT_TX_LED_PIN 16 // the PCB, on board LED

      #include <ESP8266WiFi.h>
      #include <MySensors.h>

      void setup()
      {
      // Setup locally attached sensors

      }

      void presentation()
      {
      // Present locally attached sensors here
      }

      void loop()
      {
      // Send locally attached sensors data here
      }

      Client, simple sketch to send only simple values like temperature a humidity :

      // Enable debug prints
      #define MY_DEBUG

      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      //#define MY_RS485

      #include <SPI.h>
      #include <MySensors.h>

      // Set this offset if the sensor has a permanent small offset to the real temperatures
      //#define SENSOR_TEMP_OFFSET 0

      // Sleep time between sensor updates (in milliseconds)
      // Must be >1000ms for DHT22 and >2000ms for DHT11
      static const uint64_t UPDATE_INTERVAL = 5000;

      // Force sending an update of the temperature after n sensor reads, so a controller showing the
      // timestamp of the last update doesn't show something like 3 hours in the unlikely case, that
      // the value didn't change since;
      // i.e. the sensor would force sending an update every UPDATE_INTERVAL*FORCE_UPDATE_N_READS [ms]
      //static const uint8_t FORCE_UPDATE_N_READS = 10;

      #define CHILD_ID_HUM 0
      #define CHILD_ID_TEMP 1

      bool metric = true;

      MyMessage msgHum(CHILD_ID_HUM, V_HUM);
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);

      void presentation()
      {
      // Send the sketch version information to the gateway
      sendSketchInfo("TemperatureAndHumidity", "1.1");

      // Register all sensors to gw (they will be created as child devices)
      present(CHILD_ID_HUM, S_HUM);
      present(CHILD_ID_TEMP, S_TEMP);

      metric = getControllerConfig().isMetric;
      }

      void setup()
      {

      }

      void loop()
      {

      send(msgTemp.set(12, 1));

      send(msgHum.set(66, 1));

      // Sleep for a while to save energy
      //sleep(UPDATE_INTERVAL);
      delay(UPDATE_INTERVAL);

      }

      0_1559485704664_ef06d18f-fdd9-489b-9358-cb7500661c70-image.png

      posted in Development
      maos
      maos
    • NRF24l01 Sensor_id aleatory

      Hello, i need help
      I have a gateway with nrf24l01 with the mysensor lib and a client with the arduino mini pro.
      However when I get in the gatway the topic of the sensor_id is random.
      I tested with an arduino nano and it worked well.
      Something that is escaping me?

      63551 GWT:TPS:TOPIC=mygateway1-out/255/174/3/0/3,MSG SENT
      64551 TSF:MSG:READ,255-255-0,s=139,c=3,t=3,pt=0,l=0,sg=0:
      64557 GWT:TPS:TOPIC=mygateway1-out/255/139/3/0/3,MSG SENT
      65557 TSF:MSG:READ,255-255-0,s=104,c=3,t=3,pt=0,l=0,sg=0:
      65562 GWT:TPS:TOPIC=mygateway1-out/255/104/3/0/3,MSG SENT
      66562 TSF:MSG:READ,255-255-0,s=69,c=3,t=3,pt=0,l=0,sg=0:
      66567 GWT:TPS:TOPIC=mygateway1-out/255/69/3/0/3,MSG SENT

      174,139,104,69

      in the client I only have two registered:

      #define CHILD_ID_HUM 0
      #define CHILD_ID_TEMP 1

      float lastTemp;
      float lastHum;
      uint8_t nNoUpdatesTemp;
      uint8_t nNoUpdatesHum;
      bool metric = true;

      MyMessage msgHum(CHILD_ID_HUM, V_HUM);
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);

      void presentation()
      {
      // Send the sketch version information to the gateway
      sendSketchInfo("TemperatureAndHumidity", "1.1");

      // Register all sensors to gw (they will be created as child devices)
      present(CHILD_ID_HUM, S_HUM);
      present(CHILD_ID_TEMP, S_TEMP);

      posted in Development
      maos
      maos
    • Mq135 Air quality limits

      Hello, I'm new here.
      I'm using mq135 with arduino, to measure the quality of the air inside.
      I have had readings between 45 and 150.
      What are the limits? For example :
      0-50, good
      51-100, regular
      101-199, it's not good
      200-299, very bad
      300-399, terrible

      400, critic

      Is this table correct?

      posted in General Discussion
      maos
      maos