chipKIT® Development Platform

Inspired by Arduino™

Trying Network Shield library with Ethernet examples

Created Tue, 06 Sep 2011 15:28:15 +0000 by davervw


davervw

Tue, 06 Sep 2011 15:28:15 +0000

I have the Max32 and Network Shield with mpide 0022-windows-20110822 and chipKitEthernet library and examples. What is labeled as chipKitTelnetClient is actually a telnet server example, and it works. But trying to adapt it to a telnet client doesn't work.

I took the Arduino Examples Ethernet client (that I have proven working with my Arduino board and Ethernet shield), then tried to adapt it to use the chipKit library, but it fails to connect. Switching back to telnet server works.

Is there more detailed status of the Ethernet library for chipKit Network Shield?

Thanks.


GeneApperson

Mon, 12 Sep 2011 19:03:50 +0000

Sorry about the slow response... I've been totally swamped the last few days.

I am going to get the guy who wrote the library to come on and answer questions like this.

Gene Apperson Digilent


Paul_L

Fri, 16 Sep 2011 18:12:56 +0000

Hi , everybody

I am quite new to chipkit . I am trying to adapt the example for NTP udp client with chipkit Ethernet board and libraries. In Chipkit Ethernet library the UDP has totaly diferent implementation that in Arduino Ethernet. Can somebody help me to adapt this example ?


Paul_L

Sat, 17 Sep 2011 06:24:46 +0000

I made some further analysis and fount that in the library is a SNTP.c file where is defined SNTPGetUTCSeconds() function but I did not found what .h file to include to access that function from chipKITEthernet library


KeithV

Tue, 20 Sep 2011 00:48:47 +0000

I have the Max32 and Network Shield with mpide 0022-windows-20110822 and chipKitEthernet library and examples. What is labeled as chipKitTelnetClient is actually a telnet server example, and it works. But trying to adapt it to a telnet client doesn't work. I took the Arduino Examples Ethernet client (that I have proven working with my Arduino board and Ethernet shield), then tried to adapt it to use the chipKit library, but it fails to connect. Switching back to telnet server works. Is there more detailed status of the Ethernet library for chipKit Network Shield? Thanks.

I really implemented the ChatServer example and improperly called it the telnet client. If you look at the 2, they are very simular, each starting out as telnet examples and clearly changed to ChatServer/Client examples. I agree, I should have changed the name of our example to telent server; or just made it the ChatServer example.

Also notice that the default Arduino telnet client sketch is not really a telnet client either, as it specifies port 10002, not 23; so cleary the Arduino author did not have a telnet server available either ;) Did you really test the Arduino example with a Telnet Server, or did you test it agianst the ChatServer? Looking at the code, I am not sure a telnet server would like how it is written. And those delays are really really bad.

Look at the chipKIT WebClient example, for how to do clients. So things to watch out for, if you do not specify DHCP and you don't supply a DNS server, then name lookups will fail, you must specify the IP address correctly as well as your subent mask (if it doesn't work with the default). The easiest thing to do for a client application is do an Ethernet.begin() with no parameters and allow DHCP to configure you and get your IP, DNS servers, and submasks all correct for your network. If any of these are wrong, your client won't work. Also for the WebClient sketch, when you open the serial monitor, make sure you up the speed to 115200, or the serial monitor won't keep up and you will drop bits, not that the client didn't get them, but that the serial monitor did not keep up.

Hope this helps.


KeithV

Tue, 20 Sep 2011 01:20:46 +0000

Hi , everybody I am quite new to chipkit . I am trying to adapt the example for NTP udp client with chipkit Ethernet board and libraries. In Chipkit Ethernet library the UDP has totaly diferent implementation that in Arduino Ethernet. Can somebody help me to adapt this example ?

We have not posted the UDP implementation yet. That should come in the next day or 2. The work is done, it just has to be posted on the Digilent page.

A note about UDP, Arduino's UDP was clumbsy for me to implement because the Arduino implementation is not what I would have expected as a UDP implementation. My experience is more like the Windows UDPClient Class where you bind to an IP and port on a socket and then stick with it; unlike Arduino where each call to sendpacket you can change the IP and port on the socket. This raised some trouble for me with ARP requests as each change in IP would require an ARP to resolve the MAC. I did some caching but very minimal. Also I found the inconsistency between the available method and the readpacket confusing as they differ by the 8 byte header. To be honest, I found the Arduino UDP implementation so confusing that I really don't know how it works, so I am not sure if I got it right, but at least the examples run.

