SL6087 AVSAMPLEDEMO SAAMPLE Failed

hi,
I’m using SL6087 and i want to try my first Application (AVSAMPLEDEMo) which will communicate with airvantage M2M cloud and send a data “hello world” to the cloud. I’m using this tutorials https://doc.airvantage.net/display/AVAGENTDOC/Tutorials. i followed step by step this tutorials: i think i succeeded to comunicate my module SL6087 with the airvantage ( ex. I can start the embedded application from the airvantage) but i can’t see the text message (“hello world”). I want to know what’s the problem.

some details :
when running the application the console displays

..
[LOG] [flash] [DEBUG]: "loading flash chunk log"

VM loaded and ready, starting AirVantage Agent
[LUAW] ############## PRELOADING CONFIG #######

+LUALOG: "CONFIG-INFO: Loading persisted configuration"
2014-04-11 12:57:59 GENERAL-INFO: ************************************************************
2014-04-11 12:57:59 GENERAL-INFO: Starting  AirVantage Agent ...
2014-04-11 12:57:59 GENERAL-INFO:      AirVantage Agent: 5.3.2 - Build: Unknown
2014-04-11 12:57:59 GENERAL-INFO:      Lua VM: Open AT Lua 4.0
2014-04-11 12:57:59 GENERAL-INFO:      System: ST AVSampleDemo Sample 1.0.0.20140411111706
2014-04-11 12:57:59 GENERAL-INFO: ************************************************************
[WIP] new TCPSERVER 0x181a41d8
2014-04-11 12:57:59 GENERAL-INFO: Module [AssetConnector] initialized
2014-04-11 12:58:00 GENERAL-INFO: Module [NetworkManager] initialized
2014-04-11 12:58:00 GENERAL-INFO: Module [Time] initialized
2014-04-11 12:58:01 ASSCON-INFO: Received an asset connection from <local ipc=[table 0x18144e60]>:0
2014-04-11 12:58:01 GENERAL-INFO: Module [DeviceManagement] initialized
AirVantage Agent started

+WIND: 15,1,"ORANGE TN",4,"14/04/11,10:58:11+04",6,"0"

+WIND: 7

+WIND: 4

+WIND: 10,"SM",0,"FD",0,"ON",0,"SN",0,"EN",0

+WIND: 11,"95378F45A03564951B9112AB700C3F88",,,,"A0E9206C2811AAFCC5F797681529D3C4","B939F814E758D18254DDEF54C3D17454"
2014-04-11 12:58:02 GENERAL-INFO: Module [Modem] initialized
2014-04-11 12:58:02 GENERAL-INFO: Module [SMSBearer] initialized
2014-04-11 12:58:03 GENERAL-INFO: Module [ServerConnector] initialized
2014-04-11 12:58:03 GENERAL-INFO: ReadyAgent successfully initialized
TRC_ASYNC_SAMPLE:	AWT_TRACE: sample_entryPoint
[WIP] new TCPCLIENT 0x181a4778
[WIP] new spawned TCPCLIENT 0x181a4378
2014-04-11 12:58:03 ASSCON-INFO: Received an asset connection from 127.0.0.1:49152

+WIND: 3

+WIND: 13

+WIND: 1

+WIND: 16
[LOG] [LUA] [DEBUG]: "Preloading package ad"

[LOG] [LUA] [DEBUG]: "Preloading package Agent"
...

on the other side (i.e : Airvantage)
sync.status : synchronized with warning : application read in the system is not available or unknown :frowning:

thanks in advance.

Hello,

The behaviour of this sample is to send the hello world at startup and each minute. So you need to check:

  • the communication configuration in the main.c file:
    " Config.server.autoconnect = {}"
    " Config.server.autoconnect.onboot = 30 "
    " Config.server.autoconnect.period = 1 "
    " Config.network.bearer.GPRS.apn = ‘internet.cxn’ " // Remove this line and use AT+CGDCONT in production
    " Config.server.url=‘http://na.m2mop.net/device/com’ "
    • check APN, server url
    • check pin code (your sim must not required a pin code).
  • do you see any trace which shows the network bearer is correctly mounted?
  • do you see any trace for data sending on the embedded side?

