XC2 webserver

Technical discussions related to any XMOS development kit or reference design. Eg XK-1A, sliceKIT, etc.
smuraski
Member++
Posts: 20
Joined: Fri Oct 22, 2010 3:06 pm

Post by smuraski »

This only seems to affect image files...HTML and the CSS files do not seem to be affected...even tried moving the image files to the web folder...same results...


richard
Respected Member
Posts: 318
Joined: Tue Dec 15, 2009 12:46 am

Post by richard »

smuraski wrote:I believe that there is an underlying issue with the script or PERL on a WindowsXP Pro machine...I compared the fsdata.c file from the zip distribution with those generated when the script is run and the the image files which contain 0x0D drop the first occurrence of 0x0D
0x0D is a carriage return in ASCII. I suspect the problem is automatic conversion of line endings on Windows. Try adding using binmode to set the the mode of the input files to binary after you open them (see http://perldoc.perl.org/functions/binmode.html).
smuraski
Member++
Posts: 20
Joined: Fri Oct 22, 2010 3:06 pm

Post by smuraski »

OK...so now that I understand this better...it is the sequence of 0x0A 0x0D that windows translates into 0x0A...I tried to decypher the perl script and it looks like if it is an .HTML file or .CSS then binary mode is turned off and if the file is located in the img folder and is a .jpg, .gif or .png it is turned on.

Is there another program that could be used to generate the data?

Some other issues that will eventually need answers include:

What is the meaning of the rest of the information in the declarations following the "data' as in:

static unsigned int cmd__config_html[] = {
1,(unsigned int) &data__config_html[13],2,2052,8,2,33,4,2,45,9,2,42,10,2,32,12,2,414,10,2,94,12,2,714,0,
};
What is the purpose of the data in the struct declarations?

How does the script make the decision when it creates the 2nd to last line "#define FS_ROOT file__index_html" because this also is incorrect in the genereted fsdata.c file...in one case it referred to a jpg image.

Comments in the perl script would really help to understand how the fsdata.c file is generated and a short tutorial on interpreting the script would probably minimize the support required.

I stated several posts back that I only want to be able to produce a couple of modified web pages for proof of concept to a customer...I have no intention of using a fixed rom code table in any work moving forward and therefore no interest in learning another language such as perl.
Surely after the year that this issue has been out there, XMOS must know how to solve the script issue on windows machines?

If this cannot be solved by XMOS, I may be forced to abandone this concept...and I am sure that other platforms have similar issues if they depend upon perl scripts as well...I find it hard to believe that a company such as XMOS, which seems to be trying to push a viable concept such as the XCORE, would allow so many people to fail by ignoring the windows issue of the perl script.

Maybe I am just getting old and stubborn, but I just don't want to learn a new language just so I can evaluate a product and provide a proof of concept demonstration to a company who could potentially sell hundreds of systems per year with at least two XMOS chips per system...probably more like 4-5 per system. If you really want people to adopt your platform, then I think XMOS should step up to the plate and solve the problem which by the accounts of the forums seems to be many others unable to solve the problem going back approximately a year or so.

If XMOS has no interest in helping to solve the problem, then just tell me to put it back in the box and return the product because you do not want to provide any real support...in my opinion...although I do not want to misrepresent my appreciation for the posted replies that many have provided, including XMOS...but no one from XMOS has provided an actual solution. I don't expect XMOS or anyone else to do my programming, but provide a usable "out of the box" product. Then if I must learn PERL after that, it is my choice and my reponsibility.
User avatar
leon_heller
XCore Expert
Posts: 546
Joined: Thu Dec 10, 2009 10:41 pm
Location: St. Leonards-on-Sea, E. Sussex, UK.
Contact:

Post by leon_heller »

This is a user forum and isn't necessarily monitored by XMOS support. Try contacting customer support and post their reply here.
User avatar
RogerH
Active Member
Posts: 55
Joined: Fri Oct 15, 2010 12:14 am
Contact:

Post by RogerH »

I have not found it necessary for my ARM projects, but googling around I found the following:

Mike Newsome | 23 Dec 08:44
RE: RE: web page contents
Mike Newsome <Mike.Newsome <at> hitekpower.com>
2009-12-23 07:44:26 GMT

I noticed when using the perl script makefsdata, that it needs a couple of tweaks:
1. If it is being run under Windows, the files need opening in binary mode, otherwise graphics file encoding
can fail. (add 'binmode FILE;' after line 29 'open(FILE, $file) || die "Could not open file $file\n";').

2 The length of each file reported by
print(OUTPUT "sizeof(data$fvar) - ". (length($file) + 1) ."}};\n\n"); (line 74)
seems to be wrong and should be (length($file) + 2), but that may be my misunderstanding.

Regards, Roger...
richard
Respected Member
Posts: 318
Joined: Tue Dec 15, 2009 12:46 am

Post by richard »

smuraski wrote:I stated several posts back that I only want to be able to produce a couple of modified web pages for proof of concept to a customer...I have no intention of using a fixed rom code table in any work moving forward and therefore no interest in learning another language such as perl.
Hi Smuraski,

Sorry if you think my reply was unhelpful. I haven't personally worked with the webserver code - my response was based solely on the symptoms you were describing. I've taken the perl script from xmos_tcpip_1v3 release, applied the modification I suggested and attached the resulting file to this post. You'll need to change the extension back to .pl (the forum won't let me attach a .pl). To recreate the data replace the original makeData.pl with the new version, open a command prompt in the app_xc2_firmware.1v3/src/httpd/web directory and run makeData.pl using the command:

perl makeData.pl > ../fsdata/fsdata.c

I'm not able to test it right now but I'm hopeful this will solve the problem. Let me know if this still doesn't work.
Attachments
makeData.txt
makeData.pl
(4.31 KiB) Downloaded 259 times
makeData.txt
makeData.pl
(4.31 KiB) Downloaded 259 times
User avatar
leon_heller
XCore Expert
Posts: 546
Joined: Thu Dec 10, 2009 10:41 pm
Location: St. Leonards-on-Sea, E. Sussex, UK.
Contact:

Post by leon_heller »

I just tried it and it seemed to work. Unfortunately, I can't build the application because the XDE is playing up and won't compile large applications.
smuraski
Member++
Posts: 20
Joined: Fri Oct 22, 2010 3:06 pm

Post by smuraski »

Your reply may have been helpful to someone familiar with perl and understood what the script was doing. I do appreciate the efforts of you and others, but the bottom line is that none of it was helping to understand how to fix the problem...so let me reiterate that I truly appreciate your suggestion and those of others who have tried to help...ultimately, it would be very helpful to gain a better understanding of the workings of the XC2 implementation of uIP...I will try the new script though and let you know if it works. Thank you.
User avatar
leon_heller
XCore Expert
Posts: 546
Joined: Thu Dec 10, 2009 10:41 pm
Location: St. Leonards-on-Sea, E. Sussex, UK.
Contact:

Post by leon_heller »

Perl - Poor Excuse for a Real Language. :D

If you find Python easier, there are Perl to Python converters.
smuraski
Member++
Posts: 20
Joined: Fri Oct 22, 2010 3:06 pm

Post by smuraski »

The problem with the images seems to be fixed now...thank you.

Now what about the structs and defines at the bottom of the fsdata.c file? I will try to figure out why it is different...but I am back to a lack of information regarding what the contents are supposed to be because I do not understand the perl script.
Post Reply