This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ERROR[e27]: WHILE CONFIGURING UART IN SIMPLESENSOR FROM ZSTACK..

Other Parts Discussed in Thread: Z-STACK, CC2530, CC2430

Error[e27]:Entry "HalUARTInit::?relay in module simple sensor"


why am i getting this error while building the project

  • now i got some serious problem :)... i tried calling
    uint16 myApp_ReadTemperature( void );
    and
    uint16 myApp_ReadRh( void );
    in the
    if ( event & MY_REPORT_TEMP_EVT )
    of
    void zb_HandleOsalEvent( uint16 event )
    itself like below...

    if ( event & MY_REPORT_TEMP_EVT )
    {
    // Read and report temperature value
    sensed_temp_data = myApp_ReadTemperature();
    sensed_rh_data = myApp_ReadRh();
    pData[0] = TEMP_REPORT;
    pData[1] = (uint8)( sensed_temp_data/100);//TEMP_REPORT;
    pData[2] = (uint8)( sensed_temp_data%100);
    pData[3] = (uint8)( sensed_rh_data/100);
    pData[4] = (uint8)( sensed_rh_data%100);
    zb_SendDataRequest( 0xFFFE, SENSOR_REPORT_CMD_ID, 5, pData, 0, AF_ACK_REQUEST, 0 );
    osal_start_timerEx( sapi_TaskID, MY_REPORT_TEMP_EVT, myTempReportPeriod );
    }

    collector code:
    void zb_ReceiveDataIndication( uint16 source, uint16 command, uint16 len, uint8 *pData )
    {
    uint8 buf[32];
    uint8 *pBuf;
    uint8 tmpLen;
    uint8 sensorReading;
    uint8 sensorReading1;
    uint8 sensorReading2;
    uint8 sensorReading3;
    char str[120];
    #ifndef HAL_UART
    #define HAL_UART TRUE
    #endif

    sensorReading = pData[3];
    sensorReading1 = pData[4];
    sensorReading2 = pData[1];
    sensorReading3 = pData[2];

    sprintf(str,"Temp= %d""%d""RH= %d""%d\r\n",sensorReading,sensorReading1,sensorReading2,sensorReading3);
    HalUARTWrite(HAL_UART_PORT_0,str,17);
    memset(str,0,sizeof(str));
    }

    am getting the value of Rh and temp like below..

    Temp= 00RH= 137
    Temp= 00RH= 584
    Temp= 00RH= 584
    Temp= 00RH= 584
    Temp= 00RH= 584
    Temp= 00RH= 584
    Temp= 00RH= 584
    Temp= 00RH= 584
    Temp= 00RH= 584
    Temp= 00RH= 137
    Temp= 00RH= 137
    Temp= 00RH= 584
    Temp= 00RH= 584
    Temp= 00RH= 584
    Temp= 00RH= 584
    Temp= 00RH= 584
    Temp= 00RH= 584

    my questions are:
    1) why am i getting the two values in the pdata[1] and [2] itself,
    2) why am not able to get any values from pdata[3]and[4]

    please give me some suggestion on this..
  • Do you make sure sensed_temp_data and sensed_rh_data have data and are assigned to pData[1] ,pData[2] ,pData[3] , and pData[4] correctly before you call zb_SendDataRequest().
  • yes its coming sir
  • What is your sensed_rh_data value in sender side?
  • sensed_rh_data = myApp_ReadRh();
    uint16 value sir..
  • I mean what sensed_rh_data value is after you call myApp_ReadRh()?
  • is that the numeral value asking for??000-999
  • Anyway, let us do some test on your code. If you set the following value to pData[3] and pData[4] and send them, try to see if you can receive it on receiver side.

    pData[3] = (uint8)(56);
    pData[4] = (uint8)(78);

  • i tried the test... if i give the values directly into the pData[0]......pData[8] it works well... sending the value correctly on to the collector node... but if i try to send the sensor value it is sending all the values one at a time, only through pdata[1] and pData[2]... :( i doubt it on the consecutive UART read operation... please give your suggestion here below i have placed my code..



    void zb_HandleOsalEvent( uint16 event )
    {
    uint8 pData[9];
    uint8 dcv[3];
    uint8 dcv1[3];
    uint8 dcv2[3];
    uint16 sensed_temp_data;
    uint16 sensed_rh_data;
    uint16 sensed_co2_data;
    int i;
    if ( event & MY_START_EVT )
    {
    zb_StartRequest();
    }
    if ( event & MY_REPORT_TEMP_EVT )
    {
    //Read and report temperature value
    sensed_temp_data = myApp_ReadTemperature();
    pData[0] = TEMP_REPORT;
    pData[1] = (uint8)( sensed_temp_data/100);//TEMP_REPORT;
    pData[2] = (uint8)( sensed_temp_data%100);
    delay(15);
    //for(i=0;i<3;i++)
    // {
    // sprintf(dcv,"%d",pData[1]);
    //HalUARTWrite(HAL_UART_PORT_0,dcv,3);
    // }*/
    sensed_co2_data = myApp_ReadCo2();
    pData[3] = CO2_REPORT;
    pData[4] = (uint8)( sensed_co2_data/100);
    pData[5] = (uint8)( sensed_co2_data%100);
    delay(15);

    sensed_rh_data = myApp_ReadRh();
    pData[6] = RH_REPORT;
    pData[7] = (uint8)( sensed_rh_data/100);
    pData[8] = (uint8)( sensed_rh_data%100);
    delay(15);

    zb_SendDataRequest( 0xFFFE, SENSOR_REPORT_CMD_ID, 9, pData, 0, AF_ACK_REQUEST, 0 );
    osal_start_timerEx( sapi_TaskID, MY_REPORT_TEMP_EVT, myTempReportPeriod );
    }

    every myAppXXXXXXX() function has a UART write and Read function on it...
  • UART reading might be the root cause of you problem. I would suggest you to create 3 different events, MY_REPORT_TEMP_EVT, MY_REPORT_HUMI_EVT, and MY_REPORT_CO2_EVT to do UART reading separately. After your application collect all three of them, use zb_SendDataRequest to send them in one packet.
  • i have even tried that... in that too values of some sensor is placed on memory space of some other sensor..
  • I don't understand your reply. If you have separated events for UART reading, what is the problem now?
  • hi sir please let me know how to return multiple uint 16 values from a single function using structure, and get the values of the structure members in the void zb_HandleOsalEvent( uint16 event )...
  • The easiest way is to store multiple uint16 value to an array and return it.

  • Can you please explain it with an example
  • uint8 data[6];

    void my_test(uint8 *my_data)

    {

        uint16 temp;

        uint16 humi;

        uint16 co2;

        //Get temp, humi, and co2 value

        my_data[0]=(*uint8)((temp&0xFF00)>>8);

        my_data[1]=(*uint8)((temp&0x00FF));

        my_data[2]=(*uint8)((humi&0xFF00)>>8);

        my_data[3]=(*uint8)((humi&0x00FF));

        my_data[4]=(*uint8)((co2&0xFF00)>>8);

        my_data[5]=(*uint8)((co2&0x00FF));

    }

    You can call my_test(data) and value of temp, humi, and co2 would be put in data array.