New 2.1.1 test build is ready!

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

New 2.1.1 test build is ready!

Post by PoltoS »

This build introduces many new features, allows you to use modern Arduino IDE 1.8.5 and prepares Z-Uno for the most secure IoT protocol - Z-Wave Security S2 - that will be release in the next 2.1.2.

You can get it from http://z-uno.z-wave.me/files/z-uno/test ... index.json repo (note the test-ucxx in the middle!)

What's new:

New features
  • Arduino IDE 1.6.5 and 1.8.5 are now supported. You can now use the latest Arduino IDE with Z-Uno!
  • Number of Z-Uno channels rised to 32! You can make 32 devices in one single Z-Uno.
  • Added support for up to 32 user parameters via Configuration Command Class. Parameters are numbered in Z-Wave controller as 64-95
    Use ZUNO_SETUP_CFGPARAMETER_HANDLER(handeler_func) to define your custom parameter handler where function is defined as handeler_func(param_number, value). Parameters are automaticly saved in the EEPROM. To load them from the EEPROM or change two new functions are introduced: zunoLoadCFGParam(param_number, * value) and zunoSaveCFGParam(param_number, * value).
  • Z-Uno can wake up on low and high INT1. To configure do zunoSetWUOptions(ZUNO_WUPFLAGS_INT1_HIGH/ZUNO_WUPFLAGS_INT1_LOW)
  • Same function zunoSetWUOptions(ZUNO_WUPFLAGS_INT1_KEYSCAN) is used to wake up from key scanner (any of 8 pins). Function zunoSetupKeyScannerWU(byte cols_num) is deprecated and removed.
  • Stack overflow and system errors are reported to the controller and/or to the UART0. Arduino IDE Tools menu allows to turn it on/off. This should make your debugging easier.
  • Battery measurement is made in user code: you can either define the range in voltage ZUNO_SETUP_BATTERY_LEVELS(low, high) or your personal handler that will report back the value upon request ZUNO_SETUP_BATTERY_HANDLER(handler). Values low/high are in milivolts.
  • Added BATTERY to possible values for analogRead() to read the battery level. The reported value is the position of 1.21 V between 0 and battery voltage. For 1024 precision the battery voltage equals to 1.21 V * 1024 / value.
  • Added function zunoSetBeamCountWU(byte count) to instruct Z-Uno in FLiRS mode to wake up after count second even if there were no packets.
  • In Arduino IDE Tools menu one more item added - clean EEPROM. Can clean user data, system data or all data (like reset to factory default).
Bug fixes
  • Fixed wakeup on Key Scanner (broken in 2.1.0)
  • Fixed FLIRS not reporting without a delay in the loop. Now delay is not needed anymore.
  • Fixed handler calling when devices is sent into sleep by user.
  • memset fixed
  • No need to downgrade to the previous version to upgrade from test build to a stable one
Internal changes
  • Code compilation optimized to produce 4 (four!) times smaller binary code. This is needed to let us fit the new Security S2 in the code.
  • Rewrote LLCore.c to fit the new design of internal structure. Many features were moved from the internal bootloader to the HLCore.cpp.
  • zunoSysCall(func, ...) introduced instead of inter-code stack to make faster and more compact jumps between bootloader and user sketch.
  • All system calls don't use stack anymore.
  • User memmory in the EEPROM moved to new address. This will break your data in a sketch that is using EEPROM after the update.
This version will be hold in test bed for about two weeks and then be released if no problems found.

Our next ambitious goal is to release and certify an S2 capable Z-Uno!
petergebruers
Posts: 255
Joined: 26 Jul 2015 17:29

Re: New 2.1.1 test build is ready!

Post by petergebruers »

Any sketch seems to end in the same error:

ERROR [2017-10-02 09:34:20,589] [Errno 22] invalid mode ('w') or filename: '\\C:\\Users\\peter\\AppData\\Local\\Temp\\arduino_build_582937Custom.ast'

I guess a \\ is missing between "arduino_build_582937" (the build directory) and "Custom.ast"

For instance, the one that I use to reproduce the oled float crash.
I have removed all Arduino versions and also removed Arduini15 under %appdata%
But I did not remove "Arduino" under my home directory.
I do not "install" Arduino, I always download the .zip for non-admins and run it from my documents directory...

Tomorrow I can try the same thing on my Mac... Maybe it's got something to do with my Windows laptop.

Code: Select all

