Revision 172:8c8328364b9d

b/eeprom/impoundment.yaml
1
networks: [0, 3]
2
features: []
3
default_channel: 11
4
default_basestation: 0x0010
b/tidsense/assoc.c
69 69
        PHY_SetChannel(nv_get_word(default_channel));
70 70
        debugf("association failed\n");
71 71
        assoc_state = ASSOC_STATE_FAILED;
72
        if(++assoc_n_failures > 10) {
73
            sched_task_set_interval(assoc_task, 1800, 0);
72
        if(++assoc_n_failures > 2) {
73
            sched_task_set_interval(assoc_task, 3600, 0);
74 74
            assoc_n_failures = 0;
75 75
        } else {
76
            sched_task_set_interval(assoc_task, 20, 0);
76
            sched_task_set_interval(assoc_task, 60, 0);
77 77
        }
78 78
    } else {
79 79
        assoc_associate(c);
b/tidsense/event.c
45 45
}
46 46

  
47 47
void event_task_fn(void *data) {
48
    // only if we have a master
49
    if(assoc_get_state() != ASSOC_STATE_ASSOCIATED) return;
50
    
48 51
    if(!events_with_status(EVENT_PENDING)) return;
49 52
    
50 53
    // Don't continue if there are currently events in the air
51 54
    if(events_with_status(EVENT_TRANSMITTED)) return;
52 55

  
56

  
53 57
    NWK_DataReq_t *req = network_alloc_request(1);
54 58
    if(!req) return;
55 59
    
b/tidsense/report.c
29 29

  
30 30
    network_free_request(req);
31 31
    if(error_count >= 16) {
32
        assoc_unassociate();
32
        //assoc_unassociate();
33 33
        error_count = 0;
34 34
    }
35 35
}
b/tidsense/tidsense.c
73 73
    assoc_setup();
74 74
    event_setup();
75 75
    event_create(EVENT_RESET, RST.STATUS, EVENT_INFO);
76
    sched_task_create(app_watchdog_task, NULL, 7200, 0, SCHED_ENABLED);
76
    sched_task_create(app_watchdog_task, NULL, 86400, 0, SCHED_ENABLED);
77 77
}
78 78

  
79 79

  
b/tidsense/version.c
3 3

  
4 4
const version_info_t version_info = {
5 5
    .version_major = 4,
6
    .version_minor = 1,
7
    .version_sub = 1,
6
    .version_minor = 2,
7
    .version_sub = 0,
8 8

  
9 9
    .platform = "TidN",
10 10
    .revision = REVISION,

Also available in: Unified diff