v1.5.4 VS v2

Forum dédie aux capteurs et gateway mysensors.org
dokho
Messages : 685
Inscription : 28 déc. 2014, 19:32

v1.5.4 VS v2

Message par dokho »

Bonjour,

Débutant dans mysensors j'ai commencé par une gateway ethernet ainsi qu'un capteur T°C/%Hr tout deux en 1.5.4

Comme j'aime bien le principe du DIY et que cela revient un peu moins cher (?) j'ai bien envie d'en faire d'autre mais j'ai pas mal de problème de compilation du fait, je pense, que les sketch que l'on trouve sont en v2.

Du coup ma question est: est-ce qu'il vaut mieux que je passe direct tout en v2 (étant donné que je n'ai pour l'instant qu'une gw et 1 node) ou est-ce qu'il vaut mieux que je reste en 1.5.4 et que je bricole les sketch ?
Grincheux

Re: v1.5.4 VS v2

Message par Grincheux »

Pour ma part j'ai tout passé en v2.0 il y a quelques semaines. J'ai du adapter mes nodes car les exemples étaient encore en 1.5 mais depuis tout est passé en v2.0 sur le site.

Perso je trouve les options plus facile à déclarer sur v2.0.

A toi de voir mais vivre avec les vieilles versions quand tu comptes avoir d'autres nodes autant passer en v2.0 le plus tôt.
dokho
Messages : 685
Inscription : 28 déc. 2014, 19:32

Re: v1.5.4 VS v2

Message par dokho »

Salut,

J'ai tenté de passer en V2 mais j'ai des soucis avec la gateway ethernet ...

J'ai expliqué mon pb ICI.

Tu utilises une GW USB ?
Grincheux

Re: v1.5.4 VS v2

Message par Grincheux »

J'utilise une GW ethernet et jai pas de problème.
J'avais vu ton problème mais je ne sais pas ce qui se passe.
J'ai bien la version qui s'affiche, utilise tu les exemples de la bibliothèque
https://github.com/mysensors/MySensorsA ... r/examples
20161007_234316-320x219.png
20161007_234316-320x219.png (21.58 Kio) Consulté 11537 fois
dokho
Messages : 685
Inscription : 28 déc. 2014, 19:32

Re: v1.5.4 VS v2

Message par dokho »

Bonsoir,

J'utilise bien le sketch des exemples oui:

Code : Tout sélectionner

// Enable debug prints to serial monitor
#define MY_DEBUG 

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

// Enable gateway ethernet module type 
#define MY_GATEWAY_W5100

// W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal)
//#define MY_W5100_SPI_EN 4  

// Enable Soft SPI for NRF radio (note different radio wiring is required)
// The W5100 ethernet module seems to have a hard time co-operate with 
// radio on the same spi bus.
#if !defined(MY_W5100_SPI_EN) && !defined(ARDUINO_ARCH_SAMD)
  #define MY_SOFTSPI
  #define MY_SOFT_SPI_SCK_PIN 14
  #define MY_SOFT_SPI_MISO_PIN 16
  #define MY_SOFT_SPI_MOSI_PIN 15
#endif  

// When W5100 is connected we have to move CE/CSN pins for NRF radio
#ifndef MY_RF24_CE_PIN 
  #define MY_RF24_CE_PIN 5
#endif
#ifndef MY_RF24_CS_PIN 
  #define MY_RF24_CS_PIN 6
#endif

// Enable to UDP          
//#define MY_USE_UDP

#define MY_IP_ADDRESS 192,168,0,231   // If this is disabled, DHCP is used to retrieve address
// Renewal period if using DHCP
//#define MY_IP_RENEWAL_INTERVAL 60000
// The port to keep open on node server mode / or port to contact in client mode
#define MY_PORT 5003      

// Controller ip address. Enables client mode (default is "server" mode). 
// Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere. 
#define MY_CONTROLLER_IP_ADDRESS 192, 168, 0, 230   
 
// The MAC address can be anything you want but should be unique on your network.
// Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use.
// Note that most of the Ardunio examples use  "DEAD BEEF FEED" for the MAC address.
#define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED

// Flash leds on rx/tx/err
#define MY_LEDS_BLINKING_FEATURE
// Set blinking period
#define MY_DEFAULT_LED_BLINK_PERIOD 300

// 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  3 

// Uncomment to override default HW configurations
//#define MY_DEFAULT_ERR_LED_PIN 7  // Error led pin
//#define MY_DEFAULT_RX_LED_PIN  8  // Receive led pin
//#define MY_DEFAULT_TX_LED_PIN  9  // the PCB, on board LED

#include <SPI.h>

#if defined(MY_USE_UDP)
  #include <EthernetUdp.h>
#endif
#include <Ethernet.h>
#include <MySensors.h>


