Are slot numbers really local to each node?

95 views
Skip to first unread message

Sylvain L

unread,
Jul 8, 2016, 2:46:24 PM7/8/16
to souliss

Hello!

Until now I was convinced that slot numbers were local to each node.
So I have 2 nodes, detailed here:
Gateway / node0:
- slot 0 = dimmable light
- slot 2 = pressure sensor

Node 1:
- slot 0 = temperature sensor
- slot 2 = humidity sensor

Everything was fine until today.
I use the android app to watch values.

But sometimes, when I look at the second node, I see the pressure sensor values from the first node instead of the humidity values!

If I force the pressure sensor on node 0 to update its values each second,
I even see *always* that pressure on node 1/slot2 instead of the humidity value.

Am I wrong to use the same slot number?
In the page https://github.com/souliss/souliss/wiki/Typicals, you can read:

NEVER FORGET

Souliss SLOT are related to the node itself, as example, you can have two Typicals with SLOT 0 in the same souliss network, but you can't have two Typicals with SLOT 0 in the same node.


It sounds that I can start slots from 0 on each node, right?


Where is my mistake?

Regards,


Sylvain




Juan Luis

unread,
Jul 8, 2016, 3:09:23 PM7/8/16
to souliss
You are right. You can have slot 0 in every node.
It would be hepful if you paste your code.
Regards
Just luis

Sylvain L

unread,
Jul 8, 2016, 5:39:40 PM7/8/16
to souliss

Hi Juan!

I made the code more simple (see below), but it stills produces the error when reading values on node 1 from AndroidApp.
I use Public the release for Souliss v7.1.1 (commit b549ab50787cd2e385dec0c2038918ee3a199c10).

The gateway (ethernet / rs485):

/**************************************************************************
    Souliss -
    Gateway for Boulleville
    * Arduino Mega
        - on board LED on D13
    * Ethernet shield (W5100)
        - D10 : SS
    * TEP custom Shield
        - LEDs (Green 34, RED 35, Pink 36 & 37)
        - WS2811 output on D7 & D8 for RJ45 1 & 2
        - 1Wire on D6 & D14 for RJ45 1 & 2
        - RS485-2 : D5=RX/TX, TX2=D16, RX2=D17, Serial2
        - RS485-1 : D2=RX/TX, TX1=D18, RX1=D19, Serial1
        - RFM12B :  D3=irq, PB0=D53:SS
                    PB3/D50=MISO, PB2/D51=MOSI, PB1/D52=CLK

        - Baro : D20D/D21 I2C
        - D11 : PWM buzzer
        - D42-D49= input_opto_x
        - D22-D29 : relays
        - D30-D33 : unused
        - D38-41 : unused
        - D12 / D13 : unused
        - D4 unused
        - D15/RX3 unused
        - ADC0-ADC7 unused
    * RS485
        A/B lines are on RJ45 1-2
***************************************************************************/

// USART Config
#define USARTBAUDRATE_INSKETCH
#define USART_BAUD19k2 1

// RS485-2
#define USARTDRIVER_INSKETCH
#define USART_TXENABLE            1
#define USART_TXENPIN            5
#define    USARTDRIVER                Serial2

// Ethernet options -------------------------------------------------------
#define MAC_INSKETCH
uint8_t MAC_ADDRESS[] = {0x90, 0xA2, 0xDA, 0x0E, 0xC0, 0x55};
#define AUTO_MAC    0

// Souliss options --------------------------------------------------------
// Configure the framework
#include "bconf/StandardArduino.h"          // Use a standard Arduino
#include "conf/ethW5100.h"                  // Ethernet through Wiznet W5100
#include "conf/usart.h"   
#include "conf/Gateway.h"                   // The main node is the Gateway

// Include framework code and libraries
#include <SPI.h>

/*** All configuration includes should be above this line ***/
#include "Souliss.h"

enum {
    LOGIC_TEP_VMC_ETAGE,    // 2 slots
    logic_tep_spare1,
    LOGIC_TEP_ATM_PRESSURE, // 2 slots
    logic_tep_spare2,
    LOGIC_TEP_BUZZER,
    LOGIC_TEP_LED_ROSE_1,
    LOGIC_TEP_NB
};

