All Projects → miketeachman → micropython-thingspeak-mqtt-esp8266

miketeachman / micropython-thingspeak-mqtt-esp8266

Licence: other
Publish and Subscribe to Thingspeak using MQTT with Micropython

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to micropython-thingspeak-mqtt-esp8266

micropython-adafruit-mqtt-esp8266
Using MQTT to Publish/Subscribe to adafruit io. MicroPython/CircuitPython implementation on ESP8266/ESP32
Stars: ✭ 53 (+103.85%)
Mutual labels:  putty, ampy
Pretty Putty
Pretty PuTTY
Stars: ✭ 244 (+838.46%)
Mutual labels:  putty
Wsl Ssh Pageant
A Pageant -> TCP bridge for use with WSL, allowing for Pageant to be used as an ssh-ageant within the WSL environment.
Stars: ✭ 381 (+1365.38%)
Mutual labels:  putty
Putty Tunnel Manager
Fixes and new release. PuTTY Tunnel Manager allows you to easily open tunnels, that are defined in a PuTTY session, from the system tray. You can also move the tunnels from PuTTY to PuTTY Tunnel Manager. This allows you to use PuTTY just for SSH shell sessions (without opening tunnels), and use PuTTY Tunnel Manager just for tunneling.
Stars: ✭ 41 (+57.69%)
Mutual labels:  putty
Simpleremote
Remote Administration Tools
Stars: ✭ 504 (+1838.46%)
Mutual labels:  putty
Networkmanager
A powerful tool for managing networks and troubleshoot network problems!
Stars: ✭ 1,296 (+4884.62%)
Mutual labels:  putty
Weasel Pageant
Deprecated: An ssh-agent compatible helper for interacting with Pageant from processes running on the Windows Subsystem for Linux.
Stars: ✭ 256 (+884.62%)
Mutual labels:  putty
PuTTY-ng
An improved multi-tabbed PuTTY with better user experience. This project is based on noddle1983's putty-nd.
Stars: ✭ 37 (+42.31%)
Mutual labels:  putty
Putty Cac
Windows Secure Shell Client With Support For Smart Cards & Certificates
Stars: ✭ 192 (+638.46%)
Mutual labels:  putty
Terminals
Terminals is a secure, multi tab terminal services/remote desktop client. It uses Terminal Services ActiveX Client (mstscax.dll). The project started from the need of controlling multiple connections simultaneously. It is a complete replacement for the mstsc.exe (Terminal Services) client. This is official source moved from Codeplex.
Stars: ✭ 971 (+3634.62%)
Mutual labels:  putty
Cloudconnect
Cloud aware client to connect ssh, sftp and rdp
Stars: ✭ 25 (-3.85%)
Mutual labels:  putty
Putty
PuTTY 中文版,原 http://code.google.com/p/puttycn 项目。
Stars: ✭ 628 (+2315.38%)
Mutual labels:  putty
Superputty
The SuperPuTTY Window Manager for putty sessions
Stars: ✭ 1,572 (+5946.15%)
Mutual labels:  putty
Relaxed Terminal Themes
🕶️ A relaxed terminal theme to take a more relaxed view of things. For iTerm, Hyper, the macOS Terminal and a bunch of others.
Stars: ✭ 382 (+1369.23%)
Mutual labels:  putty
SSH-PuTTY-login-bruteforcer
Turn PuTTY into an SSH login bruteforcing tool.
Stars: ✭ 222 (+753.85%)
Mutual labels:  putty
Iterm2 Color Schemes
Over 250 terminal color schemes/themes for iTerm/iTerm2. Includes ports to Terminal, Konsole, PuTTY, Xresources, XRDB, Remmina, Termite, XFCE, Tilda, FreeBSD VT, Terminator, Kitty, MobaXterm, LXTerminal, Microsoft's Windows Terminal, Visual Studio, Alacritty
Stars: ✭ 20,828 (+80007.69%)
Mutual labels:  putty
Kitty
💻 KiTTY, a free telnet/ssh client for Windows
Stars: ✭ 791 (+2942.31%)
Mutual labels:  putty
Tgputtylib
An SFTP client shared library (dll/so/dylib) with bindings and classes for C++, Delphi and Free Pascal based on PuTTY
Stars: ✭ 49 (+88.46%)
Mutual labels:  putty
SmartPutty
Multi-Tabbed PuTTY written in Java
Stars: ✭ 34 (+30.77%)
Mutual labels:  putty
AQmon
DIY Air Quality Monitor
Stars: ✭ 46 (+76.92%)
Mutual labels:  thingspeak