void setup()
{
}

void loop() {
}
Mais je n'ai pas de n° de version, ni même de noeud visible dans domoticz.

Pourtant dans les logs de domoticz j'ai ça:

Code : Tout sélectionner

2016-10-08 00:21:05.401  MySensors: connected to: 192.168.0.231:5003
Voici le log de la GW:

Code : Tout sélectionner

0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
0;255;3;0;9;TSM:INIT
0;255;3;0;9;TSM:RADIO:OK
0;255;3;0;9;TSM:GW MODE
0;255;3;0;9;TSM:READY
IP: 192.168.0.231
0;255;3;0;9;No registration required
0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1
0;255;3;0;9;Eth: connect
0;255;3;0;9;Eth: 0;0;3;0;2;
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;TSP:SANCHK:OK
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;TSP:SANCHK:OK
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;TSP:SANCHK:OK
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;TSP:SANCHK:OK
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;TSP:SANCHK:OK
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
0;255;3;0;9;Eth: 0;0;3;0;18;PING
Par contre j'utilise un UNO avec un shield W5100


Peux tu me copier le skecth que tu utilises stp ?


Merci.
Grincheux

Re: v1.5.4 VS v2

Message par Grincheux »

Voila le sketch

Code : Tout sélectionner

   /**
 * 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
 * Contribution by a-lurker and Anticimex,
 * Contribution by Norbert Truchsess <norbert.truchsess@t-online.de>
 * Contribution by Tomas Hozza <thozza@gmail.com>
 *
 *
 * DESCRIPTION
 * The EthernetGateway sends data received from sensors to the ethernet link.
 * The gateway also accepts input on ethernet interface, which is then sent out to the radio network.
 *
 * The GW code is designed for Arduino 328p / 16MHz.  ATmega168 does not have enough memory to run this program.
 *
 * LED purposes:
 * - 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
 *
 * See http://www.mysensors.org/build/ethernet_gateway for wiring instructions.
 *
 */

// Enable debug prints to serial monitor
#define MY_DEBUG 

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

// Enable gateway ethernet module type 
#define MY_GATEWAY_W5100

#define MY_NODE_ID 0

#define MY_RF24_PA_LEVEL  RF24_PA_MAX

// W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal)
//#define MY_W5100_SPI_EN 4  

// Enable Soft SPI for NRF radio (note different radio wiring is required)
// The W5100 ethernet module seems to have a hard time co-operate with 
// radio on the same spi bus.
#if !defined(MY_W5100_SPI_EN) && !defined(ARDUINO_ARCH_SAMD)
  #define MY_SOFTSPI
  #define MY_SOFT_SPI_SCK_PIN 14
  #define MY_SOFT_SPI_MISO_PIN 16
  #define MY_SOFT_SPI_MOSI_PIN 15
#endif  

// When W5100 is connected we have to move CE/CSN pins for NRF radio
#ifndef MY_RF24_CE_PIN 
  #define MY_RF24_CE_PIN 5
#endif
#ifndef MY_RF24_CS_PIN 
  #define MY_RF24_CS_PIN 6
#endif

// Enable to UDP          
//#define MY_USE_UDP

#define MY_IP_ADDRESS 192,168,1,60   // If this is disabled, DHCP is used to retrieve address
// Renewal period if using DHCP
//#define MY_IP_RENEWAL_INTERVAL 60000
// The port to keep open on node server mode / or port to contact in client mode
#define MY_PORT 5003      

// Controller ip address. Enables client mode (default is "server" mode). 
// Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere. 
//#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 254   
 
// The MAC address can be anything you want but should be unique on your network.
// Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use.
// Note that most of the Ardunio examples use  "DEAD BEEF FEED" for the MAC address.
#define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED

// Flash leds on rx/tx/err
#define MY_LEDS_BLINKING_FEATURE
// Set blinking period
#define MY_DEFAULT_LED_BLINK_PERIOD 300

// 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  3 

// Uncomment to override default HW configurations
//#define MY_DEFAULT_ERR_LED_PIN 7  // Error led pin
//#define MY_DEFAULT_RX_LED_PIN  8  // Receive led pin
//#define MY_DEFAULT_TX_LED_PIN  9  // the PCB, on board LED

#include <SPI.h>

#if defined(MY_USE_UDP)
  #include <EthernetUdp.h>
#endif
#include <Ethernet.h>
#include <MySensors.h>


void setup()
{
}

void loop() {
}
dokho
Messages : 685
Inscription : 28 déc. 2014, 19:32

Re: v1.5.4 VS v2

Message par dokho »

Salut,

Il s'agit quasiment du même sketch, sauf que dans le mien je n'ai pas:

Code : Tout sélectionner

