All Projects → witnessmenow → Universal Arduino Telegram Bot

witnessmenow / Universal Arduino Telegram Bot

Licence: mit
Use Telegram on your Arduino (ESP8266 or Wifi-101 boards)

Projects that are alternatives of or similar to Universal Arduino Telegram Bot

Esp wifimanager
This is an ESP32 / ESP8266 WiFi Connection Manager with fallback web configuration portal. Use this library for configuring ESP32, ESP8266 modules' WiFi, etc. Credentials at runtime. You can also specify static DNS servers, personalized HostName, fixed or random AP WiFi channel. With examples supporting ArduinoJson 6.0.0+ as well as 5.13.5- .
Stars: ✭ 125 (-78.03%)
Mutual labels:  arduino, wifi
Esp32marauder
A suite of WiFi/Bluetooth offensive and defensive tools for the ESP32
Stars: ✭ 233 (-59.05%)
Mutual labels:  arduino, wifi
Blinker Doc
blinker中文文档
Stars: ✭ 139 (-75.57%)
Mutual labels:  arduino, wifi
Sming
Sming - Open Source framework for high efficiency native ESP8266 development
Stars: ✭ 1,197 (+110.37%)
Mutual labels:  arduino, wifi
Mars Rover
3D printed Curiosity/Perseverance inspired Rover
Stars: ✭ 327 (-42.53%)
Mutual labels:  arduino, wifi
Perswifimanager
Persistent WiFiManager Arduino library for ESP8266
Stars: ✭ 106 (-81.37%)
Mutual labels:  arduino, wifi
Wifi keylogger
DIY Arduino Wi-Fi Keylogger (Proof of Concept)
Stars: ✭ 218 (-61.69%)
Mutual labels:  arduino, wifi
Desk Lamp Alternative Firmware
An alternative firmware for the Mijia Xiaomi Desk Lamp
Stars: ✭ 54 (-90.51%)
Mutual labels:  arduino, wifi
Esphelper
A library to make using WiFi & MQTT on the ESP8266 easy.
Stars: ✭ 310 (-45.52%)
Mutual labels:  arduino, wifi
Blynk Library
Blynk library for embedded hardware. Works with Arduino, ESP8266, Raspberry Pi, Intel Edison/Galileo, LinkIt ONE, Particle Core/Photon, Energia, ARM mbed, etc.
Stars: ✭ 3,305 (+480.84%)
Mutual labels:  arduino, wifi
Blinker Library
An IoT Solution,Blinker library for embedded hardware. Works with Arduino, ESP8266, ESP32.
Stars: ✭ 1,095 (+92.44%)
Mutual labels:  arduino, wifi
Deauthdetector
Detect deauthentication frames using an ESP8266
Stars: ✭ 406 (-28.65%)
Mutual labels:  arduino, wifi
Esp8266 deauther
Affordable WiFi hacking platform for testing and learning
Stars: ✭ 9,312 (+1536.56%)
Mutual labels:  arduino, wifi
Swifitch
Swifitch is ESP8266 based relay board that could be used to turn any light or any wall socket into smart one!
Stars: ✭ 117 (-79.44%)
Mutual labels:  arduino, wifi
Bleeper
Library to manage your firmware configurations written in C++
Stars: ✭ 54 (-90.51%)
Mutual labels:  arduino, wifi
Espmqttclient
Wifi and MQTT handling for ESP8266 and ESP32
Stars: ✭ 169 (-70.3%)
Mutual labels:  arduino, wifi
Esp3d
FW for ESP8266/ESP8285/ESP32 used with 3D printer
Stars: ✭ 979 (+72.06%)
Mutual labels:  arduino, wifi
Wifisatellite
WiFi Satellite Project - as seen on the Chaos Communication Congress
Stars: ✭ 52 (-90.86%)
Mutual labels:  arduino, wifi
M5ez
Complete interface builder for the M5Stack, an ESP32 based mini tinker-computer
Stars: ✭ 260 (-54.31%)
Mutual labels:  arduino, wifi
Heatpump
Arduino library to control Mitsubishi Heat Pumps via connector cn105
Stars: ✭ 327 (-42.53%)
Mutual labels:  arduino, wifi

Universal Telegram Bot Library

Travis CI status License Release stable

An Arduino IDE library for using Telegram Bot API. It's designed to be used with multiple Arduino architectures.

Join the Arduino Telegram Library Group Chat if you have any questions/feedback or would just like to be kept up to date with the library's progress.

Help support what I do!

