Autosteer_UDP_v5_6 + nano + ENC28J60 problem

I am trying to get an Arduino Nano running with Autosteer_UDP_v5_6 but I am not able see any activity in AgIO. For debug purposes I have disconnected everything and only have the Arduino Nano connected with a ENC28J60 Ethernet shield v1.0. Ethernet connected to computer. It is powered form USB.

I have tested that the ethernet shield is ok by running a webserver example.

I have tried tag/5.6.34, tag/5.6.33 and tag/5.6.2. When compiling these files I always get alot of varnings but I assume that is normal?
With Autosteer files from 5.6.2 the I get the following error:

Error compiling for board Arduino Nano.

But if I use IMU_UDP_v5_6 or Machine_UDP_v5_6 from 5.6.2 it works and I can see a connection in AgIO.
With the 5.6.33 and 5.6.34 versions of the files I do not get the error when compiling the Autosteer file but neither Autosteer_UDP_, IMU_UDP_ or Machine_UDP_ of these versions manages to connect to AgIO…

Output from nano with version 5.6.34:
image

Help please

What version of nano are you running? Do you have the right board selected in the arduino ide

I do not know what hardware version the Nano have, there is nothing written on it… How do I find out?
I used the same settings for all the testing and tried it several times back and forth. I get other simple sketches to run so I think the settings are correct.
Board: “Arduino Nano”.
Processor: “ATmega328P (Old Bootloader)” I have tried the other processor options but that dose not work…

That looks fine I thought you may have been using a 3.3 nano. Can you upload the usb ino sucessfully? Is should finish with upload complete with no errors. There is a mod for the enc board that you may have to do to get ethernet working.

But you can get a connection using the imu udp ino. That it weierd

Follow the last half of this video to clear the nano and try uploading again. Maybe try another nano? Good luck

try to program only the Nano with out the ethernet shield

So:

  • with the USB version of tag 5.6.2 it works.
  • I tried clearing EPROM but no luck.
  • I tried a different Nano and ethernetshield but no luck.
  • I downloaded tag 5.6.2 again and now Autosteer_UDP_v5_6 compiles and uploads without the error, but I still get a bunch of warning messages and no connection to AgIO. Can this be the problem? (Warnings in the bottom)
    If I upload IMU_UDP_v5.6, I do get the same warnings but I do get a connection:
    image

