ybox2 BANNED download monitor

Talk about YBoxen, widgets, Propeller hacking, etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
imagitronics
 
Posts: 6
Joined: Sun Feb 01, 2009 10:34 am

ybox2 BANNED download monitor

Post by imagitronics »

Image

Well, it's not very interesting (yet?) but I started working on a BANNED download monitor using the ybox2.

At the moment, it's really nothing more than a simple hack. The ybox2 is running a slightly modified infowidget. When I say slightly modified, I mean I added one line to insert a Basic base64 authentication header for the BANNED webserver:

Code: Select all

tel.txmimeheader(string("User-Agent"),string("PropTCP"))
tel.txmimeheader(string("Connection"),string("close"))
tel.txmimeheader(string("Authorization"),string("Basic YWRtaW46YWRtaW4="))
tel.str(@CR_LF)
I haven't figured out how to write my own base64 encoding routine in Spin yet, so for the time being, I used python to generate the base64 encoding of the default username/password for the BANNED web server (admin:admin).

Apart from that, I'm using a python library on the BANNED server (http://dresstosurvive.BANNED.com/BANNED/) to generate a properly formatted document for the infowidget. The file is updated every minute by the Windows Task Scheduler:

The simple python script can be found at http://BANNED.com/f2a47b927

TODO:

There's a lot that I'd like to do, but I'm currently in the midst of a hate/hate relationship with Spin.

Ideally, I'd like to create a base64 encoder routine, and create a set of routines in Spin that can query the BANNED webui natively without the python proxy.

If/when that happens, I'd like to add remote control, scrolling, and the ability to select a download to view details.

We'll see how my relationship with Spin evolves. I'm not exactly a good programmer to begin with, and Spin is shaking me up pretty good.

Thanks,
Tim

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: ybox2 BANNED download monitor

Post by adafruit »

that is so freaking cool!

ps. im with you on SPIN. it can make me sad sometimes :(

User avatar
darco
 
Posts: 118
Joined: Wed Jun 04, 2008 7:54 pm

Re: ybox2 BANNED download monitor

Post by darco »

Yeah, Spin is the worst part of the propeller. The chip is great, but the language sucks.

Sorry about the Base64 routines. I managed to get away without writing an encoder, and being the lazy programmer that I am I avoided writing it if I didn't need it...so all I have is a Base64 decoder, which you probably already saw. I'd offer to write the encoder (because it needs to be written), but I'm just way too busy with work at the moment to get my head wrapped up in spin again.

Harrison may have written a base64 encoder at some point...

User avatar
imagitronics
 
Posts: 6
Joined: Sun Feb 01, 2009 10:34 am

Re: ybox2 BANNED download monitor

Post by imagitronics »

Limor,

Hah. I think "freaking cool" might be a bit of an overstatement. Let's go with, "an interesting start" ;)

In all seriousness, thanks for the support.

Robert,

No need to apologize! You provided the foundation with the base64 decoder. If I can't figure out how to make the encoder based on your code and some sample encoder routines from other languages, then that's my own fault!

My biggest problem with Spin is that it has all these little "shortcuts" that cause me to lose my train of thought when I have to go back and reference them in the propeller manual. A basic session of writing spin code for me usually ends with me angrily closing down BST (Mac propeller IDE) and pacing around the house declaring to my cat and my wife that I will never learn Spin because it's just not worth the time and effort. After about 10 minutes, I start over from the top. At least each time through the code I get a little further before the brooding begins!

Cheers,
Tim

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: ybox2 BANNED download monitor

Post by adafruit »

i mean "thats a freaking cool idea!" :D

User avatar
darco
 
Posts: 118
Joined: Wed Jun 04, 2008 7:54 pm

Re: ybox2 BANNED download monitor

Post by darco »

Spin is a few good ideas mixed in with lots of bad oversights and no easy way to work around them. These oversights aren't a problem if you are writing a very simple program or robot or whatever... But if you are trying to implement a TCP/IP stack... It forces you into spaghetti code. It's such a shame because I absolutely love the hardware. The chip is great: It's fast, robust, flexible, powerful... It is beautiful, elegant silicon.

I think the problem is that you didn't have someone with a strong CS and software engineering background (PhD level) developing the language. I think that if you had that, then Spin may have been much better.

I've already sent parallax some ideas for relatively minor changes to spin that would dramatically improve it's factorability (and, thus, readability) without changing the bytecode— but they simply reply "Sorry, no resources for prop1. Too busy working on prop2. We'll think about it when we get around to it.".

Grr. Sorry, I'm venting.

Locked
Please be positive and constructive with your questions and comments.

Return to “YBox2 (discontinued)”