Hi group!
Here is how I use an ESP8266 with PBP. In the attached example I show you how to use PushingBox and ThingSpeak services. I'm sorry it's not a full working project.
This example suppose you know how to use Darrel's DT_INTS-18.
I'm using a PIC18F25K22 @64MHz. A clock that fast may not be required, it's yours to test it out! You must use a PIC18 because a big receiving buffer is required. It's a matter of memory banks.
There a lot of hserout2 for debugging purposes. There is no handling of any HTTP response, sorry!
Watch out: The ESP8266 works @3V. You need a level shifter on the RX & reset pins of the ESP, a resistor divider is enough. The TX of the ESP can drive the RX on the PIC without level shifting.
This is how to push data to ThingSpeak (here 3 fields with values 5, 255 & 300):
Code:
GET /update?key={my_API_key}&field1=5&field2=255&field3=300&headers=false HTTP/1.1{CrLf}Host: api.thingspeak.com{CrLf}Connection: close{CrLf}Accept: */*{CrLf}{CrLf}
- Replace {CrLf} by CrLf ( 13, 10 )
- Replace {my_API_key} with your API key
- The keyword "headers=false" will remove extra headers from response.
- The keyword "Connection: close" will close the connection automatically.
See ThingSpeak doc for more. Note: ThingSpeak is limitted to one call every 15 seconds max.
PushingBox is nice to push to several services (email, Twitter) in a single call. Note: strings must be URL encoded. Here is an online tool: http://meyerweb.com/eric/tools/dencoder/
For my lawn mower project I'm using an external I2C EEPROM to store my URL encoded tweets. The data is URL encoded and dumped using VB.NET:
Code:
Dim UrlEncoded As String = System.Web.HttpUtility.UrlEncode(MyString)
Debug.WriteLine(UrlEncoded)
Without Darrel's work a LOT of projects wouldn't exists. Thank you and RIP Darrel...
IOT_Demo.pbp.txt
ESP8266_Base.pbp.txt
Bookmarks