5.6.2\ArduinoModules\UDP\Autosteer_UDP_v5_6\Autosteer_UDP_v5_6.ino: In function ‘void setup()’:
5.6.2\ArduinoModules\UDP\Autosteer_UDP_v5_6\Autosteer_UDP_v5_6.ino:323:35: warning: invalid conversion from 'void ()(uint16_t, uint8_t
, uint16_t, uint8_t*, uint16_t) {aka void ()(unsigned int, unsigned char, unsigned int, unsigned char*, unsigned int)}’ to ‘UdpServerCallback {aka void ()(unsigned int, unsigned char, unsigned int, const char*, unsigned int)}’ [-fpermissive]
In file included from 5.6.2\ArduinoModules\UDP\Autosteer_UDP_v5_6\Autosteer_UDP_v5_6.ino:63:0:
5.6.2\ArduinoModules\UDP\Autosteer_UDP_v5_6\EtherCard_AOG.h:489:17: note: initializing argument 1 of ‘static void EtherCard::udpServerListenOnPort(UdpServerCallback, uint16_t)’
5.6.2\ArduinoModules\UDP\Autosteer_UDP_v5_6\Autosteer_UDP_v5_6.ino: In function 'void udpSteerRecv(uint16_t, uint8_t, uint16_t, uint8_t
, uint16_t)':
5.6.2\ArduinoModules\UDP\Autosteer_UDP_v5_6\Autosteer_UDP_v5_6.ino:677:93: warning: invalid conversion from 'uint8_t {aka unsigned char
}’ to ‘const char*’ [-fpermissive]
In file included from 5.6.2\ArduinoModules\UDP\Autosteer_UDP_v5_6\Autosteer_UDP_v5_6.ino:63:0:
5.6.2\ArduinoModules\UDP\Autosteer_UDP_v5_6\EtherCard_AOG.h:445:17: note: initializing argument 1 of 'static void EtherCard::sendUdp(const char, uint8_t, uint16_t, const uint8_t
, uint16_t)’
5.6.2\ArduinoModules\UDP\Autosteer_UDP_v5_6\Autosteer_UDP_v5_6.ino:696:101: warning: invalid conversion from 'uint8_t {aka unsigned char*}’ to ‘const char*’ [-fpermissive]
In file included from 5.6.2\ArduinoModules\UDP\Autosteer_UDP_v5_6\Autosteer_UDP_v5_6.ino:63:0:
5.6.2\ArduinoModules\UDP\Autosteer_UDP_v5_6\EtherCard_AOG.h:445:17: note: initializing argument 1 of 'static void EtherCard::sendUdp(const char, uint8_t, uint16_t, const uint8_t
, uint16_t)’
5.6.2\ArduinoModules\UDP\Autosteer_UDP_v5_6\Autosteer_UDP_v5_6.ino:780:115: warning: invalid conversion from 'uint8_t {aka unsigned char*}’ to ‘const char*’ [-fpermissive]
In file included from 5.6.2\ArduinoModules\UDP\Autosteer_UDP_v5_6\Autosteer_UDP_v5_6.ino:63:0:
5.6.2\ArduinoModules\UDP\Autosteer_UDP_v5_6\EtherCard_AOG.h:445:17: note: initializing argument 1 of 'static void EtherCard::sendUdp(const char, uint8_t, uint16_t, const uint8_t
, uint16_t)’
5.6.2\ArduinoModules\UDP\Autosteer_UDP_v5_6\udpserver.cpp: In static member function ‘static bool EtherCard::udpServerHasProcessedPacket(uint16_t)’:
5.6.2\ArduinoModules\UDP\Autosteer_UDP_v5_6\udpserver.cpp:68:22: warning: invalid conversion from 'uint8_t {aka unsigned char
}’ to ‘const char*’ [-fpermissive]

Are you sure the enc28j60 board is working?

hmm not completely, but I think so, I have gotten some ethernet stuff to work… I will try again tomorrow…
At least I managed to get rid of the warning messages. It was the language setting in arduino compiler. when I changed from “Standard” to “English” the warnings disappeared.

Looks like your using the ali nano with the ch340 chip on the bottom.

I use these too, but set the board to “arduino pro mini” in the arduino ide. Have not had any issues yet.

1 Like

If you are using a diferent type of enc28j60 shield. Then check what CS pin is being used. The ino program expect pin d10 on nano.

EDIT : I used an enc28j60 board that connects to nano with wires. The two led at ethernet port did not light up or blink at first. Because 3.3 v supply from nano is not enough. My enc28j60 work now with 3.3v supply from other source.

1 Like

Hmm…
If I run a simple web server test it works perfectly… And it works for both the “Arduino Nano” and the “Arduino Pro or Pro mini” setting.

#include <EtherCard.h>
 
#define STATIC 1 // set to 1 to disable DHCP (adjust myip/gwip values below)
 
#if STATIC
// ethernet interface ip address
static byte myip[] = { 192,168,1,200 };
// gateway ip address
static byte gwip[] = { 192,168,1,1 };
#endif
 
// ethernet mac address – must be unique on your network
static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };
 
byte Ethernet::buffer[500]; // tcp/ip send and receive buffer
 
const char page[] PROGMEM =
"HTTP/1.0 503 Service Unavailable\r\n"
"Content-Type: text/html\r\n"
"Retry-After: 600\r\n"
"\r\n"
"<html>"
"<head><title>"
"Service Temporarily Unavailable"
"</title></head>"
"<body>"
"<h3>This service is currently unavailable!!!!!!!!!!!!!!!!</h3>"
"<p><em>"
"The main server is currently off-line.<br />"
"Please try again later."
"</em></p>"
"</body>"
"</html>"
;
 
