But what I found on the internet is using an external webserver, able to run PHP (or Python) scripts and using a MySQL server to store registration IDs.
So far so good, but why do I need to setup an external server with MySQL and PHP just to send messages to the Android devices. The ESP8266 has server capabilities build-in and has enough storage to save registration IDs in the Flash memory.
What I wanted is:
As I could not find any tutorial or example on the Internet how to achieve this, I started to write the code by myself.
And here is the result:
ESP8266 - Google Cloud Messaging without external server
Of course the code is open source and stored in my Github repository
Hope it helps someone.
yes, if the device can get the gcm api_key, and the android registration id, the device can notify without server.
so the first is to pass the android registration id from app to device,
then make a http request to Gcm server, like this:
POST /gcm/send HTTP/1.1
User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/22.214.171.124 libidn/1.23 librtmp/2.3
registration_ids is a array with android registration ids.
Correct, that is how it works. However I didn't use the "priority" and "time_to_live' keys.
Who is online
Users browsing this forum: No registered users and 1 guest
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
We also have a RTOS version and a MESH version too!
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!