Code Monkey home page Code Monkey logo

nabaztaghackkit's Introduction

Nabaztag Hack Kit

Everything you need to hack the Rabbit: a sinatra server including simple api framework to run custom bytecode on Nabaztag v1/v2. Includes original compiler sources for linux and a modified mac os x version.

Getting Started

Installation

The Hack Kit is distributed as a ruby gem. It comes with a simple web server (based on sinatra) which runs out-of-the for connecting you rabbit and distributing the nabaztag bytecode. In addition it includes sinatra helpers/modules to communicate with the rabbit easily. Lastly it provides binaries to compile your own Nabaztag bytecode (see Binaries below).

Simple Server

The Server is the communication endpoint for the rabbit. Its two main purposes are:

  1. serving the bytecode on bootup
  2. receive and respond to HTTP requests in a defined format.

Setup

  1. Install dependencies first:
gem install nabaztag_hack_kit

or if you have a Gemfile

bundle install --path=vendor/bundle
  1. Then, create a config.ru file
require 'nabaztag_hack_kit/server'

run NabaztagHackKit::Server.new
  1. Finally, to start and run the server, execute:
bundle exec rackup -p <portnumer>

See examples/ folder for more sophisticated usage.

Binaries

The kit comes with violet sources and binaries to compile custom Nabaztag bytecode. See folder compiler/. The linux sources are (more or less) the original ones by violet, the mac osx version was created by @ztalbot2000. The compiler binaries are compiled on installation of the gem.

Following three binaries are available:

mtl_comp

A wrapper around mtl_comp. Compiles a *.mtl file. It calls mtl_merge before

mtl_simu

A wrapper around mtl_simu. Runs a *.mtl file. It calls mtl_merge before

mtl_merge

Merges multiple *.mtl files into one. Files are included like in C: #include "<relative path to file>". Output is temporary file .tmp.mtl.

Development

Be sure to checkout mtl_linux submodule first:

git submodule update

To update the kit run:

bundle exec rake build && bundle exec gem install -V pkg/nabaztag_hack_kit-0.1.0.beta6.gem

API

As example and for my own purposes I implemented a simple API to deal with RFID, LEDS, BUTTON and EARS easily. (see bytecode/main.mtl)

Input Devices

RFID

see my other project NabaztagInjector

BUTTON

Current Button has very basic functionality: a short press send HTTP Request of type Log to server, a long press forces the bunny to restart.

Output Devices

Data for all output devices are stored in buffers. Each device has two: one for onetime, imediate playback, another for permanent loops.

LEDS

Buffers 0 - 9, where 0-4 are used for onetime, and 5-9 for loop playback.

EARS

Buffers 10 - 13, where 10 & 11 are used for onetime, and 12 & 13 for loop playback.

Disclamer

The server part was heavily inspired by Trudy.rb, compiler code copied from OpenJabNab. Thanks!

Nabaztag Background

Read following posting for more background on Nabaztag Hacking (uses google translate:)

Related Projects

New firmware with WPA2

  1. https://github.com/ccarlo64/firmware_nabaztag (see http://nabaztag.forumactif.fr/t15323-firmware-for-wpa-wpa2-test)

  2. https://github.com/RedoXyde/nabgcc https://github.com/RedoXyde/mtl_linux (see http://nabaztag.forumactif.fr/t15280p25-nabaztagtag-en-wpa2)

ServerlessNabaztag -> https://github.com/andreax79/ServerlessNabaztag

CloudServer replace: http://nabaztaglives.com/

Rebuild Nabaztag:

Websocket

Websocket HowTo:

Future

I'd like to hack the Violet mir:ror too. Some starting points:

nabaztaghackkit's People

Contributors

orthographic-pedant avatar rngtng avatar ztalbot2000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

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.