On the server side:

  • Log in AVMS
  • Go on Monitor > Systems and select your system and click on Detail
  • In System detail view, you can click on Timeline. This view allows you to check the communications and the data sent. You must have AWTDA2 communication each minute.

If you want I have a look, you can send me information about your system on AVMS AND the full trace log on the embedded side (you cut the trace in attachment and I need to see what are the trace after).

Regards.

hello,

this is my preload_config function,

void preload_config() {

	char* config =
	" print('############## PRELOADING CONFIG #######')"
	" require 'Config' "
	" Config.server.autoconnect = {}"
	"Config.server.autoconnect.onboot = 30"
	" Config.server.autoconnect.period = 1 "
	" Config.network.bearer.GPRS.apn = 'weborange' "
    " Config.server.url='http://na.m2mop.net/device/com' "
	" Config.commit()";
	luaW_run(config);
}

on the embedded side the trace log displays

2014/04/11;16:17:00:616;002;ADL;1;Embedded : Appli Init
2014/04/11;16:17:00:617;001;ADL;20;[ADL] tmr subs ; id 0 ; hdlr 002A04A1 ; val 50 ; cycl 0
2014/04/11;16:17:49:547;001;ADL;1;Binary header at 002A0000
2014/04/11;16:17:49:548;001;ADL;16;[ADL PORT] subs (002A2D75) : 0
2014/04/11;16:17:49:549;001;ADL;16;[ADL PORT] subs (002A4A0D) : 1
2014/04/11;16:17:49:549;002;ADL;22;[ADL] flash subs 2 : -4
2014/04/11;16:17:49:549;003;ADL;22;Flh Obj 0000 Len : 4
2014/04/11;16:17:49:549;004;ADL;22;Read Flh Obj 0000 (4) : 0
2014/04/11;16:17:49:549;005;ADL;16;[ADL PORT] event : 0 (port 80 ; state 0)
2014/04/11;16:17:49:550;001;ADL;22;Flh Obj 0000 Len : 4
2014/04/11;16:17:49:550;002;ADL;16;[ADL PORT] unsubs (1) : 0
2014/04/11;16:17:49:551;001;ADL;16;[ADL PORT] event : 0 (port 03 ; state 0)

Your configuration seems ok but you didn’t supply the good embedded trace. What I’m looking for is something like:

or

in the console view like you have done on your first post but I need what is following. I don’t need ADL trace at this moment.

Do you see your communication in the timeline on AVMS?

What I’m trying to discover it’s if your device have communication. In a second step, we will looking for if the data is sent.

Regards.

Hello,
Yes I see a communication (OMADM Communication ) in the timeline on AVMS and the communication status logo is green.
the console displays a loop of these traces

....
[LOG] [flash] [DEBUG]: "loading flash chunk sched"

[LOG] [flash] [DEBUG]: "loading flash chunk log"

VM loaded and ready, starting AirVantage Agent
[LUAW] ############## PRELOADING CONFIG #######

+LUALOG: "CONFIG-INFO: Loading persisted configuration"
2014-04-14 11:04:33 GENERAL-INFO: ************************************************************
2014-04-14 11:04:33 GENERAL-INFO: Starting  AirVantage Agent ...
2014-04-14 11:04:33 GENERAL-INFO:      AirVantage Agent: 5.3.2 - Build: Unknown
2014-04-14 11:04:33 GENERAL-INFO:      Lua VM: Open AT Lua 4.0
2014-04-14 11:04:33 GENERAL-INFO:      System: OXIA AVSampleDemo Sample 1.0.0.20140414110039
2014-04-14 11:04:33 GENERAL-INFO: ************************************************************
[WIP] new TCPSERVER 0x181a4208
2014-04-14 11:04:33 GENERAL-INFO: Module [AssetConnector] initialized
2014-04-14 11:04:34 GENERAL-INFO: Module [NetworkManager] initialized
2014-04-14 11:04:34 GENERAL-INFO: Module [Time] initialized
2014-04-14 11:04:35 ASSCON-INFO: Received an asset connection from <local ipc=[table 0x18141380]>:0
2014-04-14 11:04:35 GENERAL-INFO: Module [DeviceManagement] initialized
AirVantage Agent started