If you read the document that is in the documents subdirectory under the chipKITEthernet library, that shoud help you understand the trade offs I made. Like I said, the UDP update should be posted shortly.


KeithV

Tue, 20 Sep 2011 01:38:12 +0000

I made some further analysis and fount that in the library is a SNTP.c file where is defined SNTPGetUTCSeconds() function but I did not found what .h file to include to access that function from chipKITEthernet library

When the UDP implementation gets posted (in the next day or 2), I added a method Ethernet.SecondsSinceEpoch to allow access to the time servers. However you must have a valid DNS server specified either by DHCP or you must supply one so that SNTPGetUTCSeconds can resolve the timer servers hostnames.


Paul_L

Tue, 20 Sep 2011 03:52:05 +0000

Thank you ,

I will wait you to post the new ChipKITEthernet class. And I will try from the sources to understand how you done it. This MPide even very siple to be used is hiding some details about files compiled and it is not easy to add some functions from Microchip libraries like TCPIP stack . I wold like to understand more about it .


KeithV

Tue, 20 Sep 2011 19:42:55 +0000

Thank you , I will wait you to post the new ChipKITEthernet class. And I will try from the sources to understand how you done it. This MPide even very siple to be used is hiding some details about files compiled and it is not easy to add some functions from Microchip libraries like TCPIP stack . I wold like to understand more about it .

Following how it was done is not a simple task; most of the problem was getting things to build in MPIDE. I did not write the Ethernet Stack, the fundamental source is in the Microchip Application Library, which has been copied to the utility directory. The conversion code I wrote is in chipKITEthernetAPI.c under utility, and then the class code is in the base chipKITEthernet library directory, this is where I did the bulk of the interface between the Arduino Ethernet Classes and the Microchip Ethernet MAL. Hopefully today that UDP code will get posted; I am looking for it as well. The UDP implementation is side-by-side with the TCPIP implementation. You probably want to read the document under the libraries\chipKITEthernet\documents directory as well; as I added a section for UDP.

I just realized something from your comments. Are you trying to build the Arduino Ethernet examples and then attempting to run them on the MAX32?. Make sure you are building the chipKITEthernet examples.


Paul_L

Wed, 21 Sep 2011 04:15:33 +0000

Dear Keith, I want to make a NTP time syncronization on MAX32 + chipkit ethernet shield. I have seen the arduino example and I was trying to adapt it to compile on chipkit hardware. It was not possible for me since the UDP implementation was missing from chipkit ethernet libraries. Then looking in the microchip utilities included in chipkit ethernet libraries I found the SNTP.c file that compiles a function to get seconds from epoch. I was trying to compile that file SNTP.c function in my program and use the function from it. I was not able to do that since by including SNTP.c and SNTP.h in my program I got an error of double referencing that function or by including only SNTP.h I got an error that the function is not referenced. This is what I want to understand how to include a piece of code from Microchip libraries to a mpide porgram


KeithV

Wed, 21 Sep 2011 05:03:01 +0000

Okay, so this requires you to understand the ethernet MAL (Microchip Applicaiton Library), as well as how to build the MAL in MPIDE. This is not a trivial task. First you must use the MAL eithernet wizard to build the ethernet library that only includes the SNTP service and other needed components which would include UDP, ARP, and DNS; the MAL wizard will help with that. Then you have to build thunks from the MAL into your sketch and get the header files to compile under MPIDE. And finally build your classes. Like I said, not a straight forward task. What you see in the chipKIT library source is what the wizard produced for TCPIP, UDP, and the other services I requested. Then I make the thunk APIs, and ultimately implemented the Classes. And you must use the appropriate build macros in the MAL for the MAX32 processor and Ethernet Shield.

If this seems a bit overwhelming, well yes and no. The learning curve is steep, but once you get it you can move pretty quickly.

As one of my examples I implemented the Arduino UdpNtpClient as the chipKITUdpNtpClient example. This does not use the MAL SNTP code but just uses UDP to call the time server directly and get the epoch time.

But like I said, I do expose the MAL SNTP call as Ethernet.SecondsSinceEpoch. Another example that will show up in the next release is RemoteWol, in there I have some code that converts the Epoch seconds to a full UTC date (month,day,year) and time. RemoteWol uses the MAL to get the time.

When you get the next release of the chipKIT libraries, I would just use Ethernet.SecondsSinceEpoch.

Sorry, the library is not out there yet; check again on Wednesday. Today it got hung up in review on some legal stuff; but I think it all looks good for release.


