Giter VIP home page Giter VIP logo

udpx-app's Introduction

udpx Logo

udpx is a technology to transport data over WiFi to microcontrollers

What it can be used for

  1. Send a picture over WiFi to a LED controller with ESP32 udpx firmware or Remora
  2. Send over the air Video frames.

Note that Remora supports only plain Pixels without any compression. udpx supports zlib and brotli as compression algorithms. Up to 1000 RGB pixels. The ESP32 has a maximum transport unit (MTU) of 1470 bytes and we are not doing buffering on the Firmware side, so using Zlib or Brotli compression 1000 pixels is the limit where you can still get a decent framerate.

Android App latest builds

If you want to test this fast using Android, just download and install the udpx app from Play store: udpx esp32

Luckycloud cloudstorage hosts the latest APK builds, if you want to check latest unstable features first uninstall the App, and download:

Latest signed APK release

And install it on your Android phone after giving it the necessary permissions. We recommend to use only the stable Play store versions.

This application sends RGB pixels to ESP32 controllers. We are using canvas to render video and read the pixels to be send as binary data to the ESP32. To accomplish that mission the ESP32 controllers should be running our UDPX Firmware or alternatively OctoWifi firmware Protocols supported:

Last two are meant to be used with OctoWiFi Led controller Firmware.

iOS /iPad version is not going to see the light at least this year. I'm reluctant to buy a Mac just for this, so anyone taking the task is greatly welcome. If you need any other platform, feel free to clone this, and make it your own. To check upcoming features just open the Issues board.

Dependencies

udpx-app uses offers both BLE and Bluetooth-serial WiFi configuration using this great plugins: https://github.com/don/BluetoothSerial https://github.com/don/cordova-plugin-ble-central

UDPX ESP32 Firmware

This is a companion App to send binary data via WiFi to ESP32 Led controllers. To compile the Firmware please refer to:

udpx Firmware in github

We use PlatformIO as a Visual Code IDE to upload this into the Espressif chip and we recommend to compile it this way.

UDPX recommended Hardware to display video

The firmware supports any RGB addressable leds to do this (WS2812B or similar). A practical way to display video is to adquire a Led Matrix that comes already built. Please check our hardware buying guide before buying the gear to build a Led Matrix. Note that the data flow on the horizontal lines on most of this panels is like this:

  1. --> right. This is important the data IN should be on the top left of the Led Matrix and flow down
  2. <-- left (pixels in this one should be reversed before sending)
  3. --> and so on.
    IN_______  1st Led Matrix
    ->|      | Row 1 ->
      |______| Row 2 <-
            -> OUT connected to IN in 2nd
    IN_______  2nd Led Matrix
    ->|      | Row 1 ->
      |______| Row 2 <-

So this App takes care of doing the sort(2) in your client before sending the bytes. It supports only this data flow at the moment, and stacking Led Matrixes one below the other, so if you are planning to build a video wall using linear Led stripes make sure to follow suit. Is actually the most easy way to do it, otherwise you should wire the data from right corner on every end of line to the left of the next one, so for simplicity is done this way. Make sure that in the Led Matrix you adquire the data flows horizontally in the larger width (Ex. 44 width, 11 height) This App reads the canvas horizontally, from top-left to right, and streams like this to the Firmware without making any rearranging except of inversing the pair lines. The udpx Firware does not have a clue of what Matrix you use, it just pushes next UDP packet after processing via Neopixels to the Led.

Licensing

This App is open source and you can make it your own as long as you respect the copyright ownership of UDPX. If you want to use it commercially is also no problem but please write a short message to see where it will be used so we can follow the project.

udpx-app's People

Contributors

martinberlin avatar dependabot[bot] avatar

Stargazers

Arduino Aficionado avatar Gonzo Gear avatar b1ghawk avatar  avatar LeekingWeng avatar  avatar Josh Hays avatar Hendrik Putzek avatar muuk avatar Carlos Fasani avatar  avatar

Watchers

James Cloos avatar  avatar Arduino Aficionado avatar  avatar

udpx-app's Issues

Add a option to make header bytes 2-3 represent chunk size

In accordance with martinberlin/pixels#3 let's add in Tab ESP a new section called "Advanced output settings"

|_| Set chunk size headers (Width*Height)

Marking this checkbox it will fill up headers 2-3 with a 16 bit LSB unsigned integer representing chunk size. For our test we will use two 44x11 panels, so this two bytes will represent a 484 chunk size.

The firmware will interpret this setting and send first chunk to channel 1 (gpio 19) and the remaining to channel 2 (gpio 20) reducing the send time to the stripe and sending parallel output to two different RMT channels in ESP32

I will implement this and reorganize last branch:
https://github.com/martinberlin/udpx-app/tree/feature/11-reverse-option Referencing the commits with this issue number

WiFI configuration over BLE

Check out ESP32WiFiBLE app and also:

https://github.com/don/cordova-plugin-ble-central

In order to enable a Config tab that will scan BLE devices or alternatively use Bluetooth serial and have the following options:

  1. Reset device
  2. Set configuration

I want to keep it as simple as possible since maintaining both BLE and Bluetooth Serial methods is already complicated per se. So the fruit of the cake here would be to end up the set credentials process with a push over Bluetooth of a json:

    {"status":true, "msg":"Connected", "ip":"IP_ADDRESS", "port":"UDP_PORT"}

or

    {"status":false, "msg":"Did not found WiFi AP NAME_OF_AP, could not connect"}
    {"status":false, "msg":"Wrong credentials, could not connect to NAME_OF_AP"}

