Welcome! Log In Create A New Profile

Advanced

Error compiling Firmware: 'temptable' was not declared in this scope

Posted by Sergey 
Error compiling Firmware: 'temptable' was not declared in this scope
January 07, 2011 06:32AM
Hi, All!
I downloaded reprap-mendel-20110106 from [jonathan.reprap.org], Arduino 22 + Sanguino-0018r2 Rev2_1_4, Java 6 SE Update 23(build 1.6.0_23-b05), WinXPSP3. And my standard electronics GEN3 from make.rrrf.org, without Heated Bed.
Then renamed the configuration.h opened the sketch in Arduino, and slect:
#define DEFAULTS MENDEL_GEN3_DEFAULTS

checked/compiled the sketch and got this:
In file included from FiveD_GCode_Interpreter.cpp:12:
/Temperature.h: In function 'void setupThermistors()':
Temperature.h:327: error: 'temptable' was not declared in this scope
Temperature.h:330: error: 'bedtemptable' was not declared in this scope
Can't figure out what went wrong...
Re: Error compiling Firmware: 'temptable' was not declared in this scope
January 07, 2011 04:00PM
Compile with Arduino 21 or earlier
Re: Error compiling Firmware: 'temptable' was not declared in this scope
January 08, 2011 06:27AM
I have tried to compile Arduino 21 and Arduino18 -- result the same sad smiley
Re: Error compiling Firmware: 'temptable' was not declared in this scope
January 08, 2011 07:43AM
Sounds like you haven't defined a thermistor in the Temperature.h file.
Re: Error compiling Firmware: 'temptable' was not declared in this scope
January 08, 2011 03:28PM
Temperature.h:
// HINT: To decide which Thermistor/s are used, you no longer need to change this file!
// please just change the two definitions in your configuration.h file that are:
//  TEMP_SENSOR       ( choose what to set it to based on the options in features.h )
//  BED_TEMP_SENSOR    ( as per above, or leave it unset, and it will automatically be set the same as TEMP_SENSOR )

P.S.
configuration.h:
#define DEFAULTS MENDEL_GEN3_DEFAULTS
...
#if DEFAULTS ==  MENDEL_GEN3_DEFAULTS
...
#define TEMP_SENSOR TEMP_SENSOR_RRRF100K_THERMISTOR  // RRRF 100k thermistor is typical for mendel, yes?
If it is not enough?

Edited 1 time(s). Last edit at 01/09/2011 02:23AM by Sergey.
I'm seeing this same problem. Is there any resolution to this?
I've got also this error... (in trunk rev 4029), andruino 18.
Re: Error compiling Firmware: 'temptable' was not declared in this scope
February 11, 2011 08:48PM
I also have this error. Quite frustrating. Any resolution?
I had the same Problem as OP.
Well I managed to compile the software for std gen3, but havent got around to aktually testing it yet.

I think its probably more of a hack than actually solving the issue though.

In configuration.h:
comment out this line:
// normal Mendel uses neither a heated bed, nor an Internal extruder PID code: 
//#define TEMP_SENSOR TEMP_SENSOR_RRRF10K_THERMISTOR  // Temperature measurement ( BED or Internal Extruder code. IF you...

in hostcom.h:
comment out these 3 lines:
//   put("X-TEMP_SENSOR:"); put(TEMP_SENSOR); putWs();
//	put("X-BED_TEMP_SENSOR:"); put(BED_TEMP_SENSOR); putWs();

I think the problem lies in the fact that on official gen3 the main Arduino does not do the temp readings, and somehow some part of the firmware just wont "get it" the main controller doesn't have temp sensors connected.
Re: Error compiling Firmware: 'temptable' was not declared in this scope
February 12, 2011 03:57PM
Quote
DarkerMark
Well I managed to compile the software for std gen3, but havent got around to aktually testing it yet.

Thanks. That worked for me too! I'll see how far I can get.
Re: Error compiling Firmware: 'temptable' was not declared in this scope
March 07, 2011 10:01PM
I figured this out (I think)

Since the error was saying that the temptable and bedtemptable were not defined, I just entered a #define statement to those 2 lines. See below:
  #if TEMP_SENSOR == TEMP_SENSOR_RRRF100K_THERMISTOR
  #define temptable = &d_temptable[0]; 
  #endif
  #if BED_TEMP_SENSOR == TEMP_SENSOR_RRRF100K_THERMISTOR
  #define bedtemptable = &d_temptable[0]; 
  #endif
