Att M2x File Upload#q=at&t M2x Picture Storage
What IoT really stands for? In guild to analyze in more depth, the bailiwick nosotros need to define some basic concepts about this kind of immature engineering. IoT is the acronym of Net of Things, a network of hardware, mainly used for automation and information logging in order to simplify every day tasks both in manufacture and in every day life. Usually these kind of equipment are connected together to form a network over the internet.
The beginning mentioning of IoT was fabricated in 1999 by Kevin Ashton during ane of his presentation. Todays IoT is all around us starting from uncomplicated smart gadgets mainly designed for abode and function utilize till serious surveillance and security systems used by the military and airports.
As you can see on the beginning image a basic IoT network is fabricated out of 3 components. The beginning, WeMos the starting indicate of the concatenation – takes care of collecting data and transmitting to the closest WiFi hotspot. The 2d is a common WiFi equipped router, links the WeMos to the net. The third one is AT&Ts cloud service, called M2X. No, it is not total of vegetables every bit presented on the motion-picture show. It takes care of collecting and storing the data transmitted by the WeMos.
But how can we setup fast and for low price such a device? Really it is more cheap and piece of cake as it sounds. There are several online platforms available nowadays for IoT projects. Ane of the best is called M2X and information technology is developed by AT&T corporation. Its complimentary version has some limitations of form, but comes with a lot of advantages:
- Large and explicit documentation
- Huge number of APIs for numerous environments similar Arduino, Python, PHP, C, Java, JavaScript, .NET and many others
- Piece of cake to use
- Gear up fabricated charts, maps and triggers
One of the cheapest hardware solution I could detect for WiFi based applications is the then called WeMos D1 R2, which cost me around vii euros from a local store here in Košice. Which is a proficient price if we go on in mind what we get for that cost, lets run across the specifications:
- 80 or 160MHz selectable operating frequency
- 11 IO pins: 1 analog input, PWM/I2C/one-wire support (except D0 pin)
- 3v3 voltage level
- 4MB wink
- ESP8266 chipset
- Http host and customer support
- Wifi capability
There are two methods how you can easily wink the Wemos D1:
- Arduino IDE: information technology is possible to write and compile software straight in Arduino official IDE, with the necessary libraries installed, in C/C++ linguistic communication, this article volition deal with this method.
- NodeMCU: the original IDE for managing these boards, its language is Python
Hopefully yous already take the latest Arduino IDE downloaded and installed on your PC, if non you can get information technology from this link: arduino-1.8.seven-windows.exe
Step ane:
Fire it up, and become to File -> Preferences (or shortcut Ctrl + comma ) , than re-create the following address into the Additional Boards Managing director URLs:http://arduino.esp8266.com/stable/package_esp8266com_index.json
Step 2:
After this pace, get to Tools -> Board: "electric current board" -> Boards Director. In the search bar type ESP82666, and download the ESP8266 library developed by ESP8266 Customs.
Afterward installing the library select the respective lath (in this case WeMos D1 R1), from Tools -> Lath: "WeMos D1 R1".
Information technology is recommended to try flashing your board before getting into more serious things with a uncomplicated Blink code, to verify if the installed libraries are upwardly and running fine. For this job yous tin can find a lot of examples under Files -> Examples.
Step 3:
If everything went as information technology was supposed to be it is time to download the library for Arduino from AT&T Github page (link: https://github.com/attm2x/m2x-arduino ) and install it with the in-built *.zip installer, (Sketch -> Include Library -> Add .Aught library).
Step 4:
For now we are finished with the necessary hardware and software preparation, it is fourth dimension to create a new account or login into the existing one, at https://m2x.att.com and create a new device.
The last footstep on the AT&Ts website is to Add a new stream to the device.
Step 5:
Everything is ready to exam out the setup. For this paste this code into your IDE:
| 1 2 3 4 five 6 7 8 9 10 11 12 13 fourteen 15 sixteen 17 18 19 20 21 22 23 24 25 26 27 28 29 xxx 31 32 33 34 35 36 37 38 39 forty 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 threescore 61 62 63 64 65 66 | #include <ESP8266WiFi.h> #define ESP8266_PLATFORM #include "M2XStreamClient.h" char ssid [ ] = "change it" ; // your network SSID (name) char pass [ ] = "change it" ; // your network password (use for WPA, or apply every bit key for WEP) int keyIndex = 0 ; // your network cardinal Index number (needed only for WEP) int condition = WL_IDLE_STATUS ; char deviceId [ ] = "GET It FROM M2X" ; // Device you lot want to push to char streamName [ ] = "GET It FROM M2X" ; // Stream y'all want to push to char m2xKey [ ] = "Get Information technology FROM M2X" ; // Your M2X access key const int temperaturePin = 0 ; WiFiClient client ; M2XStreamClient m2xClient ( & client , m2xKey ) ; void setup ( ) { Serial . brainstorm ( 9600 ) ; while ( status != WL_CONNECTED ) { Series . print ( "Attempting to connect to SSID: " ) ; Serial . println ( ssid ) ; // Connect to WPA/WPA2 network. Change this line if using open or WEP network: status = WiFi . begin ( ssid , pass ) ; // wait x seconds for connection: delay ( 10000 ) ; } Serial . println ( "Connected to wifi" ) ; printWifiStatus ( ) ; } void loop ( ) { int randomValue = random ( 1995 ) ; //generating a random number betwixt 0 - 1995 Series . print ( "random value: " ) ; Serial . println ( randomValue ) ; int response = m2xClient . updateStreamValue ( deviceId , streamName , degreesC ) ; Serial . print ( "M2x client response code: " ) ; Serial . println ( response ) ; if ( response == - 1 ) while ( 1 ) ; delay ( 1000 * lx ) ; // sends a random value every 1 minutes } void printWifiStatus ( ) { // impress the SSID of the network you're attached to: Serial . print ( "SSID: " ) ; Serial . println ( WiFi . SSID ( ) ) ; // print your WiFi shield's IP address: IPAddress ip = WiFi . localIP ( ) ; Serial . print ( "IP Accost: " ) ; Series . println ( ip ) ; // impress the received signal force: long rssi = WiFi . RSSI ( ) ; Serial . impress ( "signal forcefulness (RSSI):" ) ; Serial . impress ( rssi ) ; Serial . println ( " dBm" ) ; } |
I would like to mention that I am not the author of this source code, I accept just modified the original instance lawmaking that was included in the examples library by AT&T.
Later on uploading the source code to the WeMos D1 and refreshing M2X you lot should run across the incoming information from your device, something similar as mine on the right.
Wait! There are more possibilities with M2X! You lot can create custom dashboards, where you tin add together widgets like charts (bar, radial), stream activity, geographic maps. Also these widgets can be embedded into external websites, like the ane beneath:
Basically this would exist the main idea backside IoT, how you send information to a remote server and store it. Of class there is much more what could be done, similar sending commands to the WeMos D1 R2 or storing and besides analyzing the remotely received data. This volition be an other article, how many other things you can do with these cheap equipment. Possibilities are unlimited.
gilbertsonoweig1954.blogspot.com
Source: http://fodor95.com/2018/12/getting-started-with-wemos-d1-and-att-m2x-iot-platform/
Post a Comment for "Att M2x File Upload#q=at&t M2x Picture Storage"