Paul_L

Wed, 21 Sep 2011 06:14:35 +0000

Thank you for the answer. The fact that is not a trivial task looks clear to me since I lost a few hours trying with no results . I will try to understand the process but as you said it is not trivial so i think that it will take some time. Up to there I will use the methods implemented in the class by you . As soon than I will be able to download the new class.


GeneApperson

Wed, 21 Sep 2011 18:03:15 +0000

We ran into a problem getting the libraries to build on the new 20110907-test release. I'm hoping that we will have it fixed today and still be able to release today.

Gene Apperson Digilent


Andy123

Wed, 21 Sep 2011 18:46:54 +0000

It will be nice if you clean up PHY Init routines to remove Analog input (and some other pins) configuration - they have no business to be there and looks like left over from some older code


noisette

Fri, 23 Sep 2011 02:00:56 +0000

I tried using the examples in the Network shield libraries, but cannot get any of them to compile. Here is the error: /home/jean-francois/sketchbook/libraries/chipKITEthernet/chipKITClient.cpp:46:29: fatal error: ChipKITEthernet.h: No such file or directory compilation terminated.

Does anyone have this problem? It looks like the compiler cannot see the files.

Thanks for the help! JF


KeithV

Fri, 23 Sep 2011 04:40:19 +0000

The easy fix for this is to delete the #include chipKITEthernet.h from the sketch and then do a sketch->import library of the chipKITEthernet library.

What is happening is that the chipKITEthernet library directory is not being put on the compiler include path. By doing a <shift> verify you will see that the library dirctory is not being inculded. MPIDE is supposed to automatically calculate and put these libraries on the include path but every now and then, for some unknown reason, the library is not put on the inculde path and you have to basically tell MPIDE to put it back on the include path by re-importing the library. This irratic condition is known and Rick is trying to figure it out. If you can figure out why usually it works, but sometimes it doesn't, then let us know.

When I built the Ethernet libraries I used all of the MPIDE default directory structures. I see you use Sketchbook as you sketchbook directory, but by default MPIDE uses Arduino. I think if you used Arduino the Ethernet libriaries would have built out of the box.


Paul_L

Fri, 23 Sep 2011 04:51:08 +0000

Thank you Keith for the update of libraries . Up to this moment I compiled the ChipKITUdpNtpClient example and only changes I've done is the NTP server used is my local network ntp server and everything looks ok . I will try later the method based on SNTP.c since it looks to me more straight forward that the UDP implementation arduino compatible .


noisette

Fri, 23 Sep 2011 13:02:29 +0000

1)When running MPIDE in terminal i can see the debug output (pasted down below) . I have unzipped the Network Libraries in the Hardware/PIC32/libraries folder. I still get the same error message :home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/chipKITEthernet/chipKITClient.cpp:46:29: fatal error: ChipKITEthernet.h: No such file or directory compilation terminated.

  1. As suggested, I've tried to delete the include file (ChipKITEthernet.h) from the sketch, then manually trying to reimport it with the Sketch?Import Library... No success, same result.

  2. I can sucessfully compile other Sketchs for example i have no issues with the (Ethernet: BarometricPressureWebServer)

