nRF52 Mesh开发 (3) MESH Sensor Server/Client Models详解与实现

2023-05-16

MESH Sensor Model 实现

  • MESH Spec规定的 Sensor Model 标准
    • 传感器状态
      • 传感器描述
      • 传感器参数设置
      • 传感器cadence
      • 传感器数据
    • 传感器可发送和接收的消息
    • Sensor Server /Client Models
      • Sensor Server Models
      • Sensor Client Models
    • Sensor Server /Client Models 在nrf52832上的实现
      • Sensor(温湿度计) model 消息实现

转发请注明出处。

MESH Spec规定的 Sensor Model 标准

MESH Spec定义了传感器接口的标准方法。 这样一来,任何设备都可以公开可使用的任何一组传感器,而无需为每个应用程序定义特定的状态,消息和模型。

传感器状态

传感器状态是由四个状态组成的复合状态:传感器描述,在整个sensor生命周期中保持不变; 可以设置的传感器参数和传感器踏频状态; 以及测量值;测量值可以表示为单个数据点Sensor Data状态或表示为一系列数据点的列,例如直方图。 测量值可以随时间变化。

传感器描述

如下表所示,传感器的描述状态主要包括如下几部分:传感器属性ID、传感器正公差、传感器负公差、传感器采样函数、
传感器测量周期、传感器更新间隔。具体描述可查看mesh model spec。
Sensor Descriptor states

传感器参数设置

传感器参数设置除了传感器属性ID外,每个设置都有自己的属性ID:Sensor Setting Property ID,同样是两个字节。另外还包括:Sensor Setting Access、Sensor Setting Raw。
在这里插入图片描述
Sensor Setting Access是字段是一个枚举,指示是否可以读取或写入设备属性。 下表中定义了该字段的值,
在这里插入图片描述
Sensor Setting Raw 表示传感器的设置

传感器cadence

传感器踏频状态控制传感器发送数据的频率。 能够以不同的节奏发送一系列测量值的测量值。可将传感器配置为在值向上或向下变化超过配置的增量值时发送测量值。包括以下几个字段:
在这里插入图片描述
The Fast Cadence Period Divisor 是一个7位的值,控制传感器状态消息发布频率的增加。 该值表示为发布周期的2n除数。 例如,值0x04的除数为16,而值0x00的除数为1。 快速踏频周期除数状态的有效范围是0–15,其他值被禁止。
The Status Trigger定义状态触发增量下降和状态触发增量上升字段的单位和格式。0b0的值表示该格式应由传感器属性ID的格式类型定义;值0b1表示单位为«unitless»,格式类型为0x06(uint16),该值表示为百分比变化,分辨率为0.01%。
The Status Trigger Delta Down控制触发传感器状态消息发布的测量量的负变化;Status Trigger Delta Up控制触发传感器状态消息发布的测量量的正变化。
The Status Min Interval 是一个1字节的值,它将控制发送两个连续的传感器状态数据之间的最小间隔。 该值表示为2^n毫秒。The Fast Cadence Low 定义一系列测量量的下边界,Fast Cadence Hight 定义测量量上界。

传感器数据

传感器数据状态是一对或多对传感器属性ID和数据的序列,如下图所示:
在这里插入图片描述
Sensor Data state
另外数据也可以使用图表的方式发送,如下图所示是以柱状图的方式发送。
ensor Series Column states
在这里插入图片描述

传感器可发送和接收的消息

传感器支持的消息如下图所示,在实际实现中并不需全部实现,根据所需实现必要的消息即可。具体消息类型可查看spec。
在这里插入图片描述

Sensor Server /Client Models

Sensor Server Models

Sensor Server模型是根模型(不扩展任何其他模型)。 当此模型存在于元素上时,还应提供相应的Sensor Setup Server模型(请参阅spec第4.3.2节)。模型需支持Mesh Profile规范[2]的4.2.2节中定义的模型发布,以及Mesh Mesh规范的4.2.3节中定义的模型订阅。
在这里插入图片描述
Sensor Setup Server模型扩展 Sensor Server模型
在这里插入图片描述

Sensor Client Models

Sensor Client模型是根模型(不支持扩展任何其他模型)。模型需支持Mesh Profile规范[2]的4.2.2节中定义的模型发布,以及Mesh Mesh规范的4.2.3节中定义的模型订阅。
Sensor Client elements and messages

Sensor Server /Client Models 在nrf52832上的实现

