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
E

ericvdb

@ericvdb
About
Posts
151
Topics
10
Shares
0
Groups
0
Followers
0
Following
1

Posts

Recent Best Controversial

  • ESP8266 as MySensors nodes instead of Arduino + nRF24L01
    E ericvdb

    @AffordableTech

    MySensors = node --> gateway --> HA Controller

    If you want to use ESP8266 it is as easy as: ESP8266 node --> MQTT broker --> HA Controller

    The MQTT broker can run on a RPi (mosquitto for example)

    Regarding the ID assignment that will be DHCP if you want

    Just my 2c

    Feature Requests

  • MQTT on Serial Gateway?
    E ericvdb

    @Grubstake if you build a MQTT MySensors gateway, there's no OpenHab binding needed. Disadvantage is that you need to configure your nodes in OpenHab manually.

    General Discussion

  • N00b + MQTT gw + openHAB2
    E ericvdb

    @gohan said in N00b + MQTT gw + openHAB2:

    but anyway ethernet is the best solution for beginners because you can use myscontroller to debug messages while connected to controller.

    With MQTT you can also debug using MQTT-Spy or MQTTLens or various other MQTT apps.

    MQTT is easy in interconnecting various systems without they have to know about each-other.

    As long as you have a MQTT broker (RabbitMQ, Mosquitto, ActiveMQ, ...) you're all set.

    In OpenHab in conf/services create a file called mqtt.cfg, and past the following:

    mqtt:broker.url=tcp://ip-address-of-mqttbroker:1883
    mqtt:broker.clientId=openhab
    mqtt:broker.retain=true
    mqtt:broker.async=false
    

    Then in your items file you can do:

    Switch Light_GV_Hall    			"Ceiling"       	(GV_Hall, Lights) {mqtt=">[broker:myhome/room/switch1:command:ON:1],>[broker:myhome/room/switch1:command:OFF:0],<[broker:myhome/room/switch1:state:ON:1],<[broker:myhome/room/switch1:state:OFF:0"}
    

    And now you can turn on/off the light from OpenHab as wel as from any other device that publishes to the same toppic (yes, even from MQTT-Spy and MQTTLens)

    Troubleshooting

  • 💬 Building a Raspberry Pi Gateway
    E ericvdb

    use sudo ;)

    Announcements

  • Double click | Hold for buttons
    E ericvdb

    Maybe this will help: http://jmsarduino.blogspot.be/2009/10/4-way-button-click-double-click-hold.html

    General Discussion

  • RF433 transistor/fet wanted
    E ericvdb

    @Boots33 no, it's not the FS1000 type, but a regular cheap RF433 transmitter.
    The problem is that when powered with 12V, the transmitter does not see the 5V on the data pin as high.

    Hardware

  • RF433 transistor/fet wanted
    E ericvdb

    Hi guys,

    who can help choosing a component.
    I'm building a RF433Mhz node to control wireless powerplugs. The transmitter works fine at 5V but the range is not that great.
    The transmitter can handle up to 12V, but I have no clue what transitor/fet i can use for both the power line and the data line.
    Yesterday I tried to use a opto-coupler but that is not fast enough, I clearly see on the scope the signal fading out when going from high to low.

    I also have some BC547 laying around, but that is inverting the signal, not what i want.

    Anyone can make some suggestions?

    Thanks in advance.

    Eric

    Hardware

  • 💬 Building a Raspberry Pi Gateway
    E ericvdb

    @ben999 Yes, version 2

    Announcements

  • Is this worth it?
    E ericvdb

    Dunno about that one but I bought a Rigol 1054z 50Mhz which you can freely upgrade to 100Mhz

    https://nl.aliexpress.com/item/FREE-SHIPPING-RIGOL-DS1054Z-50MHz-Digital-Oscilloscope-4-analog-channels-50MHz-bandwidth/32498608008.html

    General Discussion

  • 💬 Building a Raspberry Pi Gateway
    E ericvdb

    @marceloaqno

    When running as a service, is there a way to watch the debug log?

    Announcements

  • [SOLVED] GatewayESP8266MQTTClient node reboots permanently as soon as MyController activates it as gateway
    E ericvdb

    @DerTomm said:

    #define MY_MQTT_CLIENT_ID "mysensors-1"
    

    try changing to something like

    #define MY_MQTT_CLIENT_ID "mywifinode-1"
    

    You are using the same client ID on both controller and node

    Troubleshooting

  • 💬 Building a Raspberry Pi Gateway
    E ericvdb

    @marceloaqno I have it completely working now. :satisfied: A Raspberry Pi PulseCounter for water/gas/electricity consumption measurements with ethernet/mqtt. I can post my code here if you want.

    Minor detail:

    millis() / 1000;
    

    should be

    millis() * 1000;
    

    to get micros() ;)

    Announcements

  • 💬 Building a Raspberry Pi Gateway
    E ericvdb

    @marceloaqno

    I have it working :smiley: only need to play with the debounce value

    Announcements

  • 💬 Building a Raspberry Pi Gateway
    E ericvdb

    @marceloaqno
    I have it almost working. Regarding the interrupt, I have to pull-up to 3.3V the io pin through a resistor of 10k?
    Right now the interrupt isn't firing

    Announcements

  • 💬 Building a Raspberry Pi Gateway
    E ericvdb

    @marceloaqno

    i was able to get a bit further by replacing all "unsigned long" declarations with "uint"

    Remains unsolved:

    root@raspberrypi:/downloads/MySensors# make
    cc  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/log.o drivers/Linux/log.c
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/noniso.o drivers/Linux/noniso.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/Print.o drivers/Linux/Print.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/EthernetClient.o drivers/Linux/EthernetClient.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/SerialPort.o drivers/Linux/SerialPort.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/Stream.o drivers/Linux/Stream.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/IPAddress.o drivers/Linux/IPAddress.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/compatibility.o drivers/Linux/compatibility.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/SoftEeprom.o drivers/Linux/SoftEeprom.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/EthernetServer.o drivers/Linux/EthernetServer.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o examples_linux/mysGateway.o examples_linux/mysGateway.cpp
    examples_linux/mysGateway.cpp: In function âvoid onPulse()â:
    examples_linux/mysGateway.cpp:96:28: error: âmicrosâ was not declared in this scope
         uint newBlink = micros();
                                ^
    examples_linux/mysGateway.cpp: In function âvoid loop()â:
    examples_linux/mysGateway.cpp:180:25: error: call of overloaded âsleep(uint&)â is ambiguous
         sleep(SEND_FREQUENCY);
                             ^
    examples_linux/mysGateway.cpp:180:25: note: candidates are:
    In file included from examples_linux/mysGateway.cpp:22:0:
    /usr/include/unistd.h:444:21: note: unsigned int sleep(unsigned int)
     extern unsigned int sleep (unsigned int __seconds);
                         ^
    In file included from ./MySensors.h:320:0,
                     from examples_linux/mysGateway.cpp:60:
    ./core/MySensorsCore.cpp:543:8: note: int8_t sleep(uint32_t, bool)
     int8_t sleep(const uint32_t sleepingMS, const bool smartSleep) {
            ^
    Makefile:46: recipe for target 'examples_linux/mysGateway.o' failed
    make: *** [examples_linux/mysGateway.o] Error 1
    
    Announcements

  • 💬 Building a Raspberry Pi Gateway
    E ericvdb

    @marceloaqno

    Today i tried to use the sketch Water Meter Pulse Sensor in mysGateway.cpp but i run into alot of errors, you have any idea?

    mysGateway.cpp:

    /**
     * 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 Marcelo Aquino <marceloaqno@gmail.org>
     * Copyleft (c) 2016, Marcelo Aquino
     * 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.
     */
     
    #include <iostream>
    #include <cstdio>
    #include <unistd.h>
    
    // For more options run ./configure --help
    
    // Config file
    //#define MY_LINUX_CONFIG_FILE "/etc/mysensors.dat"
    
    // How many clients should be able to connect to this gateway (default 1)
    #define MY_GATEWAY_MAX_CLIENTS 10
    
    // Serial config
    // Enable this if you are using an Arduino connected to the USB
    //#define MY_LINUX_SERIAL_PORT "/dev/ttyACM0"
    // Enable this if you need to connect to a controller running on the same device
    //#define MY_IS_SERIAL_PTY
    // Choose a symlink name for the PTY device
    //#define MY_LINUX_SERIAL_PTY "/dev/ttyMySensorsGateway"
    // Grant access to the specified system group for the serial device
    //#define MY_LINUX_SERIAL_GROUPNAME "tty"
    
    // MQTT options
    //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 68
    //#define MY_PORT 1883
    //#define MY_MQTT_CLIENT_ID "mysensors-1"
    //#define MY_MQTT_PUBLISH_TOPIC_PREFIX "mygateway1-out"
    //#define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "mygateway1-in"
    
    // Enable these if your MQTT broker requires usenrame/password
    //#define MY_MQTT_USER "username"
    //#define MY_MQTT_PASSWORD "password"
    
    // Flash leds on rx/tx/err
    //#define MY_DEFAULT_ERR_LED_PIN 12  // Error LED pin
    //#define MY_DEFAULT_RX_LED_PIN  16  // Receive LED pin
    //#define MY_DEFAULT_TX_LED_PIN  18  // Transmit LED pin
    // Inverse the blinking feature
    //#define MY_WITH_LEDS_BLINKING_INVERSE
    
    #include <MySensors.h>
    
    #define DIGITAL_INPUT_SENSOR 26                  // The digital input you attached your sensor.  (Only 2 and 3 generates interrupt!)
    
    #define PULSE_FACTOR 1000                       // Nummber of blinks per m3 of your meter (One rotation/liter)
    
    #define SLEEP_MODE false                        // flowvalue can only be reported when sleep mode is false.
    
    #define MAX_FLOW 40                             // Max flow (l/min) value to report. This filters outliers.
    
    #define CHILD_ID 1                              // Id of the sensor child
    
    unsigned long SEND_FREQUENCY = 30000;           // Minimum time between send (in milliseconds). We don't want to spam the gateway.
    
    MyMessage flowMsg(CHILD_ID,V_FLOW);
    MyMessage volumeMsg(CHILD_ID,V_VOLUME);
    MyMessage lastCounterMsg(CHILD_ID,V_VAR1);
    
    double ppl = ((double)PULSE_FACTOR)/1000;        // Pulses per liter
    
    volatile unsigned long pulseCount = 0;   
    volatile unsigned long lastBlink = 0;
    volatile double flow = 0;  
    bool pcReceived = false;
    unsigned long oldPulseCount = 0;
    unsigned long newBlink = 0;   
    double oldflow = 0;
    double volume =0;                     
    double oldvolume =0;
    unsigned long lastSend =0;
    unsigned long lastPulse =0;
    
    void onPulse()     
    {
      if (!SLEEP_MODE)
      {
        unsigned long newBlink = micros();   
        unsigned long interval = newBlink-lastBlink;
    
        if (interval!=0)
        {
          lastPulse = millis();
          if (interval<500000L) {
            // Sometimes we get interrupt on RISING,  500000 = 0.5sek debounce ( max 120 l/min)
            return;   
          }
          flow = (60000000.0 /interval) / ppl;
        }
        lastBlink = newBlink;
      }
      pulseCount++; 
    }
    
    void setup() {
      attachInterrupt(DIGITAL_INPUT_SENSOR, onPulse, FALLING); 
    }
    
    void presentation() {
      // Present locally attached sensors here  
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Water Meter", "1.1");
    
      // Register this device as Waterflow sensor
      present(CHILD_ID, S_WATER);  
    }
    
    void loop() {
      // Send locally attached sensors data here
      unsigned long currentTime = millis();
    
        // Only send values at a maximum frequency or woken up from sleep
      if (SLEEP_MODE || (currentTime - lastSend > SEND_FREQUENCY))
      {
        lastSend=currentTime;
    
        if (!pcReceived) {
          //Last Pulsecount not yet received from controller, request it again
          request(CHILD_ID, V_VAR1);
          return;
        }
    
        if (!SLEEP_MODE && flow != oldflow) {
          oldflow = flow;
    
          Serial.print("l/min:");
          Serial.println(flow);
    
          // Check that we dont get unresonable large flow value. 
          // could hapen when long wraps or false interrupt triggered
          if (flow<((unsigned long)MAX_FLOW)) {
            send(flowMsg.set(flow, 2));                   // Send flow value to gw
          }  
        }
    
        // No Pulse count received in 2min 
        if(currentTime - lastPulse > 120000){
          flow = 0;
        } 
    
        // Pulse count has changed
        if ((pulseCount != oldPulseCount)||(!SLEEP_MODE)) {
          oldPulseCount = pulseCount;
    
          Serial.print("pulsecount:");
          Serial.println(pulseCount);
    
          send(lastCounterMsg.set(pulseCount));                  // Send  pulsecount value to gw in VAR1
    
          double volume = ((double)pulseCount/((double)PULSE_FACTOR));     
          if ((volume != oldvolume)||(!SLEEP_MODE)) {
            oldvolume = volume;
    
            Serial.print("volume:");
            Serial.println(volume, 3);
    
            send(volumeMsg.set(volume, 3));               // Send volume value to gw
          } 
        }
      }
      if (SLEEP_MODE) {
        sleep(SEND_FREQUENCY);
      }
    }
    

    ./configure --my-debug=enable --my-gateway=ethernet --my-radio=none --my-port=5003

    [SECTION] Detecting target machine.
    [OK] machine detected: SoC=BCM2835, Type=RPi, CPU=armv6l, REV=000e.
    [OK] init system detected: systemd
    [SECTION] Saving configuration.
    [SECTION] Cleaning previous builds.
    [OK] Finished.
    

    make:

    root@raspberrypi:/downloads/MySensors# make
    cc  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/log.o drivers/Linux/log.c
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/noniso.o drivers/Linux/noniso.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/Print.o drivers/Linux/Print.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/EthernetClient.o drivers/Linux/EthernetClient.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/SerialPort.o drivers/Linux/SerialPort.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/Stream.o drivers/Linux/Stream.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/IPAddress.o drivers/Linux/IPAddress.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/compatibility.o drivers/Linux/compatibility.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/SoftEeprom.o drivers/Linux/SoftEeprom.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o drivers/Linux/EthernetServer.o drivers/Linux/EthernetServer.cpp
    g++ -DMY_GATEWAY_LINUX -DMY_DEBUG -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -DLINUX_ARCH_RASPBERRYPI -Ofast -g -Wall -Wextra -DMY_PORT=5003  -I. -I./core -I./drivers/Linux -I./drivers/RPi -MMD -c -o examples_linux/mysGateway.o examples_linux/mysGateway.cpp
    examples_linux/mysGateway.cpp: In function âvoid onPulse()â:
    examples_linux/mysGateway.cpp:96:37: error: âmicrosâ was not declared in this scope
         unsigned long newBlink = micros();
                                         ^
    examples_linux/mysGateway.cpp: In function âvoid loop()â:
    examples_linux/mysGateway.cpp:166:41: error: call of overloaded âset(volatile long unsigned int&)â is ambiguous
           send(lastCounterMsg.set(pulseCount));                  // Send  pulsecount value to gw in VAR1
                                             ^
    examples_linux/mysGateway.cpp:166:41: note: candidates are:
    In file included from ./MySensors.h:319:0,
                     from examples_linux/mysGateway.cpp:60:
    ./core/MyMessage.cpp:222:12: note: MyMessage& MyMessage::set(const char*) <near match>
     MyMessage& MyMessage::set(const char* value) {
                ^
    ./core/MyMessage.cpp:222:12: note:   no known conversion for argument 1 from âvolatile long unsigned intâ to âconst char*â
    ./core/MyMessage.cpp:234:12: note: MyMessage& MyMessage::set(bool)
     MyMessage& MyMessage::set(bool value) {
                ^
    ./core/MyMessage.cpp:241:12: note: MyMessage& MyMessage::set(uint8_t)
     MyMessage& MyMessage::set(uint8_t value) {
                ^
    ./core/MyMessage.cpp:256:12: note: MyMessage& MyMessage::set(uint32_t)
     MyMessage& MyMessage::set(uint32_t value) {
                ^
    ./core/MyMessage.cpp:263:12: note: MyMessage& MyMessage::set(int32_t)
     MyMessage& MyMessage::set(int32_t value) {
                ^
    ./core/MyMessage.cpp:270:12: note: MyMessage& MyMessage::set(uint16_t)
     MyMessage& MyMessage::set(uint16_t value) {
                ^
    ./core/MyMessage.cpp:277:12: note: MyMessage& MyMessage::set(int16_t)
     MyMessage& MyMessage::set(int16_t value) {
                ^
    examples_linux/mysGateway.cpp:180:25: error: call of overloaded âsleep(long unsigned int&)â is ambiguous
         sleep(SEND_FREQUENCY);
                             ^
    examples_linux/mysGateway.cpp:180:25: note: candidates are:
    In file included from examples_linux/mysGateway.cpp:22:0:
    /usr/include/unistd.h:444:21: note: unsigned int sleep(unsigned int)
     extern unsigned int sleep (unsigned int __seconds);
                         ^
    In file included from ./MySensors.h:320:0,
                     from examples_linux/mysGateway.cpp:60:
    ./core/MySensorsCore.cpp:543:8: note: int8_t sleep(uint32_t, bool)
     int8_t sleep(const uint32_t sleepingMS, const bool smartSleep) {
            ^
    Makefile:46: recipe for target 'examples_linux/mysGateway.o' failed
    make: *** [examples_linux/mysGateway.o] Error 1
    
    Announcements

  • 💬 Building a Raspberry Pi Gateway
    E ericvdb

    @marceloaqno what about gpio interrupts, is that supported?

    I'm thinking to use a RPi as a pulse counter for water, electricity and gas with no radio, just ethernet or mqtt.
    In combination with a I2C display, this could be a nice project ;)

    Greetz,
    Eric

    Announcements

  • combining pulse counters
    E ericvdb

    Here is the difference in code.

    Digital IO polling:

    int inPin = 7;   // pushbutton connected to digital pin 7
    int val = 0;     // variable to store the read value
    
    void setup()
    {
      pinMode(inPin, INPUT);      // sets the digital pin 7 as input
    }
    
    void loop()
    {
      val = digitalRead(inPin);   // read the input pin
    }
    

    Interrupt based:

    const byte interruptPin = 2;
    volatile byte state = LOW;
    
    void setup() {
      pinMode(interruptPin, INPUT_PULLUP);
      attachInterrupt(digitalPinToInterrupt(interruptPin), blink, CHANGE);
    }
    
    void loop() {
      // do whatever you want here
    }
    
    void blink() {
      // this gets called whenever the input changes
      state = !state;
    }
    
    Development

  • combining pulse counters
    E ericvdb

    Interrupt: whenever you input changes from low-to-high or high-to-low, the atmega will fire the method you told it to do.
    Digital IO: if you want to know the state of the digital io, you have to constantly poll the io.

    Regarding 3 counters on 1 nano, have a look at 12 input pulse counter

    Development

  • combining pulse counters
    E ericvdb

    No, use 1 nano, use interrupts for electricity and gas, and use digital input for water.
    Unless you want everything interrupt based, then you will need 2 x nano (or a mega)

    Development
  • Login

  • Don't have an account? Register

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