Coder Social home page Coder Social logo

khoih-prog / blynk_teensy Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 1.0 87 KB

Enable Blynk support of Teensy boards, especially latest Teensy 4.0, using WiFi, Ethernet, BT/BLE and GSM/GPRS shield

License: MIT License

C 49.19% C++ 50.81%
blynk blynk-library blynk-iot-platform teensyduino teensy teensy40 teensy36 teensy-board teensy35 teensy32

blynk_teensy's Introduction

Blynk_Teensy

arduino-library-badge GitHub release GitHub contributions welcome GitHub issues



Table of Contents



Why do we need this Blynk_Teensy library

Features

To enable Blynk support of Teensy boards, especially latest Teensy 4.1/4.0



Prerequisites

  1. Arduino IDE 1.8.19+ for Arduino. GitHub release
  2. Blynk library 1.0.1+. Latest release.
  3. Teensy core 1.56 for Teensy (4.1, 4.0, 3.6, 3.5, 3,2, 3.1, 3.0, LC) boards.

Installation

The suggested way to install is to:

Use Arduino Library Manager

The best way is to use Arduino Library Manager. Search for Blynk_Teensy, then select / install the latest version. You can also use this link arduino-library-badge for more detailed instructions.

Then copy BlynkDetectDevice.h to folder ~/Arduino/libraries/Blynk/src/Blynk to overwrite the original file BlynkDetectDevice.h.

Manual Install

  1. Navigate to Blynk_Teensy page.
  2. Download the latest release Blynk_Teensy-master.zip.
  3. Extract the zip file to Blynk_Teensy-master directory
  4. Copy whole
  • Blynk_Teensy-master/src folder to Arduino libraries' directory such as ~/Arduino/libraries/.

The file BlynkSimpleShieldEsp8266_Teensy.h must be placed in Blynk libraries src directory (normally ~/Arduino/libraries/Blynk/src).

Then copy BlynkDetectDevice.h to folder ~/Arduino/libraries/Blynk/src/Blynk to overwrite the original file BlynkDetectDevice.h. By doing this, the correct board type can be displayed correctly along with Blynk logo as follows:

    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on Teensy 4.1/4.0

not just unknown Arduino board type:

    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on Arduino

VS Code & PlatformIO:

  1. Install VS Code
  2. Install PlatformIO
  3. Install Blynk_Teensy library by using Library Manager. Search for Blynk_Teensy in Platform.io Author's Libraries
  4. Please visit documentation for the other options and examples at Project Configuration File


How to use

In your code, just replace

  1. BlynkSimpleShieldEsp8266.h with BlynkSimpleShieldEsp8266_Teensy.h

That's it.


Examples

  1. Teensy40_ESP8266Shield
  2. Teensy40_Serial_USB

Sample code

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial

// You could use a spare Hardware Serial on boards that have it (like Mega)

#define HWSERIAL        Serial2       // Pin RX2 : 7, TX2 : 8 for Teensy 4.0

#include <ESP8266_Lib.h>

#include <BlynkSimpleShieldEsp8266_Teensy.h>

String cloudBlynkServer = "account.duckdns.org";

#define BLYNK_SERVER_HARDWARE_PORT    8080

char auth[] = "your-token";

#define SSID_MAX_LEN      32
#define PASS_MAX_LEN      64

// Your WiFi credentials.
char ssid[] = "ssid";
char pass[] = "pass";

#define EspSerial Serial2   //Serial2, Pin RX2 : 7, TX2 : 8

// Your Teensy <-> ESP8266 baud rate:
#define ESP8266_BAUD 115200

ESP8266 wifi(&EspSerial);

void setup() 
{
  // Debug console
  Serial.begin(115200);
  delay(1000);
  Serial.println("\nStart Teensy 4.0");

  // Set ESP8266 baud rate
  EspSerial.begin(ESP8266_BAUD);
  delay(10);

  Serial.println("Start Blynk");

  Blynk.begin(auth, wifi, ssid, pass, cloudBlynkServer.c_str(), BLYNK_SERVER_HARDWARE_PORT);
}

void loop()
{
  Blynk.run();
}

and this is the terminal debug output when running the example

Start Teensy 4.0
Start Blynk
[1310] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.6.1 on Teensy 4.0

[1310] Connecting to HueNet1
[7876] AT version:0.40.0.0(Aug  8 2015 14:45:58)
SDK version:1.3.0
Ai-Thinker Technology Co.,Ltd.
Build:1.3.0.2 Sep 11 2015 11:48:04
OK
[15448] IP = 192.168.2.107
+CIFSR:STAMAC,5c:cf:7f:66:05:d2
[15448] Connected to WiFi
[25601] Ready (ping: 14ms).


Issues

Submit issues to: Blynk_Teensy issues


TO DO

  1. Same features for other shields such as WiFi, Ethernet, BT/BLE, GSM/GPRS.

DONE

  1. Basic support for Teensy


Contributions and Thanks

Many thanks for everyone for bug reporting, new feature suggesting, testing and contributing to the development of this library.


Contributing

If you want to contribute to this project:

  • Report bugs and errors
  • Ask for enhancements
  • Create issues and pull requests
  • Tell other people about this library

License

  • The library is licensed under MIT

Copyright

Copyright 2020- Khoi Hoang

blynk_teensy's People

Contributors

khoih-prog avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

bobby7811

blynk_teensy's Issues

ESP library

Hi,
I have tried running the sample code you attached. Unfortunatelly, i cant find the library ESP8266_Lib.h.
Can you please add a link to download the library?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.