本文使用的传感器为温湿度传感器,传感器消息主要包括:数据采集时间间隔设置,数据采集时间间隔获取,数据采集时间间隔发布,温湿度数据获取,温湿度数据发布。
###传感器数据读取
本人使用的开发板是青风电子的nrf52832,传感器为青风在教程中使用到的温湿度传感器DHT11(淘宝买的)参数如下图所示
温湿度传感器DH11
数据读取代码如下(有详细的注释):
dht11.h

#ifndef __dht11_H
#define __dht11_H 


#define   ds1802          11

#define dht_IO_IN()   nrf_gpio_cfg_input(ds1802,NRF_GPIO_PIN_PULLUP);   /*!< Configures SDA pin as input  */
#define dht_IO_OUT()  do { NRF_GPIO->DIRSET = (1UL << ds1802);  } while(0)   /*!< Configures SDA pin as output */
 
									   
#define	dht_data_OUT_0  nrf_gpio_pin_clear(ds1802) 
#define	dht_data_OUT_1  nrf_gpio_pin_set(ds1802)  
#define	dht_data_IN     ((NRF_GPIO->IN >> ds1802) & 0x1UL)    

u8 dhtInit(void);
u8 dhtReadData(u8 *temp,u8 *humi);  
#endif

dht11.c

#include "dht11.h"
#include "nrf_delay.h"

/* Logging and RTT */
#include "log.h"
#include "rtt_input.h"

/******************************************************************
Function: dhtRest
Description: rest the dht11.
Input:    void
Output:  void
*******************************************************************/
void dhtRest(void)
{
    dht_IO_OUT();
    dht_data_OUT_0;
    nrf_delay_ms(25);
    dht_data_OUT_1;
    dht_data_OUT_1;
    nrf_delay_us(30);
}

/******************************************************************
Function: dhtCheck
Description: check the dht11.
Input:    void
Output:  void
*******************************************************************/
u8 dhtCheck(void)
{
    u8 time = 0;
    dht_IO_IN(); // SET INPUT
    while(dht_data_IN && time < 100)
    {
        time++;
        nrf_delay_us(1);
       
    }
    if(time >= 100)
    {
        __LOG(LOG_SRC_APP, LOG_LEVEL_ERROR, "ERROR 1\n");
        return 1;
    }
    else 
    {
       time = 0;
    }
    while(!dht_data_IN && time < 100)
    {
        time++;
        nrf_delay_us(1);
       
    }
    if(time>=100)
	{
		 __LOG(LOG_SRC_APP, LOG_LEVEL_ERROR, "ERROR 2\n");
		return 1;
	}
    //__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "NO ERROR \n");
	return 0;
}

/******************************************************************
Function: dhtReadBit
Description: read one bit of dht data.
Input:    void
Output:  0 or 1
*******************************************************************/
u8 dhtReadBit(void)
{
    u8 time = 0;
    while(dht_data_IN && time < 100)
    {
        time++;
        nrf_delay_us(1);
    }
    time = 0;
    while(!dht_data_IN && time < 100)
    {
        time++;
        nrf_delay_us(1);
    }
    nrf_delay_us(40);
    if(dht_data_IN)
    {
        return 1;
    }
    else
    {
        return 0;
    }
}

/******************************************************************
Function: dhtReadByte
Description: read one byte of dht data.
Input:    void
Output:  data
*******************************************************************/
u8 dhtReadByte(void)
{
    u8 data;
    data = 0;
    for(int i = 0; i < 8; i++)
    {
       data = data << 1;
       data = data | dhtReadBit();
    }
    return data;
}

/******************************************************************
Function: dhtReadData
Description: read all data.
Input:    void
Output:  temp humi
*******************************************************************/
u8 dhtReadData(u8 *temp, u8 *humi)
{
    u8 data[5];
    dhtRest();
    if(dhtCheck() == 0)
    {
        for(int i = 0; i < 5; i++)
        {
            data[i] = dhtReadByte();
        }
        if(data[4] == data[0] +data[1] + data[2] + data[3])
        {
            *humi = data[0];
            *temp = data[2];
        }
    }
    else 
    {
        printf("read data error\n");
        return 1;
    }
    return 0;
}

/******************************************************************
Function: dhtInit
Description: initall the dht.
Input:    void
Output:  dhtCheck()
*******************************************************************/
u8 dhtInit()
{
    dhtRest();
    //__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "DHT INIT \n");
    return dhtCheck();
}

Sensor(温湿度计) model 消息实现

消息包括:温湿度采集时间设置/无回复类型、温湿度采集时间设置获取、温湿度采集时间发布、温湿度获取、温湿度发布。
首先需要定义一个company ID