MQTT protocol with Thingspeak using Micropython

Example code showing how to use the MQTT protocol with the Thingspeak cloud service [https://thingspeak.com]

  • Publish data
  • Subscribe to data

Thingspeak configuration

  1. Create a Thingspeak account https://thingspeak.com
  2. Create a new Thingspeak Channel (select New Channel on the My Channels page)
    • the Channel ID is required for configuration (found at the top of every channel page)
  3. Create a new MQTT Device by following instructions in https://www.mathworks.com/help/thingspeak/mqtt-basics.html
    • when you create a new MQTT device it is important to record the three configuration parameters:
      • MQTT Client ID
      • MQTT Username
      • MQTT Password (careful - you can only copy the password during the MQTT device creation step)

Example code configuration

  • The code includes variables with the form "ENTER_" indicating places where WiFi and Thingspeak configuration parameters are needed

Tested with Hardware

  • Adafruit Feather HUZZAH ESP8266
  • Adafruit Feather HUZZAH ESP32
  • WeMos D1 Mini
  • Lolin D32
  • Lolin D32 Pro
  • Pyboard D (note: requires UMQTT library to be installed)

Tested with Micropython Versions

  • Micropython v1.19.1

Recommended Tools for Windows

  • Adafruit Ampy to copy files to the filesystem
    • install version 1.0.3 or newer which has the -d option (use -d1 to avoid USB connection issues in Windows)
  • Putty to interact with the REPL
    • set Serial speed to 115200 and Flow control to None

Publishing data to ThingSpeak channels

Usage

  1. Configure code file publishThingspeak.py with WiFi and ThingSpeak configuration parameters
  2. Copy the file publishThingspeak.py to your device, using ampy, rshell, or webrepl
$ ampy -pCOMx -d1 put publishThingspeak.py main.py
  1. Reset the board
  2. Observe that data is being Published to the ThingSpeak channel at Thingspeak.com

Subscribing to ThingSpeak channels (still to be updated)

Usage

  1. Configure code file subscribeThingspeak.py with ThingSpeak parameters
  2. Copy the file subscribeThingspeak.py to your device, using ampy, rshell, webrepl
$ ampy -pCOMx -d1 put subscribeThingspeak.py main.py
  1. Configure a 2nd device to publish the freeHeap data (see above)
  2. Reset the board
  3. Connect to the REPL with Putty (or simlar) to observe subscribed channel data being received (every 30s in the example code)

Installing UMQTT Package for Pyboard D

The example code requires the MicroPython MQTT (UMQTT) Package. Pyboard D firmware does not have this package built-in

How to install the UMQTT package
  1. Navigate to [Micropython lib](https://github.com/micropython/micropython-lib
  2. Select the "Clone or download" button
  3. Select "Download ZIP"
  4. Extract the ZIP. Should see folder called "micropython-lib-master"
  5. Two files need to be copied to the MicroPython filesystem
    • micropython-lib\micropython\umqtt.simple\umqtt\simple.py
    • micropython-lib\micropython\umqtt.robust\umqtt\robust.py

Copy these two files to the MicroPython filesystem with the directory structure shown below.

boot.py
lib
  |
  umqtt
     simple.py
     robust.py

Example with Ampy:

>ampy -pCOM27 -d1 ls
boot.py
>ampy -pCOM27 -d1 mkdir lib
>ampy -pCOM27 -d1 mkdir lib/umqtt
>ampy -pCOM27 -d1 put simple.py lib/umqtt/simple.py
>ampy -pCOM27 -d1 put robust.py lib/umqtt/robust.py
>ampy -pCOM27 -d1 ls
boot.py
lib
>ampy -pCOM27 -d1 ls lib
umqtt
>ampy -pCOM27 -d1 ls lib/umqtt
simple.py
robust.py
Validating the UMQTT package install

From the REPL (using Putty, etc) execute the following commands and observe similar output

>>> from umqtt.robust import MQTTClient

>>> dir(MQTTClient)
['__class__', '__init__', '__module__', '__name__', '__qualname__', '__bases__', '__dict__', 'connect', 'delay', 'disconnect', 'log', 'DEBUG', 'DELAY', 'reconnect', 'publish', 'wait_msg', '_send_str', '_recv_len', 'set_callback', 'set_last_will', 'ping', 'subscribe', 'check_msg']

If you see this result you have successfully installed the umqtt package. 🎉 😌

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].