Re: Error compiling Firmware: 'temptable' was not declared in this scope
March 08, 2011 03:47AM
No...#define and variable declarations are two different things. A #define without the = might work, but the real problem appears to be earlier in the Temperature.h file, at about line 40:

#if ( EXTRUDER_CONTROLLER == EXTRUDER_CONTROLLER_INTERNAL )  || ( EXTRUDER_CONTROLLER == EXTRUDER_CONTROLLER_DC ) 
Pair *temptable; // a pointer to the first "Pair" is equivalient to a "Table" type, but conveniently modifiable.
#endif 


// ... And this is the heated bed thermistor (if any)
#if HEATED_BED == HEATED_BED_ON 
Pair *bedtemptable; 
#endif
On default gen3, EXTRUDER_CONTROLLER = EXTRUDER_CONTROLLER_RS485 and so the above declarations are not included, hence the error when these variables are set later in the file.

I suggest removing these conditionals:
Pair *temptable; // a pointer to the first "Pair" is equivalient to a "Table" type, but conveniently modifiable.
Pair *bedtemptable;
[/code]

This should get rid of this error, and also allow the same Temperature.h file to be used for both motherboard and extruder.
Re: Error compiling Firmware: 'temptable' was not declared in this scope
March 08, 2011 09:25AM
It compiled and uploaded fine for me with the added #define's. I am having all sorts of other issues even getting my reprap software to see the MB, so I can't test if it works..
I think its a compilation bug that affects us using MENDEL_GEN3_DEFAULTS configuration. I had the same problem with the latest release "reprap-mendel-20110207.zip". Here is how I fixed the problem.

I bought the Gen3 version of the laser-cut Mendel from Techzone. This kit does not come with a bed heater, thus no bed temperature sensor is required. In "configuration.h", add the following to line 175 right after the line "#define TEMP_SENSOR TEMP_SENSOR_RRRF100K_THERMISTOR // RRRF 100k thermistor is typical for mendel, yes?".

#define BED_TEMP_SENSOR 0 // No Bed Temp sensor

Then on line 38 of "temperature.h", modify this line to:

#if ( EXTRUDER_CONTROLLER == EXTRUDER_CONTROLLER_INTERNAL ) || ( EXTRUDER_CONTROLLER == EXTRUDER_CONTROLLER_DC || EXTRUDER_CONTROLLER == EXTRUDER_CONTROLLER_RS485 )

This allows temptable to be defined for the rest of the rest of the firmware to work.

You should be able to compile without any errors now.
Re: Error compiling Firmware: 'temptable' was not declared in this scope
March 23, 2011 06:04AM
I think there is something here that ppls dont want to see or say.
Or, maybe i am alone to see, or its a manifestation of my schizofrenia.
But if one thinks there is something wrong, and doesnt point at it, then one can never evolve.

In Gen 3, all temperature sensing and all math is done by extruder board alone. That is the point of having it. In the gen3 firmware for the master there should be NO temperature related stuff, no sensors, no pins, no tables, pure and simple nothing of this kind, nada, zip. The master gets all the temperature via rs485, thats all it has to do.

This "markup language" with named sensors and stuff, when i seen it first i said its like a nightmare where one only learned def and ifdef commands and is using it to torment ppls, and i didnt got quite positive feedback to that (i wonder why). I think i also said it will get stuff confused. And apparently it did so even to the author. Somehow the guy doing it obviously didnt knew enough about gen3 temperatures and slave extruder, so he considered that in master firmware one temperature sensor and table is mandatory regardless of what electronic is used. Critical mishap. It is actually not true for gen3 and in its case its a pristine example of what bloat means, to be honest.

Actually to be correct, bloat refers to a feature that is available, is used, but its code is inflated. In this case, its a feature that will never be used, unless someone hacks his MB1.2 and puts sensors on the corresponding adc pins, and then reads those, instead of rs485 ones.

A way to "debug" this for gen3 from master MB1.2 firmware would be to remove all temp related stuff from it, instead of trying to find a minor glitch somewhere.

Somebody correct me please if i am wrong.
Sorry again either way, no criticism = no chance to become better.

Edited 1 time(s). Last edit at 03/23/2011 06:16AM by NoobMan.
Hello.

