mbed application board program with most libraries pulled in to create a feature rich starting point for hackathons
Dependencies: C12832_lcd EthernetInterface HTTPClient LM75B MMA7660 mbed-rtos mbed
Fork of HTTPClient_HelloWorld by
AT&T M2M Mobile App Hackathon
- DFW 09-14 & 09-15
- Attendee List
- API Details
- Winning team pitches idea to ATT Executives on Tuesday 09-17-2013
Team's Project Pitch Notes
- Car location and tracking system (GPS + Wifi + Cellular)
- Temperature / auto vent control for home and industrial use (cellular + servo)
- GPS triangulation (sonar + cellular)
- Emergency Tool (Low cost OnStar / Sync Emergency Assistance)
- Remote Video Conference: Tele-presense (cellular and buttons. Rest was web services)
- M2M Billboard (LED + Cellular)
- Order management (restaurants) - Interrupt driven service. Not polled by wait staff (level sensor and cellular)
- pool manager (simulated ph and chem readings -> cellular)
- sprest - learning electronic sprinkler system (simulated moisture and weather readings -> cellular)
- safe traffic signals: stoprite (lots of statistics, used buttons and toy cars to create a scenario)
- Ecosense
Keywords Used Frequently During Presentation
- real-time
- MQTT
- Arduino
- 2lemetry
- HTML5
- Big data
- Server side
Participants
- ARM mbed
- low use. No wifly modules and little/no wired Ethernet
- ATT Github page with arduino stuff
- 2lemetry
- MSFT
- One group hacked on windows phone, rest on android / iphone
- Most were HTML5 (better looking ones)
Pictures from the Event
main.cpp@7:f50a7529de41, 2013-09-15 (annotated)
- Committer:
- atthackathon
- Date:
- Sun Sep 15 22:04:12 2013 +0000
- Revision:
- 7:f50a7529de41
- Parent:
- 5:83c272535884
small updates
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
donatien | 0:0e0debc29569 | 1 | #include "mbed.h" |
atthackathon | 3:71cb394cbb32 | 2 | |
atthackathon | 3:71cb394cbb32 | 3 | // Ethernet |
donatien | 0:0e0debc29569 | 4 | #include "EthernetInterface.h" |
donatien | 0:0e0debc29569 | 5 | #include "HTTPClient.h" |
donatien | 1:d263603373ac | 6 | EthernetInterface eth; |
donatien | 1:d263603373ac | 7 | HTTPClient http; |
atthackathon | 5:83c272535884 | 8 | #define WEBPAGE_BUF_SIZE 4096 |
atthackathon | 5:83c272535884 | 9 | char str[WEBPAGE_BUF_SIZE]; |
donatien | 1:d263603373ac | 10 | |
atthackathon | 3:71cb394cbb32 | 11 | //LCD |
atthackathon | 3:71cb394cbb32 | 12 | #include "C12832_lcd.h" |
atthackathon | 3:71cb394cbb32 | 13 | C12832_LCD lcd; |
atthackathon | 3:71cb394cbb32 | 14 | |
atthackathon | 3:71cb394cbb32 | 15 | // joystick pins and LED |
atthackathon | 3:71cb394cbb32 | 16 | BusIn joystick(p15,p12,p13,p16); |
atthackathon | 3:71cb394cbb32 | 17 | DigitalIn enter(p14); |
atthackathon | 3:71cb394cbb32 | 18 | BusOut led(LED1,LED2,LED3,LED4); |
atthackathon | 3:71cb394cbb32 | 19 | Ticker joystick_to_led; |
atthackathon | 4:1ec9d1243e8b | 20 | void joystickHandler(void) |
atthackathon | 4:1ec9d1243e8b | 21 | { |
atthackathon | 4:1ec9d1243e8b | 22 | led = (enter) ? 0xf : joystick; |
atthackathon | 4:1ec9d1243e8b | 23 | } |
atthackathon | 3:71cb394cbb32 | 24 | |
atthackathon | 3:71cb394cbb32 | 25 | // Accelerometer |
atthackathon | 3:71cb394cbb32 | 26 | #include "MMA7660.h" |
atthackathon | 3:71cb394cbb32 | 27 | MMA7660 accelerometer(p28, p27); |
atthackathon | 3:71cb394cbb32 | 28 | |
atthackathon | 3:71cb394cbb32 | 29 | // RGB LED |
atthackathon | 3:71cb394cbb32 | 30 | PwmOut r(p23); |
atthackathon | 3:71cb394cbb32 | 31 | PwmOut g(p24); |
atthackathon | 3:71cb394cbb32 | 32 | PwmOut b(p25); |
atthackathon | 3:71cb394cbb32 | 33 | |
atthackathon | 3:71cb394cbb32 | 34 | // Temp sensor |
atthackathon | 3:71cb394cbb32 | 35 | #include "LM75B.h" |
atthackathon | 3:71cb394cbb32 | 36 | LM75B temp(p28,p27); |
atthackathon | 3:71cb394cbb32 | 37 | |
atthackathon | 4:1ec9d1243e8b | 38 | //char const *URL = "http://mbed.org/media/uploads/donatien/hello.txt"; |
atthackathon | 5:83c272535884 | 39 | //char const *URL = "http://mbed.org/"; |
atthackathon | 7:f50a7529de41 | 40 | char const *URL = "http://www.att.com/"; |
atthackathon | 5:83c272535884 | 41 | char const MAC[] = {0x00,0x02,0xF7,0xF0,0x00,0x00}; |
atthackathon | 7:f50a7529de41 | 42 | void mbed_mac_address(char *mac) |
atthackathon | 7:f50a7529de41 | 43 | { |
atthackathon | 7:f50a7529de41 | 44 | memcpy(mac, MAC, sizeof(MAC)); |
atthackathon | 7:f50a7529de41 | 45 | } |
atthackathon | 4:1ec9d1243e8b | 46 | |
atthackathon | 3:71cb394cbb32 | 47 | int main() |
donatien | 0:0e0debc29569 | 48 | { |
atthackathon | 4:1ec9d1243e8b | 49 | r = g = b = 1.0f; |
atthackathon | 4:1ec9d1243e8b | 50 | joystick_to_led.attach(&joystickHandler, 0.001f); |
atthackathon | 3:71cb394cbb32 | 51 | lcd.printf ("Bootstrap Complete!\n"); |
atthackathon | 4:1ec9d1243e8b | 52 | |
atthackathon | 3:71cb394cbb32 | 53 | // Prepare to use DHCP |
atthackathon | 4:1ec9d1243e8b | 54 | if (0 != eth.init()) { |
atthackathon | 3:71cb394cbb32 | 55 | error("Init Failed\n"); |
atthackathon | 3:71cb394cbb32 | 56 | } |
atthackathon | 3:71cb394cbb32 | 57 | // Try to get an IPAddress |
atthackathon | 5:83c272535884 | 58 | if (0 != eth.connect(30000)) { |
atthackathon | 7:f50a7529de41 | 59 | error("Connect Failed: Check ethernet connection or try to increase the timeout\n"); |
atthackathon | 3:71cb394cbb32 | 60 | } |
atthackathon | 3:71cb394cbb32 | 61 | // Now we are part of the network |
atthackathon | 3:71cb394cbb32 | 62 | printf("IP Address: %s\n", eth.getIPAddress()); |
atthackathon | 7:f50a7529de41 | 63 | lcd.cls(); |
atthackathon | 7:f50a7529de41 | 64 | lcd.locate(0,0); |
atthackathon | 7:f50a7529de41 | 65 | lcd.printf("TCP/IPv4: %s\n", eth.getIPAddress()); |
donatien | 0:0e0debc29569 | 66 | //GET data |
atthackathon | 7:f50a7529de41 | 67 | printf("Trying to fetch page %s\n", URL); |
atthackathon | 5:83c272535884 | 68 | if(!http.get(URL, str, WEBPAGE_BUF_SIZE)) { |
atthackathon | 3:71cb394cbb32 | 69 | printf("Page fetched successfully - read %d characters\n", strlen(str)); |
atthackathon | 3:71cb394cbb32 | 70 | printf("Result: %s\n", str); |
atthackathon | 3:71cb394cbb32 | 71 | } else { |
atthackathon | 4:1ec9d1243e8b | 72 | printf("Error - HTTP return code = %d\n", http.getHTTPResponseCode()); |
donatien | 0:0e0debc29569 | 73 | } |
atthackathon | 3:71cb394cbb32 | 74 | eth.disconnect(); |
donatien | 0:0e0debc29569 | 75 | |
donatien | 0:0e0debc29569 | 76 | while(1) { |
atthackathon | 7:f50a7529de41 | 77 | // print the temperature to the LCD |
atthackathon | 7:f50a7529de41 | 78 | float tmp_temp = (temp.read() * 1.8f ) + 32.0f; |
atthackathon | 4:1ec9d1243e8b | 79 | lcd.locate(8,10); |
atthackathon | 7:f50a7529de41 | 80 | lcd.printf("Temp: %.1fF", tmp_temp); |
atthackathon | 4:1ec9d1243e8b | 81 | |
atthackathon | 7:f50a7529de41 | 82 | // print and display the gyro data |
atthackathon | 7:f50a7529de41 | 83 | float x = fabs(accelerometer.x()); |
atthackathon | 7:f50a7529de41 | 84 | float y = fabs(accelerometer.y()); |
atthackathon | 7:f50a7529de41 | 85 | float z = fabs(accelerometer.z()); |
atthackathon | 7:f50a7529de41 | 86 | r = 1.0f - x; |
atthackathon | 7:f50a7529de41 | 87 | g = 1.0f - y; |
atthackathon | 7:f50a7529de41 | 88 | b = z; |
atthackathon | 4:1ec9d1243e8b | 89 | lcd.locate(8,20); |
atthackathon | 7:f50a7529de41 | 90 | lcd.printf("X: %2.1f Y:%2.1f Z:%2.1f\n", x, y, z); |
atthackathon | 4:1ec9d1243e8b | 91 | |
donatien | 0:0e0debc29569 | 92 | } |
donatien | 0:0e0debc29569 | 93 | } |