/** Vendor specific company ID for Simple OnOff model */
#define SENSOR_DHT_COMPANY_ID    (ACCESS_COMPANY_ID_NORDIC)

每个消息都需要一个操作码,用于assess层识别不同的消息,操作码定义如下:

/**sensor_dht opcodes**/
typedef enum
{
    SENSOR_DHT_OPCODE_SETTING_SET = 0xD1,
    SENSOR_DHT_OPCODE_SETTING_GET = 0xD2,
    SENSOR_DHT_OPCODE_SETTING_SET_UNRELIABLE = 0xD3,
    SENSOR_DHT_OPCODE_SETTING_STATUS = 0XD4,
    SENSOR_DHT_OPCODE_GET = 0XD5,
    SENSOR_DHT_OPCODE_STATUS = 0XD6
} sensor_dht_opcode_t;

下面是各个消息结构,setting message 中可根据实际需求增添功能,用于功能简单下面的实现略去了SIG规范中的sensor ID与setting ID

/** Message format for the  Setting Set message. */
typedef struct __attribute((packed))
{
    //uint16_t property_id;/**< sensor_dht property id. */
    //uint16_t setting_property_id;/**< sensor_dht setting property id. */
    uint8_t period_time; /**< the data send period. */
} sensor_dht_msg_setting_set_t;

/** Message format for the  Setting Get message. */
typedef struct __attribute((packed))
{
    //uint16_t property_id;/**< sensor_dht property id. */
    //uint16_t setting_property_id;/**< sensor_dht setting property id. */ 
} sensor_dht_msg_setting_get_t;

/** Message format for the dht  Setting Set unreliable message . */
typedef struct __attribute((packed))
{
    //uint16_t property_id;/**< sensor_dht property id. */
    //uint16_t setting_property_id;/**< sensor_dht setting property id. */
    uint8_t period_time; /**< the data send period. */
} sensor_dht_msg_setting_set_unreliable_t;

/** Message format for the sensor_dht Setting Status message . */
typedef struct __attribute((packed))
{
    //uint16_t property_id;/**< sensor_dht property id. */
    //uint16_t setting_property_id;/**< sensor_dht setting property id. */
    uint8_t period_time; /**< the data send period. */
} sensor_dht_msg_setting_status_t;

/** Message format for the dht  Get message . */
typedef struct __attribute((packed))
{
    //uint16_t property_id;

}sensor_dht_msg_get_t;

/** Message format for the sensor_dht Status message . */
typedef struct __attribute((packed))
{
    uint8_t temp;
    uint8_t humi;
} sensor_dht_msg_status_t;

###sensor(温湿度计)server model实现
model是一个具体的功能实例,server多用于发送状态消息,接收设置等消息,所以需要用到opcode、server ID,消息回调函数,使用struct封装这些内容,在接收到setting消息后,access层可根据opcode和server ID回调不同的函数。access_model_handle_t是access定义的一个结构体,用于注册连接opcode、server ID 和回调函数。

/** Sensor dht server model ID */
#define SENSOR_DHT_SERVER_MODEL_ID (0x0000)

/** Forward declaration*/
typedef struct __sensor_dht_server  sensor_dht_server_t;

/** sensor dht setting set callback type*/
typedef uint8_t (*sensor_dht_setting_set_cb_t) (const sensor_dht_server_t *p_self,
                                           uint8_t period_time);

/** sensor dht setting get callback type*/
typedef uint8_t (*sensor_dht_setting_get_cb_t)(const sensor_dht_server_t *p_self);

/** sensor dht get callback type*/
typedef void (*sensor_dht_get_cb_t)(const sensor_dht_server_t *p_self);
/** sensor dht server state structure*/
struct __sensor_dht_server
{
    /** Model handel assigned to the server*/
    access_model_handle_t model_handle;
    /** Setting get callback.*/
    sensor_dht_setting_get_cb_t setting_get_cb;
    /** Setting set callback.*/
    sensor_dht_setting_set_cb_t setting_set_cb;
    /** Sensor dht data Get callback.*/
    sensor_dht_get_cb_t get_cb;
};

另外还需要声明model 初始化函数、状态发布函数作为API供model实现时使用。

