Skip to content

DerGeorg/node-p1x3lramen

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

p1x3lramen

Using an HTTP server to send pixel soup to a Divoom Pixoo LED panel over a bluetooth connection.


WARNING: This is experimental and runs an unsecured HTTP server with an unvalidated API on port 8000. Use at your own risk and try to understand what it does.


This is meant to expose all functions of the device like a prototyping pegboard so you can tinker with the device and create awesome things. pixelramen can be used as app and accessing it over port 8000 or by using the ES6 modules directly.

Usage


The divoom pixoo uses bluetooth 5 so a computer with support for that would be a requirement.

This app is written in JavaScript for node so you need Node.js installed.

Pair the pixoo

You need to pair the pixoo with your computer.

When using a Mac like I do, Open Bluetooth Preferences, switch on the pixoo and connect it as soon as it apears in the Preferences.

I have no idea how the pairing works on other systems, but it's probably similar.

Running the app

Open a terminal (yea, doesn't work without it), clone the project from github and install the dependencies:

git clone https://github.com/jfroehlich/node-p1x3lramen
cd node-p1x3lramen
npm install

Then start the app:

node index.js <MAC>

This will start the http server. Open localhost:8000 in a browser. This should auto connect to the device. You can disconnect by using the HTTP API or by killing the app with ctrl-c.

Start with different Port (optional)

node index.js <MAC> <PORT>

This will start the http server. Open localhost:<PORT> in a browser.

Start with pm2

git clone https://github.com/jfroehlich/node-p1x3lramen
cd node-p1x3lramen
npm install

Then start the app:

pm2 start index.js -- <MAC>

pm2 with different Port (optional)

pm2 start index.js -- <MAC> <PORT>

This will start the http server. Open localhost:<PORT> in a browser.

pm2 log

pm2 log

pm2 stop

pm2 stop index

Testing


I did write some tests to run them one after each other. You can run them with the web server with a configureable delay after each test.

First connect to the device with /connect in the browser. When connected call /test?delay=2000. The number is the delay in milliseconds.

Why this project?

I got a Divoom Pixoo for christmas in 2020 but couldn't use it since Divoom only has a smartphone app and the pixoo only connects over bluetooth 5 which my smarphone didn't support. I didn't get the perl and python scripts to run but there is an implementation for the timebox evo which happens to (mostly) have the same API as the pixoo.

The timebox evo script is realy cool but it connects and disconnects for each cli command, is actually for the evo, is a bit complicated and I don't like type script that much. So, I decided to write my own little app. Feel free to use it and get inspired.

HTTP API


This is a quick documentation of the HTTP API. For the range of values look at source/devices/pxioo.js for now.

  • /api/status returns the current connection status and the app configuration for the device

  • /api/connect Connect to the device

  • /api/disconnect Disconnect from the device

  • /api/fullday?enable=<bool> Switches between 12h and 24h mode. Note: Does work, but not as expected -- don't know why.

  • /api/datetime?date=<isodate>&fullday=<bool> Updates the time and switches between 12h and 24h mode

  • /api/brightness?level=<num> Sets the brightness level

  • /api/lighting?color=<hexcolor>&brightness=<num>&mode=<num>&powerScreen=<bool> Sets the color and brightness or switches the screen off

  • /api/clock?mode=<num>&showTime=<bool>&showWeather=<bool>&showTemperature=<bool>&showCalendar=<bool>&color=<hexcolor> Switches between clock modes and sets it's config

  • /api/score?red=<num>&blue=<num> Switches to score mode and sets the scores for red and blue

  • /api/visualization?mode=<num>

  • /api/effect?mode=<num>

  • /api/climate?weather=<num>&temperature=<num> Set the weather and temperature

  • /api/screenOff?enable=<bool> Power Screen ON/OFF

  • /test A very basic integration test.

Display Image

To Display an image on the Pixoo, you musst first upload with /api/upload the picture and then set the image with/api/img

  • /api/upload Used to upload an image to the Server. Use the multipath/form and the key file for the actual file. Returns the path to the image, use this to set the image.
  • /api/img?path=<String> Displays the image on the Pixoo. With /api/upload you can get the path

References


This project is build using the ingenuity of many others:

About

Sending pixel soup to a Divoom Pixoo LED panel. https://github.com/jfroehlich/pixelramen

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 90.0%
  • HTML 10.0%