+WIND: 15,1,"ORANGE TN",4,"14/04/14,09:04:25+04",6,"0"

+WIND: 7

+WIND: 4

+WIND: 10,"SM",0,"FD",0,"ON",0,"SN",0,"EN",0

+WIND: 11,"95378F45A03564951B9112AB700C3F88",,,,"5D17BD50B861E83724E7A62195598663","038CC83C86D037000616940513903271"
2014-04-14 11:04:36 GENERAL-INFO: Module [Modem] initialized
2014-04-14 11:04:37 GENERAL-INFO: Module [SMSBearer] initialized
2014-04-14 11:04:37 GENERAL-INFO: Module [ServerConnector] initialized
2014-04-14 11:04:37 GENERAL-INFO: ReadyAgent successfully initialized
TRC_ASYNC_SAMPLE:	AWT_TRACE: sample_entryPoint
TRC_ASYNC_SAMPLEE:	anisanisanis : here you are inside avsampledemo_main
[WIP] new TCPCLIENT 0x181a47a8
[WIP] new spawned TCPCLIENT 0x181a43a8
2014-04-14 11:04:38 ASSCON-INFO: Received an asset connection from 127.0.0.1:49152

+WIND: 3

+WIND: 13

+WIND: 1

+WIND: 16
[LOG] [LUA] [DEBUG]: "Preloading package ad"

[LOG] [LUA] [DEBUG]: "Preloading package Agent"
.
.
.
[LOG] [flash] [DEBUG]: "loading flash chunk sched"

[LOG] [flash] [DEBUG]: "loading flash chunk log"

VM loaded and ready, starting AirVantage Agent
[LUAW] ############## PRELOADING CONFIG #######

+LUALOG: "CONFIG-INFO: Loading persisted configuration"
2014-04-14 11:05:20 GENERAL-INFO: ************************************************************
2014-04-14 11:05:20 GENERAL-INFO: Starting  AirVantage Agent ...
2014-04-14 11:05:20 GENERAL-INFO:      AirVantage Agent: 5.3.2 - Build: Unknown
2014-04-14 11:05:20 GENERAL-INFO:      Lua VM: Open AT Lua 4.0
2014-04-14 11:05:20 GENERAL-INFO:      System: OXIA AVSampleDemo Sample 1.0.0.20140414110039
2014-04-14 11:05:20 GENERAL-INFO: ************************************************************
[WIP] new TCPSERVER 0x181a41d8
2014-04-14 11:05:20 GENERAL-INFO: Module [AssetConnector] initialized
2014-04-14 11:05:21 GENERAL-INFO: Module [NetworkManager] initialized
2014-04-14 11:05:21 GENERAL-INFO: Module [Time] initialized
2014-04-14 11:05:22 ASSCON-INFO: Received an asset connection from <local ipc=[table 0x18144d08]>:0
2014-04-14 11:05:22 GENERAL-INFO: Module [DeviceManagement] initialized
AirVantage Agent started

+WIND: 15,1,"ORANGE TN",4,"14/04/14,09:05:10+04",6,"0"

+WIND: 7

+WIND: 4

+WIND: 10,"SM",0,"FD",0,"ON",0,"SN",0,"EN",0