/******************************************************************
Function: sensor_dht_server_init
Description: initall the sensor_dht_server.
Input:    p_server  Sensor dht server structure pointer
          element_index  Element index to add the server model

Output:  NRF_SUCCESS         Successfully added client.
         NRF_ERROR_NULL      NULL pointer supplied to function.
         NRF_ERROR_NO_MEM    No more memory available to allocate model.
         NRF_ERROR_FORBIDDEN Multiple model instances per element is not allowed.
         NRF_ERROR_NOT_FOUND Invalid element index.
*******************************************************************/
uint32_t sensor_dht_server_init(sensor_dht_server_t *p_server, uint16_t element_index);

/******************************************************************
Function: sensor_dht_server_setting_status_publish
Description: publish the sensor dht setting status.
Input:    p_server  Sensor dht server structure pointer
          period_time  the time interval of presnet sensor status

Output:  NRF_SUCCESS         Successfully added client.
         NRF_ERROR_NULL      NULL pointer supplied to function.
         NRF_ERROR_NO_MEM    No more memory available to allocate model.
         NRF_ERROR_FORBIDDEN Multiple model instances per element is not allowed.
         NRF_ERROR_NOT_FOUND      Invalid model handle or model not bound to element.
         NRF_ERROR_INVALID_ADDR   The element index is greater than the number of local unicast
 *                                  addresses stored by the @ref DEVICE_STATE_MANAGER.
         NRF_ERROR_INVALID_PARAM  Model not bound to appkey, publish address not set or wrong
 *                                  opcode format.
         NRF_ERROR_INVALID_LENGTH Attempted to send message larger than @ref ACCESS_MESSAGE_LENGTH_MAX
*******************************************************************/
uint32_t sensor_dht_server_setting_status_publish(sensor_dht_server_t * p_server, uint8_t period_time);

/******************************************************************
Function: sensor_dht_server_status_publish
Description: publish the sensor dht setting status.
Input:    p_server  Sensor dht server structure pointer
          temp      sensor temperature data 
          humi      sensor humidity data

Output:  NRF_SUCCESS         Successfully added client.
         NRF_ERROR_NULL      NULL pointer supplied to function.
         NRF_ERROR_NO_MEM    No more memory available to allocate model.
         NRF_ERROR_FORBIDDEN Multiple model instances per element is not allowed.
         NRF_ERROR_NOT_FOUND      Invalid model handle or model not bound to element.
         NRF_ERROR_INVALID_ADDR   The element index is greater than the number of local unicast
 *                                  addresses stored by the @ref DEVICE_STATE_MANAGER.
         NRF_ERROR_INVALID_PARAM  Model not bound to appkey, publish address not set or wrong
 *                                  opcode format.
         NRF_ERROR_INVALID_LENGTH Attempted to send message larger than @ref ACCESS_MESSAGE_LENGTH_MAX
*******************************************************************/
uint32_t sensor_dht_server_status_publish(sensor_dht_server_t * p_server, uint8_t temp, uint8_t humi);

###sensor(温湿度计)client model 实现
client用于发送setting等消息,接收status消息。在实现中与server基本一致,多出一个消息传输时间管理,具体代码如下:

/** Acknowledged message transation timeout */
#ifndef SENSOR_DHT_CLIENT_ACKED_TRANSACTION_TIMEOUT
#define SENSOR_DHT_CLIENT_ACKED_TRANSACTION_TIMEOUT (SEC_TO_US(60))
#endif

/** Sensor dht Client model ID */
#define SENSOR_DHT_CLIENT_MODEL_ID (0x0000)

/** Sensor dht Client state codes */
typedef enum
{
    /** The server did not reply to a setting status */
    SENSOR_DHT_SETTING_STATUS_ERROR_NO_REPLAY,
    /** Setting status set was cancelled */
    SENSOR_DHT_SETTING_STATUS_CANCELLED
} sensor_setting_status_t;

/** Forward declaration. */
typedef struct __sensor_dht_client sensor_dht_client_t;

/** sensor dht setting status callback type*/
typedef void (*sensor_dht_setting_status_cb_t)(const sensor_dht_client_t *p_self, 
                                               const sensor_dht_msg_setting_status_t *p_setting_status,
                                               const uint16_t src);

/** sensor dht status callback type*/
typedef void (*sensor_dht_status_cb_t)(const sensor_dht_client_t *p_self, 
                                       const sensor_dht_msg_status_t *p_status,
                                       const uint16_t src);

/** sensor dht timeout callback type*/
typedef void(*sensor_dht_timeout_cb_t)(access_model_handle_t handle, void *p_self);

