things4u / ESP-1ch-Gateway-v5.0--OLD

Version 5 of Single Channel LoRa Gateway
MIT License
311 stars 162 forks source link

inDecodes functions Doesn't work #39

Closed iApotoxin closed 5 years ago

iApotoxin commented 5 years ago

I think, this function need more parameters.

platenspeler commented 5 years ago

Can you please explain? Doesn't work? What does not work? What parameter is missing?

iApotoxin commented 5 years ago

int inDecodes(char * id) {

uint32_t ident = ((id[3]<<24) | (id[2]<<16) | (id[1]<<8) | id[0]);

int i;
for ( i=0; i< (sizeof(decodes)/sizeof(codex)); i++) {
    if (ident == decodes[i].id) {
        return(i);
    }
}
return(-1);

}

screen shot 2561-07-11 at 08 48 40 In _utils decodes and codex don't declared in function.

peterkorolev commented 5 years ago

Comment out the function "inDecodes," and set TRUSTED_DECODE in ESP-sc-gway.h to 0.

iApotoxin commented 5 years ago

To peterkorolev. Yes, I solve this issue like yours suggestion. but i think it will be effect to other. it's seem works but gateway can't send data to node. so i don't know this problem is effected from lost inDecode function, is it.

platenspeler commented 5 years ago

I do not think that sending data to the node it is related to your first issue.

For the inDecodes function I have added

if _LOCALSERVER==1

It should only be defined and work when _LOCALSERVER is set. I have uploaded the change to github.

Maarten

iApotoxin commented 5 years ago

To platenspeler.

Thank You, So i have a question. This example code can forward downlink to node, or not ?

platenspeler commented 5 years ago

As far as I know the gateway does send downstream messages correctly. It is a little difficult for me to test as we have quite a few gateways around the house. I plan to test the downstream function on ESP32 again in August.