appzer / pushsafer-arduino-library Goto Github PK
View Code? Open in Web Editor NEWArduino library for Pushsafer.com
Arduino library for Pushsafer.com
Hi,
I really appreciate you made this library but it does not seem to work.
Is it because of the new changes you made a couple of weeks ago?
When I try with Postman, it works.
WiFi connection is successful as well.
My test code below:
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <Pushsafer.h>
// Initialize Wifi connection to the router
// Pushsafer private or alias key
#define PushsaferKey "mykey"
WiFiClientSecure client;
Pushsafer pushsafer(PushsaferKey, client);
void setup() {
Serial.begin(115200);
// Set WiFi to station mode and disconnect from an AP if it was Previously
// connected
WiFi.mode(WIFI_STA);
WiFi.disconnect();
delay(100);
// Attempt to connect to Wifi network:
Serial.print("Connecting Wifi: ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(500);
}
Serial.println("");
Serial.println("WiFi connected");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
pushsafer.debug = true;
struct PushSaferInput input;
input.message = "This is a test message";
input.device = "a";
Serial.println(pushsafer.sendEvent(input));
Serial.println("Sent");
}
void loop() {
}
It doesnt work with an Arduino WiFi R2. The error message shows that: "Error compiling for board Arduino Uno WiFi Rev2."
Is there any easy way to adjust the code to fit that?
Thank you very much!
Latest compile error. Have I missed something?
C:\Users\cruis\Documents\Arduino\libraries\pushsafer-arduino-library-master\src\Pushsafer.cpp: In member function 'String Pushsafer::sendEvent(PushSaferInput)':
C:\Users\cruis\Documents\Arduino\libraries\pushsafer-arduino-library-master\src\Pushsafer.cpp:75:14: error: 'struct PushSaferInput' has no member named 'time2live'
if(input.time2live != "")
^
C:\Users\cruis\Documents\Arduino\libraries\pushsafer-arduino-library-master\src\Pushsafer.cpp:77:72: error: 'struct PushSaferInput' has no member named 'time2live'
start_request = start_request + buildString(boundary, "l", input.time2live);
^
C:\Users\cruis\Documents\Arduino\libraries\pushsafer-arduino-library-master\src\Pushsafer.cpp:113:10: warning: unused variable 'c' [-Wunused-variable]
char c;
^
Hello!
I am currently trying to build a pulse oximeter with an arduino nano and the idea was to make it sand a notification on my phone whether the values were dangerous!
So I used the code of the example on your website but arduino IDE does not recognize the library , so I can’t use the function to send the notification…
Do you have any idea of why this is not working?
Thank you in advance!
Hi, I tried the script through an ESP32 programmed from the Arduino IDE (1.8.9) sending to a Samsung Galaxy S8 Android phone.
The text portions do come through to the phone only if the App is open. Additionally no notifications come in, and if any parameters such as the r or p are changed to a value, the script yields no result at the phone at all.
I also tried from the on-line dashboard to send a message, and the phone responds PERFECTLY. Notifications work, sound works, etc. So I am left to conclude that the problem lies with the script. I'm a very newbie, so I really don't know where to begin to troubleshoot. I'm hoping a fully workable version with notifications and sound could be made with a bit of tweaking by a knowledgeable person.
Arduino version 1.8.13
Experience level (Advanced user)
Library is loaded and re-loaded where it should be. Arduino\libraries\pushsafer-arduino-library
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
//#include <WiFiClient.h>// THis was added to match the sample file used to compile in the
#include <Pushsafer.h>
My header includes are from the example which the test program used to say there isn't a fault, has different include.
I am using one of our official production Wemos D1-mini devices.
"C:\Users\cruis\AppData\Local\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-4-b40a506/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\Users\cruis\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4/tools/sdk/include" "-IC:\Users\cruis\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4/tools/sdk/lwip2/include" "-IC:\Users\cruis\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4/tools/sdk/libc/xtensa-lx106-elf/include" "-IC:\Users\cruis\AppData\Local\Temp\arduino_build_897810/core" -c -Wall -Wextra -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++11 -MMD -ffunction-sections -fdata-sections -fno-exceptions -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10813 -DARDUINO_ESP8266_WEMOS_D1MINI -DARDUINO_ARCH_ESP8266 "-DARDUINO_BOARD="ESP8266_WEMOS_D1MINI"" -DFLASHMODE_DIO -DESP8266 "-IC:\Users\cruis\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266" "-IC:\Users\cruis\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\variants\d1_mini" "-IC:\Users\cruis\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266WiFi\src" "-IC:\Users\cruis\Documents\Arduino\libraries\pushsafer-arduino-library\src" "-IC:\Users\cruis\Documents\Arduino\libraries\ArduinoJson\src" "C:\Users\cruis\Documents\Arduino\libraries\pushsafer-arduino-library\src\Pushsafer.cpp" -o "C:\Users\cruis\AppData\Local\Temp\arduino_build_897810\libraries\pushsafer-arduino-library\Pushsafer.cpp.o"
C:\Users\cruis\Documents\Arduino\libraries\pushsafer-arduino-library\src\Pushsafer.cpp: In member function 'String Pushsafer::sendEvent(PushSaferInput)':
C:\Users\cruis\Documents\Arduino\libraries\pushsafer-arduino-library\src\Pushsafer.cpp:75:14: error: 'struct PushSaferInput' has no member named 'time2live'
if(input.time2live != "")
^
C:\Users\cruis\Documents\Arduino\libraries\pushsafer-arduino-library\src\Pushsafer.cpp:77:72: error: 'struct PushSaferInput' has no member named 'time2live'
start_request = start_request + buildString(boundary, "l", input.time2live);
^
C:\Users\cruis\Documents\Arduino\libraries\pushsafer-arduino-library\src\Pushsafer.cpp:113:10: warning: unused variable 'c' [-Wunused-variable]
char c;
^
Multiple libraries were found for "ArduinoJson.h"
Used: C:\Users\cruis\Documents\Arduino\libraries\ArduinoJson
Not used: C:\Users\cruis\Documents\Arduino\libraries\arduino_863954
Not used: C:\Users\cruis\Documents\Arduino\libraries\ArduinoJson-old
Using library ESP8266WiFi at version 1.0 in folder: C:\Users\cruis\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\libraries\ESP8266WiFi
Using library pushsafer-arduino-library at version 1.0.0 in folder: C:\Users\cruis\Documents\Arduino\libraries\pushsafer-arduino-library
Using library ArduinoJson at version 6.17.3 in folder: C:\Users\cruis\Documents\Arduino\libraries\ArduinoJson
exit status 1
Error compiling for board LOLIN(WEMOS) D1 R2 & mini.
If I remove time2live from the Pushsafer.h file...the file compiles okay, but then the sketch doesn't work with my paid pushsaver account.
I also noted that the samples run last time to show this will compile, was not the standard example file. For example, This was commented out "#include <WiFiClientSecure.h>" and wifiClient.h was used.
Lets compare apples for apples here and look at this issue subjectively please.
in Pushsafer.h String Time2Live; odes not match
Pushsafer.cpp if(input.time2live != "")
I corrected it locally to lowercase in .h as the others were.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.