[Benötige Hilfe] MYSENSORS Pulse Sensor Watermeter Einrichtung

Begonnen von Jarnsen, 10 Januar 2016, 00:41:18

Vorheriges Thema - Nächstes Thema

Matscher

Klar kein Problem. :) Wenn Du das ersetzt hast und neu geladen hast, bin ich auf das Ergebnis gespannt. Dort muß, wenn alles funktioniert, "interval: 123346" als Beispiel auftauchen.

Zitat
void onPulse()     
{
  if (!SLEEP_MODE) {
    unsigned long newBlink = micros();   
    unsigned long interval = newBlink-lastBlink;
    lastPulse = millis();
    if (interval < 2080) {       // Sometimes we get interrupt on RISING,  500000 = 0.5sek debounce ( max 120 l/min)  WAS 2080
      return;   
    }

    flow = ((60000000.0 /interval) / ppl)*.264172;
    //flow = ((60000000.0 /interval) / ppl);
    Serial.print("interval:");
    Serial.println(interval);
    lastBlink = newBlink;
    // Serial.println(flow, 4);
  }
  pulseCount++;

}
Rasp 3
CUL V3 868Mhz + nanoCUL 868Mhz als RFR + nanoCUL 868Mhz für Homematic + SIGNALduino
Zigbee CC2531 - Aquara TempSensor
MySensors Ethernet Gateway, Water meter, Gas meter
Modul: 09_CUL_FHTTK.pm (assumed), culfw part HAS_FHT_TF

Jarnsen

ok geändert. 115200 nur Zeichensalat

230400 Baut bringt das

send: 0-0-0-0 s=0,c=2,t=24,pt=0,l=0,sg=0,st=ok:
send: 0-0-0-0 s=0,c=2,t=24,pt=0,l=0,sg=0,st=ok:
interval:106420384
interval:131048
interval:641368
interval:134872
interval:4298984
interval:302872
send: 0-0-0-0 s=0,c=2,t=24,pt=0,l=0,sg=0,st=ok:
interval:5400360
interval:1861464
send: 0-0-0-0 s=0,c=2,t=24,pt=0,l=0,sg=0,st=ok:
interval:4312968
interval:817472
send: 0-0-0-0 s=0,c=2,t=24,pt=0,l=0,sg=0,st=ok:
send: 0-0-0-0 s=0,c=2,t=24,pt=0,l=0,sg=0,st=ok:


hoffe kannst damit was anfangen
1 x RPi2,
1 x nanoCUL433, 1 x nanoCUL868, 1 x SIGNALduino433
Sonos/SonosSpeak, Homebridge, 2 x Enigma2, 10 x Nobily Rollläden, 3 x Intertechno Steckdosen
Pushover, Abfallerinnerung, MySensors, 7 x Max!

Jarnsen

#17
Habe Serial GW und SensorNode nochmal mit API 1.4.2 beschrieben, dies brachte auch keine Besserung. Was denkst du, soll ich auf 1.4 bleiben oder wieder auf 1.5 gehen? Denke am Fehler wird das nichts machen.


kann es am SerialGW liegen? Das er die Daten einfach nicht weiter gibt.

Grüße Jarnsen
1 x RPi2,
1 x nanoCUL433, 1 x nanoCUL868, 1 x SIGNALduino433
Sonos/SonosSpeak, Homebridge, 2 x Enigma2, 10 x Nobily Rollläden, 3 x Intertechno Steckdosen
Pushover, Abfallerinnerung, MySensors, 7 x Max!

Hauswart

Nein so aktuell wie möglich sein, es gab mit 1.5 oder 1.6 eine kleine Umstellungen auf welches auch das FHEM Modul umgestellt wurde.
1. Installation:
KNX, Tasmota (KNX), Sonos, Unifi

2. Installation:
HM-CFG-USB, Unifi (, SIGNALduino 868, MySensors, SIGNALduino 433)

Jarnsen

#19
so, alles aktualisiert auf API 1.5.1

Watermeter ID auf 111 festgelegt. Seitdem die Feste ID da ist steht auch mehr im Device.

