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.

Linux/LAUNCHXL-CC1310: TI 15.4-Stack 2.08.00.04

Part Number: LAUNCHXL-CC1310
Other Parts Discussed in Thread: CC1310, CC1350

Tool/software: Linux

Hi,

I tried to follow the wiki for adding a new sensor but the wiki is outdated (is for a different release).

  • I´m having problems in the file appsrv.c, The latest version of the stack is diferent.
  • Follow all the steps except when the files are different I can run successfull the script buil_all.sh. Then I ran the script run_collector.sh and run_gateway.sh and it opens the browser but I dont have any information from the collector.

Is there a new version of that wiki or was anyone able to add a new sensor to the last release of TI 15.4 stack?

Thank you,

Hélio Pereira

  • Hello microsistemas,

    Can you show me the gateway.sh output? Is the CoP responding?

    Regards,
    AB
  • Hi,

    I attached a picture of the terminal when I start running the collector.sh and the gateway.sh. The CoP blinks the red LED twice when I start the collector.sh.

    #!/bin/bash
    #############################################################
    # @file run_gateway.sh
    #
    # @brief TIMAC 2.0 run_gateway.sh, used by run_demo.sh to launch gateway
    #
    # Group: WCS LPC
    # $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
    #
    #############################################################
    # $License: BSD3 2016 $
    #  
    #   Copyright (c) 2015, Texas Instruments Incorporated
    #   All rights reserved.
    #  
    #   Redistribution and use in source and binary forms, with or without
    #   modification, are permitted provided that the following conditions
    #   are met:
    #  
    #   *  Redistributions of source code must retain the above copyright
    #      notice, this list of conditions and the following disclaimer.
    #  
    #   *  Redistributions in binary form must reproduce the above copyright
    #      notice, this list of conditions and the following disclaimer in the
    #      documentation and/or other materials provided with the distribution.
    #  
    #   *  Neither the name of Texas Instruments Incorporated nor the names of
    #      its contributors may be used to endorse or promote products derived
    #      from this software without specific prior written permission.
    #  
    #   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    #   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    #   THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    #   PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    #   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    #   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    #   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    #   OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    #   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    #   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    #   EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    #############################################################
    # $Release Name: TI-15.4Stack Linux x64 SDK$
    # $Release Date: Sept 27, 2017 (2.04.00.13)$
    #############################################################
    
    nodejs=`which nodejs`
    arch=`uname -m`
    
    if [ x"$nodejs"x != "xx" ]
    then
        # great, we have this
        :
    else
        if [ x"${arch}"x == x"armv7l"x ]
        then
    	# This name should be changed...
    	# however it has not been done yet
    	# SEE:
    	#  lists.debian.org/.../msg00002.html
    	nodejs=`which node`
        fi
    fi
    
    if [ x"$nodejs"x == xx ]
    then
    	echo "Cannot find node-js appplication, is it installed?"
    	exit 1
    fi
    
    if [ ! -f $nodejs ]
    then
    	echo "Cannot find node-js application, is it installed?"
    	exit 1
    fi
    
    if [ ! -x $nodejs ]
    then
        echo "Cannot find node-js application, is it installed?"
        exit 1
    fi
    
    PID=`pidof $nodejs`
    
    if [ "x${PID}x" != "xx" ]
    then
        kill -9 ${PID}
    fi
    
    
    $nodejs ./gateway.js &
    PID=$!
    # Wait a couple seconds for it to get started
    # or ... for it to exit
    sleep 2
    
    if ps -p $PID > /dev/null
    then
        echo "Gateway is running as Process id: ${PID}"
        exit 0
    else
        echo "Cannot start gateway application"
        exit 1
    fi

    Image from terminal

    Thank you,

    Hélio Pereira

  • Try pressing the reset button on the CoP, if this doe snot work try using an earlier version of the CoP. maybe SDK v2.10

    I am setting up a similar environment as you to see if I can recreate.

    Thank you for your patience.

    Regards,
    AB
  • I tried SDK - 2.10.00.36 it happens the same.

    It only happens if I try to build adding a new sensor, if I run the demo from the prebuilt it works ok.

    Maybe it's something I changed in the files when I tried to add a new sensor.

    I attached the files i ´m using.

    Thank you,

    Hélio Pereira

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/156/example.7z

  • It´s working now without the generic sensor, I had an error in collectorapp.html and I had to use a diferent SDK - 2.30.00.20.

    I cannot follow all the parts in the wiki to add a new sensor because it´s for an older version. 

    Is there a new document explaining how to add a new sensor or can you explain me on gateway/collector side where do I have to change to receive data from a generic sensor.

    Thank you,

    Hélio Pereira

  • Hello Helio,

    I am glad you were able to get it to work.

    The file structure for the collector application has not changed that much, and that guide should still be relevant. What steps can you not follow from the guide?

    Regards,
    AB
  • Hi,

    In appsrv.c there is no static void appsrv_deviceSensorData_common function.

    Thank you,
    Hélio Pereira
  • Hello micro,

    Have checked if this function has been renamed to something like : "appsrv_sensordata update" or similar?
  • Hi,

    I managed to receive data in the collector and in the gateway but it took me sometime because the structure of the code has changed and there's no documentation.

    I think the function that handles the sensor data is "appsrv_deviceRawDataUpdate". But it´s different, there´s no reference to the sensor type.

    And in collector.c the function "processSensorData(ApiMac_mcpsDataInd_t *pDataInd)" is not called in any file.

    So I created a function to read the sensor data and store for processing.

    I call my function in "dataIndCB(ApiMac_mcpsDataInd_t *pDataInd)"

    ….
                case Smsgs_cmdIds_sensorData:
                    Collector_statistics.sensorMessagesReceived++;
    				Csf_deviceSensorDisplay(pDataInd);											
                    processDataRetry(&(pDataInd->srcAddr));
                    Csf_deviceRawDataUpdate(pDataInd);
                    SensorData(pDataInd);                        //my function
                    break;
    ….

    Thank you,

    Hélio Pereira