/** sensor client state structure*/
struct __sensor_dht_client
{
    /** Model handle assigned to the client. */
    access_model_handle_t model_handle;
    /** setting status callback called after status received from server*/
    sensor_dht_setting_status_cb_t setting_status_cb;
    /** status callback called after status received from server*/
    sensor_dht_status_cb_t status_cb;
    /** periodic timer timeout callback used for periodic publication*/
    sensor_dht_timeout_cb_t timeout_cb;
    /** internal client state*/
    struct 
    {
        bool reliable_transfer_active; /**< Variable used to determine if a transfer is currently active. */
        sensor_dht_msg_setting_set_t setting_data;  /**< Variable reflecting the data stored in the server. */
    } state;
    
};

/******************************************************************
Function: sensor_dht_client_init
Description: initall the sensor_dht_client.
Input:    p_client  Sensor dht Client structure pointer
          element_index  Element index to add the server model

Output:  NRF_SUCCESS         Successfully added client.
         NRF_ERROR_NULL      NULL pointer supplied to function.
         NRF_ERROR_NO_MEM    No more memory available to allocate model.
         NRF_ERROR_FORBIDDEN Multiple model instances per element is not allowed.
         NRF_ERROR_NOT_FOUND Invalid element index.
*******************************************************************/
uint32_t sensor_dht_client_init(sensor_dht_client_t *p_client, uint16_t element_index);

/******************************************************************
Function: sensor_dht_client_setting_set
Description: Sets the state of the Sensor dht  server.
Input:    p_client  Sensor dht Client structure pointer
          period_time  the time interval of presnet sensor status
          
Output:  NRF_SUCCESS              Successfully sent message.
         NRF_ERROR_NULL           NULL pointer in function arguments
         NRF_ERROR_NO_MEM         Not enough memory available for message.
         NRF_ERROR_NOT_FOUND      Invalid model handle or model not bound to element.
         NRF_ERROR_INVALID_ADDR   The element index is greater than the number of local unicast
                                   addresses stored by the @ref DEVICE_STATE_MANAGER.
         NRF_ERROR_INVALID_STATE  Message already scheduled for a reliable transfer.
         NRF_ERROR_INVALID_PARAM  Model not bound to appkey, publish address not set or wrong
                                   opcode format.
*******************************************************************/
uint32_t sensor_dht_client_setting_set(sensor_dht_client_t *p_client, uint8_t period_time);

/******************************************************************
Function: sensor_dht_client_setting_set
Description: Sets the setting state of the Sensor dht  server without reliable.
Input:    p_client  Sensor dht Client structure pointer
          period_time  the time interval of presnet sensor status
          
Output:  NRF_SUCCESS              Successfully sent message.
         NRF_ERROR_NULL           NULL pointer in function arguments
         NRF_ERROR_NO_MEM         Not enough memory available for message.
         NRF_ERROR_NOT_FOUND      Invalid model handle or model not bound to element.
         NRF_ERROR_INVALID_ADDR   The element index is greater than the number of local unicast
                                   addresses stored by the @ref DEVICE_STATE_MANAGER.
         NRF_ERROR_INVALID_STATE  Message already scheduled for a reliable transfer.
         NRF_ERROR_INVALID_PARAM  Model not bound to appkey, publish address not set or wrong
                                   opcode format.
*******************************************************************/
uint32_t sensor_dht_client_setting_set_unreliable(sensor_dht_client_t *p_client, uint8_t period_time);

/******************************************************************
Function: sensor_dht_client_setting_get
Description: Gets the setting state of the Sensor dht  server.
Input:    p_client  Sensor dht Client structure pointer
          
Output:  NRF_SUCCESS              Successfully sent message.
         NRF_ERROR_NULL           NULL pointer in function arguments
         NRF_ERROR_NO_MEM         Not enough memory available for message.
         NRF_ERROR_NOT_FOUND      Invalid model handle or model not bound to element.
         NRF_ERROR_INVALID_ADDR   The element index is greater than the number of local unicast
                                   addresses stored by the @ref DEVICE_STATE_MANAGER.
         NRF_ERROR_INVALID_STATE  Message already scheduled for a reliable transfer.
         NRF_ERROR_INVALID_PARAM  Model not bound to appkey, publish address not set or wrong
                                   opcode format.
*******************************************************************/
uint32_t sensor_dht_client_setting_get(sensor_dht_client_t *p_client);

