It is currently Tue Mar 28, 2017 12:37 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Tue Aug 23, 2016 2:22 pm 
Offline
Member
Member

Joined: Tue Aug 23, 2016 2:11 pm
Posts: 4
Hi everyone,

I can't seem to get my Ethernet shield to work. I've tried several libraries (from website and forum) and keep getting the same results. The ka04_sample_code.zip version from the website gives compilation errors with prog_char, but I managed to resolve those using the version I found on the forum: viewtopic.php?p=77099#p77099

Using Arduino IDE 1.6.10 and the EtherCard library from above mentioned post, I can compile and upload the example sketch to my Arduino Uno without warnings or errors.
Checking the Serial Monitor gives the following output:
Code:
[Starting the Arduino Server]
MAC: 74:69:69:2D:30:31


The code hangs at the statement (since it never prints "Failed to access Ethernet controller" or "Setting up DHCP (this can take a while...)"):
Code:
if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)


I have tried to use an older Arduino IDE (1.6.7, since that's the version used with the post mentioned above), but I have the same result.

Any ideas?

Also, I found some posts about people with the same issues, but they were testing it on an Arduino Mega. For them it seemed to work on Arduino Uno. I am working with the UNO, so I assume nothing needs to be changed to the library itself.


Last edited by Norfolk on Wed Aug 24, 2016 9:45 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed Aug 24, 2016 9:44 am 
Offline
Member
Member

Joined: Tue Aug 23, 2016 2:11 pm
Posts: 4
I also want to note that I studied computer science so programming is not a problem. Any help or questions in terms of troubleshooting can be quite in-depth. Next thing I will check is some debugging of the EtherCard library itself and see which sub-function of ether.begin is blocking the call. That might give me insight on what is happening.


Top
 Profile  
 
PostPosted: Thu Sep 01, 2016 4:53 pm 
Offline
Member
Member

Joined: Tue Aug 23, 2016 2:11 pm
Posts: 4
Today I found the reason for the sketch hanging at .begin():

Whenever I plug something else on top of the shield in the 5V pin, it hangs at .begin(). If I remove that wire from the 5V pin and reset the board, the shield successfully runs the .begin() statement and gets a IP address from the DHCP server.

Any ideas why connecting something to the 5V pin makes the sketch stall at .begin ? (The part connected is a CNY70 sensor with a 82ohm resistor for the emitter and a 20k ohm resistor for the detector)


Top
 Profile  
 
PostPosted: Thu Sep 01, 2016 6:14 pm 
Offline
Senior Member
Senior Member

Joined: Tue Mar 27, 2007 12:24 am
Posts: 3261
Location: USA
You can download the schematics from here.
http://www.vellemanusa.com/downloads/0/illustrated/illustrated_assembly_manual_ka04.pdf

Since I don't have one so this is just a guess.
It looks like if the 5 volts goes low it activates the reset on the VMA04.
Maybe the other board is pulling the 5volts down.


Top
 Profile  
 
PostPosted: Fri Sep 09, 2016 8:48 am 
Offline
Member
Member

Joined: Tue Aug 23, 2016 2:11 pm
Posts: 4
I did some measuring and the other board takes about 40mA at 5V. Then I tested with an external power source instead of the USB port in my computer and this seems to fix the problem. I guess my USB port in the computer just did not offer enough power :)

Thanks for the input Wrong Way!


Top
 Profile  
 
PostPosted: Mon Sep 12, 2016 5:29 pm 
Offline
Senior Member
Senior Member

Joined: Tue Mar 27, 2007 12:24 am
Posts: 3261
Location: USA
No problem
Glad you have it sorted out.


Top
 Profile  
 
PostPosted: Thu Jan 05, 2017 1:16 pm 
Offline
Member
Member

Joined: Thu Jan 05, 2017 1:08 pm
Posts: 1
replace if (ether.begin(sizeof Ethernet::buffer, mymac) == 0) with if (ether.begin(sizeof Ethernet::buffer, mymac, 10) == 0)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group