When is the source code for the CosmCloudApp going to be posted and where?
Best regards,
Peter
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.
When is the source code for the CosmCloudApp going to be posted and where?
Best regards,
Peter
Hi Peter,
We are working on the CosmCloud Application. Will update once the app is released.
Regards,
Abhijit
Hi Peter,
I see that there is a Wiki page for this http://processors.wiki.ti.com/index.php/CosmCloudApp. Can you also keep me posted on the release date as I am very interested in getting a project going using it.
Hi Mike,
I wrote my own app since I wanted to get the CC3000 working on something. After unwinding a few problems with connect() I finally got the CC3000 reliably sending data to cosm with the csv protocol which is super simple to use. I will wait for the API to come out before I convert to xml.
Let me know if you want my .
Peter
Hi Peter,
To save re-inventing the wheel, anything that you can offer (code samples or advise) will be appreciated.
Many thanks,
Mike
Hi Mike, I call this routine from the main code:
long http_server_update(void)
{
long lerr;
sockaddr tSocketAddr;
long ulClientSocket;
long SentLen;
unsigned long ulServerIpAddr;
char Request[CC3000_MINIMAL_TX_SIZE];
char sData[50];
char sTemp[50];
unsigned long port;
int len;
int iBytesReceived;
memcpy(Request, 0, sizeof(Request));
memcpy(sData, 0, sizeof(sData));
memcpy(sTemp, 0, sizeof(sTemp));
/*
* Example output:
*
* PUT /api/v2/feeds/84547.csv HTTP/1.1
* Host: api.cosm.com
* X-Apikey: gogtzh2WIzLN-yNqSkkL1aZBasmSAK
* User-Agent: contrary
*Content-Length: 7
* Content-Type: text/csv
* Connection: close
* 0,87
* 1,33
*/
* cosm IP address expressed as long and concatenated
ulServerIpAddr = 2915787293; // gets unwound into correct hex bytes and flipped to little endian
//test idiot cleanup - debugger breaks cause lots of left open sockets
closesocket(0);
closesocket(1);
closesocket(2);
closesocket(3);
// Connect to Cosm
//
tSocketAddr.sa_family = AF_INET;
//
// Web HTTP Port
//
port = htons(80);
memcpy(&tSocketAddr.sa_data[0], &port, sizeof(unsigned short));
// IP addr cosm
ulServerIpAddr = htonl(ulServerIpAddr);
memcpy(&tSocketAddr.sa_data[2], (unsigned char*)&ulServerIpAddr, 4);
// Connect Socket
ulClientSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
lerr = connect(ulClientSocket, &tSocketAddr, sizeof(tSocketAddr));
_no_operation();
if(lerr != ESUCCESS)
{
closesocket(ulClientSocket);
return lerr;
}
//
//make data transmission packet
//
sprintf(Request, "PUT /v2/feeds/%s.csv HTTP/1.1\r\n", FEEDID);
strcat(Request, "Host: api.cosm.com\r\n");
strcat(Request, "Accept: */*\r\n");
strcat(Request, "X-PachubeApiKey: ");
sprintf (sTemp, "%s\r\n", APIKEY);
strcat(Request, sTemp);
// memcpy(sTemp, 0, sizeof(sTemp));
sprintf(sData, "0, %d",TEMPERATURE);
strcat(sData,"\r\n");
sprintf(sTemp,"1, %d",VOLUME);
strcat(sTemp,"\r\n");
strcat(sData,sTemp);
len = strlen(sData);
// last pieces of the HTTP PUT request:
sprintf(sTemp, "Content-Length: %d\r\n\r\n", len);
strcat(Request,sTemp);
strcat(Request,sData);
turnLedOn(CC3000_CLIENT_CONNECTED_IND);
SentLen = send(ulClientSocket, Request, strlen(Request), 0);
if(SentLen <= 0)
{
return SentLen;
}
memcpy(sTemp, 0, sizeof(sTemp));
iBytesReceived = recv(ulClientSocket, sTemp, 50, 0);
turnLedOn(CC3000_SENDING_DATA_IND);
closesocket(ulClientSocket);
{
turnLedOn(CC3000_UNUSED1_IND);
__delay_cycles(100000);
toggleLed(CC3000_UNUSED1_IND);
__delay_cycles(100000);
__no_operation();
}
return ESUCCESS;
}
Obviously this is only the csv version but it sure does work well when the CC3000 is working, which I find is a random event in the best of circumstances. One thing I have consistently random(?!?) problems with is connect(). Sometimes it works and sometimes it doesn't.
Wish TI would publish a V1.8 patch that got around the connect() failure when wlan_start and wlan_stop have been performed.
Hi Peter,
Thank you for the code example.... very much appreciated for your time.
Cheers,
Michael
Hi Peter, Michael,
We have fixed some of the TCP issues and will be part of the new software, I tested the cosm app we have and it behaves more reliable. One issue we noticed in the SP 1.7 software, the tx complete event helps to properly close the socket. We still need to perform more testing on the reliability of the cosm app once the host driver and patch are available.
Pedro
Hi Peter,
The latest release is on-going system testing.
We are working to release it in the next couple of weeks.
Thanks,
Alon.S
Thanks Alon,t
I have been testing my home-grown cosm api and it works some of the time. Problems still seem to be in the TCP portion of the TI API. Tried a couple of workarounds for send and recv but nothing that conclusively stops bad behavior.
Peter
Hi Alon,
I just wondered if you have any news when the Cosm app will be ready for deployment?
I looked on the WIKI page and there suggests that there is a link to the code for the cc3000 but its not active.
Cheers,
Michael
Hi Pedro,
Is there any news on the Cosmcloud app release date? There is a wiki page but it contains a dead link for the download.
Thanks in advance,
Mike
Hi Alon,
Has this project been released yet?
I’m very green to the CC3000 and the MSP430FR57XX series of micro’s. I’m far more experienced with Cypress PSoC and MicroChip PIC’s.
I was looking at Mark’s demo - I have the same kit - youtube video - http://www.youtube.com/watch?v=Uz0xVqUHqb8
Is there demonstration code available for what you have done here with Cosm? I’m currently using a PSoC to connect to COSM - https://cosm.com/feeds/93657, this is a live poultry incubator for our small hobby farm. It works well enough, but it isn’t wifi and I need some demo code to try to get up and running quickly.
All of the COSM related examples for CC3000 are either broken links or state coming soon – on the E2E and TI wiki pages.
Any help or information would be much appreciated.
Regards,
Shawn Cherewick
Protowerx Design Inc.
Hi Shawn,
Apparently the only cloud demo we show now is based on Exosite:
http://exosite.com/project/ti-msp430-cc3000-dev-kit
Regards,
Mark