Topics

Error compiling Teensy 3.2 ethernet code

John Scherer
 

In preparation for hi-res encoders, I've thought I'd try compile the ethernet code from the current Master (beta) branch, 1.10b, but I'm getting an error when compiling:
  Arduino: 1.8.9 (Windows 10), TD: 1.48-beta1, Board: "Teensy 4.0, Serial, Faster, US English"

In file included from C:\Users\john\AppData\Local\Temp\arduino_build_658080\sketch\MountStatus.h:3:0,

                 from C:\Users\john\AppData\Local\Temp\arduino_build_658080\sketch\Encoders.h:4,

                 from C:\Users\john\Documents\Arduino\OnStep\Master (beta)\max\OnStep\addons\Ethernet\Ethernet.ino:85:

Accessories.h: In function 'bool command(const char*, char*)':
Accessories.h:120: error: too many arguments to function 'boolean processCommand(const char*, char*, long int)'
   bool success = processCommand(command,response,webTimeout,false);

                                                                  ^

C:\Users\john\AppData\Local\Temp\arduino_build_658080\sketch\Accessories.h:22:9: note: declared here

 boolean processCommand(const char cmd[], char response[], long timeOutMs) {

         ^

Accessories.h: In function 'bool commandBlind(const char*)':
Accessories.h:127: error: too many arguments to function 'boolean processCommand(const char*, char*, long int)'
   return processCommand(command,response,webTimeout,false);

                                                          ^

C:\Users\john\AppData\Local\Temp\arduino_build_658080\sketch\Accessories.h:22:9: note: declared here

 boolean processCommand(const char cmd[], char response[], long timeOutMs) {

         ^

Accessories.h: In function 'bool commandBool(const char*)':
Accessories.h:132: error: too many arguments to function 'boolean processCommand(const char*, char*, long int)'
   bool success = processCommand(command,response,webTimeout,false);

                                                                  ^

C:\Users\john\AppData\Local\Temp\arduino_build_658080\sketch\Accessories.h:22:9: note: declared here

 boolean processCommand(const char cmd[], char response[], long timeOutMs) {
         ^
Accessories.h: In function 'char* commandString(const char*)':
Accessories.h:141: error: too many arguments to function 'boolean processCommand(const char*, char*, long int)'
   bool success = processCommand(command,response,webTimeout,false);

C:\Users\john\AppData\Local\Temp\arduino_build_658080\sketch\Accessories.h:22:9: note: declared here

 boolean processCommand(const char cmd[], char response[], long timeOutMs) {

         ^

Ethernet: In function 'void logCommandErrors(char*, char*)':
Ethernet:284: error: too many arguments to function 'boolean processCommand(const char*, char*, long int)'
   processCommand(cmd,result,cmdTimeout,true);
                                            ^
In file included from C:\Users\john\AppData\Local\Temp\arduino_build_658080\sketch\MountStatus.h:3:0,

                 from C:\Users\john\AppData\Local\Temp\arduino_build_658080\sketch\Encoders.h:4,

                 from C:\Users\john\Documents\Arduino\OnStep\Master (beta)\max\OnStep\addons\Ethernet\Ethernet.ino:85:

C:\Users\john\AppData\Local\Temp\arduino_build_658080\sketch\Accessories.h:22:9: note: declared here

 boolean processCommand(const char cmd[], char response[], long timeOutMs) {

         ^

Multiple libraries were found for "Ethernet.h"
 Used: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Ethernet
 Not used: C:\Program Files (x86)\Arduino\libraries\Ethernet
too many arguments to function 'boolean processCommand(const char*, char*, long int)'

The current release version of the ethernet code (1.7c)  compiles without error for teensy 3.2/4.0

John Scherer
 

In Accessories.h, there are several calls to processCommand(), which seem to have too many parameters passing to it, for example:

 processCommand(cmd,result,cmdTimeout,true);

I did some looking and if I remove the boolean value in all the calls to processCommand(), in this case true, though others were false, the code compiles without error.  Not sure if this is a proper fix so I'll wait for confirmation .

Howard Dutton
 

Yea the Ethernet master branch code is in a state of limbo at the moment

I'll get around to updating it soon.

John Scherer
 

At your leisure Howard.  It will take a week to get the part here, and I don't have a Teensy Ethernet adapter board yet, which will take longer as soon as I order it.

Howard Dutton
 

I was just waiting to test and made up the Ethernet cable and hooked my MaxPCB2 up in the observatory yesterday as it happens.  What a pain in the neck messing around with everything trying to figure out why I couldn't get a stable connection to the telescope controller.  After about 2 hours I realized my OCS (Observatory Control System) Ethernet MAC address was the same as the MaxPCB2's Ethernet MAC.  Once that was fixed it all worked perfectly.  But note this mount doesn't have encoders so I didn't test that.

GitHub has the update now.