Coder Social home page Coder Social logo

esp-rix's Introduction

Remote Information eXchange

ARDUINO-AVR ESP8266 ESP 32

Remote Information eXchange adds remote logging and debugging capabilities to your ESP based Arduino projects. This can be useful if your project is in an inaccessible location, and serial isn't available.

Installation

Clone this repo to your Arduino libraries directory. On Linux this is ~/Arduino/libraries/

Usage

Include the RIX library

#include <esp-rix.h>

Listen for RIX calls at the end of your loop() function

void loop() {
	// Other loop code here

	// Rix supports 7 levels of debug messages
	rix_1("This is a LEVEL 1 message");
	rix_7("This is a LEVEL 7 message");

	// Rix also supports printf style messages
	rix_5("MCU Uptime: %d minutes", millis() / 1000 / 60);

	handle_rix();
}

On a machine that shares the same WiFi as your ESP you can telnet to your ESP's IP address to view the messages.

Library options

Enable/disable color in output

rix_color(0); // Disable color

Set the initial output logging level

rix_log_level(4); // Default: 7

Change the TCP port that RIX listens on

rix_tcp_port(2300); // Default: 23

Using delay() in your scripts may cause RIX to be less responsive. A rix_delay() method has been added as a drop-in replacement to keep your project responsive.

rix_delay(500); // Wait 500 ms

RIX has a function to make connecting to your WiFi simple:

int ok = rix_init_wifi("MySSID", "SekritPassword");

Disabling RIX

When you're done debugging you can disable RIX entirely by adding:

# define RIX_DISABLE

before the include line. This will make all the rix_* calls no-ops, and disable logging. This means you can leave all your setup and logging calls in your code and simply disable the library at compile time.

Backwards compatibility

On non-ESP boards RIX is automatically disabled. This allows you to test and debug on an ESP board, and then compile on an Arduino Nano with no changes to your code.

Inspired by

RIX was inspired by Joao Lopes' RemoteDebug which appears to be abandonned.

esp-rix's People

Contributors

scottchiefbaker avatar

Stargazers

 avatar luzhou avatar Banko Viktor avatar

Watchers

 avatar  avatar

Forkers

bankoviktor

esp-rix's Issues

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.