"Stream to cube" not possible!!

218 views
Skip to first unread message

Dirk S.

unread,
Sep 11, 2015, 4:16:27 PM9/11/15
to cubetalk
Streaming to cube not possible due to the fact, that the listener is not loading! The Photon is not changing to purple, after I acknowledged the message ..."take a dance breake for 20 seconds...!!
Nothing happens! Still breathing cyan! Cube is online as normal. Loading offline pattern is no problem. Even the video tutorial from the specialist is not working! HELP!! What about the promised update from JUNE 2015?

Werner M.

unread,
Sep 11, 2015, 11:36:59 PM9/11/15
to cubetalk
ummm.. interesting.

First thing, let´s calm down.
Yes, it is an issue, I can confirm that. But I can also confirm it is a new one, as this was working until not too long ago.
This shouldn´t be an issue in the cubes as the library only listens to udp packets coming in on port 2222.
You do that whenever you call cube.begin() in your sketch. Since you cannot get your cube to run withiut calling the begin function, it´s safe to assume if yiur cube is displaying something (from a viz) then it is also listening on udp packets.

So my guess is that something´s supposed to send certain data packets via udp on port 2222 and it suddenly stopped doing that.

Alex is probably the best guy to tell us if my guess is a long shot or if it´s somewhere near the ballpark.

-Werner

Werner M.

unread,
Sep 12, 2015, 12:36:37 PM9/12/15
to cubetalk
I've tested this by forcing my cube to listen for udp streaming at every call to cube.show(). The way I did this was to modify my Cube::show() function, like so:

/** Make changes to the cube visible.
  Causes pixel data to be written to the LED strips.
*/

void Cube::show()
{
 
this->strip.show();
 
if(this->onlinePressed) {
   
Particle.process();
   
this->listen();    // we're forcing the cube to listen for UDP streaming
 
}
}

So my cube would be calling the listen function, and this one would be constantly listening for data that is coming in from port 2222 and is the same size as the cube's LED count (512, in case of an 8x8x8). If it finds nothing was received, it does nothing else.
(BTW, that array should be dimensioned according to the pixel count; instead, the array is always set to a fixed size (512) - OK for 8x8x8 cubes, but probably wrong for the bigger ones. I'd change the array definition to set the dimensions with the constant that's already been set in the header file.)

/** Listen for the start of UDP streaming. */
void Cube::listen() {
  int32_t bytesrecv
= this->udp.parsePacket();

 
// no data, nothing to do
 
if(bytesrecv == 0) return;

 
if(millis() - this->lastUpdated > 60000) {
   
//update the network settings every minute
   
this->updateNetworkInfo();
   
this->lastUpdated = millis();
 
}

 
if(bytesrecv == PIXEL_COUNT) {
   
char data[512];
   
this->udp.read(data, bytesrecv);

   
for(int x = 0; x < this->size; x++) {
     
for(int y = 0; y < this->size; y++) {
       
for(int z = 0; z < this->size; z++) {
         
int index = z*this->size + y*this->size + x;
         
Color pixelColor = Color((data[index]&0xE0)>>2, (data[index]&0x1C)<<1, (data[index]&0x03)<<4);   //colors with max brightness set to 64
         
this->setVoxel(x, y, z, pixelColor);
       
}
     
}
   
}
 
}

 
this->show();
}

Even with that, testing streaming apps on cubetube still did not work. So I think it's definately something going wrong in the server.


-Werner

Dirk S.

unread,
Sep 13, 2015, 3:05:18 PM9/13/15
to cubetalk
Big thanks so far for your effort to fix that issue!
In the meantime I´ve also tried to get the streaming working by using MS WIN10 with Firefox and Chrome ... but unfortunately same bad result!

Werner M.

unread,
Sep 15, 2015, 10:25:24 PM9/15/15
to cubetalk
Right. So I've been busy doing some interesting UDP-streaming-related research on my cube. It turns out I wrote a listener sketch that I can set to any UDP port I want.
And I know it works, 'cause it is working for that research I've documented in there.

So setting that sketch to listen on 2222 also did not work when I tried to stream from cubetube.
This means my cube's listening, but on the other end, no one's talking.

I wonder if other people are getting the apps streamed to their cubes.

Werner M.

unread,
Sep 18, 2015, 3:32:24 PM9/18/15
to cubetalk
Just an update: after having tested a sketch that I developed for UDP listening over the local network and publishing it (privately) in cubetube, I found out it wouldn't work!
The code is the same I published in my Particle Web IDE and tested to be working. But when the same code pasted in a new viz is compiled and downloaded from cubetube, the photon would not listen to UDP packets.

So I can confirm that there is a problem in cubetube.

I have to do some testing in my LAN later, with the binary loaded from cubetube, and see if it Wireshark can tell me something useful. If I find anything interesting I shall post it here.


Message has been deleted

Ben Ledbury

unread,
Sep 19, 2015, 4:17:26 AM9/19/15
to cubetalk
At least one of the issues here is that the listener binary appears to be missing so there's nothing available to flash to the cube.
Whether or not that binary would actually work once flashed is another matter.

Ben Ledbury

unread,
Sep 19, 2015, 4:20:18 AM9/19/15
to cubetalk
Should be present at "/home/glass/cubetube-production/media/listeners/websocketsListener.bin", I found this by following the URL logged by the JavaScript (/listener/<core_id>/Core/)

Ben Ledbury

unread,
Sep 19, 2015, 4:21:50 AM9/19/15
to cubetalk
This is for the core BTW, the photon may well have the binary available

Werner M.

unread,
Sep 20, 2015, 5:37:40 PM9/20/15
to cubetalk
The lack of a binary for the listener could be the issue for nothing being flashed to the cube when you click OK in the javascript Alert box, but there is definately something else going on when you flash a viz from cubetube, because my UDP listener sketch does not work at all when flashed from cubetube. And it works perfectly when I flash it from Particle Web IDE.

BandonRandon

unread,
Nov 6, 2015, 12:48:40 AM11/6/15
to cubetalk
Just got my L3D Cube and would love to try the viz that require a computer. Any update on this issue?
Reply all
Reply to author
Forward
0 new messages