#define MY_NODE_ID 0
#define MY_RF24_PA_LEVEL  RF24_PA_MAX
et que dans le mien j'ai cette section d'activée:

Code : Tout sélectionner

#define MY_CONTROLLER_IP_ADDRESS 192,168,0,230 

J'ai donc fais un essai avec ton script et ça ne fonctionne pas non plus:

La GW "reboot" en boucle:

Code : Tout sélectionner

0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
0;255;3;0;9;TSM:INIT
0;255;3;0;9;TSM:RADIO:OK
0;255;3;0;9;TSM:GW MODE
0;255;3;0;9;TSM:READY
IP: 192.168.0.231
0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
0;255;3;0;9;TSM:INIT
0;255;3;0;9;TSM:RADIO:OK
0;255;3;0;9;TSM:GW MODE
0;255;3;0;9;TSM:READY
IP: 192.168.0.231
0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
0;255;3;0;9;TSM:INIT
0;255;3;0;9;TSM:RADIO:OK
0;255;3;0;9;TSM:GW MODE
0;255;3;0;9;TSM:READY
IP: 192.168.0.231
Ce qui, dans domoticz, ce traduit par:

Code : Tout sélectionner

2016-10-09 13:26:38.009  MySensors: trying to connect to: 192.168.0.231:5003
2016-10-09 13:26:39.012  MySensors: connected to: 192.168.0.231:5003
2016-10-09 13:26:43.013  MySensors: Connection reset!
2016-10-09 13:26:43.014  TCP: Reconnecting in 30 seconds...

Si quelqu'un a une idée ...
dokho
Messages : 685
Inscription : 28 déc. 2014, 19:32

Re: v1.5.4 VS v2

Message par dokho »

Je me réponds à moi même :)

J'ai trouvé la solution sur le forum Mysensors: il faut downgrader "Arduino AVR Boards" en 1.6.11 (source)

J'ai bien la version de GW qui remonte dans domoticz.
Par contre dans les réglages je ne vois rien, contrairement à une GW serial ou l'on voit la gateway en tant que node 0
dokho
Messages : 685
Inscription : 28 déc. 2014, 19:32

Re: v1.5.4 VS v2

Message par dokho »

Bon toujours rien qui remonte:
Image


Pourtant le node est enregitré et envoie des infos quand j'ouvre ou ferme:

Code : Tout sélectionner

tarting sensor (RNNNA-, 2.0.0)
TSM:INIT
TSM:RADIO:OK
TSP:ASSIGNID:OK (ID=2)
TSM:FPAR
TSP:MSG:SEND 2-2-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
TSP:MSG:READ 0-0-2 s=255,c=3,t=8,pt=1,l=1,sg=0:0
TSP:MSG:FPAR RES (ID=0, dist=0)
TSP:MSG:PAR OK (ID=0, dist=1)
TSM:FPAR:OK
TSM:ID
TSM:CHKID:OK (ID=2)
TSM:UPL
TSP:PING:SEND (dest=0)
TSP:MSG:SEND 2-2-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1
TSP:MSG:READ 0-0-2 s=255,c=3,t=25,pt=1,l=1,sg=0:1
TSP:MSG:PONG RECV (hops=1)
TSP:CHKUPL:OK
TSM:UPL:OK
TSM:READY
!TSP:MSG:SEND 2-2-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=fail:0100
TSP:MSG:SEND 2-2-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,ft=1,st=ok:2.0.0
TSP:MSG:SEND 2-2-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=ok:0
TSP:MSG:SEND 2-2-0-0 s=3,c=0,t=0,pt=0,l=0,sg=0,ft=0,st=ok:
Request registration...
!TSP:MSG:SEND 2-2-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=fail:2
TSP:MSG:SEND 2-2-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=1,st=ok:2
TSP:MSG:READ 0-0-2 s=255,c=3,t=27,pt=1,l=1,sg=0:1
Node registration=1
Init complete, id=2, parent=0, distance=1, registration=1
!TSP:MSG:SEND 2-2-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=fail:1
TSP:MSG:SEND 2-2-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,ft=1,st=ok:0
TSP:MSG:SEND 2-2-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=ok:1
TSP:MSG:SEND 2-2-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=ok:0
TSP:MSG:SEND 2-2-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,ft=0,st=ok:1

Par contre si je fais l'essai avec une GW USB j'ai bien le node qui apparait ...
dokho
Messages : 685
Inscription : 28 déc. 2014, 19:32

Re: v1.5.4 VS v2

Message par dokho »

Bonjour,
J'ai résolu le problème en ajoutant un deuxième condensateur de 47uF sur l'émetteur.

J'ai maintenant un pb avec les DHT22 qui ne remontent aucunes valeurs...

Envoyé de mon SM-N9005 en utilisant Tapatalk
Répondre