void setup(){
Serial.begin(57600);
Serial.println("\n[backSoon]");
 
if (ether.begin(sizeof Ethernet::buffer, mymac) == 0)
Serial.println( "Failed to access Ethernet controller");
#if STATIC
ether.staticSetup(myip, gwip);
#else
if (!ether.dhcpSetup())
Serial.println("DHCP failed");
#endif
 
ether.printIp("IP: ", ether.myip);
ether.printIp("GW: ", ether.gwip);
ether.printIp("DNS: ", ether.dnsip);
}
 
void loop(){
  // wait for an incoming TCP packet, but ignore its contents
  if (ether.packetLoop(ether.packetReceive())) {
    memcpy_P(ether.tcpOffset(), page, sizeof(page));
    ether.httpServerReply(sizeof(page)-1);
  }
}

Hello again, Thanks for the advice I appreciate it. Unfortunately, I have still not found the problem. But to reiterate and sum up where I stand at the moment.

  • Autosteer_USB_v5_0 works great, but I want to use UDP. Mostly trying with tag 5.6.2, but have also tried with 5.6.33 and 5.6.34.
  • I have the rip off “nano”/“pro mini”, I am not sure which but I have tried both settings in Arduino IDE and can not se any difference between them.
  • I have the ENC28J60 ethernet shield. It dose not have the short described in video above.
  • I have three Nanos and three ethernet shields but they are from the same batches, they all behave the same way so if it is a hardware issue it is a batch problem.
  • The Ethernet server example I posted above works good and it responds to pings from computer.
  • Based on the above code I tested and determined that the CS pin is 10.
  • Both LEDs on ethernet shield blinks as on a normal ethernet outlet.
  • If I upload IMU_UDP_v5_6 to the Nano, I get a reading in AgIO which I interpret to mean that there is some traffic, but it dose not respond to pings from the computer.
  • When IMU_UDP_v5_6 or Autosteer_UDP_v5_6 is loaded to the nano there is a lot less blinking but there is some. (with a direct connection between the computer and the nano, the green is solid and yellow makes a short blink every 1-3s.)
  • I have tried all of this with both the nano and ethenet shield as stand alone and as connected to the WAS and Cyrton (picture in the bottom).
  • Teensy with F9P and IMU over UDP works great.
  • I have a dedicated switch for this setup. The computer connect to my home network by normal ethernet cable and to this switch with a ethernet to USB adapter.
  • Both networks runt at 192.168.1.* but it dose not help to disconnect the home network so I assume thats not an issue…
    image

The AoG nano UDP code won’t reply to icmp pings, you have to enable those in the code. Search in the sketch/code for icmp.

2 Likes

Unplug the ethernet adapter from the board with the arduino not connected.

Upload the udp steer program to the nano with nothing connected. Make sure its says ok.

Unplug usb from nano

Connect the udp shield. Connect the usb but only for power do not connect anything to the com port. Now plug in the ethernet cable if your steering module shows up.

Even if you have manually set the IPs, set IP in agio and remember to press send.

The shield is blocking nano, if ethernet data is being received during usb comms.

:crossed_fingers:t2:This should work, then plug it into you board.

After this its checking windows firewall setting to make sure agio is being fully let through.

1 Like

The ethernet adapter could be the problem. My USB eth adapter in some cases give a strange ip, depending on the sequence the system is connected.
I ended up using a wifi router connecting nano by cable to that one and then connect computer by wifi to same router. Router delivets ip address 192.168.1

2 Likes

My next suggestion was to make sure the internet isn’t on the same address as auto steer

I changed #define ETHERCARD_ICMP to 1 in EtherCard_AOG.h and now Autosteer_UDP_v5_6 responds to ping. Thanks for the explanation!

I followed your instructions to the letter, but still no connection…

Even if you have manually set the IPs, set IP in agio and remember to press send.

I do not have the option to send the IPs is that because I already are at 192.168.1.*?

image

I checked the firewall and it has all premission for both home network and public.

I think I will have to try another computer or something else next…