Jump to content
  • 0

Compiling deWebIOServer from Arduino IDE for chipKit WF32


mstoer

Question

I have compiled the deWebIOServer example in the past with mpide and ran it on my WF32 board with no problems.   I know want to compile it from the Arduino IDE (1.6.9) as a test before setting up my own webserver on the WF32 and cannot get it to compile.  I used the Arduino IDE to add the chipKit core (v1.2.1) .   Simple "hello world" and "blink" type apps compile and run fine.    However when compiling the deWebIOServer  app I get the errors below and haven't been able to resolve them.   Did I mess up the core installation somewhere or is it something else?   Google hasn't been to helpful on this.

Marcell

 

Arduino: 1.6.9 (Windows 10), Board: "chipKIT WF32"

libraries\HTTPServer\HTMLSDPage.cpp.o: In function `DFILE::write(unsigned char)':

c:/users/mstoer/appdata/local/arduino15/packages/chipkit/hardware/pic32/1.2.1/libraries/dfatfs/dfatfs.h:136: undefined reference to `DFILE::fsputc(char)'

libraries\HTTPServer\HTMLSDPage.cpp.o: In function `DFILE::read()':

c:/users/mstoer/appdata/local/arduino15/packages/chipkit/hardware/pic32/1.2.1/libraries/dfatfs/dfatfs.h:137: undefined reference to `DFILE::fsread(void*, unsigned long, unsigned long*, unsigned long)'

libraries\HTTPServer\HTMLSDPage.cpp.o: In function `DFILE::peek()':

c:/users/mstoer/appdata/local/arduino15/packages/chipkit/hardware/pic32/1.2.1/libraries/dfatfs/dfatfs.h:139: undefined reference to `DFILE::fslseek(unsigned long)'

libraries\HTTPServer\HTMLSDPage.cpp.o: In function `DFILE::flush()':

c:/users/mstoer/appdata/local/arduino15/packages/chipkit/hardware/pic32/1.2.1/libraries/dfatfs/dfatfs.h:140: undefined reference to `DFILE::fssync()'

libraries\HTTPServer\HTMLSDPage.cpp.o: In function `SDRead(DFILE&, unsigned char*, unsigned long)':

c:/users/mstoer/appdata/local/arduino15/packages/chipkit/hardware/pic32/1.2.1/libraries/httpserver/htmlsdpage.cpp:112: undefined reference to `DFILE::fsread(void*, unsigned long, unsigned long*, unsigned long)'

libraries\HTTPServer\HTMLSDPage.cpp.o: In function `SDSetup()':

c:/users/mstoer/appdata/local/arduino15/packages/chipkit/hardware/pic32/1.2.1/libraries/httpserver/htmlsdpage.cpp:139: undefined reference to `DFATFS::fsmount(DFSVOL&, char const*, unsigned char)'

c:/users/mstoer/appdata/local/arduino15/packages/chipkit/hardware/pic32/1.2.1/libraries/httpserver/htmlsdpage.cpp:157: undefined reference to `DFILE::fsopen(char const*, unsigned char)'

c:/users/mstoer/appdata/local/arduino15/packages/chipkit/hardware/pic32/1.2.1/libraries/httpserver/htmlsdpage.cpp:163: undefined reference to `DFILE::fsclose()'

libraries\HTTPServer\HTMLSDPage.cpp.o: In function `ComposeHTMLSDPage(CLIENTINFO_T*)':

c:/users/mstoer/appdata/local/arduino15/packages/chipkit/hardware/pic32/1.2.1/libraries/httpserver/htmlsdpage.cpp:256: undefined reference to `DFILE::fsopen(char const*, unsigned char)'

c:/users/mstoer/appdata/local/arduino15/packages/chipkit/hardware/pic32/1.2.1/libraries/httpserver/htmlsdpage.cpp:275: undefined reference to `DFILE::fslseek(unsigned long)'

c:/users/mstoer/appdata/local/arduino15/packages/chipkit/hardware/pic32/1.2.1/libraries/httpserver/htmlsdpage.cpp:340: undefined reference to `DFILE::fsclose()'

c:/users/mstoer/appdata/local/arduino15/packages/chipkit/hardware/pic32/1.2.1/libraries/httpserver/htmlsdpage.cpp:362: undefined reference to `DFILE::fsclose()'

libraries\HTTPServer\HTMLSDPage.cpp.o: In function `__static_initialization_and_destruction_0':

c:/users/mstoer/appdata/local/arduino15/packages/chipkit/hardware/pic32/1.2.1/libraries/httpserver/htmlsdpage.cpp:54: undefined reference to `SoftSPI::SoftSPI(unsigned char, unsigned char, unsigned char, unsigned char)'

collect2.exe: error: ld returned 255 exit status

exit status 255
Error compiling for board chipKIT WF32.

 

 

Link to comment
Share on other sites

Recommended Posts

JColvin,

Thanks for your reply.  I have a couple of questions the answers to which might help me get this working.

1) Is it possible that I installed the libraries in the wrong place on my hard drive so the project is not recognizing them?

2) Are there any other potential gotchas in project installation that would cause it not to build?

3) Can we swap out the chipKIT core version for another version to make this work?

4) Can we swap out the project for another project that does something similar but that builds with either of the cores?

5) What exactly is the function of the 'core' in these projects?

Thanks again for your help.

squirrel1

Link to comment
Share on other sites

So does your point (1) mean that if I want to connect the server programmatically to a portable device that I need to do this by calling into and perhaps modifying the C++ library that is installed at the libraries/HTTPServer directory?

As for your point (2), I seem to have a case of "it runs on my machine" syndrome. I have several different controls and styles that run correctly locally on my laptop but not on the project server. As a consequence, I am considering moving the html code off of the WF32 and onto my portable device. Unfortunately, this introduces its own set of problems. For example, it no longer runs on any arbitrary portable device that has hotspot functionality but instead must be installed first on the portable device. I know you said you added a link to test this but have you tried text formatting, such as bolding? For example, can you add a readonly input box that sets the text, font and bolding in a separate css file? This is one example of what I am unable to do.

Thanks again!

squirrel1

Link to comment
Share on other sites

Hi @squirrel1,

1) I believe so; it looks like in the deWebIOServerSrc.cpp file there is a AddHTMLPage(szHTMLReboot, ComposeHTMLRebootPage); which you can dig into further in the main HTTPServer file (a couple of file levels up from where the deWebIOServer example is located on your computer). I don't think there is any pre-made example for it though and it goes beyond my knowledge of the network stack that this demo is built off of, so I won't be of a lot more help in that regard.

2) It should be able to handle css just fine. I didn't do any extensive testing or anything like that (also limited by my personal knowledge) but I added in the needed materials from this W3 example to the top of the the HomePage.htm file and changed the 'Link Button' to go to Google's home page and that seemed to work correctly. Again, I haven't worked with HTML and CSS a ton so I can't fully vouch for this, but as long as the server can find the correct stylesheet and there aren't any conflicting classes, it should be good to go. I know even simple things can end up going wrong since (back when I had permission to do so) I attempted to add basic tool-tips to some of the button based links, but that messed up all of the coloring that was already applied to those classes, even though I didn't add or change any coloring. I guess the moral of that anecdote is things can go wrong super easy.

Good luck!

Thanks,
JColvin

Link to comment
Share on other sites

A few more questions:
1) Is it possible to force a reset on the server and reconnect the server to a portable device without recompiling or unplugging it?

2) - It is displaying the text in my htm file so we know that it is finding it correctly.
- It is drawing my image correctly so we know that it knows how to navigate folders.
- But something is losing the formatting. HomePage.htm says:

"The SD file system can contain HTML pages, JPEGs, GIFs, ICOs, TXT, MPEGs, WMVs, JSs, and XMLs for download to the browser;"

but says nothing about css files, which are integral to the html framework.

Is it possible that the server is not reading the css correctly or at all?

Thanks,

squirrel1

Link to comment
Share on other sites

Hi @squirrel1,

I don't believe there is a such a limitation on the name of the network to connect to; my hotspot is 11 characters with a space in the middle; the only thing I did (which I imagine you did as well) was have the SSID in quotes to show that it is a string.

I'm not as familiar with the various HTML capabilities and features, so I can't speak towards why the flexbox isn't working, but I do know that you do need the HomePage.htm to exist at the root of the SD file system to then call/link to your own page. I'm not certain on the blank browser window. I presume your phone and laptop are connected to the same WiFi network that the WiFi radio on the WF32 is connected to? It will also take some time to initially connect the WF32 to the network (up to 40 seconds according to the documentation in HTTPServerConfig.h) so you won't be able to load up the web page right away.

The last point helps me at least; I was always a bit annoyed by the fact that I had to go click through a bunch of folders to find what I needed, so thank you for pointing that out.

Thanks,
JColvin

Link to comment
Share on other sites

I am connecting the WF32 to my wifi hotspot now. It seems to be a function of the names allowed by the server software. Initially, the length of the name of my phone was 21 characters including 2 spaces. So I removed the spaces and it still didn't work. But I gave it a 5 character name with no spaces and it connected. Is there an 8 character limit to the server name as with file names? Maybe this is something that could be included in the server software documentation?

The problem that I'm having now is that I'm using an HTML flexbox that fails to display. The browser on my phone displays the contents of the flexbox cells vertically along the left margin without drawing the grid. It displays fine locally on my laptop. The browser software on my phone is current. An alternate version that uses constant input boxes arranged in div blocks displays with some of the formatting missing. Also, I am unable to load the page over my wifi network either to my phone or to my laptop. It generates no error message, just a blank browser window. Do you have any idea what might be going on here?

The last note is that there is a feature in the Arduino IDE UI that brings up a window with the path to the current project. Earlier, I asked how to find the path to the project, and I chose a long and difficult way to determine this path. But then I learned to just go to Sketch > Show Sketch Folder and it comes right up. I hope this saves somebody some time.

Thanks for helping me to troubleshoot this!

squirrel1

Link to comment
Share on other sites

Hi @squirrel1,

I tested this with the hotspot functionality on my phone and it worked correctly for me.

The things I can think of at the moment is that (at least for me) when I had my laptop connect to my phones hotspot to connect to the provided static IP address, I chose for it to be discoverable on the network, and I also made sure that I had edited and saved the new username and password on the HTTPServerConfig.h file before re-uploading the program to the WF32. I was also able to connect to the page directly from my phone. Did you do the same for your system?

Thanks,
JColvin

Link to comment
Share on other sites

JColvin, thanks for these pointers.  I have successfully built this project locally and brought up its main html page over my wifi network.  The problem I'm having now is that I need to run it in an environment without an external wifi network, using the wifi hotspot functionality of a mobile device.  It seems like this should be possible but I am unable to get it to connect to the hotspot on my mobile device.

Am I missing something here?  Or will this require different project source code?

Thanks very much.

squirrel1

Link to comment
Share on other sites

Hi @squirrel1,

I don't have a Mac so I don't know for certain (and these sorts of files tend to be hidden in a Mac anyway), but looking at these two threads here and here it appears that you might be able to find the file in /Applications/Arduino.cpp/Contents/Resources/Hardware/Arudino/Cores/ (and then presumably without evidence on my part) Digilent/hardware/pic32/1.0.4/libraries/HTTPServer/examples/deWebIOServer/HTTPServerConfig.h where you can then change lines 136 (the szSsid) and the line 150 (the szPassPhrase).

Alternatively, you might be able to find them (as per this thread) in the 'hardware' folder in ~Documents/Arduino.

But again I don't have Mac so I can't confirm this for certain.

I believe in that other thread, that project was a senior design project, not a Digilent made project. The directions I would follow to ensure the project is working is these ones. We don't have any further formal made Digilent projects for connecting to another device aside from the project that Jon linked you to.

Let me know if you have any other questions.

Thanks,
JColvin

Link to comment
Share on other sites

Correct, I was compiling the project as downloaded from here:

http://www.instructables.com/id/Remote-IPad-Mount-Control-Using-WF32/

as directed by this thread:

https://forum.digilentinc.com/topic/5477-wf32-project-with-user-interface-and-wifi/

So I loaded the project on the File menu as you indicated, and it compiled and uploaded.

Now I am missing the instructions on what to do next. There are some instructions in the deWebIOServer file but they seem to be lacking some important points.

I need to copy the project to a local location so I can modify it. Where are these files located on the hard drive (given that I'm on OSX)? Then I need to copy files to the SD card. Are these at the same location? Can I use the instructions at the instructables link above?


Thanks again,

squirrel1

Link to comment
Share on other sites

Hi @squirrel1,

I'm not recognizing some of the errors. Are you using the deWebIOServer that (after you have selected the WF32 as your board) you can open from the Arduino IDE in File>Examples>HTTPServer>deWebIOServer? Looking at the compilation output it looks like you're using a set of code that you downloaded from somewhere.

The Arduino IDE will stay the same yes.

You could try the ESP8266 core if you wanted, but those of us here at Digilent have never used it so we can't vouch for any sort of compatibility.

I don't believe there is any difference between using a MacBook rather than Windows, but I haven't used a Mac to verify this.

Let me know if you have any questions.

Thanks,
JColvin

Link to comment
Share on other sites

deWebIOServer_compile_output_Digilent_core_2018-01-24.txtdeWebIOServer_compile_output_Digilent_core_2018-01-24.txtI gather from these discussions that I need to try the same project with the same IDE and the same hardware but with a different core.

So I installed the Digilent core, reset the board to "chipKIT WF32", and recompiled. I got a different set of error messages, which is progress, right? Arduino->WF32 no longer appears as an option, which is good, right?

I have posted the compile output. Do you recognize any of these errors?


A few sanity checks:

Do I need to download a new project with the same name from a different location as the old one to make this work?

The IDE is the same in all of these cases but the core is different, right?

Also, earlier in this thread, there is talk of the ESP8266 core. Would there be any use in trying this?

Also, I'm running on a MacBook as opposed to Windows, which shouldn't matter, should it?

 

Thanks,

squirrel1

Link to comment
Share on other sites

Hi @squirrel1,

1) Possibly, but both the chipKIT and Digilent Core install the libraries for you inside of the AppData folder (presuming you are using Windows) so unless you have moved some stuff around in there, it's pretty unlikely to be in the wrong location.

2, 3, 5) The only main gotcha is the difference of the cores. My understanding of cores (also nicely explained on this stackexchange thread) is that they provide the low level functionality behind functions for a specific collection of boards. Specifically here, the chipKIT core supports chipKIT boards and the Digilent core supports Digilent boards. I imagine that part of the confusion is coming from the fact that a number of Digilent boards are listed within the chipKIT core. My understanding is that Digilent used to be a contributor and member of the chipKIT community, but about a year ago Digilent stopped working with and contributing to the chipKIT core and instead focused on our own Digilent core that focuses just on Digilent boards. Since then, the chipKIT core (as an open source core, as is the Digilent core) has continued to update its code but has not received any dedicated support towards Digilent boards or their examples. I do not recall what the last chipKIT core supported by Digilent was though.

In terms of practical applications of what you are doing, realistically you will be able to have both the Digilent Core and the chipKIT Core installed on the Arduino IDE. When you want to use a particular core, select the board you want to use from under that core (via the usual Tools>Board>select board of choice).

4) I am personally not aware of another project that does something similar that compiles on both cores. There likely is one, but I have not gone through and looked and tested each project.

Let me know if you have any other questions.

Thanks,
JColvin

Link to comment
Share on other sites

Hi @squirrel1,

Unfortunately, those of us here at Digilent don't have a ton of experience with the newer chipKIT cores (it looks like you're using the chipKIT Core ver. 1.4.3), so we won't be a ton of help in debugging that core since it has been primarily optimized for chipKIT boards, of which Digilent is no longer a part of. Instead we have our own Digilent Core which has been optimized for our own Digilent products, such as the WF32.

Thank you,
JColvin

Link to comment
Share on other sites

JColvin,

I have verified all of the steps that are required for a setup of this project and it checks out.  I have attached a complete build output.  Unfortunately, the copy-paste version is not color coded like it is in the IDE but hopefully you can follow what is going on.  Instead, I have put notes in where there is an item of interest.  I hope you can follow.

Thanks so much for your help.

squirrel1

deWebIOServer_compile_output_2018-01-18.txt

Link to comment
Share on other sites

As a friendly comment, I was able to get the same example (deWebIOServer) to work successfully on the Arduino IDE 1.8.5 for the WF32. I think the Arduino IDE 1.6.9 is recommended because that was the version that most of the development and verification work for the Digilent Core was done in, but I haven't encountered any issues in using newer versions of the IDE as of yet.

Thanks,
JColvin

Link to comment
Share on other sites

I never pursued it much anymore. I switched my project to using an Arduino Mega with an ESP8266 (for WIFI) and a separate SD card module, which took less time than trying to debug the problem with the WF32.  I can try the Digilent core some day,  but it prefers the outdated version 1.6.9 IDE (I currently used 1.8.5).  I don't know if there will any issues because of that and I will not revert to the older version of the IDE, because the newer version(s) fixed several bugs I can into.

Link to comment
Share on other sites

Hi @squirrel1,

I'm using the Digilent Core rather than the chipKIT Core with Arduino 1.6.9, so I can't readily speak towards why you are getting this error, but I successfully got the the deWebIOServer to compile and run on my WF32 with a microSD. I found this tutorial especially helpful for getting running the first time around.

Let me know if you have any questions.

Thanks,
JColvin

Link to comment
Share on other sites

I am having a similar problem with this project, deWebIOServer.  It breaks in the same place, with error:

/Users/<my_account_name>/Library/Arduino15/packages/chipKIT/hardware/pic32/1.4.3/libraries/DFATFS/DFATFS.h:136: undefined reference to `DFILE::fsputc(char)'

