forked from billroy/socket.io-arduino-client
-
Notifications
You must be signed in to change notification settings - Fork 3
/
params.json
6 lines (6 loc) · 2.56 KB
/
params.json
1
2
3
4
5
6
{
"name": "Socket.io Esp Client",
"tagline": "A socket.io client for the Esp 8266",
"body": "# SocketIO Esp8266 Client \r\n#### an esp client for connecting and messaging with Socket.io servers over https.\r\n\r\nThis implementation is derived from [Bill Roy][1] and [washo4evr][2] implementation you should check out their work. the major difference is that this library is implemented using HTTPS instead of HTTP because it's 2016 :stuck_out_tongue:\r\n\r\n***\r\n\r\n## There are 2 examples included in this repository\r\n* arduino_client\r\n* socket_io_server\r\n\r\n_The socket_io server is a node implementation. to run the server cd into the repository and run the following commands_\r\n```bash\r\nnpm install \\\\Install the dependencies\r\nnode index \\\\Start the server\r\n```\r\n\r\n\r\n### Note\r\n\r\nThis library is not complete here are a list of features which still need to be implemented/fixed over the next few weeks.\r\n\r\n* Socket times out after about 60 seconds.\r\n* Send data from the Esp to the server.\r\n\r\n### Installation instructions\r\n\r\nClone this repository into your Arduino Sketchbook directory under libraries, then restart the Arduino IDE so that it notices the new library. Now, under File\\Examples you should see SocketIOClientSecure. \r\n\r\n### How To Use This Library\r\n\r\n```c++\r\nIPAddress server(104, 198, 98, 11); \r\nconst int httpPort = 8081; \r\nSocketIOClientSecure socketIOClient; \r\n... \r\n... \r\n... \r\nvoid setup() { \t\r\n\tSerial.begin(115200); \t\r\n\t...\r\n\t...\r\n\t//Connect to the server\t \t\r\n\tif (!socketIOClient.connect(server, httpPort)) Serial.println(F(\"Not connected.\")); \t\r\n\tif (socketIOClient.connected()) \t\r\n\t{ \t\r\n\t\t//Send message to server\r\n\t\t//socketIOClient.send(\" Connected !!!!\"); \t\r\n\t}else{ \t\t\r\n\t\tSerial.println(\"Connection Error\"); \t\t\r\n\t\twhile (1); \t\r\n\t} \t\r\n\tdelay(1000); \r\n} \r\nvoid loop(){ \t\r\n\tif (socketIOClient.monitor()){ \t\t\r\n\t\tSerial.println(\"RID\"); \t\t\r\n\t\tSerial.println(RID); \t\t\r\n\t\tif (RID == \"atime\" && Rname == \"time\"){ \t\t\t\r\n\t\t\tSerial.print(\"Time is \"); \t\t\t\r\n\t\t\tSerial.println(Rcontent); \t\t\r\n\t\t} \t\r\n\t}else if(!socketIOClient.connected()) { \t\t\r\n\t\tSerial.println(\"I ran\"); \t\t\r\n\t\tsocketIOClient.connect(server, httpPort); \t\r\n\t} \r\n}\r\n\r\n```\r\n\r\n[1]: https://github.com/billroy/socket.io-arduino-client\r\n[2]: https://github.com/washo4evr/Socket.io-v1.x-Library\r\n",
"note": "Don't delete this file! It's used internally to help with page regeneration."
}