Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erroneous node displayed #137

Open
tew opened this issue Jul 10, 2016 · 18 comments
Open

Erroneous node displayed #137

tew opened this issue Jul 10, 2016 · 18 comments
Assignees
Labels

Comments

@tew
Copy link

tew commented Jul 10, 2016

Hello.

When displaying data when using a simple network with a gateway and one node, it appears that some informations from the gateway may be displayed on the detail panel of the node.

The gateway and nodes are defined like:
Gateway / node0:

  • slot 0 = dimmable light
  • slot 2 = pressure sensor

Node 1:

  • slot 0 = temperature sensor
  • slot 2 = humidity sensor

The issue is that 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.

PleasSo 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 gateway node to update its values each second,
When I look at the detail panel of node 1, the correct value - humidity - appears briefly sometimes, but is most of the time replaced by the pressure from the gateway node.

You will find attached the 2 sketches to demonstrate the issue.
gateway.txt
node1.txt

The issue was already discussed in the souliss forum, in this thread:
https://groups.google.com/forum/#!topic/souliss/7UWuvrFQyi4

Have a nice day!

Sylvain

@tew
Copy link
Author

tew commented Jul 18, 2016

To illustrate the issue, here is a screen capture when displayiong the second node.
You can see the second device - an humidity captor - with the value of the pressure (2428) from the first node instead of humidity.

Regards,

Sylvain

screenshot_2016-07-08-23-37-09

@shineangelic
Copy link
Member

could you post a screen of UDP test option after pressing "TYPREQ" ? thank you

this bug is so weird

@shineangelic shineangelic self-assigned this Jan 24, 2017
@tew
Copy link
Author

tew commented Jan 27, 2017

Hello!
I'll try to do that on this week-end

@tew
Copy link
Author

tew commented Jan 28, 2017

Hi!

Here is the screenshot. I hope this can help!

screenshot

@shineangelic
Copy link
Member

@plinioseniore could you have a look at this? the typrequest seems strange to me, for sure the app is receiving more than two nodes...

this bug is interesting somehow, I never heard of structure requests bug...
@tew do you have root access on your phone? To go deep, I'd probably need your DB file, that is located at /data/data/it.angelic.soulissclient/databases/

you can send that privately, even tho it doesn't contain strictly personal data, nor your IP addresses

@tew
Copy link
Author

tew commented Jan 30, 2017

@shineangelic I'm sorry I should have told this before, but my network now contains more than 2 nodes indeed. They are 4 nodes.
However this issue also occurs with 2 nodes.

At the first post on this bug, there code source with 2 nodes to demonstrate it.
I don't think my setup is particular.

I think the bug occurs when receiving data from the first node, while displaying the second node on soulissapp. Would you be able to reproduce the setup given below? If not I can try to do this for you. Let me know.

@plinioseniore
Copy link
Member

plinioseniore commented Jan 30, 2017 via email

@tew
Copy link
Author

tew commented Jan 30, 2017

Yes, I've changed the number of slots.

I've made a new test, with two very basic nodes.
Gateway, ethernet 192.168.1.70, 1 slot with a T58 (pressure, sent every 7 seconds)
Node1, ethernet, 192.168.1.71: 1 slot with a T52 (temperature, sent every 10 seconds)

With soulissapp, I look the node1. Sometimes the slot displays a temperature, which is right, sometimes a pressure, which is wrong, since it comes from the gateway node.

Here are the screens:

screenshot_2017-01-30-22-05-08

screenshot_2017-01-30-22-02-15

As you can see, both screen shots display a T52 slot, I'm on the node1, indeed.

Here is also a TYPREQ:
screenshot_2017-01-30-22-06-56

I used this source code for gateway/node:

issue137.zip

Is there anything else I can do to help you?
Maybe installing a custom APK? I'm not root on my phone.

@tew
Copy link
Author

tew commented Jan 30, 2017

One last thing: the souliss code I use is a fresh clone from github, branch friariello, commit 5e0af6d419076f4c0a504754cbfc7c3c8193b1d9.

@plinioseniore
Copy link
Member

plinioseniore commented Jan 30, 2017 via email

@shineangelic
Copy link
Member

shineangelic commented Jan 31, 2017 via email

@plinioseniore
Copy link
Member

plinioseniore commented Jan 31, 2017 via email

@shineangelic
Copy link
Member

shineangelic commented Jan 31, 2017 via email

@shineangelic
Copy link
Member

shineangelic commented Jan 31, 2017

anyway, this is the relevant piece of code. It always worked and I don't think the problem is here

for (short j = 0; j < numberOf; j++) {
                try {
                    SoulissNode it = nodes.get(((int) j / typXnodo) + tgtnode);
                    SoulissTypical temp = it.getTypical((short) (j % typXnodo));
                    SoulissTypicalDTO dto = temp.getTypicalDTO();
                    dto.setOutput(mac.get(5 + j));
                    dto.setSlot(((short) (j % typXnodo)));
                    dto.setNodeId((short) (j / typXnodo + tgtnode));
                    // sufficiente una refresh
                    dto.refresh(temp);
                    Log.d(Constants.Net.TAG, "---REFRESHED NODE:" + (j / typXnodo + tgtnode) + " SLOT:" + (j % typXnodo));
                } catch (NotFoundException e) {
                    // skipping unexistent typical");
                    //OK, può succedere
                } catch (Exception e) {
                    Log.w(Constants.Net.TAG, "Errore di calcolo??" + e.getMessage());
                    // FIXME nodes.get(((int) j / typXnodo) + tgtnode) è SBAGLIATO l'ha detto Dario
                }
            }

@shineangelic
Copy link
Member

on the log file, when app receives update, the log (/sdcard/souliss.log) will report exactly which node has been updated.

@tew what's your maxTypicalXnode setting ? You can see it when you request DB structure, it's the 7th byte

@tew
Copy link
Author

tew commented Jan 31, 2017

I looked at the file /sdcard/souliss.log but it has not been updated since november. Should delete it? Is it stored in another place?

How can I request the DB structure?

@shineangelic
Copy link
Member

shineangelic commented Jan 31, 2017

@plinioseniore can't be the UI binding, because the unit measure is C degrees, not pascal. So a T52 is being shown for sure.

I bet the wrong value 1072 is being saved on DB, it comes from there.

I really need to replicate this in debug.

@tew you log is dated november because you had no application error, and in production/release mode, log only shows errors and warnings, not debug messages

@plinioseniore
Copy link
Member

plinioseniore commented Jan 31, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants