C++ requires a type specifier for all declarations

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
lanbrown
Posts: 302
Joined: 01 Jun 2021 08:06

Re: C++ requires a type specifier for all declarations

Post by lanbrown »

@amatilda

I used the links for 3.7 and it resolved the issues.
amatilda
Posts: 61
Joined: 26 Sep 2021 22:09

Re: C++ requires a type specifier for all declarations

Post by amatilda »

lanbrown wrote:
27 Aug 2022 07:48

It should actually be this URL:
https://z-uno.z-wave.me/files/z-uno2/pa ... index.json
Where did you get this link?
lanbrown
Posts: 302
Joined: 01 Jun 2021 08:06

Re: C++ requires a type specifier for all declarations

Post by lanbrown »

amatilda wrote:
29 Aug 2022 19:22
lanbrown wrote:
27 Aug 2022 07:48

It should actually be this URL:
https://z-uno.z-wave.me/files/z-uno2/pa ... index.json
Where did you get this link?
It was a guess. When I kept seeing errors about the toolchain and for the G1 board, I thought that maybe the link in the documentation was wrong. So I added a 2 to z-uno to see if that would work and it did. Well, sort of. It no longer complained about a G1 toolchain for a G2 board but still had the issue with compiling. I believe PoltoS is going to update the links/documentation for the G2 which should alleviate the issue.
lanbrown
Posts: 302
Joined: 01 Jun 2021 08:06

Re: C++ requires a type specifier for all declarations

Post by lanbrown »

When uploading the sketch I get this error and that file is not there:

Code: Select all

Couldn't determine program size
Needed file "C:\Users\user\AppData\Local\Temp\2\arduino_build_253281\OneWire_temperature_sensor_DS18B20_ino_signed.bin" doesn't exist. Build the sketch first!
An error occurred while uploading the sketch
There is a file that is similar in name of OneWire_temperature_sensor_DS18B20.ino

I cannot find the file anywhere. I'm using 3.7 (listed as 3.07). I tried the beta (3.8) but it produced even more errors.

So there is light at the end of the tunnel.
amatilda
Posts: 61
Joined: 26 Sep 2021 22:09

Re: C++ requires a type specifier for all declarations

Post by amatilda »

lanbrown wrote:
29 Aug 2022 20:00
When uploading the sketch I get this error and that file is not there:

Code: Select all

Couldn't determine program size
Needed file "C:\Users\user\AppData\Local\Temp\2\arduino_build_253281\OneWire_temperature_sensor_DS18B20_ino_signed.bin" doesn't exist. Build the sketch first!
An error occurred while uploading the sketch
There is a file that is similar in name of OneWire_temperature_sensor_DS18B20.ino

I cannot find the file anywhere. I'm using 3.7 (listed as 3.07). I tried the beta (3.8) but it produced even more errors.

So there is light at the end of the tunnel.

"When uploading the sketch I get this error and that file is not there" - what sketch and what version of z-uno?

" I tried the beta (3.8) but it produced even more errors" - last 3.9
lanbrown
Posts: 302
Joined: 01 Jun 2021 08:06

Re: C++ requires a type specifier for all declarations

Post by lanbrown »

It is a G2. 3.7 and the IDE is 1.8.19

It is this sketch:
https://z-uno.z-wave.me/examples/multip ... e-sensors/

Code: Select all

// Multiple temperature sensors DS18B20

#include "ZUNO_DS18B20.h"

#define DS18B20_BUS_PIN 11                  // Pin to which DS18B20 bus is connected
#define N_SENSOR 3                          // Number of DS18B20 sensors
// You need to adopt ZUNO_SETUP_CHANNELS and add more getters if tou need more sensors

OneWire ow(DS18B20_BUS_PIN);
DS18B20Sensor ds18b20(&ow);

#define ADDR_SIZE 8                         // Size of address of devices on 1-wire bus
byte addresses[ADDR_SIZE * N_SENSOR];        // Here we store all the scanned addresses
#define ADDR(i) (&addresses[i * ADDR_SIZE]) // Macro to simplify our life
byte number_of_sensors;                     // Number of sensors found
word temperature[N_SENSOR];                 // Here we store temperatures

// Define Z-Wave channels. Add more if you need more sensors
ZUNO_SETUP_CHANNELS(
        ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_TEMPERATURE, SENSOR_MULTILEVEL_SCALE_CELSIUS, SENSOR_MULTILEVEL_SIZE_TWO_BYTES, SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS, getterTemp1),
        ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_TEMPERATURE, SENSOR_MULTILEVEL_SCALE_CELSIUS, SENSOR_MULTILEVEL_SIZE_TWO_BYTES, SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS, getterTemp2),
        ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_TEMPERATURE, SENSOR_MULTILEVEL_SCALE_CELSIUS, SENSOR_MULTILEVEL_SIZE_TWO_BYTES, SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS, getterTemp3)
);

void setup() {
  number_of_sensors = ds18b20.findAllSensors(addresses);
}

void loop() {
  for (byte i = 0; i < number_of_sensors && i < N_SENSOR; i++) {
    // Read temperature
    temperature[i] = ds18b20.getTemperature(ADDR(i)) * 100;
    // Sending report
    zunoSendReport(i + 1); // Channels starts from 1
  }
  delay(30000);
}

// Getters. Add more if you need more sensors
word getterTemp1() {
  return temperature[0];
}

word getterTemp2() {
  return temperature[1];
}