/******************************************************************
Function: sensor_dht_client_get
Description: Gets the state of the Sensor dht  server.
Input:    p_client  Sensor dht Client structure pointer
          
Output:  NRF_SUCCESS              Successfully sent message.
         NRF_ERROR_NULL           NULL pointer in function arguments
         NRF_ERROR_NO_MEM         Not enough memory available for message.
         NRF_ERROR_NOT_FOUND      Invalid model handle or model not bound to element.
         NRF_ERROR_INVALID_ADDR   The element index is greater than the number of local unicast
                                   addresses stored by the @ref DEVICE_STATE_MANAGER.
         NRF_ERROR_INVALID_STATE  Message already scheduled for a reliable transfer.
         NRF_ERROR_INVALID_PARAM  Model not bound to appkey, publish address not set or wrong
                                   opcode format.
*******************************************************************/
uint32_t sensor_dht_client_get(sensor_dht_client_t *p_client);

/******************************************************************
Function: sensor_dht_client_pending_msg_cancel
Description: Cancel any ongoing reliable message transfer.
Input:    p_client  Sensor dht Client structure pointer      
Output:  
*******************************************************************/
void sensor_dht_client_pending_msg_cancel(sensor_dht_client_t *p_client);

#总结
目前市场上MESH的应用场景多为智能照明,在传感器领域的需求需要进一步的开发。平时多看几遍协议,有利于深入理解MESH特性。
作者目前已不再做蓝牙Mesh相关项目,协议或许有些更新。在2020年时做的sensor model 代码仅供大家参考,请点击sensor model 源码

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

nRF52 Mesh开发 (3) MESH Sensor Server/Client Models详解与实现 的相关文章

  • 环境错误:Gmsh 版本必须 >= 2.0

    我是 fipy 的新手 所以如果我问一些应该显而易见的问题 请原谅我的无知 但我无法运行已经存在的 并且在其他机器上工作的 脚本 无法获取EnvironmentError Gmsh version must be gt 2 0 我可能在安装
  • 使用 python 带有自签名证书的 ssl

    我正在尝试使用我的自签名证书在 python 中构建一个简单的服务器 我使用 makecert 创建了 cer pfx pvk 文件 context ssl create default context ssl Purpose CLIENT
  • 服务器发送事件如何向特定客户端发送响应

    在服务器发送事件中 它总是向所有客户端发送相同的响应 但我想知道的是 如何使用 java 将响应发送到只有一个客户端 这是我在 sw js SSE 内部定义的事件 var eventSource new EventSource HelloS
  • Payara5 服务器将无法部署:未知协议 RFB

    在干净的 eclipse 环境中 payara5 将不会部署 我已经使用 java 1 8 下载了正确版本的服务器 只需将其添加到新服务器即可启动它 我无法摆脱这个错误 payara 登陆页面可以工作 但管理控制台超时 任何帮助表示赞赏 2
  • 如何保持用户登录始终“与服务器连接”

    我正在开发一个应用程序 我希望用户保持登录状态意味着在成功登录后始终连接到服务器 就像 Facebook 应用程序一样 我试图用谷歌搜索这个 但没有找到任何正确的逻辑 许多网站建议使用SharedPreference但保留用户的登录信用 S
  • ipython 服务器无法启动:没有名为 notebook.notebookapp 的模块

    我一直在尝试按照几个教程设置 ipython 服务器 因为没有一个完全符合我的情况 几天前 我确实设法将其启动 但随后无法通过 url 访问它 今天它不再启动了 我找不到太多关于我得到的这个特定错误的信息 Traceback most re
  • 如何使用 Express 和 NGINX 设置路由?

    我正在尝试使用 NGINX 作为反向代理来配置 Express 服务器 NGINX 提供静态文件 Express 提供动态内容 问题 正常的根链接有效 website com 但是当我导航到 website com api 时 我从 NGI
  • 套接字编程中的客户端到客户端消息传递

    我正在开发一个项目 该项目是基于 C 中的 WinSock 的服务器客户端应用程序 我已经完成了服务器和客户端之间通信所需的任何操作 我能够在它们之间发送和接收消息 现在我需要知道如何完成客户端到客户端消息传递部分以及必须如何完成工作 我只
  • Unity3D 带孔动态网格

    从两个顶点列表动态创建一个带有孔的网格 我目前正在尝试动态创建一个带有孔的网格 2D 我有一个轮廓和孔轮廓的 Vector3 顶点列表 我的问题 How would I go about merging these two lists of
  • Unity:将网格物体轻轻包裹在其他网格物体周围?

    给定一个网格 如左侧的立方体对象 和另一个自定义的球状网格 右侧 如果更容易的话 它可以是另一种形状 Unity 和 C 中的一个在运行时如何将第二个网格轻轻包裹在第一个网格周围 谢谢 下面的方法 借助 VirtualMethodStudi
  • 用于发送字符串数据的简单 rpyc 客户端和服务器

    我正在使用 rpyc 在 python 中编写一个程序 我的目标是创建一个简单的服务器 它接受来自客户端的数据字节 字符串 我对 python 和 rpyc 都很陌生 这是我的 server py 代码 from rpyc utils se
  • 如何在 Laravel 中为 20 分钟后的每条新记录制定调度程序任务?

    我有一个停车系统 我使用 Angular 6 Laravel 作为后端 但我有一个具体问题 我不知道正确的方法 公园有两个图腾 它们向我的服务器发送一个条目 只有当客户从出口走出图腾并进入付款区时 我才会检查客户是否无效 这是我的代码 当他
  • 用于平滑开放 3D 网格边缘的算法

    我有一个 3D 网格 它代表一个具有一些粗糙边界的表面 我想对其进行平滑处理 我使用半边数据结构来存储几何图形 因此我可以轻松地迭代边界边 顶点和面 我还可以使用点积和叉积轻松确定给定的一对边是否是凸 凹的 平滑边缘的最佳方法是什么 使它们
  • MongoError:拓扑已关闭,尽管已建立数据库连接,仍请连接

    我正在编写一个 Web 应用程序 它使用异步数据库请求作为 api 的一部分 目前 我有一个异步快速路由 等待异步函数返回函数 这两个函数都返回布尔值并且都查询数据库 第一个可以正常工作 但第二个却不能 这是 MongoClient 设置
  • 服务器显示文本而不是 HTML

    我正在尝试创建一个 C 服务器 它将接受输入并能够通过 html 格式将它们返回给用户 其中服务器充当用户界面 我当前的问题似乎无法弄清楚为什么 C 服务器在 localhost 3838 处将 HTML 代码以文本形式吐出 而不是将其显示
  • 如何防止 Spring Boot 守护进程/服务器应用程序立即关闭/关闭?

    我的 Spring Boot 应用程序不是 Web 服务器 而是使用自定义协议的服务器 在本例中使用 Camel 但是 Spring Boot 在启动后立即停止 优雅地 我该如何防止这种情况 我希望应用程序能够通过 Ctrl C 或以编程方
  • 在 Python 中创建二维非矩形形状的三角形网格

    假设我有一组点定义二维平面中非矩形形状的周长 我需要一个函数来创建三角形网格划分 在其中可以修改三角形单元的数量并返回每个单元的 x y 坐标 谢谢 你可能应该看看 dmsh https github com nschloe dmsh py
  • Tomcat 和 TomEE、TomEE 和 TomEE Plus 之间有什么区别

    我想在服务器中部署 EJB Ear 但我对选择服务器感到非常困惑tomcat TomEE and TomEE Plus 两者有什么区别Tomcat and TomEE 其中有哪些新功能TomEE and TomEE Plus 在什么情况下才
  • 通过PHP从网站上传文件到Amazon EC2服务器

    我有一个网站 bedatify com 我想创建一个页面 人们可以在其中将图像上传到我的亚马逊 EC2 服务器 我检查了类似的问题 例如无法在 Amazon EC2 上上传文件 php https stackoverflow com que
  • 数据包无序。得到:80 预期:0 node.js

    这是我的 非常简单 代码 var connection mysql createConnection infosDB connection connect connection query SELECT FROM action functi

