Giter Site home page Giter Site logo

lucalas / streamlabsarduinoalerts Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 1.0 13 KB

Library to connect to your Streamlabs account and catch all the Twitch events.

C++ 72.43% Shell 27.57%
arduino esp32 esp8266 streamlabs streamlabs-socket twitch twitch-bot

streamlabsarduinoalerts's Introduction

Streamlabs Arduino Alerts Build Status

Library to connect to your Streamlabs account and catch all the Twitch events.

Twitch catchable events

  • Follow
  • Subscription
  • Resubscription
  • Donation
  • Raid
  • Host
  • Bit

Supported Hardware

  • ESP8266 Arduino for ESP8266
  • ESP32 Arduino for ESP32
  • ESP31B
  • Particle with STM32 ARM Cortex M3
  • ATmega328 with Ethernet Shield (ATmega branch)
  • ATmega328 with enc28j60 (ATmega branch)
  • ATmega2560 with Ethernet Shield (ATmega branch)
  • ATmega2560 with enc28j60 (ATmega branch)

Add library

Best thing is to use the Arduino Library Manager.

  • Go to Sketch > Include Library > Manage Libraries.
  • Install WebSockets by Markus Sattler
  • Install StreamlabsArduinoAlerts
  • Select Sketch > Include Library > StreamlabsArduinoAlerts

Methods

connect(socket_token)

Method to connect to Streamlabs server, required socket token.

followTwitchEvent(callback)

subscriptionsTwitchEvent(callback)

resubscriptionsTwitchEvent(callback)

hostTwitchEvent(callback)

bitsTwitchEvent(callback)

raidsTwitchEvent(callback)

donationEvent(callback)

loop()

Example

Connection
char* socketToken = "token";
StreamlabsAPI streamlabsAPI.connect(socketToken);
Event Callback
void followerEvent(const char* payload) {
	Serial.print("got followerEvent message: ");
	Serial.println(payload);
}
streamlabsAPI.followTwitchEvent(followerEvent);
Loop Method

loop method is required to make this library work.

void loop() {
    streamlabsAPI.loop();
}

Event result documentation can be found on Streamlabs WebSite HERE

Get Streamlabs Socket Token

You can find yours at https://streamlabs.com/dashboard#/apisettings under "API TOKENS" then "Your Socket API Token". This token is bound to the account that you are logged in with. If you need to access the alerts of a streamer, ask them to provide you with a token from the above location.

Issues

Submit issues to: https://github.com/lucalas/StreamlabsArduinoAlerts/issues

streamlabsarduinoalerts's People

Contributors

lucalas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

thomascvan

streamlabsarduinoalerts's Issues

SocketIoClient not able to connect

Hi there,

today I wanted to try something using your library, but it just keeps saying "[SIoC] Disconnected!" and I can't figure out why.
I installed WebSockets, SocketIoClient and Json. My Streamlabs Socket Token should be correct too, as it worked fine a few months ago. @lucalas Could you please confirm this library is up-to-date?

Greetings!

Resub Alert not working

Hi there!
I'm using your library for a while now and really love it! But unfortunately I can't get a Resub event when I send it using streamlabs.com. Is there any way to make it work/add it?

Greetings!

The problem continues.

Hi lucalas
The problem continues. Can someone collect and upload old working files in a folder?
I need old arduino version and all old working library.
I've been trying for months and couldn't find a solution.

connection

hi, i am very new to arduino and i have this school project where i need to use this.

So as i am trying to follow the readme i cant get to connect without errors

`#include <SocketIoClient.h>
#include <ArduinoJson.h>
#include <StreamlabsAPI.h>

char* socketToken = "token";
StreamlabsAPI streamlabsAPI.connect(socketToken);`

this is everything in my project and i get this error:
error: expected initializer before '.' token 7 | StreamlabsAPI streamlabsAPI.connect(socketToken); | ^ exit status 1 expected initializer before '.' token

I just don't understand how i can do something wrong...

Error including map

When I try to compile I receive the following error:

C:\Users\xxxx\Documents\Arduino\libraries\StreamlabsArduinoAlerts\src/StreamlabsAPI.h:2:10: fatal error: map: No such file or directory
#include
^~~~~
compilation terminated.
exit status 1

Replace socket-io client library

Replace the use of socket-io client library with socket-io class inside of arduinowebsocket to avoid incompatibility problems.
Related to #1 opened issue.

SSL client reconnects after some time

Device: ESP32

The socket connection resets every 20 seconds or so. Wifi network itself is not the issue, tried multiple networks. With debugging enabled, serial monitor prints these logs:

[ 95771][V][ssl_client.cpp:68] start_ssl_client(): Starting socket
[ 97086][V][ssl_client.cpp:146] start_ssl_client(): Seeding the random number generator
[ 97087][V][ssl_client.cpp:155] start_ssl_client(): Setting up the SSL/TLS structure...
[ 97091][D][ssl_client.cpp:176] start_ssl_client(): WARNING: Skipping SSL Verification. INSECURE!
[ 97099][V][ssl_client.cpp:254] start_ssl_client(): Setting hostname for TLS session...
[ 97107][V][ssl_client.cpp:269] start_ssl_client(): Performing the SSL/TLS handshake...
[ 99543][V][ssl_client.cpp:290] start_ssl_client(): Verifying peer X.509 certificate...
[ 99544][V][ssl_client.cpp:298] start_ssl_client(): Certificate verified.
[ 99547][V][ssl_client.cpp:313] start_ssl_client(): Free internal heap after TLS 210912
[ 99555][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 427 bytes...
[ 99955][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 576 bytes...
[100570][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 12 bytes...
[100571][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 7 bytes...
[120003][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 6 bytes...
[120006][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 7 bytes...
[136819][V][ssl_client.cpp:369] send_ssl_data(): Writing HTTP request with 8 bytes...
[136822][V][ssl_client.cpp:321] stop_ssl_socket(): Cleaning SSL connection.
[136840][V][ssl_client.cpp:321] stop_ssl_socket(): Cleaning SSL connection.
[137427][V][ssl_client.cpp:62] start_ssl_client(): Free internal heap before TLS 255668
[137427][V][ssl_client.cpp:68] start_ssl_client(): Starting socket

...and the process continues. The library works in theory, but I don't want to miss an event coming in at the exact time the connection is interrupting, thus missing the event.

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.