DEBUG OUTPUT: 0 [main] DEBUG processing.app.Base - DEBUG: Logging enabled.processing.app.Base 294 [main] DEBUG processing.app.Base - Target initiated: name = arduino folder= arduino 300 [main] DEBUG processing.app.Base - Target initiated: name = pic32 folder= pic32 306 [main] DEBUG processing.app.Base - Target initiated: name = tools folder= tools 306 [main] DEBUG processing.app.Base - Get boards for: pic32 306 [main] DEBUG processing.app.Base - Get platformsfor: pic32 306 [main] DEBUG processing.app.Base - librariesFolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries 1035 [main] DEBUG processing.app.Base - DEBUG: Enter: rebuildExamplesMenu 1035 [main] DEBUG processing.app.Base - Get boards for: pic32 1035 [main] DEBUG processing.app.Base - Get platformsfor: pic32 1035 [main] DEBUG processing.app.Base - Get platformsfor: pic32 1057 [main] DEBUG processing.app.Base - DEBUG: Find examples in library.core.path = ./hardware/pic32/libraries 1138 [main] DEBUG processing.app.Base - DEBUG:start: rebuilding import menu 1138 [main] DEBUG processing.app.Base - Get boards for: pic32 1138 [main] DEBUG processing.app.Base - Get platformsfor: pic32 1138 [main] DEBUG processing.app.Base - Get platformsfor: pic32 1138 [main] DEBUG processing.app.Base - library.core.path = ./hardware/pic32/libraries 1139 [main] DEBUG processing.app.Base - DEBUG: add libraries. 1139 [main] DEBUG processing.app.Base - DEBUG: start: addLibraries. 1141 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/ArduinoTestSuite 1146 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/chipKITCAN 1147 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/chipKITEthernet 1147 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/chipKITMDDFS 1148 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/chipKITUSBDevice 1148 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/chipKITUSBHIDHost 1149 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/chipKITUSBHost 1149 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/chipKITUSBMSDHost 1149 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/EEPROM 1153 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/Ethernet 1154 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/Firmata 1154 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/LiquidCrystal 1154 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/Matrix 1155 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/SD 1155 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/Servo 1156 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/sketch_test 1156 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/SoftPWMServo 1156 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/SoftwareSerial 1157 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/SPI 1157 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/Sprite 1158 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/Stepper 1158 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/Wire 1158 [main] DEBUG processing.app.Base - DEBUG: start: addLibraries. 1180 [main] DEBUG processing.app.Base - DEBUG: start: rebuilding boards menu. 1181 [main] DEBUG processing.app.Base - Get boards for: pic32 1181 [main] DEBUG processing.app.Base - Get boards for: pic32 1184 [main] DEBUG processing.app.Base - Get boards for: pic32 1184 [main] DEBUG processing.app.Base - Get boards for: pic32 1185 [main] DEBUG processing.app.Base - Get boards for: pic32 1185 [main] DEBUG processing.app.Base - Get boards for: pic32 1185 [main] DEBUG processing.app.Base - Get boards for: pic32 1186 [main] DEBUG processing.app.Base - Get boards for: pic32 1188 [main] DEBUG processing.app.Base - Get boards for: pic32 1189 [main] DEBUG processing.app.Base - Get boards for: pic32 1189 [main] DEBUG processing.app.Base - Get boards for: pic32 1189 [main] DEBUG processing.app.Base - Get boards for: pic32 1190 [main] DEBUG processing.app.Base - Get boards for: pic32 1190 [main] DEBUG processing.app.Base - Get boards for: pic32 1190 [main] DEBUG processing.app.Base - Get boards for: pic32 1191 [main] DEBUG processing.app.Base - Get boards for: tools 1191 [main] DEBUG processing.app.Base - Get boards for: arduino 1191 [main] DEBUG processing.app.Base - Get boards for: arduino 1191 [main] DEBUG processing.app.Base - Get boards for: arduino 1192 [main] DEBUG processing.app.Base - Get boards for: arduino 1193 [main] DEBUG processing.app.Base - Get boards for: arduino 1193 [main] DEBUG processing.app.Base - Get boards for: arduino 1194 [main] DEBUG processing.app.Base - Get boards for: arduino 1194 [main] DEBUG processing.app.Base - Get boards for: arduino 1194 [main] DEBUG processing.app.Base - Get boards for: arduino 1195 [main] DEBUG processing.app.Base - Get boards for: arduino 1195 [main] DEBUG processing.app.Base - Get boards for: arduino 1207 [main] DEBUG processing.app.Base - Get boards for: arduino 1208 [main] DEBUG processing.app.Base - Get boards for: arduino 1208 [main] DEBUG processing.app.Base - Get boards for: arduino 1208 [main] DEBUG processing.app.Base - Get boards for: arduino 1209 [main] DEBUG processing.app.Base - Get boards for: arduino 1209 [main] DEBUG processing.app.Base - Get boards for: arduino 1209 [main] DEBUG processing.app.Base - Get boards for: arduino 1210 [main] DEBUG processing.app.Base - DEBUG: end: rebuilding boards menu. 1210 [main] DEBUG processing.app.Base - DEBUG:start: rebuilding import menu 1210 [main] DEBUG processing.app.Base - Get boards for: pic32 1210 [main] DEBUG processing.app.Base - Get platformsfor: pic32 1210 [main] DEBUG processing.app.Base - Get platformsfor: pic32 1210 [main] DEBUG processing.app.Base - library.core.path = ./hardware/pic32/libraries 1210 [main] DEBUG processing.app.Base - DEBUG: add libraries. 1210 [main] DEBUG processing.app.Base - DEBUG: start: addLibraries. 1211 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/ArduinoTestSuite 1212 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/chipKITCAN 1212 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/chipKITEthernet 1212 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/chipKITMDDFS 1213 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/chipKITUSBDevice 1213 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/chipKITUSBHIDHost 1213 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/chipKITUSBHost 1214 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/chipKITUSBMSDHost 1214 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/EEPROM 1214 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/Ethernet 1219 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/Firmata 1220 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/LiquidCrystal 1220 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/Matrix 1221 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/SD 1221 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/Servo 1221 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/sketch_test 1222 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/SoftPWMServo 1222 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/SoftwareSerial 1223 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/SPI 1231 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/Sprite 1232 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/Stepper 1232 [main] DEBUG processing.app.Base - Base.subfolder: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries/Wire 1232 [main] DEBUG processing.app.Base - DEBUG: start: addLibraries. Stable Library

Native lib Version = RXTX-2.2pre2 Java lib Version = RXTX-2.1-7 WARNING: RXTX Version mismatch Jar version = RXTX-2.1-7 native lib Version = RXTX-2.2pre2 1300 [main] DEBUG processing.app.Base - Get programmers for: pic32 1300 [main] DEBUG processing.app.Base - Get programmers for: tools 1300 [main] DEBUG processing.app.Base - Get programmers for: arduino 1300 [main] DEBUG processing.app.Base - Get programmers for: arduino 1300 [main] DEBUG processing.app.Base - Get programmers for: arduino 1301 [main] DEBUG processing.app.Base - Get programmers for: arduino 1301 [main] DEBUG processing.app.Base - Get programmers for: arduino 1301 [main] DEBUG processing.app.Base - Get programmers for: arduino 1452 [main] DEBUG processing.app.Base - addsketches librariesFolder: true: /home/jean-francois/Documents/mpide-0022-linux32-20110907-test/./hardware/pic32/libraries

Any ideas? I am kind of stuck right now, and seem to be running around in cercles.

Cheers, Jean-Francois


KeithV

Fri, 23 Sep 2011 14:58:06 +0000

noisette, STOP!

Start over please, you are way off track.

These libraries should not be under hardware! There is no chance that MPIDE will find them under hardware.

Looking at your first post looked more reasonable. Ideally you should unzip the files under

C:\Users&lt;username>\Documents\Arduino\libraries

Then under libraries the ethernest libraries are created by unziping the file there.

C:\Users&lt;username>\Documents\Arduino\libraries\chipKITEthernet\chipKITEthernet.h

The reason BarometricPressureWebServer works as they are not 3rd party libraries and they are not in the library directory under the sketchbook dirctory (which by default is Arduino). We are 3rd party libraries and MUST be in the libraries directory under the sketchbook (default Arduino) directory.


KeithV

Fri, 23 Sep 2011 15:00:05 +0000

Thank you Keith for the update of libraries . Up to this moment I compiled the ChipKITUdpNtpClient example and only changes I've done is the NTP server used is my local network ntp server and everything looks ok . I will try later the method based on SNTP.c since it looks to me more straight forward that the UDP implementation arduino compatible .

Glad you got it to work, sorry it took so long to get those libraries out there.


noisette

Fri, 23 Sep 2011 15:32:09 +0000

Hi KeithV.

I use Linux and not Windows, thus i have no C: drive. Would there be some issues of MPIDE trying to look for .h files in areas related to absolute and / or relative paths ?

  1. I've created a libraries subfolder under my sketchbook, then unzipped all the 7 Network Chipkit 3rd party libraries and still no luck in compiling any of the demo sketches in all of those 7 subfolders.

  2. I've then copied all those seven Network subfolders and their contents in Hardware/PIC32/Libraries. Also under the default install folder/Libraries. Still no luck. No matter where i copy them, the compiler doesn't seem to want to see them.

  3. I will try to install on my Windows XP machine and see if i get the same results. But i would really like to be able to use MPIDE Chipkit Network libraries off my Linux Ubuntu PC.

Cheers, Jean-Francois

noisette, STOP!

Start over please, you are way off track.

These libraries should not be under hardware! There is no chance that MPIDE will find them under hardware.

Looking at your first post looked more reasonable. Ideally you should unzip the files under

C:\Users&lt;username>\Documents\Arduino\libraries

Then under libraries the ethernest libraries are created by unziping the file there.

C:\Users&lt;username>\Documents\Arduino\libraries\chipKITEthernet\chipKITEthernet.h

The reason BarometricPressureWebServer works as they are not 3rd party libraries and they are not in the library directory under the sketchbook dirctory (which by default is Arduino). We are 3rd party libraries and MUST be in the libraries directory under the sketchbook (default Arduino) directory.


noisette

Fri, 23 Sep 2011 17:10:38 +0000

Hi KeithV,

I've narrowed down the problem:

The network libraries demo sketches compiles sucessfully under Windows MPIDE and not under Linux32. For some reason, the Linux32 version fails to see the .h files.

Thanks for your support, Jean-Francois.


GeneApperson

Fri, 23 Sep 2011 21:14:05 +0000

Jean-Francois

Just to be sure that you understand the folder structure in the MPIDE install: The folder [install dir]/libraries is where the Arduino standard libraries are located The folder [install dir]/hardware/pic32/libraries is where the chipKIT/PIC32 standard libraries are located.

Third party libraries (such as the Digilent libraries) go in the following folder: [sketch dir]/libraries

The IDE won't find the libraries correctly if they aren't in the sketch folder's libraries folder.

Gene Apperson Digilent


Andy123

Sat, 24 Sep 2011 14:22:19 +0000

Gene:

New library release still have some code left over from another poject that will interfere with other shields and functionality, it does not look like it belongs here. I understand that it's a good idea to reuse the code, but at least make it compiler conditional with # if defined (...)

chipKITEthernetAPI.c

// 16-bit C30 and and 32-bit C32
	// Enable multi-vectored interrupts
	INTEnableSystemMultiVectoredInt();
		
	// Enable optimal performance
	SYSTEMConfigPerformance(GetSystemClock());
	mOSCSetPBDIV(OSC_PB_DIV_1);				// Use 1:1 CPU Core:Peripheral clocks
	// Disable JTAG port so we get our I/O pins back, but first
	// wait 50ms so if you want to reprogram the part with 
	// JTAG, you'll still have a tiny window before JTAG goes away.
	// The PIC32 Starter Kit debuggers use JTAG and therefore must not 
	// disable JTAG.
	DelayMs(50);
		DDPCONbits.JTAGEN = 0;
		
	CNPUESET = 0x00098000;		// Turn on weak pull ups on CN15, CN16, CN19 (RD5, RD7, RD13), which is connected to buttons on PIC32 Starter Kit boards
		
	// ADC
	AD1CHS = 0;					// Input to AN0 (potentiometer)
	AD1PCFGbits.PCFG4 = 0;		// Disable digital input on AN4 (TC1047A temp sensor)
	AD1PCFGbits.PCFG2 = 0;		// Disable digital input on AN2 (potentiometer)

	// ADC
	AD1CON1 = 0x84E4;			// Turn on, auto sample start, auto-convert, 12 bit mode (on parts with a 12bit A/D)
	AD1CON2 = 0x0404;			// AVdd, AVss, int every 2 conversions, MUXA only, scan
	AD1CON3 = 0x1003;			// 16 Tad auto-sample, Tad = 3*Tcy
	AD1CSSL = 1&lt;&lt;2;				// Scan pot

GeneApperson

Tue, 27 Sep 2011 16:40:36 +0000

Andy,

Thanks... I'll look into it.

Gene


KeithV

Tue, 27 Sep 2011 17:32:25 +0000

Andy,

Thanks for the heads up,

Are you willing to try a test? Replace the initialization code with the following and see if this works for you?

Please let me know?

static void InitializeBoard(void) {

   TRISEbits.TRISE9 = 0;   // output phy enable SMSC8720, data part of the NIC
   LATEbits.LATE9 = 1; // high, enable the phy
   
   // Enable optimal performance
   SYSTEMConfigPerformance(GetSystemClock());
                 

}


KeithV

Tue, 27 Sep 2011 17:47:12 +0000

Andy,

Make it even simpler, try:

You must have the following to work.

static void InitializeBoard(void) {

TRISEbits.TRISE9 = 0;   // output phy enable SMSC8720, data part of the NIC
LATEbits.LATE9 = 1; 	// high, enable the phy

}


Andy123

Tue, 27 Sep 2011 20:58:47 +0000

Keith

Yes I tested it with

static void InitializeBoard(void)
{ 
TRISEbits.TRISE9 = 0; // output phy enable SMSC8720, data part of the NIC
LATEbits.LATE9 = 1; // high, enable the phy
}

Works just fine.

I also replaced RE9 conenction with RC reset and disabled call InitializeBoard(); completely. works just fine - I have another topic in Shields forum about reset.