(http://up.picr.de/24297688zn.jpg)

aber aktualisieren tut sich nichts, wo kann ich im Sensorsketch den Zählerstand eintragen?? Vielleicht geht es dann.


Grüße Jarnsen

EDIT:

LOG:


2016.01.16 17:26:04 3: Opening MySensorsGateway device /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A5018N5J-if00-port0
2016.01.16 17:26:04 3: Setting MySensorsGateway serial parameters to 115200,8,N,1
2016.01.16 17:26:04 3: MySensorsGateway device opened
2016.01.16 17:26:17 5: MYSENSORS/RAW: /0;0
2016.01.16 17:26:17 5: MYSENSORS/RAW: 0;0/;3;0;9;read: 111-111-0 s=1,c=2,t=24,pt=0,l=0,sg=0:
2016.01.16 17:26:17 5: MYSENSORS/RAW: 0;0;3;0;9;read: 111-111-0 s=1,c=2,t=24,pt=0,l=0,sg=0:/
111;1;2;0;24;

2016.01.16 17:26:17 5: MYSENSORS Read: Rx: fr=000 ci=000 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'read: 111-111-0 s=1,c=2,t=24,pt=0,l=0,sg=0:'

2016.01.16 17:26:17 5: MYSENSORS gateway MySensorsGateway: read: 111-111-0 s=1,c=2,t=24,pt=0,l=0,sg=0:
2016.01.16 17:26:17 5: MYSENSORS Read: Rx: fr=111 ci=001 c=002(C_REQ         ) st=024(V_VAR1          ) ack=0 ''

2016.01.16 17:26:32 5: MYSENSORS/RAW: /0;0;3
2016.01.16 17:26:32 5: MYSENSORS/RAW: 0;0;3/;0;9;read: 111-11
2016.01.16 17:26:32 5: MYSENSORS/RAW: 0;0;3;0;9;read: 111-11/1-0 s=1,c=2,t=24,pt=0,l=0,sg=0:

2016.01.16 17:26:32 5: MYSENSORS Read: Rx: fr=000 ci=000 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'read: 111-111-0 s=1,c=2,t=24,pt=0,l=0,sg=0:'

2016.01.16 17:26:32 5: MYSENSORS gateway MySensorsGateway: read: 111-111-0 s=1,c=2,t=24,pt=0,l=0,sg=0:
2016.01.16 17:26:32 5: MYSENSORS/RAW: /111;1;2;0;24;

2016.01.16 17:26:32 5: MYSENSORS Read: Rx: fr=111 ci=001 c=002(C_REQ         ) st=024(V_VAR1          ) ack=0 ''

2016.01.16 17:26:49 5: MYSENSORS/RAW: /0;0;3;0;9;read: 111-111-0 s=1,c=2,t=24,pt=0,l=0,sg=0:
111;1;2;0;24;

2016.01.16 17:26:49 5: MYSENSORS Read: Rx: fr=000 ci=000 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'read: 111-111-0 s=1,c=2,t=24,pt=0,l=0,sg=0:'

2016.01.16 17:26:49 5: MYSENSORS gateway MySensorsGateway: read: 111-111-0 s=1,c=2,t=24,pt=0,l=0,sg=0:
2016.01.16 17:26:49 5: MYSENSORS Read: Rx: fr=111 ci=001 c=002(C_REQ         ) st=024(V_VAR1          ) ack=0 ''

2016.01.16 17:27:02 5: MYSENSORS/RAW: /0;0;3;0
2016.01.16 17:27:02 5: MYSENSORS/RAW: 0;0;3;0/;9;read: 111-111-0 s=1,c=2,t=24,pt=0,l=0,sg=0:

2016.01.16 17:27:02 5: MYSENSORS Read: Rx: fr=000 ci=000 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'read: 111-111-0 s=1,c=2,t=24,pt=0,l=0,sg=0:'

2016.01.16 17:27:02 5: MYSENSORS gateway MySensorsGateway: read: 111-111-0 s=1,c=2,t=24,pt=0,l=0,sg=0:
2016.01.16 17:27:02 5: MYSENSORS/RAW: /111;1;2;0;24;

2016.01.16 17:27:02 5: MYSENSORS Read: Rx: fr=111 ci=001 c=002(C_REQ         ) st=024(V_VAR1          ) ack=0 ''

2016.01.16 17:27:17 5: MYSENSORS/RAW: /0;0;3;0;9;re
2016.01.16 17:27:17 5: MYSENSORS/RAW: 0;0;3;0;9;re/ad: 111-111-0 s=1,c=2,t=24,pt=0,l
2016.01.16 17:27:17 5: MYSENSORS/RAW: 0;0;3;0;9;read: 111-111-0 s=1,c=2,t=24,pt=0,l/=0,sg=0:
111;1;
2016.01.16 17:27:17 5: MYSENSORS Read: Rx: fr=000 ci=000 c=003(C_INTERNAL    ) st=009(I_LOG_MESSAGE   ) ack=0 'read: 111-111-0 s=1,c=2,t=24,pt=0,l=0,sg=0:'

2016.01.16 17:27:17 5: MYSENSORS gateway MySensorsGateway: read: 111-111-0 s=1,c=2,t=24,pt=0,l=0,sg=0:
2016.01.16 17:27:17 5: MYSENSORS/RAW: 111;1;/2;0;24;

2016.01.16 17:27:17 5: MYSENSORS Read: Rx: fr=111 ci=001 c=002(C_REQ         ) st=024(V_VAR1          ) ack=0 ''

1 x RPi2,
1 x nanoCUL433, 1 x nanoCUL868, 1 x SIGNALduino433
Sonos/SonosSpeak, Homebridge, 2 x Enigma2, 10 x Nobily Rollläden, 3 x Intertechno Steckdosen
Pushover, Abfallerinnerung, MySensors, 7 x Max!

Jarnsen

#20
Habe heute versucht den Gateway aus FHEM zu löschen. Das ging nicht mit  Delete this device (MySensorsGateway), sondern nur mit direkt aus der fhem.cfg löschen. Danach neu gestartet und device wieder neu angelegt. Ich glaube irgendwas passt mit dem GW nicht. Werde mir nächste Woche mal nen WLan-GW zusammenbasteln. Vielleicht wird es dann.


Hat noch jemand ne Idee???

@ Matscher

Passt der log so??

Gruß Jarnsen
1 x RPi2,
1 x nanoCUL433, 1 x nanoCUL868, 1 x SIGNALduino433
Sonos/SonosSpeak, Homebridge, 2 x Enigma2, 10 x Nobily Rollläden, 3 x Intertechno Steckdosen
Pushover, Abfallerinnerung, MySensors, 7 x Max!

Matscher

#21
Hallo Jarson,

Zitatsend: 0-0-0-0 s=0,c=2,t=24,pt=0,l=0,sg=0,st=ok:
so wie ich das verstehe wird nur ein Request vom Sensor gesendet (c=2) für V_VAR1 (t=24), aber es kommt nichts vom Gateway.

Und daher vermute ich, das dadurch nichts gesendet wird, da nichts vom Gateway empfangen wurde.

Zitat
if (pcReceived && (SLEEP_MODE || sendTime)) {
ZitatIm kurzen log taucht kein Received last pulse count from gw: auf.

Was mich auch noch wundert:
Zitat
ok geändert. 115200 nur Zeichensalat

230400 Baut bringt das

Ich habe keine idee!, ausser den Gateway nochmal zu resetten.

Gruß,
Matscher
Rasp 3
CUL V3 868Mhz + nanoCUL 868Mhz als RFR + nanoCUL 868Mhz für Homematic + SIGNALduino
Zigbee CC2531 - Aquara TempSensor
MySensors Ethernet Gateway, Water meter, Gas meter
Modul: 09_CUL_FHTTK.pm (assumed), culfw part HAS_FHT_TF

Jarnsen

nur beim sensor muß ich 230400 einstellen das ich seriell was sehe.... beim GW ist bei 115200 alles i.o. wie gesagt versuche die Tage nen WLAN-GW... Serial GW mehrfach geflasht... wo kann ich den derzeitigen Zählerstand eintragen.... vielleicht bringt das was... alles läuft auf API 1.5.1...

stelle meinen GW sketch nocht ein
/**
* 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
* The ArduinoGateway prints data received from sensors on the serial link.
* The gateway accepts input on seral which will be sent out on radio network.
*
* The GW code is designed for Arduino Nano 328p / 16MHz
*
* Wire connections (OPTIONAL):
* - Inclusion button should be connected between digital pin 3 and GND 
* - RX/TX/ERR leds need to be connected between +5V (anode) and digital pin 6/5/4 with resistor 270-330R in a series
*
* LEDs (OPTIONAL):
* - To use the feature, uncomment WITH_LEDS_BLINKING in MyConfig.h
* - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved
* - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
* - ERR (red) - fast blink on error during transmission error or recieve crc error
*
*/

#define NO_PORTB_PINCHANGES 

#include <MySigningNone.h>
#include <MyTransportRFM69.h>
#include <MyTransportNRF24.h>
#include <MyHwATMega328.h>
#include <MySigningAtsha204Soft.h>
#include <MySigningAtsha204.h>

#include <SPI.h> 
#include <MyParserSerial.h> 
#include <MySensor.h> 
#include <stdarg.h>
#include <PinChangeInt.h>
#include "GatewayUtil.h"

#define INCLUSION_MODE_TIME 1 // Number of minutes inclusion mode is enabled
#define INCLUSION_MODE_PIN  3 // Digital pin used for inclusion mode button
#define RADIO_ERROR_LED_PIN 4  // Error led pin
#define RADIO_RX_LED_PIN    6  // Receive led pin
#define RADIO_TX_LED_PIN    5  // the PCB, on board LED

// NRFRF24L01 radio driver (set low transmit power by default)
MyTransportNRF24 transport(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW);
//MyTransportRFM69 transport;

// Message signing driver (signer needed if MY_SIGNING_FEATURE is turned on in MyConfig.h)
//MySigningNone signer;
//MySigningAtsha204Soft signer;
//MySigningAtsha204 signer;

// Hardware profile
MyHwATMega328 hw;

// Construct MySensors library (signer needed if MY_SIGNING_FEATURE is turned on in MyConfig.h)
// To use LEDs blinking, uncomment WITH_LEDS_BLINKING in MyConfig.h
#ifdef WITH_LEDS_BLINKING
MySensor gw(transport, hw /*, signer*/, RADIO_RX_LED_PIN, RADIO_TX_LED_PIN, RADIO_ERROR_LED_PIN);
#else
MySensor gw(transport, hw /*, signer*/);
#endif

char inputString[MAX_RECEIVE_LENGTH] = "";    // A string to hold incoming commands from serial/ethernet interface
int inputPos = 0;
boolean commandComplete = false;  // whether the string is complete

void parseAndSend(char *commandBuffer);

void output(const char *fmt, ... ) {
   va_list args;
   va_start (args, fmt );
   vsnprintf_P(serialBuffer, MAX_SEND_LENGTH, fmt, args);
   va_end (args);
   Serial.print(serialBuffer);
}

 
void setup() 
{
  gw.begin(incomingMessage, 0, true, 0);

  setupGateway(INCLUSION_MODE_PIN, INCLUSION_MODE_TIME, output);

  // Add interrupt for inclusion button to pin
  PCintPort::attachInterrupt(pinInclusion, startInclusionInterrupt, RISING);


  // Send startup log message on serial
  serial(PSTR("0;0;%d;0;%d;Gateway startup complete.\n"),  C_INTERNAL, I_GATEWAY_READY);
}

void loop() 
{
  gw.process();

  checkButtonTriggeredInclusion();
  checkInclusionFinished();
 
  if (commandComplete) {
    // A command wass issued from serial interface
    // We will now try to send it to the actuator
    parseAndSend(gw, inputString);
    commandComplete = false; 
    inputPos = 0;
  }
}


/*
  SerialEvent occurs whenever a new data comes in the
hardware serial RX.  This routine is run between each
time loop() runs, so using delay inside loop can delay
response.  Multiple bytes of data may be available.
*/
void serialEvent() {
  while (Serial.available()) {
    // get the new byte:
    char inChar = (char)Serial.read();
    // if the incoming character is a newline, set a flag
    // so the main loop can do something about it:
    if (inputPos<MAX_RECEIVE_LENGTH-1 && !commandComplete) {
      if (inChar == '\n') {
        inputString[inputPos] = 0;
        commandComplete = true;
      } else {
        // add it to the inputString:
        inputString[inputPos] = inChar;
        inputPos++;
      }
    } else {
       // Incoming message too long. Throw away
        inputPos = 0;
    }
  }
}


vielleicht passt was im Modul nicht

THX Jarnsen
1 x RPi2,
1 x nanoCUL433, 1 x nanoCUL868, 1 x SIGNALduino433
Sonos/SonosSpeak, Homebridge, 2 x Enigma2, 10 x Nobily Rollläden, 3 x Intertechno Steckdosen
Pushover, Abfallerinnerung, MySensors, 7 x Max!

Kuzl

Kann das sein, dass du evtl nicht das richtige Board in der Arduino IDE eingestellt hast? Wenn du die Doppelte BAUD einstellen must, hört sich das so an, dass du z.b. ein 16MHz Quarz hast, aber auf 8MHz kompiliert hast. Daher könnte es auch sein, dass das Gateway keine Ahnung hat, was der Sensor eigentlich will.

Jarnsen

Ja ich habe auf 8 kompelliert, mein pro Mini soll ein 3.3v 8Mhz sein. Werde es nochmal mit 16 MHz versuchen.
1 x RPi2,
1 x nanoCUL433, 1 x nanoCUL868, 1 x SIGNALduino433
Sonos/SonosSpeak, Homebridge, 2 x Enigma2, 10 x Nobily Rollläden, 3 x Intertechno Steckdosen
Pushover, Abfallerinnerung, MySensors, 7 x Max!

Jarnsen

@ Kuzl

du hattest recht, muß ein 5V 16Mhz sein, habe jetzt mit 5V 16Mhz beschrieben jetzt stimmt die Baudrate. Hatte als test nochmal das Blinkprogramm einmal mit 8 und einmal mit 16 draufgebügelt. Mit 8 Mhz waren es nur ca 500ms und mit 16 Mhz kam es schon so hin mit 1000ms. Das ändert aber immernoch nichts an meinem Problem. Ich glaube fast das das eine NRF24L01+ kaputt ist oder eines von beiden ein ohne das "+" ist. kann ich die beiden NRF24L01+ entfernen und die kabel direkt verbinden um das zu prüfen? Nur um die radio´s auszuschließen oder auch nicht. Habe die Radios auch schon mal getauscht vom GW zum Node und andersherum. Ich würde auch fast behaupten wollen das das eine mit 5V läuft. Bin ja über RAW in den mini und da es ja wie es aussieht ein 5V 16Mhz ist lief das NRF ja dann mit 5V. Auf dem StepDown auf dem mini steht "S8NJ" falls jemand was damit anfangen kann.


Jarnsen
1 x RPi2,
1 x nanoCUL433, 1 x nanoCUL868, 1 x SIGNALduino433
Sonos/SonosSpeak, Homebridge, 2 x Enigma2, 10 x Nobily Rollläden, 3 x Intertechno Steckdosen
Pushover, Abfallerinnerung, MySensors, 7 x Max!

Kuzl

Wie auf mysensors.org zu lesen ist, sind zwar die Eingänge des NRF 5V-tollerant, allerdings kannst du ihn nicht mit 5V versorgen, kann sein, dass er kaputt ist.
Einfach Ausbauen und den Sensor ans GW hängen geht nicht, wird ja ganz anders angesprochen.

Am besten ist, du kompilierst nochmal mit einer neuen Sensor ID und schaust dann im Serial-Monitor, ob da schonmal alles passt.
Dann kannst du ihn versuchen im GW anzulernen.

Für Batteriebetrieb würd ich dir allerdings 8MHz/3.3V empfehlen, da keine verluste am Spgregler und weniger verbrauch durch 8MHz

Jarnsen

#27
Zitat von: Kuzl am 19 Januar 2016, 07:31:59
Wie auf mysensors.org zu lesen ist, sind zwar die Eingänge des NRF 5V-tollerant, allerdings kannst du ihn nicht mit 5V versorgen, kann sein, dass er kaputt ist.

Für Batteriebetrieb würd ich dir allerdings 8MHz/3.3V empfehlen, da keine verluste am Spgregler und weniger verbrauch durch 8MHz

hatte ja 3.3V bestellt. wie es aussieht nen anderen bekommen. An den NRF24L01 liegt es nicht, habe ich ausgetauscht. Bekomme aber am GW "nur" startup complete.
Hat denn jemand FHEM 5.7 und MySensors API 1.5.1 am laufen.

EDIT:

Sensor mit Arduino nano gebaut, brachte auch keine Besserung. Letzte Hoffnung das es mit dem WLan GW läuft den ich mir die Tage zusammenbau. Ansonsten bleibt nur noch den Grund im Modul zu suchen.


oder was denkt ihr??


Jarnsen
1 x RPi2,
1 x nanoCUL433, 1 x nanoCUL868, 1 x SIGNALduino433
Sonos/SonosSpeak, Homebridge, 2 x Enigma2, 10 x Nobily Rollläden, 3 x Intertechno Steckdosen
Pushover, Abfallerinnerung, MySensors, 7 x Max!

gloob

Da ich MySensor als Serial Gateway mit der aktuellen 1.5er Version nutze und keine Probleme habe, kann ich mir nicht vorstellen, dass es am Modul liegen sollte.
Raspberry Pi 3 | miniCUL 433MHz | nanoCUL 868 MHz | nanoCUL 433 MHz | MySensors WLAN Gateway | LaCrosse WLAN Gateway | SignalESP 433 MHz | SignalESP 868 MHz | HM-MOD-UART WLAN Gateway | IR - 360 Grad WLAN Gateway

Jarnsen

#29
@ gloob

Hast du die Möglichkeit ein Watermeter nachzubauen???

EDIT:

Hast du FHEM 5.7 drauf oder ne alte Version.
1 x RPi2,
1 x nanoCUL433, 1 x nanoCUL868, 1 x SIGNALduino433
Sonos/SonosSpeak, Homebridge, 2 x Enigma2, 10 x Nobily Rollläden, 3 x Intertechno Steckdosen
Pushover, Abfallerinnerung, MySensors, 7 x Max!