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
MaKinM

MaKin

@MaKin
About
Posts
38
Topics
8
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Binary sensor for production counting transmits false values
    MaKinM MaKin

    @rejoe2 Thanks, I actually have a counter but removed it from the code to keep it simple. It counts the pulses and sends the number for comparison and it matches actually. So the problem is at the beginning with the node "getting false pulses" from the machine. Any idea how that can be explained? :(

    Troubleshooting

  • Binary sensor for production counting transmits false values
    MaKinM MaKin

    Thanks for your response. You are perfectly right. The counting happens on the server (counting the transmitted '1's coming via MQTT).

    Troubleshooting

  • Binary sensor for production counting transmits false values
    MaKinM MaKin

    Hey guys,

    I am currently working on a project in our company where I would like to use NodeMCU to count produced parts and send the data via MQTT. The NodeMCU is attached to one of the pulse generators (e.g. a cutter or welder) and the NodeMCU receives that signal but it seems like it is counting too many signals (like doubling the real value) and I cannot figure out why.

    The highes frequency of pulses (produced parts) I have to deal with are about 2 - 3 per second.

    This is my simple binary sketch:

    // 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 9600
    
    #define MY_GATEWAY_MQTT_CLIENT
    #define MY_GATEWAY_ESP8266
    
    #define MCU_ID redacted
    
    // Set MQTT client id
    #define MY_MQTT_CLIENT_ID MCU_ID
    
    // Set this node's subscribe and publish topic prefix
    #define MY_MQTT_PUBLISH_TOPIC_PREFIX redacted
    #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX redacted
    
    // Enable these if your MQTT broker requires username/password
    #define MY_MQTT_USER redacted
    #define MY_MQTT_PASSWORD redacted
    
    // Set WIFI SSID and password
    #define MY_ESP8266_SSID redacted
    #define MY_ESP8266_PASSWORD redacted
    
    // MQTT broker ip address.
    #define MY_CONTROLLER_URL_ADDRESS redacted
    
    // The MQTT broker port to to open
    #define MY_PORT 1883
    
    #include <ESP8266WiFi.h>
    #include <MySensors.h>
    #include <Bounce2.h>
    
    #define CHILD_ID 1
    #define BUTTON_PIN  3
    
    #define LEDRED 16
    #define LEDGREEN 0
    
    Bounce debouncer = Bounce(); 
    int oldValue=-1;
    
    MyMessage msg(CHILD_ID,V_STATUS);
    MyMessage msgCount(CHILD_ID,I_LOG_MESSAGE);
    MyMessage msgHeartbeat(CHILD_ID,I_HEARTBEAT_RESPONSE);
    
    int countHeartbeat = 0;
    
    void setup()   
    {
    
      // Setup the button
      pinMode(BUTTON_PIN,INPUT);
      // Activate internal pull-up
      digitalWrite(BUTTON_PIN,HIGH);
    
      // After setting up the button, setup debouncer
      debouncer.attach(BUTTON_PIN);
      debouncer.interval(5);
    
      countHeartbeat = 0;
    
      //Setup the Pulse LED
      pinMode(LEDRED, OUTPUT);
    
      //Setup the Status LED
      pinMode(LEDGREEN, OUTPUT);
      digitalWrite(LEDGREEN, HIGH);
    }
    
    void presentation() {
    
      sendSketchInfo(MCU_ID, "1.0");
      present(CHILD_ID, S_BINARY);
      //present(HEARTBEAT_ID, S_BINARY); 
    }
    
    
    //  Check if digital input has changed and send in new value
    void loop() 
    {
      debouncer.update();
      // Get the update value
      int value = debouncer.read();
      countHeartbeat ++;
      if(countHeartbeat >= 1155000){
        //Serial.println("Heartbeat");
        send(msgHeartbeat.set(1));
        countHeartbeat = 0;
      }
      
      if (value != oldValue) {
         // Send in the new value
         send(msg.set(value==HIGH ? 0 : 1)); 
         oldValue = value;
         if ( value == 1) {
            //Serial.println("Off");
            digitalWrite(LEDRED, LOW);
            delay(30);
         } else {
            //Serial.println("On");
            digitalWrite(LEDRED, HIGH);
         }
         
      }
      //send(heartbeat.set(value==1));
    }
    

    I appreciate any hint or comment!

    Troubleshooting

  • Problem with NRF24L01+PA+LNA (Gateway - Sensor Connection)
    MaKinM MaKin

    @gohan Thanks, I will try that!

    Hardware

  • Problem with NRF24L01+PA+LNA (Gateway - Sensor Connection)
    MaKinM MaKin

    We bought these: NRF24L01+ PCB Adapter

    We do not use any capacitor.

    What irritates me, the gateway works (ethernet gateway) with the +PA+LNA, whereas the sensor nodes do not. We have switched the PCB Adapters and antennas without any change.

    Hardware

  • Problem with NRF24L01+PA+LNA (Gateway - Sensor Connection)
    MaKinM MaKin

    @gohan I bought the voltage regulators for nrf24 and provide 5V, but still...

    Hardware

  • How to get sensor data into influxdb?
    MaKinM MaKin

    @Yveaux do you also use Grafana in order to visualize the data? I am not sure what fields/attributes are necessary despite "time" and "value" for a binary sensor.

    General Discussion database time influxdb

  • Problem with NRF24L01+PA+LNA (Gateway - Sensor Connection)
    MaKinM MaKin

    It's weird, as it seems to work for my Gateway, but as soon as my sensors are connected with the +PA+LNA, they cannot register. :(

    Hardware

  • Problem with NRF24L01+PA+LNA (Gateway - Sensor Connection)
    MaKinM MaKin

    Thanks a lot guys. Can you recommend a suitable power supply? And what capacitator should I get?

    And how does the RFM69 compare to the NRF24L01?

    Hardware

  • Problem with NRF24L01+PA+LNA (Gateway - Sensor Connection)
    MaKinM MaKin

    Thanks for your help, once again.

    I have only connected it to the Nano's 3.3V port yet.
    Unfortunately, I didn't know that disconnecting the antenna might damage the radio. But I did only try it with one of the radios.

    How should I then connect it properly if the 3.3V is insufficient?

    Thanks in advance.

    Hardware

  • Problem with NRF24L01+PA+LNA (Gateway - Sensor Connection)
    MaKinM MaKin

    Hello everyone,

    I have just switched from NRF24L01+ to NRF24L01+PA+LNA radio modules and I am currently struggling with establishing a connection between the Gateway and a Sensor.

    Gateway (NRF24L01+PA+LNA):

    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
    IP: 192.168.0.100
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    IP: 192.168.0.100
    0;255;3;0;9;Attempting MQTT connection...
    0;255;3;0;9;MQTT connected
    0;255;3;0;9;Sending message on topic: mygateway1-out/0/255/0/0/18
    

    Sensor Node (NRF24L01+PA+LNA):

    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:INIT:STATID=10
    15 TSF:SID:OK,ID=10
    16 TSM:FPAR
    1615 TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    3624 !TSM:FPAR:NO REPLY
    3627 TSM:FPAR
    3630 TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    5638 !TSM:FPAR:NO REPLY
    5640 TSM:FPAR
    5643 TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    7651 !TSM:FPAR:NO REPLY
    7653 TSM:FPAR
    7656 TSF:MSG:SEND,10-10-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    9664 !TSM:FPAR:FAIL
    9665 TSM:FAIL:CNT=1
    9667 TSM:FAIL:PDT
    19670 TSM:FAIL:RE-INIT
    

    In general: With the NRF24L01+PA+LNA connected to 3V, the serial monitor remains empty from time to time (especially often if the antenna itself is disconnected from the radio module).

    Also, when starting the Arduino IDE with the sensor node connected, I receive the following error message:

    Error while setting serial port parameters: 115,200 N 8 1
    

    With the NRF24L01 radio module I used before, there is no such problem. The Gateway receives and the sensor sends - as it is supposed to be.

    It's really frustrating, because I wanted to enhance the signal strength and now I am left with no communication at all. :flushed:

    I have read that the problem might be the 3.3V supply. Does this problem match the schema?

    Thanks in advance.

    Hardware

  • How can I measure/track current pulses from machines?
    MaKinM MaKin

    @mfalkvidd I can have it output in either 12V or 24V - my choice.

    I have various SRD-12VDC-SL-C octocoupler relays, but I have no idea how to set it up as a sensor instead of an actuator. :(

    @gohan see my reply to mfalkvidd

    I had a look at the Power Meter Pulse Sensor but I am clueless on how to transfer it to my components.

    Thanks again for taking the time to help.

    Hardware

  • How can I measure/track current pulses from machines?
    MaKinM MaKin

    @gohan thanks for your input! Can you explain how exactly you would do that? I think I should have some optocoupler in my starter kit - does it have to be some special kind of optocoupler? Can you tell me how to connect the Arduino, Octocoupler and the "machine" I want to measure? Are there mySensor sketches I could work with?

    @mfalkvidd thank you too. I just had to do some research on what ttl means and unfortunately, I am not sure whether this true for our machine. Same question here, is there a sample sketch available?

    Thank you very much guys. I really appreciate your support.

    Hardware

  • How can I measure/track current pulses from machines?
    MaKinM MaKin

    @gohan said in How can I measure/track current pulses from machines?:

    You could use node-red to route data to any database if you like.

    Thanks for the info. I already had a look at node-red but so far, I am satisfied with the myController interface for influxDB. :-)

    Hardware

  • How can I measure/track current pulses from machines?
    MaKinM MaKin

    @mfalkvidd said in How can I measure/track current pulses from machines?:

    @MaKin have you looked at https://www.mysensors.org/build/pulse_power ? Not that I want to ruin your learning experience at school, but it sounds pretty similar to that example.

    You're absolutely not. Thanks a lot. But am I right to use a relay instead of the light sensor? Because in mysensors relays are (obviously) used as actuators.

    Hardware

  • How can I measure/track current pulses from machines?
    MaKinM MaKin

    Hello everyone,

    for a student's project, I have to find a way to track current impulses from a machine, so that I can record the times that impulses were triggered in a given time (e.g. per hour). Unfortunately I am no electrical engineer and therefore struggle with the hardware side, which is why I came to you guys after searching the Internet (which is pretty difficult if you do not really know the terms to search for :cold_sweat: ).

    What I have though so far: Using a relay module, connecting the "machine" to the Arduino with the relay in between and logging the impulses with the binary sensor. Does that make any sense to you?

    The analysis part including Grafana and influxDB is easy peasy, but I have to get that far in the first place.

    I would really appreciate your help with this as it really is frustrating. :disappointed_relieved:

    So far, I managed to do everything I wanted with mysensors and help I found here, but this time I am overstrained...

    Thanks in advance,

    MaKin

    Hardware

  • How to get sensor data into influxdb?
    MaKinM MaKin

    I have just discovered that there is an option for external servers like influxdb in mycontrollers. Can you say something about it compared to red node?

    And thanks for the code!

    General Discussion database time influxdb

  • How to get sensor data into influxdb?
    MaKinM MaKin

    Thanks a lot and yes please, that'd be very helpful!

    General Discussion database time influxdb

  • How to get sensor data into influxdb?
    MaKinM MaKin

    Hey guys,

    I am running several sensors (mysensors) and would like to push them into an influxDB instance in order to visualize it with Grafana.

    Influxdb and Grafana are already running on my Pi3 but I'm not sure what is the most elegant and easy way to push the data into the database.

    Any hint is appreciated. :-)

    General Discussion database time influxdb

  • Error decoding message from gateway, probably received bad byte.
    MaKinM MaKin

    Hello everyone,

    I wanted to implement MySensors with HASS as a students project. I already have it running at home and it works flawlessly. But now I cannot overcome the following error:

    mysensors.mysensors: Error decoding message from gateway, probably received bad byte.
    

    I've never had such an error before. I tried using the combination of Arduino-Gateway and Arduino-DHT22 AND I also tried to have both on the same Arduino (both ways worked with my sketches at home).

    I also tried to install pyserial 2.5 as it was stated in another thread. :/

    Do you guys have any idea what else I could try?

    Home Assistant
  • Login

  • Don't have an account? Register

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