随机推荐

  • cmd/dos批处理脚本出错-is not recognized as an internal or external command

    cmd xff08 dos xff09 批处理脚本执行出现错误 xff1a is not recognized as an internal or external command xff0c 运行中断 脚本文件无语法错误 xff0c 编辑
  • CTF竞赛介绍及刷题网址更新---2020.08

    CTF xff08 Capture The Flag xff09 中文一般译作夺旗赛 xff0c 在网络安全领域中指的是网络安全技术人员之间进行技术竞技的一种比赛形式 CTF起源于1996年DEFCON全球黑客大会 xff0c 以代替之前黑
  • VS2008与Matlab混合编程设置

    VS2008 与MATLAB R2009b 混合编程环境配置 一 xff0c VS2008 中的函数调用matlab的写好的函数 1 Matlab 生成 DLL 1 1 编译器的安装 实验环境 xff1a XP 32 位机MATLAB R2
  • System.console().readPassword() java.lang.NullPointerException

    java核心技术 卷I 书籍中有关 java io Console 类的1个示例 System console readLine 与 System console readPassword 在 idea 中运行出现 java lang Nu
  • Linux man中文手册的安装与使用

    概要 xff1a 在 ubuntu 20 04 中下载 安装使用 man 中文手册 文章目录 linux shell命令学习法宝 man 手册man中文手册的下载 安装及环境变量的配置下载安装环境变量配置及 cman 命令使用 man 中文
  • X window selection --- xclip

    原文 英文 url xff1a https encyclopedia thefreedictionary com X 43 Window 43 selection 本文为笔者的翻译 xff0c 红色部分为笔者增加的批注 文章目录 Activ
  • linux安装xclip实现终端与剪贴板之间的通道

    概要 xff1a ubuntu 20 04 通过安装 xclip 来实现终端与剪贴板之间的数据通道 xff1a xclip 类似 dos 中的 clip命令 xff0c xclip 可将命令执行的结果保存到剪贴板 xff0c 还允许将文件的
  • java中GBK与UTF-8编码的转换

    文章目录 java源文件中中文字符的编码的问题UTF 8和GBK格式的文件相互转换java实现文件编码的转换 java不同编码的字节数组的转换Java判断文件编码格式对于UTF 8格式文件的判断 xff1a 利用cpdetector开源库确
  • GBK编码表

    全国信息技术标准化技术委员会 汉字内码扩展规范 GBK Chinese Internal Code Specification 1 0 版 xff08 按编码顺序排列 xff09 其编码范围 xff1a 8140 xff0d FEFE xf
  • dll文件下载网址

    https cn dll files com
  • windows中dos命令汇总及获取管理员权限

    文章目录 windows 获取管理员权限的2种方式runas 用法 windows dos 命令行语法项windows dos命令总述 windows dos命令详细介绍 win7及以前 微软官网 windows dos命令详细介绍 win
  • windows比cmd更强大的 WMIC命令使用详解

    文章目录 什么是wmic WMIC能做什么 WMIC命令使用帮助文档WMIC命令使用实例wmic的运行方式可以有两种法1 显示进程的详细信息2 停止 暂停和运行服务功能3 显示出BIOS信息4 停止进程的操作5 连接远程电脑6 BIOS 基
  • 编程意识——宏定义封装多个函数参数

    作者 釜薪君 公众号 嵌入式杂牌军 文章目录 前言一 这种意识的来源二 实现源码分析1 函数调用2 宏定义部分3 函数实现4 宏替换后的函数调用 总结 前言 今天带小伙伴们分析一段不错的代码 xff0c 学习一下关于宏封装的一种意识 xff
  • DSP28335的SCI的FIFO中断使用心得

    自学了一段时间的DSP28335的串口设置 xff0c 写下来帮助更多的新手 xff0c 遇到了很多问题也记录一些解决办法 以下全都是我个人的理解 xff0c 可能说的不对 xff0c 大家讨论 1 关于为什么必须用FIFO 一般的DSP系
  • 51单片机堆栈深入剖析

    用C语言进行MCS51系列单片机程序设计是单片机开发和应用的必然趋势 Keil公司的C51编译器支持经典8051和8051派生产品的版本 xff0c 通称为Cx51 应该说 xff0c Cx51是C语言在MCS51单片机上的扩展 xff0c
  • 基于ros_arduino_bridge的智能小车----上位机篇

    基于ros arduino bridge的智能小车 上位机篇 基于ros arduino bridge的智能小车 硬件篇 基于ros arduino bridge的智能小车 下位机篇 ros arduino bridge文件系统 xff08
  • 基于ros_arduino_bridge的智能小车----下位机篇

    基于ros arduino bridge的智能小车 下位机篇 参考文章 xff1a 基于ros arduino bridge的智能小车 上位机篇 基于ros arduino bridge的智能小车 硬件篇 下位机部分实际上可以视作完全独立的
  • 【命令】Python执行命令超时控制【原创】

    目录 参考 概要 方案 方案一 xff1a os system 方案二 xff1a os popen 方案三 xff1a subprocess check output 方案四 xff1a subprocess Popen 方案五 xff1
  • nRF52 Mesh开发 (2) SDK例程Light_switch server 添加一个element控制开发板其他LED灯

    server文件结构 xff1a 使用SEGGER编译的话直接打开 emProject文件即可 xff1b img文件中包含程序运行过程图 xff1b include文件包含该例程下的头文件 xff1b 2 具体操作 xff1a 在main
  • nRF52 Mesh开发 (3) MESH Sensor Server/Client Models详解与实现

    MESH Sensor Model 实现 MESH Spec规定的 Sensor Model 标准传感器状态传感器描述传感器参数设置传感器cadence传感器数据 传感器可发送和接收的消息Sensor Server Client Model