Author Topic: Using Blynk with the Oak  (Read 7853 times)

werner

  • Newbie
  • *
  • Posts: 37
Using Blynk with the Oak
« on: February 17, 2016, 01:11:29 am »
Does anyone know if its possible already to use http://www.blynk.cc/ in conjunction with the Oak?

This was o the original reasons I became enthusiastic about the Oak on KickStarter.  I just don't know where to get started to try and use it.

Quote from the Oak KickStarter campaign:
Quote
Blynk (a recent Kickstarter success: https://www.kickstarter.com/projects/167134865/blynk-build-an-app-for-your-arduino-project-in-5-m) is going to support the Oak!

It already has awesome support for things like Spark and Onion - and when the Oak ships it will support it too! 

Blynk is a really cool platform that allows you to quickly create a beautiful mobile interface for your hardware project. You just open the Blynk app (iOS or Android) drag-and-drop widgets (including buttons, sliders, and more) and assign them to pins on your Oak (or other hardware). Then you update your board with the special sketch and you can control things or get sensor data with no programming. 
« Last Edit: February 17, 2016, 02:10:25 am by werner »

werner

  • Newbie
  • *
  • Posts: 37
Re: Using Blynk with the Oak
« Reply #1 on: February 17, 2016, 02:59:49 am »
Update :  I just saw that Digistump Oak is still only on the roadmap, but not implemented yet.  (See http://community.blynk.cc/t/hardware-supported-by-blynk/16)

So I guess the my questions should be : Any idea how long this will take to move from roadmap to implementation?

werner

  • Newbie
  • *
  • Posts: 37
Re: Using Blynk with the Oak
« Reply #2 on: February 18, 2016, 12:22:19 am »
 :-\   I guess silence also an answer.    <sigh>

I suppose the Android app example that was also mentioned in the KickStarter campaign is also still something for the future?  Or is that available already? 
« Last Edit: February 18, 2016, 12:31:01 am by werner »

lm180

  • Newbie
  • *
  • Posts: 1
Re: Using Blynk with the Oak
« Reply #3 on: February 18, 2016, 08:21:32 am »
Hi, there is an example of how to use blynk with the Oak. Comes with the Arduino Oak package 0.9.3.
But, I can't get it to work, I get a bunch of errors when trying to compile.

« Last Edit: February 18, 2016, 11:10:01 am by lm180 »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Using Blynk with the Oak
« Reply #4 on: February 19, 2016, 10:27:19 pm »
Blynk is not supporting the Oak yet - a working example and official support will come shortly after the first non-beta firmware release

gspadari

  • Newbie
  • *
  • Posts: 16
Re: Using Blynk with the Oak
« Reply #5 on: April 10, 2016, 11:37:52 am »
Any news on this? Thanks.

PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: Using Blynk with the Oak
« Reply #6 on: April 11, 2016, 12:34:16 am »
I think it will be a little while (read weeks, not months) until Blynk is officially added (as the Blynk dev guys only recently got their samples to play with and document) and I suspect getting Particle compile support running and documented is higher up the hit list.

However, exeng said he got something working here by changing the example... I haven't tried it as I wasn't a backer... but maybe you guys can do something with it, or those that have got it working will pop in again soon...

Pete

exeng

  • Sr. Member
  • ****
  • Posts: 454
Re: Using Blynk with the Oak
« Reply #7 on: April 11, 2016, 08:42:54 am »
Here is a link to the Blynk thread that shows the changes I made to my local copy of the Blynk.h library file to get it to work. This is unofficial and will most likely change when officially supported by Digistump.
http://digistump.com/board/index.php/topic,2069.0.html

Also, Blynk now charges for widgets unless you were a backer of Blynk. It appears that the charges are nominal but since I haven't updated my app yet, I haven't been subjected to them.  Any new or updated versions of the Blynk app will cost something for each widget but seems you will get a 2000 energy credit to start and get back energy when you recycle widgets. It's created quite a discussion on the Blynk community forum.
http://community.blynk.cc/t/introducing-blynk-energy-first-paid-services/4975

exeng

mikekgr

  • Newbie
  • *
  • Posts: 34
Re: Using Blynk with the Oak
« Reply #8 on: April 11, 2016, 10:02:14 am »
Here is a link to the Blynk thread that shows the changes I made to my local copy of the Blynk.h library file to get it to work. This is unofficial and will most likely change when officially supported by Digistump.
http://digistump.com/board/index.php/topic,2069.0.html

Also, Blynk now charges for widgets unless you were a backer of Blynk. It appears that the charges are nominal but since I haven't updated my app yet, I haven't been subjected to them.  Any new or updated versions of the Blynk app will cost something for each widget but seems you will get a 2000 energy credit to start and get back energy when you recycle widgets. It's created quite a discussion on the Blynk community forum.
http://community.blynk.cc/t/introducing-blynk-energy-first-paid-services/4975

exeng

They charge only once not repeatedly for the use of UI materials like buttons, lcds etc. Nothing too much to worry about. It is acceptable for me to attract some money in order to continue theirs development and to offer app server and the rest resources.
I have not any connection with them tho...

PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: Using Blynk with the Oak
« Reply #9 on: April 11, 2016, 06:34:58 pm »
Oh... that was in the blynk header... no wonder I was a bit confused when I read that the first time ;) duh! Ok, so you made that change to the copy of the blynk library included with the oak (so for the 1.0.1 core, that would be located in %userprofile%\AppData\Local\Arduino15\packages\digistump\hardware\oak\1.0.1\libraries\Blynk if you're using Arduino 1.6.6 onwards (change the Local to Roaming for earler IDE versions)).

I would be tempted to wrap that change in ifdef tags (unless anyone else has a better way to detect compilation against the oak core), and that could then go into the standard blynk library... although since that header seems to be Oak specific... there isn't really a need, and the void connectWiFi(const char* ssid, const char* pass) they use can actually be removed as it is actually invalid for the oak...

#ifdef ARDUINO_ESP8266_OAK
  // ADDED for Oak (by exeng) - similar to standard ESP8266 version above, but without args to connectWiFi()
  void connectWiFi()
    {
        BLYNK_LOG("Oak in connect WiFi");
        WiFi.begin(); // Oak is already has a configured SSID to connect to
       
        while (WiFi.status() != WL_CONNECTED) {
            ::delay(10000);  // delay 10 seconds
        }
        BLYNK_LOG("Connected to WiFi");

        IPAddress myip = WiFi.localIP();
        BLYNK_LOG("My IP: %d.%d.%d.%d", myip[0], myip[1], myip[2], myip[3]);
    }
// END of ADDED for Oak (by exeng)
#else
    // Original standard version of function, for use with ESP8266 boards
    void connectWiFi(const char* ssid, const char* pass)
    {
        /*BLYNK_LOG("Connecting to %s", ssid);
        if (pass && strlen(pass)) {
           WiFi.begin(ssid, pass);
        } else {
           WiFi.begin(ssid);
        }*/
        while (WiFi.status() != WL_CONNECTED) {
            ::delay(500);
        }
        BLYNK_LOG("Connected to WiFi");

        IPAddress myip = WiFi.localIP();
        BLYNK_LOG("My IP: %d.%d.%d.%d", myip[0], myip[1], myip[2], myip[3]);
    }
#endif

« Last Edit: April 11, 2016, 08:47:52 pm by pfeerick »

exeng

  • Sr. Member
  • ****
  • Posts: 454
Re: Using Blynk with the Oak
« Reply #10 on: April 11, 2016, 08:53:26 pm »
@pfeerick, The conditionals around the changes are a good idea (I feel like I should say gid idea since your in AUS) but I didn't do it because my changes were local and assumed to be temporary if and when Erik eventually makes an official change to the library for Oak.

To be very clear, as far as I know the changes have not been made to the official release. You have to make them locally to your copy of the library. And... until they are included in the official release, you will have to re-apply the changes anytime the library is updated. That's why I keep a safe backup of my local changes.

gid day

exeng

PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: Using Blynk with the Oak
« Reply #11 on: April 12, 2016, 02:06:17 am »
I also then feel compelled to respond "how quaint" followed by g'day mate in response! ;D Oh yes, keeping local backups is essential... won't be happy if the Arduino IDE decides to update stuff on you or you forget and go and update the library! :o

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: Using Blynk with the Oak
« Reply #12 on: April 12, 2016, 04:09:32 pm »
I keep seeing cool Connectivity methods in various threads.  Starting one thread to track them might work but could get polluted quickly - it could become a WIKI section.  It occurred to me putting a unique string once per Thread where stuff works could at least allow a forum Search to work.
Blynk::OAK_CONNECT
« Last Edit: April 12, 2016, 04:12:31 pm by defragster »