souliss / soulissapp

SoulissApp is an Android Application for Souliss Framework
https://play.google.com/store/apps/details?id=it.angelic.soulissclient
MIT License
33 stars 33 forks source link

Rebuild node doesn't work #91

Closed juanpintom closed 9 years ago

juanpintom commented 9 years ago

Anyone has tested this new funcion? Isn't working for me, I push but nothing happens.

Regards :P

plinioseniore commented 9 years ago

This is supposed to update the typicals in that node only, is supposed to work properly with commit 3b6883903 of souliss

juanpintom commented 9 years ago

Sorry, this was my fault :( :P I'll update this night and try again.

Regards

2015-10-22 9:09 GMT+02:00 Dario Di Maio notifications@github.com:

This is supposed to update the typicals in that node only, is supposed to work properly with commit 3b6883903 of souliss

— Reply to this email directly or view it on GitHub https://github.com/souliss/soulissapp/issues/91#issuecomment-150127701.

ribico commented 9 years ago

I found one issue. I added one additional slot to the node GW but rebuild did not add it at the bottom of the list. By re-creating the whole DB the new slot was shown.

plinioseniore commented 9 years ago

Which commit? Use patch7.1.1 as 7.1 has a bug on this new feature.

Dario.

From Mobile.

ribico commented 9 years ago

OK, I tested the latest 7.1 commit and I did not upgrade to 7.1.1 branch... never mind.

plinioseniore commented 9 years ago

Don't assume that patches will fix your problem :)

From Mobile.

juanpintom commented 9 years ago

Tested with patch7.1.1 and isn't work, I get on the log: (vNet)(0xAB01)<|0xB|0x17|0xC900|0xAB01|0x22|0x0|0x0|0x3F|0x18>

And nothing more.

Regards

plinioseniore commented 9 years ago

From which node this log has been captured, from 0xC900? Looks a quite strange address

plinioseniore commented 9 years ago

Just had a try on my network running the gateway as 7.1.1, the Peer can run any release in 7.x, is working fine for me.

juanpintom commented 9 years ago

I updated the GW too but still not working, same log on the peer addresed as AB06, I dont know from where it comes this c900 :S

(vNet)(0xAB01)<|0xB|0x17|0xC900|0xAB01|0x22|0x0|0x0|0x3F|0x18>

Regards

2015-10-24 12:59 GMT+02:00 Dario Di Maio notifications@github.com:

Just had a try on my network running the gateway as 7.1.1, the Peer can run any release in 7.x, is working fine for me.

— Reply to this email directly or view it on GitHub https://github.com/souliss/soulissapp/issues/91#issuecomment-150784237.

plinioseniore commented 9 years ago

If you enable Souliss debug and reboot your gateway, it will show the peer list. Likely is corrupted.

From Mobile.

juanpintom commented 9 years ago

Ok, I think we're near to find the problem, I've 2 nodes declarated manually on the GW (still not updated and changed to dynamic addressing) One of this nodes is 0x00C9 not 0xC900.

On the GW the peer list is: (ss)<|0xC8|0xC7|0xC9|0xAB05|0xAB06|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x>

and here my GW sketch with OTA /** Souliss - Web Configuration

This example demonstrate a complete web configuration of ESP8266 based

nodes, the node starts as access point and allow though a web interface the configuration of IP and Souliss parameters.

This example is only supported on ESP8266.

***/

define MaCaco_DEBUG_INSKETCH

define MaCaco_DEBUG 0

define VNET_DEBUG_INSKETCH

define VNET_DEBUG 0

define SOULISS_DEBUG_INSKETCH

define SOULISS_DEBUG 1

include

include

include

include

include

// Configure the Souliss framework

include "bconf/MCU_ESP8266.h" // Load the code directly on

the ESP8266

include "conf/RuntimeGateway.h" // This node is a Peer and can

became a Gateway at runtime

include "conf/DynamicAddressing.h" // Use dynamically assigned

addresses

include "conf/WEBCONFinterface.h" // Enable the WebConfig

interface

include "Souliss.h"

define MYLED 0

uint8_t GPIO_POUT = 15; //GPIO15

define LOG Serial

OTA_Setup();

void setup() { Serial.begin(115200); Initialize(); if(!digitalRead(13)){ //EEPROM.begin(512); // write a 0 to all 512 bytes of the EEPROM for (int i = STORE__PADDR_s; i < STORE__PADDR_f; i++) EEPROM.write(i, 0);

    // turn the LED on when we're done
    pinMode(15, OUTPUT);
    digitalWrite(15, HIGH);
    Serial.println("NODES DELETED");
    EEPROM.commit();
    //EEPROM.end();
    delay(3000);
}

if(!digitalRead(12)){
    //EEPROM.begin(512);
    // write a 0 to all 512 bytes of the EEPROM
    for (int i = 0; i < 512; i++)
      EEPROM.write(i, 0);

    // turn the LED on when we're done
    pinMode(15, OUTPUT);
    digitalWrite(15, HIGH);
    Serial.println("EEPROM DELETED");
    EEPROM.commit();
    //EEPROM.end();
    delay(3000);
}

// Read the IP configuration from the EEPROM, if not available start
// the node as access point
if(!ReadIPConfiguration())

{ // Start the node as access point with a configuration WebServer SetAccessPoint(); startWebServer();

// We have nothing more than the WebServer for the configuration // to run, once configured the node will quit this. while(1) { yield(); runWebServer(); }

}

if (IsRuntimeGateway())
{
    // Connect to the WiFi network and get an address from DHCP
    Serial.println("GW MODE");
    SetAsGateway(myvNet_dhcp);       // Set this node as gateway for

SoulissApp SetAddressingServer(); //SetAddress(0xAB01, 0xFF00, 0x0000); SetAsPeerNode(0x00C7, 1); SetAsPeerNode(0x00C9, 2); //SetAsPeerNode(0x00CA, 3); // SetAsPeerNode(0x00BD, 4);

}
else
{
    // This board request an address to the gateway at runtime, no need
    // to configure any parameter here.
    Serial.println("PEER MODE");
    SetDynamicAddressing();
    //SetAddress(0xAB05, 0xFF00, 0xAB01);
    //SetAddress(0x00BD, 0xFF00, 0x00C8);
    GetAddress();
}

Set_DimmableLight(MYLED);
startWebServer();

LOG.print("vNet Media : ");
LOG.println (vNet_GetAddress(vNet_MyMedia()),HEX);
LOG.print("vNet 1 : ");
LOG.println (vNet_GetAddress(1),HEX);
LOG.print("vNet 2 : ");
LOG.println (vNet_GetAddress(2),HEX);
LOG.print("vNet 3 : ");
LOG.println (vNet_GetAddress(3),HEX);
LOG.print("vNet 4 : ");
LOG.println (vNet_GetAddress(4),HEX);
LOG.print("vNet 5 : ");
LOG.println (vNet_GetAddress(5),HEX);

OTA_Init();

}

void loop() { runWebServer(); EXECUTEFAST() { UPDATEFAST();

    FAST_50ms() {   // We process the logic and relevant input and

output every 50 milliseconds Logic_DimmableLight(MYLED); analogWrite(GPIO_POUT, mOutput(MYLED+1)*4); }

    // Run communication as Gateway or Peer
    if (IsRuntimeGateway())
        FAST_GatewayComms();
    else
        FAST_PeerComms();
}

EXECUTESLOW() {
    UPDATESLOW();

    SLOW_10s() {  // Read temperature and humidity from DHT every 110

seconds Timer_DimmableLight(MYLED); }

    // If running as Peer
    if (!IsRuntimeGateway())
        SLOW_PeerJoin();
}
OTA_Process();

}

Maybe this causes rebuild node isn't working ok??

Regards

2015-10-24 17:05 GMT+02:00 Dario Di Maio notifications@github.com:

If you enable Souliss debug and reboot your gateway, it will show the peer list. Likely is corrupted.

From Mobile.

— Reply to this email directly or view it on GitHub https://github.com/souliss/soulissapp/issues/91#issuecomment-150824671.

plinioseniore commented 9 years ago

Quite strange, because your Peer list looks ok, the line of code that is interested is this one

return MaCaco_send(C8TO16(memory_map + MaCaco_ADDRESSES_s + 2*(rx->startoffset)), MaCaco_TYPREQ, 0, MaCaco_TYP_s, MaCaco_TYPLENGHT, 0x00);

I cannot see anything wrong with this, but you can try to add some debug lines to understand the parameter passed to this line in your case.

juanpintom commented 9 years ago

What do you need? (what debug lines you need? :P)

Regards

2015-10-25 12:00 GMT+01:00 Dario Di Maio notifications@github.com:

Quite strange, because your Peer list looks ok, the line of code that is interested is this https://github.com/souliss/souliss/blob/friariello/frame/MaCaco/MaCaco.cpp#L368 one

return MaCaco_send(C8TO16(memory_map + MaCaco_ADDRESSES_s + 2*(rx->startoffset)), MaCaco_TYPREQ, 0, MaCaco_TYP_s, MaCaco_TYPLENGHT, 0x00);

I cannot see anything wrong with this, but you can try to add some debug lines to understand the parameter passed to this line in your case.

— Reply to this email directly or view it on GitHub https://github.com/souliss/soulissapp/issues/91#issuecomment-150912221.

plinioseniore commented 9 years ago

Change it as

if((rx->numberof == 1) && (rx->startoffset != 0)) {
  Serial.println(rx->startoffset,HEX);
  Serial.println(C8TO16(memory_map + MaCaco_ADDRESSES_s + 2*(rx->startoffset),HEX);
  return MaCaco_send(C8TO16(memory_map + MaCaco_ADDRESSES_s + 2*(rx->startoffset)), MaCaco_TYPREQ, 0, MaCaco_TYP_s, MaCaco_TYPLENGHT, 0x00);            
}
juanpintom commented 9 years ago

On GW? Or on peer?

Ty and sorry about dumb question :( :P

Regards

2015-10-25 16:49 GMT+01:00 Dario Di Maio notifications@github.com:

Change it as

if((rx->numberof == 1) && (rx->startoffset != 0)) { Serial.println(rx->startoffset,HEX); Serial.println(C8TO16(memory_map + MaCaco_ADDRESSESs + 2(rx->startoffset),HEX); return MaCaco_send(C8TO16(memory_map + MaCaco_ADDRESSESs + 2(rx->startoffset)), MaCaco_TYPREQ, 0, MaCaco_TYP_s, MaCaco_TYPLENGHT, 0x00); }

— Reply to this email directly or view it on GitHub https://github.com/souliss/soulissapp/issues/91#issuecomment-150936835.

plinioseniore commented 9 years ago

Gateway only

juanpintom commented 9 years ago

Ok I added this lines and no see nothing on the LOG, seems isn't go trought this lines, I've added this before the IF on the line 367 and don't see this values either :S

Serial.print("rx->numberof: "); Serial.println(rx->numberof); Serial.print("rx->startoffset: "); Serial.println(rx->startoffset); if((rx->numberof == 1) && (rx->startoffset != 0)) //LINE 367

Regards

2015-10-25 18:32 GMT+01:00 Dario Di Maio notifications@github.com:

Gateway only

— Reply to this email directly or view it on GitHub https://github.com/souliss/soulissapp/issues/91#issuecomment-150946946.

juanpintom commented 9 years ago

Here the logs I see when I push Rebuild node:

This on GW: (MaCaco)<|0x22|0x0|0x0|0x3|0x1|0x> (MaCaco)<|0x22|0x0|0x0|0x3F|0x18|0x>

This on the PEER: (vNet)(0xAB06)<|0x23|0x17|0xAB01|0xAB06|0x15|0x0|0x0|0x57|0x18|0x80|0x4D|0xC0|0x50|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x49|0x0|0x3C|0x0|0x3C|0x80|0x4F|0x0|0x0|0x0|0x0|0x0|0x0>

2015-10-25 19:36 GMT+01:00 Juan Pinto juanpintom@gmail.com:

Ok I added this lines and no see nothing on the LOG, seems isn't go trought this lines, I've added this before the IF on the line 367 and don't see this values either :S

Serial.print("rx->numberof: "); Serial.println(rx->numberof); Serial.print("rx->startoffset: "); Serial.println(rx->startoffset); if((rx->numberof == 1) && (rx->startoffset != 0)) //LINE 367

Regards

2015-10-25 18:32 GMT+01:00 Dario Di Maio notifications@github.com:

Gateway only

— Reply to this email directly or view it on GitHub https://github.com/souliss/soulissapp/issues/91#issuecomment-150946946.

plinioseniore commented 9 years ago

@juanpintom is very strange, this means that for some reason it doesn't catch the Serial object. The log on the Peer is just a subscription update and doesn't involve the rebuild of typicals.

juanpintom commented 9 years ago

Yes, it's strange :S I'll try again this night.

Regards

2015-10-26 13:01 GMT+01:00 Dario Di Maio notifications@github.com:

@juanpintom https://github.com/juanpintom is very strange, this means that for some reason it doesn't catch the Serial object. The log on the Peer is just a subscription update and doesn't involve the rebuild of typicals.

— Reply to this email directly or view it on GitHub https://github.com/souliss/soulissapp/issues/91#issuecomment-151112058.

shineangelic commented 9 years ago

I can't understand. Is this a SoulissApp bug ?

plinioseniore commented 9 years ago

I cannot understand too, I've succesfully rebuild my nodes.

juanpintom commented 9 years ago

Sorry was my fault, I opened the Issue here but I don't know where my problem was, now it's clear is a problem of my network on framework side.

Regards

2015-10-26 20:42 GMT+01:00 Dario Di Maio notifications@github.com:

I cannot understand too, I've succesfully rebuild my nodes.

— Reply to this email directly or view it on GitHub https://github.com/souliss/soulissapp/issues/91#issuecomment-151261578.

shineangelic commented 9 years ago

ok, closing this

juanpintom commented 9 years ago

Ok, but I still need some help to solve it, I'll open an issue on FW side

Regards

2015-10-26 21:24 GMT+01:00 Alessandro Del Pex notifications@github.com:

ok, closing this

— Reply to this email directly or view it on GitHub https://github.com/souliss/soulissapp/issues/91#issuecomment-151273880.