LoraWAN论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 6456|回复: 0
打印 上一主题 下一主题

各位帮看看遇到一个棘手问题 1301 动态配置频段 发现延迟...

[复制链接]

8

主题

12

帖子

78

积分

注册会员

Rank: 2

积分
78
跳转到指定楼层
楼主
发表于 2019-4-28 17:51:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
由于客户要求将1301做成了  单信道  平台下发修改频段指令配置不同频段 平台 配置频段1301参数比较频繁 代码在下面  遇到问题是每次重新配置必须要 lgwstop 然后 再lgwstart 但是发现配置完后 这个时间比较长 要3秒左右 由于我集中器配置完就马上抄表了 这个3秒时间太长了  平台而且是 每10秒就要配置一次频段参数 导致时间大大拉长  而且我发现 调用 lgwsop    lgwstart 这组函数频繁的话 会出现  如下错误   我的整体配置代码在最下面 有遇到过解决了这个问题的请指教
lgw_start:999: ERROR: Version of AGC firmware not expected, actual:2 expected:4
2019-04-28 13:53:23.564 lgw_pkt_entry.c: ERROR: [main] failed to start the concentrator

void lgwparaConfigure(uint32_t freq) {

    int ret = -1;
    static uint32_t Prefreq = 0;
    struct lgw_conf_rxif_s ifconf;
    struct lgw_conf_rxrf_s rfconf;

    ret = lgw_stop();

    if(ret != LGW_HAL_SUCCESS) {

        goto ERRON_EXIT;
    }

    if(!access(global_cfg_path, R_OK)) {

        CULog("INFO:found global configuration file %s and parse it", global_cfg_path);

        int ret = pare_sx1301_configuration(global_cfg_path);

        if(ret != 0) {

            goto ERRON_EXIT;
        }
    }

    memset(&rfconf, 0, sizeof(rfconf));
    memset(&ifconf, 0, sizeof(ifconf));
    rfconf.enable = true;
    rfconf.freq_hz = freq;
    rfconf.rssi_offset = -166.0;
    rfconf.type = LGW_RADIO_TYPE_SX1255;
    rfconf.tx_enable = true;
    rfconf.tx_notch_freq = DEFAULT_NOTCH_FREQ;
    lgw_rxrf_setconf(0, rfconf); /* radio A, f0 */

    ifconf.enable = true;
    ifconf.rf_chain = 0;
    ifconf.freq_hz = 0;
    ifconf.datarate = DR_LORA_SF8;
    lgw_rxif_setconf(0, ifconf);

    ret = lgw_start();

    if(ret == LGW_HAL_SUCCESS) {
        CULog("INFO: [main] concentrator started, packet can now be received\n");
    }
    else {
        CULog("ERROR: [main] failed to start the concentrator\n");
        goto ERRON_EXIT;
    }
       
    pthread_mutex_lock(&pthread_mutex_recvlock);
    lgw_recvflag = true;
    pthread_mutex_unlock(&pthread_mutex_recvlock);


    return;

ERRON_EXIT:

    if(raise(SIGINT) == -1) {

        CULog("WARNING:singnal raise fail.");
        exit(EXIT_FAILURE);
    }
}




回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|LoraWAN论坛  

GMT+8, 2024-4-19 16:42 , Processed in 0.124688 second(s), 7 queries , File On.

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表