Due to high demand expect some shipping delays at this time, orders may not ship for 1-2 business days.
0

Trying to get the FlickrWidget running on Ybox2
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Trying to get the FlickrWidget running on Ybox2

by Fuligin on Mon Jul 07, 2008 8:36 pm

Hi.

I am attempting to get the flickr widget from the ybox running on the ybox2, in the hopes of extending and figuring out something cool to do with it.

Being a complete beginner with SPIN and the propeller chip, I find and run the FlickrWidget from ybox.tv, which of course did not work due to the lack of the x port (this was not obvious to me at first since my friend built the actual ybox2). Anyway, there was something else that seems to be significant: a pattern was drawn in the display buffer that seems to be data, sort of a tall rectangle with a shorter one to it's left and some garble near the bottom. I will refer to this henceforth as the Weird Mystery Pattern (WMP).

So, I created a "frankenstein widget" that merges the FlickrWidget with the api_telnet_serial widget and the driver_socket to replace the x port. It also displayed the WMP.

It worked. Once. The second time I go to connect, I get a connect failure (I am using the LED and piezo to debug). This seems to be due to the WMP being overwritten by the Flickr image.

I think I proved this by writing nulls to the display buffer to clear it and noting I could not even get it to work a single time.

I also set the length of the display buffer to ¾ of max (as a test), so the image would partially paint, yet the WMP would be untouched. This lets me connect a second time, but something is still whacked since I no longer can get the server to return a 200 http code. It seems like the telnet widget works once, and then goes braindead.

Any thoughts or ideas as to what the WMP is, whether what I am doing is even feasible, or any limitations you might be aware of that I am perhaps hitting would be very welcome.
Fuligin
 
Posts: 5
Joined: Mon Jul 07, 2008 7:26 pm

by darco on Mon Jul 07, 2008 9:24 pm

You have an admirable goal, and it would be very cool if/when you get it working!

Off the top of my head, the likely issue is memory availability. The networking overhead on the ybox2 is much higher than on the original ybox because all of the networking is now done on the propeller.

Currently, the networking code takes up around half of your memory. Ouch! You can reduce this a fair amount by reducing the size of some of the buffers. Specifically, change the Q_BITS constant in qring.spin down from 8 to something like 6. This will reduce performance, but also decrease the memory footprint by... 192 longs. Ok, that wasn't so much. Nevermind.

I mention all of this because the flickr program for the original ybox had gobs of memory to work with (and abuse) compared to the ybox2. Without looking at your code, my best guess is that this is the problem: Memory corruption, aggravated by very tight memory constraints.

That being said, it could still be possible to get it to work, but I'd need to have a look at your source code first to figure out what is going on.
darco
 
Posts: 118
Joined: Wed Jun 04, 2008 7:54 pm
Location: Campbell, CA

by darco on Mon Jul 07, 2008 9:33 pm

Oh, by the way... api_telnet_serial isn't itself a "widget", it is more like a library or an interface. It is used by the widgets.

The official widgets (not including the bootloader) on SVN are:

infowidget.spin

wwwexample.spin

twitwidget.spin

alarmwidget.spin
darco
 
Posts: 118
Joined: Wed Jun 04, 2008 7:54 pm
Location: Campbell, CA

by Fuligin on Mon Jul 07, 2008 9:59 pm

Thanks for the reply. I mailed you the source, and can post it here also, if you like.

Your theory seems correct. It would be cool to get working though.
Fuligin
 
Posts: 5
Joined: Mon Jul 07, 2008 7:26 pm

by Fuligin on Tue Jul 08, 2008 1:43 pm

An interesting update from playing at home last night with the ybox2.

I could not get DHCP to issue an address from a linksys router. I read the other thread, so understand that is an issue in some cases.

The interesting thing is I started hold down the button on the ybox2, and got it into a weird state, where I saw, very briefly, the WMP (weird mystery pattern) from the bootloader.

I did a reset and got things back to normal (good since the prop plug has not arrived yet).

Not sure that is any sort of meaningful clue, but it was the exact same pattern in the exact same place on the screen.
Fuligin
 
Posts: 5
Joined: Mon Jul 07, 2008 7:26 pm

by Fuligin on Tue Jul 08, 2008 5:41 pm

Also, one further thought:

DHCP is necessary for the bootloader, but not for the Widget. Would anything be gained by a lighter version of the TCP stack for the Widget to use that does not include DHCP?

The qring buffers would still eat a lot of ram, probably.
Fuligin
 
Posts: 5
Joined: Mon Jul 07, 2008 7:26 pm

Please be positive and constructive with your questions and comments.