// Define the network configuration according to your router settings
uint8_t ip_address[4]  = {192, 168, 1, 70};
uint8_t subnet_mask[4] = {255, 255, 255, 0};
uint8_t ip_gateway[4]  = {192, 168, 1, 1};
#define myvNet_address      ip_address[3]       // The last byte of the IP address is also the vNet address

// Define the RS485 network configuration
#define myvNet_subnet   0xFF00
#define Gateway_RS485   0xCE01
#define Peer_RS485      0xCE02

//============================================================================
void setup()
{
    Serial.begin(115200);
    Initialize();

    // Set Ethernet network parameters
    Souliss_SetIPAddress(ip_address, subnet_mask, ip_gateway);                          // Address on the Ethernet interface
    SetAsGateway(myvNet_address);                                                       // Set this node as gateway for SoulissApp 

    // Set RS485 parameters
    SetAddress(Gateway_RS485, myvNet_subnet, 0);                    // Set the address on the RS485 bus

    // This node as gateway will get data from the Peer
    SetAsPeerNode(Peer_RS485, 1);
   
    Set_T19(LOGIC_TEP_VMC_ETAGE);               // 2 slots
    Set_Pressure(LOGIC_TEP_ATM_PRESSURE);       // T53  /!\ 2 slots!
    Set_PulseOutput(LOGIC_TEP_BUZZER);          // T14  / 1 slot
    Set_SimpleLight(LOGIC_TEP_LED_ROSE_1);      // Define a simple LED light logic
}

// Mean value of atm pressure = 1013.25 hPa
#define DEADBAND_PRESSURE       0.0001      // Deadband value 0.01%, 0.10hPa for 1023°

//============================================================================
void loop()
{
    // Here we start to play
    EXECUTEFAST() {                    
        UPDATEFAST();  

        FAST_50ms() {   // We process the logic and relevant input and output every 50 milliseconds
            // TYPICALS ------------------------------------------------------
            Logic_SimpleLight(LOGIC_TEP_LED_ROSE_1);
            Logic_PulseOutput(LOGIC_TEP_BUZZER);
            Souliss_Logic_T58(memory_map, LOGIC_TEP_ATM_PRESSURE, DEADBAND_PRESSURE, &data_changed);
        }

        FAST_1110ms() {
            static float pressure = 1000.0;
            pressure += 1.0;
            Souliss_ImportAnalog(memory_map, LOGIC_TEP_ATM_PRESSURE, &pressure);
        }
        // This node does just networking, bridging the Peer node to the Ethernet network
        FAST_GatewayComms();
    }
}



The RS485 node:


/**************************************************************************
    Souliss -
    Node for velux_sud, with RS485 link to gateway.
   
    * Moteino R3 (without RF)
        - on board LED on D9.
        - debug UART RX/TX: 10/11
    * Batibox with RS485 module
        - D7 & D8 : buttons input
        - 1 wire on D4 (0ohm on SENS_SIGN 1-2, DS18B20 connected on SENSOR 3pins header
          1W_SENSOR_ALIM to be set at 5V
    * RS485 from D0/D1 (RX/TX) and D3 (to select RX/TX on transceiver)
   
   
***************************************************************************/

// USART Config
#define USARTBAUDRATE_INSKETCH
#define USART_BAUD19k2 1

#define USARTDRIVER_INSKETCH
#define USART_TXENABLE            1
#define USART_TXENPIN            3
#define    USARTDRIVER                Serial   

// Configure the framework
#include "bconf/StandardArduino.h"          // Use a standard Arduino
#include "conf/usart.h"                      // USART / RS485 transceiver

/*** All configuration includes should be above this line ***/
#include "Souliss.h"

// Define the RS485 network configuration
#define myvNet_subnet   0xFF00
#define Gateway_RS485   0xCE01
#define Peer_RS485      0xCE02

