Other Parts Discussed in Thread: CC1310
Hi,
My setup:
Sensor
- CC1352R custom board
- RSSI -47..-52 (image 2)
- SDK 3.30.0.03
TI 15.4 stack Linux
- 3.30.00.12
- CC1310 Launchpad as coprocessor with SDK 3.20
I´m sending from the sensor a payload of 160 bytes(233 bytes entire packet) for 64 times with a reporting time of 2s after I receive 64 packets I change the reporting time for 30min. Then in TI 15.4 stack I save the packets to a file and I notice In the data I save I miss a few packets of the 64 I send.
In sensor side I have periodic event in sensor.c function Sensor_process() wich is set after reading the sensors in Sensor Controller Studio. The data is acknowledge by the collector(see image 1)
/*Periodic event*/
if(Sensor_events & SENSOR_SEND_PERIODIC_EVT)
{
/* To set the msg lenght and permissions*/
scs_IRQ_task = false;
scs_PERIODIC_task = true;
/* Read sensors */
readSensors();
/* Process Sensor Reading Message Event */
processSensorMsgEvt();
/* Clear the event */
Util_clearEvent(&Sensor_events, SENSOR_SEND_PERIODIC_EVT);
/* Set clock for next reading */
Ssf_setReadingClock(configSettings.reportingInterval);
/* Clear Flag */
scs_PERIODIC_task = false;
}
I save the packets in appclient.js in the function appC_processDeviceDataRxIndMsg(data). I create write stream it takes around 100us to write to the file.
/* Nodehub Stream ADXL100x data */
if(PRINT_PERFORMANCE)
{
let t0 = now();
}
let ts = Date.now();
log_ADXL100x.write(ts + ',' + nodehub_number.toString() + ',' + adxl100x_Sample_offset.toString()
+ ',' + adxl100x_Sample + '\n');
if(PRINT_PERFORMANCE)
{
let t1 = now();
}
if(PRINT_PERFORMANCE) console.log('\nPerformance '+ (t1-t0).toFixed(4) + 'ms');
/* Nodehub Stream sensor data expect ADXL100x */
if(adxl100x_Sample_offset >= 63){
// current timestamp in milliseconds
let ts = Date.now();
if(PRINT_PERFORMANCE)
{
let t0 = now();
}
log_sensors.write(ts + '|' + deviceData.tempSensor.ambienceTemp.toString() + '|' + deviceData.nodehubTempSensor.temp.toString()
+ '|' + deviceData.nodehubStateSensor.state.toString()+ '|' + deviceData.nodehubStateSensor.g_value.toString()
+ '|' + deviceData.nodehubBatterySensor.volts.toString() + '\n');
if(PRINT_PERFORMANCE)
{
let t1 = now();
}
if(PRINT_PERFORMANCE) console.log('\nPerformance Sensors'+ (t1-t0).toFixed(4) + 'ms');
}
I also disable the file writing in appclient.js and printed in the terminal and it misses data sometimes as well.
Image 1 - wireshark
Image 2 - collectorapp
I attached the log file from collector and the file(test.txt) I write in appclient.js in the third collumn is data index and should be from 0 to 63.
Thank you,
Hélio Pereira