+WIND: 11,"95378F45A03564951B9112AB700C3F88",,,,"FA3D4A38C52BF876D60674A32002E41A","A2D683E221D24299082960FE6C8AEED3"
2014-04-14 11:05:23 GENERAL-INFO: Module [Modem] initialized
2014-04-14 11:05:23 GENERAL-INFO: Module [SMSBearer] initialized
2014-04-14 11:05:24 GENERAL-INFO: Module [ServerConnector] initialized
2014-04-14 11:05:24 GENERAL-INFO: ReadyAgent successfully initialized
TRC_ASYNC_SAMPLE:	AWT_TRACE: sample_entryPoint
TRC_ASYNC_SAMPLEE:	anisanisanis : here you are inside avsampledemo_main
[WIP] new TCPCLIENT 0x181a4778
[WIP] new spawned TCPCLIENT 0x181a4378
2014-04-14 11:05:24 ASSCON-INFO: Received an asset connection from 127.0.0.1:49152

i didn’t known where is the problem :frowning:

Hello,

From the traces we can see that the AirvantageAgent was successfully initialized

2014-04-14 11:04:37 GENERAL-INFO: ReadyAgent successfully initialized
TRC_ASYNC_SAMPLE:   AWT_TRACE: sample_entryPoint
TRC_ASYNC_SAMPLEE:   anisanisanis : here you are inside avsampledemo_main

As a consequence I suppose that the device reboots while it is executing your code.

Is it possible to have the piece of your code that run in the callback given to the ReadyAgent_Start function ?
And ideally in the callback of AWT_ASYNC_Run and AWT_HL_A_DataManager_Create functions ?

Moreover, if you use the developer studio you can get some informations about the reasons of your reboots:
1/ Go to the TargetManagement perspective and open the backtraces view
2/ On the top panel, specify the AXF file of your application
3/ The refresh button (a double yellow arrow icon) should be enable, click it and wait few seconds
=> stacktraces should be displayed, they will help you to find out the reason of your reboot.

hello,
I opened the backtraces view but it display nothing : No backtraces …
This is the code you asked,
main.c

void agent_init(u8 ID, void* ctx) {

	/* initialize the internet & TCP/IP plug-In */
	wip_netInitOpts(
		/* Comment the following line to suppress low-level traces: */
		WIP_NET_OPT_DEBUG_PORT, WIP_NET_DEBUG_PORT_USB, // low level traces put UART1 if using Serial
		WIP_NET_OPT_END);

	luaW_start( & setup);
	luaW_run("require 'log'; log.setlevel('INFO'); log.uart=0; require 'at.atpluslua'");
	wip_debug("VM loaded and ready, starting AirVantage Agent\n");
	preload_config();
	ReadyAgent_Start(avsampledemo_entryPoint);
	wip_debug("AirVantage Agent started\n");
}

void main_task ( void )
{
	adl_InitGetType ();
    TRACE (( 1, "Embedded : Appli Init" ));

    adl_atCmdSend("AT+WDSC=3,1", NULL, NULL);

    /* Allows to get the uart1 access to act on the gateway before Ready Agent launching. */
    adl_tmrSubscribe (FALSE, 50, ADL_TMR_TYPE_100MS, agent_init);
}

sample.c

int avsampledemo_entryPoint()
{
  AWT_TRACE(TRC_ASYNC_SAMPLE, "AWT_TRACE: sample_entryPoint");
  // AWT_ASYNC_Run must be called to initialize the asynchronous communication framework
  AWT_ASYNC_Run(0, NULL, avsampledemo_main);

  return 0;
}