I tried that, what Ziggy purposed.... I manage to compile firmware, but in RepRap software I get ERROR: GCodeReaderAndWriter.getBTemp<> - no value stored...And the program keeps freezing, and onlie X motor can be muved once restarting program. Can any of you post a link to a last good configuration (combination).
I'm also heawing problems with skuitching sound of motors (especialy Extruder motor) - I'm using Motherboard V1.2 and Extruder board V2.2....

Regards
Bogdan
Re: Error compiling Firmware: 'temptable' was not declared in this scope
March 26, 2011 12:24AM
Hi,

Had the same issue. Ziggy's thread is on the money about Mendel / Gen3 electronics, it's a problem about defining variables. Adding the
|| EXTRUDER_CONTROLLER == EXTRUDER_CONTROLLER_RS485 ) to line 38 of temperature.h fixes the "temptable" error but not the "bedtemptable" error which also happened to me. Tuning "HEATED_BED_ON" in "configuration.h" fixes that but causes other compile problems.

Try this mod adding the two lines beginning with "pair" to the setupThermistors() procedure in "temperature.h"

void setupThermistors() {

Pair *temptable;  
Pair *bedtemptable;

  #if TEMP_SENSOR == TEMP_JAYCAR_NTC_125DEG_10K_THERMISTOR
  temptable = &a_temptable[0]; 
  #endif
  #if BED_TEMP_SENSOR == TEMP_JAYCAR_NTC_125DEG_10K_THERMISTOR
  bedtemptable = &a_temptable[0]; 
  #endif
//continues......

it seems to work with all sensors.

Cheers
Re: Error compiling Firmware: 'temptable' was not declared in this scope
March 26, 2011 04:20AM
kirtlesog Wrote:
-------------------------------------------------------
> Try this mod adding the two lines beginning with
> "pair" to the setupThermistors() procedure in
> "temperature.h"
>
>
> void setupThermistors() {
>
> Pair *temptable;
> Pair *bedtemptable;


Putting them in setupThermistors() will probably break hardware that does actually use them, as this function will then initialize these local variables rather than the conditionally-defined global ones; I suggest (but haven't tested) putting these two lines instead of the existing conditional definitions (around line 40). Having them defined but not used won't do any harm (assuming we can spare 4 bytes of memory).
Re: Error compiling Firmware: 'temptable' was not declared in this scope
March 26, 2011 08:19AM
Rebecca,

Your're right, my bad. Put the two lines as unconditional further up, always compiles but I'm having other problems with this firmware.

Cheers
Re: Error compiling Firmware: 'temptable' was not declared in this scope
March 26, 2011 10:56AM
You only need 3 changes to make this motherboard firmware compile for Gen 3 Mendel.

In configuration.h, uncomment the correct choice for this machine:
// pre-select a typical setup from the below list
//   using typical pinouts and typical capabilities. see features.h for what typical setups we have available
//#define DEFAULTS DARWIN_DEFAULTS
#define DEFAULTS MENDEL_GEN3_DEFAULTS
//#define DEFAULTS MENDEL_MEGA_DEFAULTS
//#define DEFAULTS BATHPROTO_DEFAULTS
In Temperature.h, insert "#if EXTRUDER_CONTROLLER != EXTRUDER_CONTROLLER_RS485" near the beginning and #endif at the very end:
// The temperature control dead zone in deg C

#define HALF_DEAD_ZONE 5

#if EXTRUDER_CONTROLLER != EXTRUDER_CONTROLLER_RS485

... the rest of the text here

#endif
In FiveD_Gcode_Interpreter, insert the same #if and #endif around the call to setupThermistors():
#if EXTRUDER_CONTROLLER != EXTRUDER_CONTROLLER_RS485  
  setupThermistors(); // map the correct thermistor table to the correct thermistor ( extruder or bed )
#endif

This compiles for me with Arduino 021. But I when I load it to the motherboard (Techzone Gen 3 remix), the red led stops blinking at 2 Hz after it finishes loading the firmware. So I suspect that there are other things that need fixing.

Edited 1 time(s). Last edit at 03/26/2011 11:13AM by brnrd.
Re: Error compiling Firmware: 'temptable' was not declared in this scope
March 29, 2011 03:16AM
Hi Guys, my apologies to those who have tried my previous suggestion on how to get the firmware to compile and could not get the firmware to work on the actual machine. I have not tested out the code myself as I am still struggling with the mechanical build with the lack of documentation from TechZone and a few missing parts in the "complete kit:".

I looked at the source code again and realised that for the both temptable and bedtemptable are not required for the main control board firmware because for defaults=MENDEL_GEN3_DEFAULTS, the temperature management is done by the Extruder slave controller. So we only need 1 change, ie to redefine temp_sensor to '0'.

Change this line#174 in configuration.h from
#define TEMP_SENSOR TEMP_SENSOR_RRRF100K_THERMISTOR // RRRF 100k thermistor is typical for mendel, yes?

to:
#define TEMP_SENSOR 0 // No temperature sensor, temperature management is now done by extruder controller in Gen 3 electronics

Please let us know if it works. Thanks!
Re: Error compiling Firmware: 'temptable' was not declared in this scope
March 29, 2011 08:47AM
There is already an existing conditional parameter, EXTRUDER_CONTROLLER_RS485, that specifies that the extruder is external to the motherboard through RS485. It seems that using this is the more general way to fix the compile error as I wrote in my post. But even if you fix the errors related to the thermistors, the firmware still doesn't run on Gen 3.
Re: Error compiling Firmware: 'temptable' was not declared in this scope
March 29, 2011 09:37PM
brnrd, you are absolutely right.
Re: Error compiling Firmware: 'temptable' was not declared in this scope
March 30, 2011 03:05AM
I found somewhere in this forum that you will need to use the firmware in the zip file "OneWireA-DFirmware.zip". It has changes to allow the use of the DS2760 chip that comes with TechZone's Gen3 electronics. I merged the changes to the recently released reprap-mendel-20110207 package and attached it here. Let me know if it works.

As for me, I am stuck with a dead half-assembled machine. Lambert just acknowledged that Kimberly had sent me the wrong parts and promised to resend me the correct ones. As usual, didn't hear from him ever since and they did not send me the parts either. They may be extremely busy sorting out all the mixup with all their unhappy customers now. I will wait for a little while more. Does anyone of you know how else I can contact anyone from TechZone? eg direct telephone lines? They don't respond to most of my emails.thumbs down
Attachments:
open | download - TechZone Gen 3 (reprap-mendel-20110207 mod) Extruder.zip (14.1 KB)
Re: Error compiling Firmware: 'temptable' was not declared in this scope
March 30, 2011 09:38AM
I also found that even with the OneWireA-DFirmware.zip, I could not compile in Arduino 022. It did however work fine in Arduino 021. I don't know why, it just works in the older versions for some reason.
VDX
Re: Error compiling Firmware: 'temptable' was not declared in this scope
March 30, 2011 10:17AM
... my findings too - 0022 won't compile, 0021 works confused smiley


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Error compiling Firmware: 'temptable' was not declared in this scope
March 30, 2011 02:28PM
Ziggy Wrote:
-------------------------------------------------------
> I found somewhere in this forum that you will need
> to use the firmware in the zip file
> "OneWireA-DFirmware.zip". It has changes to allow
> the use of the DS2760 chip that comes with
> TechZone's Gen3 electronics. I merged the changes
> to the recently released reprap-mendel-20110207
> package and attached it here. Let me know if it
> works.
>

I actually added Techzone's code for the Thermocouple A-D to the reprap firmware 20100719 a couple of weeks ago. It's been working well for me. I uploaded it to the forum in another tread here.

Note that there's a bug in Techzone's firmware where they assign the temperature to a byte so if your temperature goes above 255, it wraps back to 0. This results in your tip overheating and can cause a fire if you have too much power on your heater. I suggest that you either use my modified code or make the change in the code before using the firmware.
Re: Error compiling Firmware: 'temptable' was not declared in this scope
March 30, 2011 09:54PM
Thanks a million, brnrd!
I followed the directions to solve the temptable problem...and it worked ...but now when I compile, it gets an error with reference to serial1. Is anyone else having this problem and if so is there a solution? Tried compiling in both arduino 22 and 18. Thanks for your help!
Re: Error compiling Firmware: 'temptable' was not declared in this scope
April 09, 2011 07:11PM
It compiles with Arduino 021. It seems it doesn't compile with 22 according to some people. I don't know about 18. The main problem is that after successfully compiling with those changes, it still doesn't run and I haven't been able to debug it.
Sorry, only registered users may post in this forum.

Click here to login