In the app, only if status is true, display a Dialog box:

Connected with IP: IP_ADDRESS Port: UDP_PORT
Do you want to update your Controller connection parameters?

If you select YES, then it will set that on the Controller tab, opening that Tab for you to check if it's everything like expected. Then you can press play and see if it works.

Both discarded in the First Version:

  • As an alternative for security PIN, it would be possible just to have a "Lock ESP32" option. After confirming, if lock is done, the only way to update WiFi credentials will be to upload a new firmware.
  • Optionally it will read configuration on startup when the ESP32 is paired (Discarded, for simplicity)
    Eventually would be nice to know just for the record, what SSID it was inside the ESP32, but no old passwords flying around Ble.

Increasing bright from 0.1 to higher values generates yellow

In the Android app, increasing the brightness generates a strange degrade that generates yellow in the bottom of every RMT channel. Not sure if it's the app or if I drunk one glass of white wine too much.
Interesting if you are into yellow.

mDns discovery using zeroconf takes too long

Check if there is a configuration setting or a way to restart the mDns discovery if it does not discover anything for 5 seconds. At the moment is necessary to restart the udpx App which is quite bad for usability and too time consuming.

Implement PIX565 as a protocol

Since I started testing with bigger Matrixes, like 50*20, I realized even with compression is always on the limit and skips frames all the time.
So I would like to try to implement 565:

5 bits for Red
6 for Green
5 for Blue

Issue to support this on the Pixels library:
IoTPanic/pixels#7

Add advanced settings option

As a user, I would like to have an advanced stettings option, that is collapsed by default.
If you open it, will display a more detailed control of the output, for now let's add a:

 |_| Invert direction per unit

If checked will invert the direction of the lines after the first unit. Let's imagine our unit has 11 lines:

1 --> in first unit
11--> if that checkbox is checked then
01<-- of second unit

1 --> in first unit
11--> if that checkbox is not checked then
01--> of second unit

Send brightness as byte[1]

Brightness will be not done anymore in the Android side. When converting and byte shifting to achieve 565, this makes all colors quite flat and also greenish white. But also we are doing multiplications over 1000 of RGB colors in slow javascript.

It will be send as the byte[1] via UDP and will be calculated in the Firmware side.
Firmware reference: martinberlin/udpx#17

Dropdown in the UX should be like

|___v| Byte[1] value

10% | 2
15% | 3
20% | 4
25% | 5
30% | 6
35% | 7
40% | 8
45% | 9
50% | 10
55% | 11
60% | 12
65% | 13
70% | 14
75% | 15
80% | 16
85% | 17
90% | 18
95% | 19
100% | 20

UPDATE: There has to be a round operation that flattens the image diving each byte value /2

        r = Math.round(pixels[k][0]*0.5);
        g = Math.round(pixels[k][1]*0.5);
        b = Math.round(pixels[k][2]*0.5);

This reduces a lot the compression, since it works much better when they are patterns to compress, but it won't help much in videos that have a rainbow of colors on each frame.
This will be implented on branch : feature/13-pix565
Since it's related to this new protocol.

Add bytes number in red when surpases 1470 MTU size

Now message says:
NNN compressed bytes sent

or
NNN bytes send

Just wrap the number with:

<span color="#FF0000">NNN</span>

To give a clean indication that the ESP32 Max. transport unit is being surpassed

Add a Led matrix option to reverse pair lines in the client

Only as a test since I want to make some benchmarks add a dropdown that will let the user select between:
|_| Reverse matrix pair lines in Android (checked by default)

Measure before implementing anything in the Firmware side how much we gain doing this. If the difference is insignificant for the 968 Pixels tests, then we can leave it as is.

Add a Reset stripe short UDP command to make off all the Leds [99,0,0]

The commands are going to be preceded by c

Then 0,0 will follow to identify this as "all off" in the udpx Firmware side.
This should happen if at any time the user decides to change in the Video tab any of this parameters:

Width, Height or Units

Related: Firmware udpx Issue 14

Update: There will be 2 short commands that send 3 bytes each

99,0,0   Put all stripe off
114,0,0  Reset WiFi credentials

So we can force WiFi Credentials delete in case we are on the go, to leave the strip ready to be configured elsewhere.
There is already a Reset in + Wifi tab, but is actually sending a Bluetooth message, so we can send both and display clearly the Controller name you are addressing.

@carlosfasani identified this issue, since if you decide to send less pixels on a live session, the pixels at the end will remain with last values. With this small fix, this won't happen, since on every onchange on Width, Height or Units, will send first the command and then keep on with the Video rendering.

Update ms/frame to FPS

Samuel @IoTPanic suggested:
I think to make it easier for people to understand, you should change the ms/Frame into a set FPS field and do the math in the app

Javascript vulnerability

After Play Console feedback I need to update jquery to:

https://snyk.io/test/npm/jquery/3.4.0

And in a second though, the only reason is still there is because I use the Tabs from bootstrap, but I would love to get rid of it. Anyone knows any good alternative to use Tabs without any complex Javascript that works good in mobile?

UX redesign: Tabbed navigation

As home is starting to be too crowded with too many options we are planning to add some tabbed navigation.
From top of my frontal lobe:

  • Led matrix
  • Controlller

Led matrix will group all related configurations such as width, height, units:
tab-matrix

Controlller will host Espressif IP, Port and Protocol used to send the binary data.

BLE explained in #1 will be a future 3rd tab that will list, pair and set up the WiFi credentials for the controllers

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.