I have created a lot of different Arduino libraries that I hope people can make use of. If you enjoy my work, please consider becoming a Github sponsor!

Introduction

This library provides an interface for Telegram Bot API.

Telegram is an instant messaging service that allows for the creation of bots. Bots can be configured to send and receive messages. This is useful for Arduino projects as you can receive updates from your project or issue it commands via your Telegram app from anywhere.

This is a library forked from one library and inspired by another

Each library only supported a single type of Arduino and had different features implemented. The only thing that needs to be different for each board is the actual sending of requests to Telegram so I thought a library that additional architectures or boards could be configured easily would be useful, although this springs to mind:

alt text

Installing

The downloaded code can be included as a new library into the IDE selecting the menu:

 Sketch / include Library / Add .Zip library

You also have to install the ArduinoJson library written by Benoît Blanchon. Search for it on the Arduino Library manager or get it from here.

Getting Started

To generate your new Bot, you need an Access Token. Talk to BotFather and follow a few simple steps described here.

Include UniversalTelegramBot in your project:

#include <UniversalTelegramBot.h>

and pass it a Bot token and a SSL Client (See the examples for more details)

// Telegram BOT Token (Get from Botfather)
#define BOT_TOKEN "XXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
WiFiClientSecure secured_client;
UniversalTelegramBot bot(BOT_TOKEN, secured_client);

Features

Here is a list of features that this library covers. (Note: The examples link to the ESP8266 versions)

Feature Description Usage Example
Receiving Messages Your bot can read messages that are sent to it. This is useful for sending commands to your arduino such as toggle and LED int getUpdates(long offset)

Gets any pending messages from Telegram and stores them in bot.messages . Offset should be set to bot.last_message_received + 1. Returns the numbers new messages received.
FlashLED or any other example
Sending messages Your bot can send messages to any Telegram or group. This can be useful to get the arduino to notify you of an event e.g. Button pressed etc (Note: bots can only message you if you messaged them first) bool sendMessage(String chat_id, String text, String parse_mode = "")

Sends the message to the chat_id. Returns if the message sent or not.
EchoBot or any other example
Reply Keyboards Your bot can send reply keyboards that can be used as a type of menu. bool sendMessageWithReplyKeyboard(String chat_id, String text, String parse_mode, String keyboard, bool resize = false, bool oneTime = false, bool selective = false)

Send a keyboard to the specified chat_id. parse_mode can be left blank. Will return true if the message sends successfully.
ReplyKeyboard
Inline Keyboards Your bot can send inline keyboards.

Note: URLS & callbacks are supported currently
bool sendMessageWithInlineKeyboard(String chat_id, String text, String parse_mode, String keyboard)

Send a keyboard to the specified chat_id. parse_mode can be left blank. Will return true if the message sends successfully.
InlineKeyboard
Send Photos It is possible to send phtos from your bot. You can send images from the web or from the arduino directly (Only sending from an SD card has been tested, but it should be able to send from a camera module) Check the examples for more info From URL

Binary from SD

From File Id
Chat Actions Your bot can send chat actions, such as typing or sending photo to let the user know that the bot is doing something. bool sendChatAction(String chat_id, String chat_action)

Send a the chat action to the specified chat_id. There is a set list of chat actions that Telegram support, see the example for details. Will return true if the chat actions sends successfully.
Location Your bot can receive location data, either from a single location data point or live location data. Check the example. Location
Channel Post Reads posts from channels. Check the example. ChannelPost
Long Poll Set how long the bot will wait checking for a new message before returning now messages.

This will decrease the amount of requests and data used by the bot, but it will tie up the arduino while it waits for messages
bot.longPoll = 60;

Where 60 is the amount of seconds it should wait
LongPoll
Update Firmware and SPIFFS You can update firmware and spiffs area through send files as a normal file with a specific caption. update firmware
or
update spiffs
These are captions for example.
telegramOTA
Set bot's commands You can set bot commands programmatically from your code. The commands will be shown in a special place in the text input area bot.setMyCommands("[{\"command\":\"help\", \"description\":\"get help\"},{\"command\":\"start\",\"description\":\"start conversation\"}]");. See examples SetMyCommands

The full Telegram Bot API documentation can be read here. If there is a feature you would like added to the library please either raise a Github issue or please feel free to raise a Pull Request.

Other Examples

Some other examples are included you may find useful:

  • BulkMessages : sends messages to multiple subscribers (ESP8266 only).

  • UsingWifiManager : Same as FlashLedBot but also uses WiFiManager library to configure WiFi (ESP8266 only).

License

License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].