// Define logic identifiers
enum {
    LOGIC_VS_TEMPE_SDB,  // 2 slots
    logic_vs_spare1,
    LOGIC_VS_HUM_SDB,    // 2 slots
    logic_vs_spare2,
    LOGIC_VS_TEMPE_MUR_SUD,  // 2 slots
    logic_vs_spare3,
    LOGIC_VS_NB
};

#define DEADBAND_TEMPE              0.01         // Deadband value 1%, 0.2° for 20°
#define DEADBAND_HUM                0.03         // Deadband value 3%, 1.5° for 50%

//============================================================================
void setup()
{
    // Init souliss framework
    Initialize();
    // Set network parameters
    SetAddress(Peer_RS485, myvNet_subnet, Gateway_RS485);     

    Set_Temperature(LOGIC_VS_TEMPE_SDB);        // T52  /!\ 2 slots!
    Set_Humidity(LOGIC_VS_HUM_SDB);             // T53  /!\ 2 slots!
    Set_Temperature(LOGIC_VS_TEMPE_MUR_SUD);    // T52  /!\ 2 slots!
}

//============================================================================
void loop()
{
    // Here we start to play
    EXECUTEFAST() {
        UPDATEFAST();
   
        FAST_110ms() {
            Souliss_Logic_T52(memory_map, LOGIC_VS_TEMPE_SDB, DEADBAND_TEMPE, &data_changed);
            Souliss_Logic_T53(memory_map, LOGIC_VS_HUM_SDB, DEADBAND_HUM, &data_changed);
            Souliss_Logic_T52(memory_map, LOGIC_VS_TEMPE_MUR_SUD, DEADBAND_TEMPE, &data_changed);
        }
        FAST_PeerComms();                           
    }

    EXECUTESLOW() {
        UPDATESLOW();

        // 70 SECONDeS =======================================================
        SLOW_10s() {
            static float hum = 10.0;
            hum += 0.1;
            Souliss_ImportAnalog(memory_map, LOGIC_VS_HUM_SDB, &hum);
        }
    }
}



Thanks for your help!

Regards,

Sylvain

Juan Luis

unread,
Jul 9, 2016, 3:40:18 AM7/9/16
to souliss
mmmm code seems to be ok, but I tested it and indeed fails. 
When you acces to the Node1 the first instant you can see the correct value but inmediatly turn to the Node0 Value....
Curious, it could be a bug in the APP.
If I make progress I will tell you.

Juan Luis

Di Maio, Dario

unread,
Jul 9, 2016, 3:15:47 PM7/9/16
to sou...@googlegroups.com

Attach the full sketch please.

Dario.

From Mobile.

Sylvain L

unread,
Jul 10, 2016, 3:30:16 AM7/10/16
to souliss

Please find attached the 2 sketches.

Have a nice day!

Sylvain
tep1.ino
velux_sud1.ino

Di Maio, Dario

unread,
Jul 10, 2016, 5:30:50 AM7/10/16
to sou...@googlegroups.com
Looks like that you have found a bug on SoulissApp, I guess that this happen only if you have the detail panel open, is it?

Please open an issue on github for soulissapp, I will invite Alessandro to this topic to follow the issue.

Thanks,
Dario.

Sylvain L

unread,
Jul 10, 2016, 3:50:11 PM7/10/16
to souliss

Hello Dario.

Yes you're right, the issue appears on the detail panel.

I've opened an issue on the tracker:
https://github.com/souliss/soulissapp/issues/137

Thank you for your support!

Sylvain

Di Maio, Dario

unread,
Jul 10, 2016, 4:13:59 PM7/10/16
to sou...@googlegroups.com

Is summer and Alessandro may not be available to fix it right now, but likely it will be closed with the next release.

On the detail of the node does you see the right one?

Dario.

From Mobile.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/f8bafeeb-33dd-4f1b-8f9e-4b9d50499082%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sylvain L

unread,
Aug 8, 2016, 3:23:32 AM8/8/16
to souliss


Hello.

I add a screenshot in the bug tracker.

Sylvain
Reply all
Reply to author
Forward
0 new messages