How to send a Picture using Arduino and ESP8266

Pushsafer make it easy and safe to get push-notifications in real time on your Android or Windows mobile device, iPhone, iPad and Desktop!

Mit Pushsafer kann man in Echtzeit, einfach und sicher, Push-Benachrichtigungen auf sein iPhone, iPad, Android oder Windows Gerät sowie auf den Desktop senden lassen!

======================
Google Play
App Store
Windows Store
Homepage
tobbeg

How to send a Picture using Arduino and ESP8266

Postby tobbeg » 29. May 2017, 22:53

Hi
I have Everything working fine sending notifications with dynamic data,
but I seem not get it right sending a Picture, or sending the weblink of a Picture I want to be displayed in the
pushsafer notifications?

What am I getting wrong here?

I use http.post and it works all fine, but I don't get the Picture in my iPhone?

CODE
====
Message += String(F("&p=data:image/jpeg;base64,"));
Message += rbase64.encode(F("weblink of my Picture.jpeg"));

Weblink is made of http: followed by //iot.mydomain.se/filename with .jpeg in the end
(Hope you get it since I am not allowed rtio send the correct weblink :-)

Above is part of the message sent, but my iPhone only shows a very small 2mm x 2mm rectangle


What am I doing wrong here?

Appreciate all the help !

Best regards
Thorbjörn

User avatar
admin
Site Admin
Posts: 944
Joined: 1. Dec 2014, 12:41
Location: Germany

Re: How to send a Picture using Arduino and ESP8266

Postby admin » 30. May 2017, 08:00

Hello,

you have to load the image and base64 encode them.
You can use this library: https://github.com/adamvr/arduino-base64

The encodes image string you have to pass throught the pushsafer parameter p

Hope this helps

Kevin
Pushsafer DE: Dir gefällt Service und Support! Dann freuen wir uns auf deine Bewertung!
Pushsafer EN: You like Service and Support! Then we look forward to your review!

Pushsafer.com Website - iOS - Android - Windows 10

tobbeg

Re: How to send a Picture using Arduino and ESP8266

Postby tobbeg » 31. May 2017, 07:05

Hi again

so you mean the jpeg Picture file itself needs to be part of message sent to Pushsafer in base64 format?

I thought only the web link reference needed to be included in base64 format
and that Pushsafer APP retrieved the jpeg from the www location submitted.

or am I missing something here?

Thanks for your prompt reply
Thorbjörn

User avatar
admin
Site Admin
Posts: 944
Joined: 1. Dec 2014, 12:41
Location: Germany

Re: How to send a Picture using Arduino and ESP8266

Postby admin » 31. May 2017, 07:28

tobbeg wrote:Hi again

so you mean the jpeg Picture file itself needs to be part of message sent to Pushsafer in base64 format?

I thought only the web link reference needed to be included in base64 format
and that Pushsafer APP retrieved the jpeg from the www location submitted.

or am I missing something here?

Thanks for your prompt reply
Thorbjörn
Correct, you have to load the image, encode the binary with base64, the string you get, you have to pass throught the parameter p to pushsafer. Weblinks are not possible. See the API description here: https://www.pushsafer.com/en/pushapi

Regards
Kevin
Pushsafer DE: Dir gefällt Service und Support! Dann freuen wir uns auf deine Bewertung!
Pushsafer EN: You like Service and Support! Then we look forward to your review!

Pushsafer.com Website - iOS - Android - Windows 10


Who is online

Users browsing this forum: No registered users and 12 guests