word getterTemp3() {
  return temperature[2];
}
amatilda
Posts: 61
Joined: 26 Sep 2021 22:09

Re: C++ requires a type specifier for all declarations

Post by amatilda »

lanbrown wrote:
29 Aug 2022 20:18
It is a G2. 3.7 and the IDE is 1.8.19

It is this sketch:
https://z-uno.z-wave.me/examples/multip ... e-sensors/

Code: Select all

// Multiple temperature sensors DS18B20

#include "ZUNO_DS18B20.h"

#define DS18B20_BUS_PIN 11                  // Pin to which DS18B20 bus is connected
#define N_SENSOR 3                          // Number of DS18B20 sensors
// You need to adopt ZUNO_SETUP_CHANNELS and add more getters if tou need more sensors

OneWire ow(DS18B20_BUS_PIN);
DS18B20Sensor ds18b20(&ow);

#define ADDR_SIZE 8                         // Size of address of devices on 1-wire bus
byte addresses[ADDR_SIZE * N_SENSOR];        // Here we store all the scanned addresses
#define ADDR(i) (&addresses[i * ADDR_SIZE]) // Macro to simplify our life
byte number_of_sensors;                     // Number of sensors found
word temperature[N_SENSOR];                 // Here we store temperatures

// Define Z-Wave channels. Add more if you need more sensors
ZUNO_SETUP_CHANNELS(
        ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_TEMPERATURE, SENSOR_MULTILEVEL_SCALE_CELSIUS, SENSOR_MULTILEVEL_SIZE_TWO_BYTES, SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS, getterTemp1),
        ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_TEMPERATURE, SENSOR_MULTILEVEL_SCALE_CELSIUS, SENSOR_MULTILEVEL_SIZE_TWO_BYTES, SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS, getterTemp2),
        ZUNO_SENSOR_MULTILEVEL(ZUNO_SENSOR_MULTILEVEL_TYPE_TEMPERATURE, SENSOR_MULTILEVEL_SCALE_CELSIUS, SENSOR_MULTILEVEL_SIZE_TWO_BYTES, SENSOR_MULTILEVEL_PRECISION_TWO_DECIMALS, getterTemp3)
);

void setup() {
  number_of_sensors = ds18b20.findAllSensors(addresses);
}

void loop() {
  for (byte i = 0; i < number_of_sensors && i < N_SENSOR; i++) {
    // Read temperature
    temperature[i] = ds18b20.getTemperature(ADDR(i)) * 100;
    // Sending report
    zunoSendReport(i + 1); // Channels starts from 1
  }
  delay(30000);
}

// Getters. Add more if you need more sensors
word getterTemp1() {
  return temperature[0];
}

word getterTemp2() {
  return temperature[1];
}

word getterTemp3() {
  return temperature[2];
}
I have this code compiled and loaded successfully.

Try reinstalling z-uno by uninstalling it manually first.
lanbrown
Posts: 302
Joined: 01 Jun 2021 08:06

Re: C++ requires a type specifier for all declarations

Post by lanbrown »

I completely uninstalled the IDE, deleted any directories that were left, installed the IDE and the 3.7 board manager. Still the same error:

Code: Select all

Arduino: 1.8.19 (Windows Server 2016), Board: "Z-Wave>ME Z-Uno2, USA, Enabled, Normal +0dBm"

Couldn't determine program size

Needed file "C:\Users\user\AppData\Local\Temp\2\arduino_build_929741\sketch_aug26a_ino_signed.bin" doesn't exist. Build the sketch first!

An error occurred while uploading the sketch



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
amatilda
Posts: 61
Joined: 26 Sep 2021 22:09

Re: C++ requires a type specifier for all declarations

Post by amatilda »

lanbrown wrote:
29 Aug 2022 21:39
I completely uninstalled the IDE, deleted any directories that were left, installed the IDE and the 3.7 board manager. Still the same error:

Code: Select all

Arduino: 1.8.19 (Windows Server 2016), Board: "Z-Wave>ME Z-Uno2, USA, Enabled, Normal +0dBm"

Couldn't determine program size

Needed file "C:\Users\user\AppData\Local\Temp\2\arduino_build_929741\sketch_aug26a_ino_signed.bin" doesn't exist. Build the sketch first!

An error occurred while uploading the sketch



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
And if you try to only compile the sketch?
Arduino from windows store?
lanbrown
Posts: 302
Joined: 01 Jun 2021 08:06

Re: C++ requires a type specifier for all declarations

Post by lanbrown »

If I click verify, the only error is that it cannot determine the size.

I've attached screenshots for the verify and the upload.

Code: Select all

Couldn't determine program size
Needed file "C:\Users\ADMINI~1\AppData\Local\Temp\2\arduino_build_929741\sketch_aug26a_ino_signed.bin" doesn't exist. Build the sketch first!
An error occurred while uploading the sketch
Attachments
Screen Shot 2022-08-30 at 12.43.16 PM.png
Screen Shot 2022-08-30 at 12.43.16 PM.png (215.81 KiB) Viewed 2688 times
Screen Shot 2022-08-30 at 12.18.35 PM.png
Screen Shot 2022-08-30 at 12.18.35 PM.png (908.31 KiB) Viewed 2688 times
Screen Shot 2022-08-30 at 12.18.15 PM.png
Screen Shot 2022-08-30 at 12.18.15 PM.png (75.16 KiB) Viewed 2688 times
Post Reply