// OLED test by petergebruers, based on DS18B20 sketch
// by Michael Schmidt

#include <ZUNO_DS18B20.h>
#include <ZUNO_OLED_I2C.h>
#include <EEPROM.h>
OLED oled;
// set up channel
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,
                         getterTemp),
  ZUNO_SWITCH_BINARY(getSWBin, setSWBIN)
);

void setup() {
  oled.begin();
  oled.clrscr();
}

float counter;

void loop() {
  if (counter >= 99) counter = 0;
  else
    counter += 1;
  oled.gotoXY(0, 2);
  // OK:
  // oled.print(int(counter));
  // oled.print(long(counter*1000));
  // NOK:
  // oled.print(counter,0);
  oled.print(counter);
}
byte getSWBin() {
  return 0;
}
void setSWBIN(byte value) {}
word getterTemp() {
  return int(counter);
}
petergebruers
Posts: 255
Joined: 26 Jul 2015 17:29

Re: New 2.1.1 test build is ready!

Post by petergebruers »

On my Mac I can compile and upload both under Arduino 1.6.5 and 1.8.5, so I definitely have an issue on my Windows laptop.

I have a specific issue with my BH1750 sketch, I'll post the details in that topic:

viewtopic.php?f=3427&t=25521
p0lyg0n1
Posts: 242
Joined: 04 Aug 2016 07:14

Re: New 2.1.1 test build is ready!

Post by p0lyg0n1 »

Try to check the compiler on Windows. Looks like I forgot the right separator in path.
petergebruers
Posts: 255
Joined: 26 Jul 2015 17:29

Re: New 2.1.1 test build is ready!

Post by petergebruers »

I am trying FLiRS (a few different variants, including one that worked on firmware 2.10...) on Z-Way 2.3.6-rc8. The controller does not detect it as FLiRS, but as "mains". I always do exclude -> push sketch -> include. After reset, the green LED does not blink, so it is probably going to sleep... What am I missing? Here is a minimalistic sketch to reproduce the problem:

Code: Select all

// 2.1.1 FLiRS example by user "petergebruers"
// FLiRS capable channels: Siren and Valve control only!

ZUNO_SETUP_SLEEPING_MODE(ZUNO_SLEEPING_MODE_FREQUENTLY_AWAKE);
ZUNO_SETUP_CHANNELS(ZUNO_SIREN(getter, setter));

void setup() {
}

void loop() {
}

void setter(BYTE value) {
}

BYTE getter() {
  return 42;
}
EDIT: I probably included while the Z-Uno was in rescue mode. It is OK when I include my Z-Uno while it runs the user sketch.
Last edited by petergebruers on 13 Oct 2017 14:18, edited 1 time in total.
schmidmi
Posts: 55
Joined: 01 Dec 2016 16:45
Location: Germany (Karlsruhe)

Re: New 2.1.1 test build is ready!

Post by schmidmi »

I think you mean "Arduino IDE 1.6.5 and 1.8.5 are now supported", isn't it?
micky1500
Posts: 298
Joined: 07 Feb 2016 16:29
Location: England

Re: New 2.1.1 test build is ready!

Post by micky1500 »

New features
• Arduino IDE 1.6.5 and 1.8.5 are not supported. You can now use the latest Arduino IDE with Z-Uno!
I think that's false.. Typo from PoltoS.
HaHa
Raspi 4 - (Buster - 32 Bit) Zwave Version 4.1.1, Raz 7 Pro, Serial API Version: 07.38
petergebruers
Posts: 255
Joined: 26 Jul 2015 17:29

Re: New 2.1.1 test build is ready!

Post by petergebruers »

Yes, a typo, but:
petergebruers wrote:
03 Oct 2017 10:04
On my Mac I can compile and upload both under Arduino 1.6.5 and 1.8.5, so I definitely have an issue on my Windows laptop.

I have a specific issue with my BH1750 sketch, I'll post the details in that topic:

viewtopic.php?f=3427&t=25521
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: New 2.1.1 test build is ready!

Post by PoltoS »

Indeed, a typo! thanks!

For Windows we have fixed the problem. We will release it fixed next week
petergebruers
Posts: 255
Joined: 26 Jul 2015 17:29

Re: New 2.1.1 test build is ready!

Post by petergebruers »

Thank you, PoltoS, next week I will toy with custom parameters, battery level, UART0 debugging and I'll try to improve the MH-Z19 CO2 sensor sketch!
Post Reply