eelcor 18 Posted September 21, 2014 Share Posted September 21, 2014 Hi everybody, People might have read the hackaday post describing the ESP8266. The ESP8266 is a really low price Wifi chip, which uses serial communication (just like the Wifly etc.) to connect to wifi. Although the CC3100 and CC3200 are the better chips, the ESP8266 main differentiating point is its ridiculous low price. I've ordered 8 for $3.50 each (aliexpress). It doesn't seem to support IPv6 out of the box, but there is an SDK, which might open future possibilities. I was thinking to make a library for energia to support the ESP8266. Anyone interested? Are there specific starting points to make this library usable? I am looking at two scenario's: - MQTT client - Relaying sensor data or control. - Web service - Returning a JSON object with sensor data. It would be nice to use the hooks of an ethernet library and only need to process strings/arrays of bytes. Edit: As this wifi dongle uses an UART, how do I create two UARTS on a G2553? Kind regards, Eelco Rouw Automate and yosh 2 Quote Link to post Share on other sites
MORA99 9 Posted September 21, 2014 Share Posted September 21, 2014 I am interested in a lib, even if it cant use the current ethernet interface/framework it could be a good fit for dumb sensors that just send/recieve some data. Quote Link to post Share on other sites
al1fch 5 Posted September 21, 2014 Share Posted September 21, 2014 I'm interested too. This module could be a perfect companion for a 2553 in low powermode, sending datas time to time. For second UART look at SoftwareUart exemple. (hard Uart + soft Uart) Quote Link to post Share on other sites
igor 163 Posted September 22, 2014 Share Posted September 22, 2014 So this device has a low power 32 bit CPU in it. What is the point of an MSP430 connected to it? (i.e., if you add the G2553, e.g., as a peripheral to this device, what does the MSP430 bring to the setup.) Quote Link to post Share on other sites
al1fch 5 Posted September 22, 2014 Share Posted September 22, 2014 Adding some MSP gives : -Energia for application programming (very important for some of us !!) -some proven I/O : GPIO , ADC, UART... -great MSP low powering modes Off course standalone ESP8266 is very interesting too !!! Quote Link to post Share on other sites
cde 334 Posted September 23, 2014 Share Posted September 23, 2014 So this device has a low power 32 bit CPU in it. What is the point of an MSP430 connected to it? (i.e., if you add the G2553, e.g., as a peripheral to this device, what does the MSP430 bring to the setup.) Most boards for the esp only have 2 gpio broken out, lack of technical data, sdk, etc. Quote Link to post Share on other sites
MORA99 9 Posted September 23, 2014 Share Posted September 23, 2014 A small ti/avr/arduino board and just using the ESP as a network module is probaly a lot easyier, and not that much more expensive. Quote Link to post Share on other sites
spirilis 1,265 Posted September 23, 2014 Share Posted September 23, 2014 Anyone find out what sort of MCU core drives this? Sent from my Galaxy Note II with Tapatalk 4 Quote Link to post Share on other sites
al1fch 5 Posted September 23, 2014 Share Posted September 23, 2014 Anyone find out what sort of MCU core drives this? Xtensa from Tensilica (now Cadence) GCC compiler is on the way ...http://www.esp8266.com/viewforum.php?f=9 Quote Link to post Share on other sites
reaper7 67 Posted September 23, 2014 Share Posted September 23, 2014 @@spirilis - we just made ??a milestone single GPIO control as output via AT commands http://www.esp8266.com/viewtopic.php?f=5&t=8&start=20 bluehash, pine and yosh 3 Quote Link to post Share on other sites
eelcor 18 Posted September 24, 2014 Author Share Posted September 24, 2014 Hi everybody, The modules are quite easy to connect and configure. Although the wifi dongle has its own microcontroller, I want to use it with the launchpad. I am not looking to tweak the modules themselves but create simple connected devices. The combination of a value line controller and the ESP8266 yields cheap smart switches and smart objects. Still pondering how the library should be structured... Kind regards, Eelco Quote Link to post Share on other sites
igor 163 Posted October 13, 2014 Share Posted October 13, 2014 Another alternative - EMW3162. Uses Cortex M3 (STM32F205RG) (for those put off by the less common CPU of the ESP8266). Looks like it could be a less expensive ($8.50), more powerful (120MHz, 1M byte of Flash, 128k bytes) alternative to the CC3200.No desire to hijack this thread, but would be curious about comparison between the three platforms. I started a thread on this on stellarisiti, but it seems to be slow showing up. Quote Link to post Share on other sites
bubba198 2 Posted March 11, 2015 Share Posted March 11, 2015 after fighting with the terrible string handling of msp430-g++ I finally got ESP8266 to work with MSP430 G2553 and upload telemetry data to ubidots. This is a REAL working code, no BS. Thanks to all who suggested using standard c str instead of the "String" object. #define SSID "xxxx" #define PASS "xxxxx" #define DST_IP "things.ubidots.com" #define idvariable "xxxxxxxx" // replace with your Ubidots Variable ID #define token "xxxxxxxxxxxxx" // replace with your Ubidots token int len; void setup() { // Open serial communications and wait for port to open: char cmd[254]; Serial.begin(115200); Serial.setTimeout(5000); //test if the module is ready Serial.println("AT+RST"); delay(1000); if (Serial.find("ready")) { //dbgSerial.println("Module is ready"); } else { //dbgSerial.println("Module have no response."); while (1); } delay (1000); //connect to the wifi boolean connected = false; for (int i = 0; i < 5; i++) { if (connectWiFi()) { connected = true; break; } } if (!connected) { while (1); } delay(5000); Serial.println("AT+CIPMUX=0"); } void loop() { int value = analogRead(A0); //you can change ir to another pin int num=0; String var = "{\"value\":"+ String(value) + "}"; num = var.length(); String cmd = "AT+CIPSTART=\"TCP\",\""; cmd += DST_IP; cmd += "\",80"; Serial.println(cmd); if (Serial.find("Error")) return; len=strlen ("POST /api/v1.6/datasources/"); len=len+strlen (idvariable); len=len+strlen ("/values HTTP/1.1\nContent-Type: application/json\nContent-Length: "); char numlenght[4]; // this will hold the length of num which is the length of the JSON element sprintf(numlenght, "%d", num); // saw this clever code off the net; works yay len=len+strlen (numlenght); len=len + num; //fixed length of the string that will print as Content-Length: in the POST len=len+strlen ("\nX-Auth-Token: "); len=len+strlen (token); len=len+strlen ("\nHost: things.ubidots.com\n\n"); len=len+strlen ("\n\n"); Serial.print("AT+CIPSEND="); Serial.println (len); //lenght of the entire data POST for the CIPSEND command of ESP2866 //Serial.println(cmd.length()); if (Serial.find(">")) { //Serial.print(">"); } else { Serial.println("AT+CIPCLOSE"); delay(1000); return; } Serial.print ("POST /api/v1.6/variables/"); Serial.print (idvariable); Serial.print ("/values HTTP/1.1\nContent-Type: application/json\nContent-Length: "); Serial.print (num); Serial.print ("\nX-Auth-Token: "); Serial.print (token); Serial.print ("\nHost: things.ubidots.com\n\n"); Serial.print (var); Serial.println ("\n\n"); delay(9000); //Serial.find("+IPD"); clear the input buffer after the web site responds to the POST while (Serial.available()) { char c = Serial.read(); } delay(1000); } boolean connectWiFi() { Serial.println("AT+CWMODE=1"); String cmd = "AT+CWJAP=\""; cmd += SSID; cmd += "\",\""; cmd += PASS; cmd += "\""; Serial.println(cmd); delay(2000); if (Serial.find("OK")) { return true; } else { return false; } } roadrunner84 1 Quote Link to post Share on other sites
roadrunner84 466 Posted March 11, 2015 Share Posted March 11, 2015 @@bubba198 You do see that you're still using String instead of c-style strings? Also, you're using Serial.print() while also using '\n', though sometimes you use println(). //This code Serial.print ("POST /api/v1.6/variables/"); Serial.print (idvariable); Serial.print ("/values HTTP/1.1\nContent-Type: application/json\nContent-Length: "); Serial.print (num); Serial.print ("\nX-Auth-Token: "); Serial.print (token); Serial.print ("\nHost: things.ubidots.com\n\n"); Serial.print (var); Serial.println ("\n\n"); // Could also be this code Serial.print ("POST /api/v1.6/variables/"); Serial.print (idvariable); Serial.println("/values HTTP/1.1"); Serial.println("Content-Type: application/json"); Serial.print ("Content-Length: "); Serial.println(num); Serial.print ("X-Auth-Token: "); Serial.println(token); Serial.println("Host: things.ubidots.com"); Serial.println(""); Serial.print (var); Serial.println(""); Serial.println(""); Although the second looks a bit more messy, you're splitting the headerlines in a crisp fashion. It's just style, I just like the second one better. Quote Link to post Share on other sites
bluehash 1,581 Posted April 10, 2015 Share Posted April 10, 2015 Just FYI, that this thread is getting attention from twitter. https://twitter.com/ubidots/status/586269901364588544 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.