I'm running a WF32 connected with USB to a MacBook running the latest OSX.

Did anybody ever find a solution to this problem?  Can anybody help me figure out why this won't compile?  Thanks!

Link to comment
Share on other sites

Hi Chuck,

To install the ESP8266 core with the Arduino IDE, you can follow the instructions here:

https://github.com/esp8266/Arduino

Adafruit has similiar info on their page for setting up the IDE.  There are several pages showing how to control hardware.  Here is an example:

http://randomnerdtutorials.com/esp8266-web-server-with-arduino-ide/

 

When I have some time I'll have to go through the list of errors above for the WF32 and try to figure out what it is looking for. All the basic examples compile and run, just not the Webserver one.

Marcell

 

Link to comment
Share on other sites

Marcell,

I decided to see which libraries were being used by UECIDE and copy them to the empty folder that the Arduino installation had created in the sketches folder.  This eliminated the long list of errors that you and I both experienced.  

It still had two errors involving conflicting return types and two errors involving "overriding virtual size_t Print::write" that I have not looked into, but it must be closer to compiling error free.

I am not going to pursue this any further either because the working version built under UECIDE has the problems mentioned earlier.  I had seen information about the ESP8266 module last year and thought maybe I had ordered some but I find that was not the case.  I ordered some today.  

If you have any links to a useful web server example that shows how to accept requests from a web page and control hardware items it would be much appreciated.  I see some information from Adafruit and others that I will look into but it would help a lot to have a reference to something that has worked for you.

The Adafruit link provided this URL to be added in the board manager:

https://adafruit.github.io/arduino-board-index/package_adafruit_index.json

I have not added this yet, I will wait to see what else I learn about the ESP module.

Thanks,

Chuck

 

 

Link to comment
Share on other sites

Hi Chuck,

Sorry, but I cannot get the WebIOServer code to compile under Arduino IDE with the "new core" that is now released.  I haven't found any help on this either, so I've abandoned it for now while I do some work on my ESP modules (no problems compiling code for them).

Marcell

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...