void avsampledemo_main(int argc, char **argv)
{
    // Create a DataManager for our Asset, and define a callback to receive the asynchronous events from the Agent
    // This call must return AWT_STATUS_ASYNC
    AwtStatus res = AWT_HL_A_DataManager_Create(&pDataManager, ASSET_ID, HLEventCallback, NULL);
    AWT_TRACE(TRC_ASYNC_SAMPLE, "inside avsampledemo_main");
    if (res != AWT_STATUS_ASYNC)
    {
    	AWT_TRACE(TRC_ASYNC_SAMPLE, "on condition if of avsampledemo_main");
        wip_debug("AWT_HL_A_DataManager_Create returns unexpected result %d\n", res);
        return;
    }
    // Here the manager is *not* ready yet.
}

In fact i just followed the Airvantage tutorial but it doesn’t work :frowning:

Hello ,
Can someone explain me why the application AVSAMPLEDEMO didn’t send a text message just after starting it and thx for help??
By accident I removed the SIM when the application is running and i got these trace in the console

[LOG] [flash] [DEBUG]: "loading flash chunk require"

[LOG] [flash] [DEBUG]: "loading flash chunk sched"

[LOG] [flash] [DEBUG]: "loading flash chunk log"

VM loaded and ready, starting AirVantage Agent
[LUAW] ############## PRELOADING CONFIG #######

+LUALOG: "CONFIG-INFO: Loading persisted configuration"
2014-04-16 14:37:34 GENERAL-INFO: ************************************************************
2014-04-16 14:37:34 GENERAL-INFO: Starting  AirVantage Agent ...
2014-04-16 14:37:34 GENERAL-INFO:      AirVantage Agent: 5.3.2 - Build: Unknown
2014-04-16 14:37:34 GENERAL-INFO:      Lua VM: Open AT Lua 4.0
2014-04-16 14:37:34 GENERAL-INFO:      System: ST AVSampleDemo Sample 1.0.0.20140418102401
2014-04-16 14:37:34 GENERAL-INFO: ************************************************************
[WIP] new TCPSERVER 0x181a41d8
2014-04-16 14:37:35 GENERAL-INFO: Module [AssetConnector] initialized
2014-04-16 14:37:35 GENERAL-INFO: Module [NetworkManager] initialized
2014-04-16 14:37:35 GENERAL-INFO: Module [Time] initialized
2014-04-16 14:37:36 ASSCON-INFO: Received an asset connection from <local ipc=[table 0x181348e0]>:0
2014-04-16 14:37:36 GENERAL-INFO: Module [DeviceManagement] initialized
AirVantage Agent started
2014-04-16 14:37:37 GENERAL-ERROR: Failed to initialize module [Modem], err=Failed to guess PIN status, reported error=+CME ERROR: 10
2014-04-16 14:37:37 GENERAL-ERROR: Failed to initialize module [SMSBearer], err=depends on [Modem] that did not initialize successfully
2014-04-16 14:37:38 GENERAL-INFO: Module [ServerConnector] initialized
2014-04-16 14:37:38 GENERAL-ERROR: ReadyAgent initialization finished with some errors:
2014-04-16 14:37:38 GENERAL-ERROR: 	 [SMSBearer] failed with depends on [Modem] that did not initialize successfully
2014-04-16 14:37:38 GENERAL-ERROR: 	 [Modem] failed with Failed to guess PIN status, reported error=+CME ERROR: 10
TRC_ASYNC_SAMPLE:	AWT_TRACE: sample_entryPoint
[WIP] new TCPCLIENT 0x181a45e8
TRC_ASYNC_SAMPLE:	inside avsampledemo_main
[WIP] new spawned TCPCLIENT 0x181a4358
2014-04-16 14:37:38 ASSCON-INFO: Received an asset connection from 127.0.0.1:49152
2014-04-16 14:37:38 BEARER-INFO: Bearer GPRS start: Waiting for SIM card...

So i re-inserted the SIM and by chance the application send the text message to the cloud but just for once!! what’s my problem ?

2014-04-16 14:37:38 ASSCON-INFO: Received an asset connection from 127.0.0.1:49152
2014-04-16 14:37:38 BEARER-INFO: Bearer GPRS start: Waiting for SIM card...

+WIND: 13

+WIND: 1
2014-04-16 14:38:06 SRVCON-INFO: Send http request to http://na.m2mop.net/device/com, body size = 34
[WIP] new TCPCLIENT 0x181a4398
[WIP] closing TCPCLIENT 0x181a4398

+WIND: 15,1,"ORANGE TN",4,"14/04/18,14:23:12+04",6,"0"

+WIND: 16
2014-04-16 14:38:09 NETMAN-WARNING: Cannot mount 'GPRS', 'GPRS' retrying(2)

+WIND: 4

+WIND: 10,"SM",0,"FD",0,"ON",0,"SN",0,"EN",0

+WIND: 11,"95378F45A03564951B9112AB700C3F88",,,,"6C2ACB173FBD8C49117BD2A3F28F4902","4AD0D4FFD7C1325248BD677110EC986A"
[GPRS]: open: -> DISCONNECTED
[GPRS]: start: -> CONNECTING
2014-04-16 14:38:14 BEARER-INFO: Bearer start: in progress...
[GPRS]: GPRS CTX (cid=4) found
[GPRS]: GPRS EVENT SETUP OK (cid=4): GPRS activate
[GPRS]: GPRS CTX (cid=4) found
[GPRS]: GPRS EVENT: 27 (cid=4)

+WIND: 15,1,"Orange Tn",2,"Orange Tn",3,"+04",4,"14/04/18,14:23:28+04",6,"0"
[GPRS]: GPRS CTX (cid=4) found
[GPRS]: GPRS EVENT ACTIVATE OK (cid=4)
[GPRS]: GPRS: -> CONNECTED
2014-04-16 14:38:17 BEARER-INFO: Bearer start: success
2014-04-16 14:38:17 NETMAN-INFO: 'GPRS' mounted
2014-04-16 14:38:17 NETMAN-INFO: Selected, default route through 'GPRS'
[WIP] new UDP 0x181a5038
[WIP] new TCPCLIENT 0x181a5098
TRC_ASYNC_SAMPLE:	data pushe 
[WIP] new TCPCLIENT 0x181a4238
[WIP] closing TCPCLIENT 0x181a5098
2014-04-18 14:23:34 TIME-INFO: Time successfully synchronized to Fri Apr 18 14:23:34 2014, applied offset: 1.71911973415734e5s
[WIP] closing UDP 0x181a5038
2014-04-18 14:23:34 SRVCON-INFO: Send http request to http://na.m2mop.net/device/com, body size = 74
[WIP] new TCPCLIENT 0x181a4738
[WIP] closing TCPCLIENT 0x181a4238
2014-04-18 14:23:37 SRVCON-INFO: Send http request to http://na.m2mop.net/device/com, body size = 34
[WIP] new TCPCLIENT 0x181a4778
[WIP] closing TCPCLIENT 0x181a4738
[WIP] closing TCPCLIENT 0x181a4778
AWTDACOM_FORCE_CONNECTION_TO_SERVER_EVENT success
TRC_ASYNC_SAMPLE:	message sent to the server successfully
2014-04-18 14:24:00 SRVCON-INFO: Send http request to http://na.m2mop.net/device/com, body size = 34
2014-04-18 14:24:00 SRVCON-INFO: Send http request to http://na.m2mop.net/device/com, body size = 34
[WIP] new TCPCLIENT 0x181a5268
[WIP] closing TCPCLIENT 0x181a5268
2014-04-18 14:25:00 SRVCON-INFO: Send http request to http://na.m2mop.net/device/com, body size = 34
[WIP] new TCPCLIENT 0x181a5268
[WIP] closing TCPCLIENT 0x181a5268
2014-04-18 14:26:00 SRVCON-INFO: Send http request to http://na.m2mop.net/device/com, body size = 34
[WIP] new TCPCLIENT 0x181a5268
.
.
.

I’m waiting for any help, and thank you in advance.