Comments (7)
If you run out of memory for paramters the programming via ets should fail and you should get an error on the serial console. Are you sure that you use the correct offsets? You need to count the bytes and not the parameters. If you can't figure it out, you can share the code and I can look at it.
from knx.
Hi,
Ive tried to implement a module with ~15 channel and lots of parameters.
now it seems i cant find parameter values. what i get from knx.paramByte() function has nothing to whats i set using ETS software.Ive 13 Group Objects right now, last ones number is 121. and around 50 parameters. and since this library seems to use only 512 byte for storage, i guss its too much?
Does implementing too many Group Objects cause this problem? Is there anyway i can expand the storage?Thanks
In my case, handreds of group objects and handreds of parameters seem fine, nearly 2K byte. if using EEPROM.h, simply EEPROM.begin(2048) can make it work, if your hardware supports.
About reading parameters, you can use paramByte() or paramInt() or paramData(), in condition that you know the length of each parameter. You can easily get the parameter length from the generated .xml by CreateKnxProd
from knx.
If you run out of memory for paramters the programming via ets should fail and you should get an error on the serial console.
I dont get any error in serial console, still values i get from paramByte() are not valid.
Are you sure that you use the correct offsets? You need to count the bytes and not the parameters. If you can't figure it out, you can share the code and I can look at it.
yup Im pretty sure, checked several times. I'll show output below.
In my case, handreds of group objects and handreds of parameters seem fine, nearly 2K byte. if using EEPROM.h, simply EEPROM.begin(2048) can make it work, if your hardware supports.
Well, I have several questions! in function getEepromBuffer() implemented in my platform(stm32) the only size i get as function input is always 512 as is specified in memory.cpp as constant:
Lines 16 to 17 in 4677044
so it should always be 512 bytes right? how is yours 2k ???
btw, I'm using STM32F107 and Im storing data on its flash(last page)
So, heres my XML (generated with my own script, man it was hard):
https://gist.github.com/ajlajlajl/fbd2ce469b08798a27b8a6cb5ece8f61
I've added STM32 platform and a few other changes like LED & button pins. Im not gonna mention them here cuz i guss they r not important.
This is my ino file (I've simplified my program to this one file):
#include "./knxStack/knx.h"
#define CHNO 12
#define LEDG PA5
#define PROGBTN PC13
#define DEBUGSERIALPINR PC11
#define DEBUGSERIALPINS PC10
HardwareSerial SerialDBG(DEBUGSERIALPINR, DEBUGSERIALPINS);
void printParameters();
void controlCallback(GroupObject& go);
GroupObject* kgoControl[CHNO];
GroupObject* kgoStatus[CHNO];
#define GroupObjectAdrs(i) (i * 2 + 2)
#define ParameterAdrs(i) (i * 4 + 2)
void setup()
{
SerialDBG.begin(115200);
ArduinoPlatform::SerialDebug = &SerialDBG;
knx.readMemory();
if (knx.configured()) {
for (int i = 0; i < CHNO; i++) {
kgoControl[i] = &(knx.getGroupObject(GroupObjectAdrs(i)));
kgoControl[i]->dataPointType(Dpt(1, 1));
kgoControl[i]->callback(controlCallback);
kgoControl[i]->extra = i;
kgoStatus[i] = &(knx.getGroupObject(GroupObjectAdrs(i) + 1));
kgoStatus[i]->dataPointType(Dpt(1, 1));
}
}
else {
SerialDBG.println("Not Configured yet!");
}
pinMode(PROGBTN, INPUT);
knx.buttonPin(PROGBTN);
knx.start();
}
int ks;
unsigned long lastpressed2 = 0;
void loop()
{
knx.loop();
if (SerialDBG.available()) {
byte b = SerialDBG.read();
switch (b)
{
case 'R':
printParameters();
break;
}
}
}
void controlCallback(GroupObject& go) {
ArduinoPlatform::SerialDebug->print("Set Channel ");
ArduinoPlatform::SerialDebug->print(go.extra);
ArduinoPlatform::SerialDebug->print(" to ");
ArduinoPlatform::SerialDebug->print((bool)go.value());
ArduinoPlatform::SerialDebug->println('.');
kgoStatus[go.extra]->value((bool)go.value());
}
void printParameters() {
if (knx.configured()) {
SerialDBG.println("Parameters:");
SerialDBG.print("Debug[");
SerialDBG.print((int)0);
SerialDBG.print("]: ");
SerialDBG.println((int)knx.paramByte(0));
SerialDBG.println("-- Channels --");
for (int i = 0; i < CHNO; i++) {
SerialDBG.print("Ch ");
SerialDBG.print(i);
SerialDBG.print(" : EN[");
SerialDBG.print((int)(ParameterAdrs(i)));
SerialDBG.print("] > ");
SerialDBG.print(knx.paramByte(ParameterAdrs(i)));
SerialDBG.print(" , NOC[");
SerialDBG.print((int)(ParameterAdrs(i) + 1));
SerialDBG.print("] > ");
SerialDBG.print(knx.paramByte(ParameterAdrs(i) + 1));
SerialDBG.print(" , FB[");
SerialDBG.print((int)(ParameterAdrs(i) + 2));
SerialDBG.print("] > ");
SerialDBG.print(knx.paramByte(ParameterAdrs(i) + 2));
SerialDBG.print(" , RS[");
SerialDBG.print((int)(ParameterAdrs(i) + 3));
SerialDBG.print("] > ");
SerialDBG.print(knx.paramByte(ParameterAdrs(i) + 3));
SerialDBG.println(" .");
}
}
else {
SerialDBG.println("Not Configured yet!");
}
}
Group objects and everything else works fine but parameters.
This is output of printParameters() function:
Parameters:
Debug[0]: 0
-- Channels --
Ch 0 : EN[2] > 0 , NOC[3] > 32 , FB[4] > 197 , RS[5] > 178 .
Ch 1 : EN[6] > 0 , NOC[7] > 8 , FB[8] > 13 , RS[9] > 179 .
Ch 2 : EN[10] > 0 , NOC[11] > 8 , FB[12] > 13 , RS[13] > 179 .
Ch 3 : EN[14] > 0 , NOC[15] > 8 , FB[16] > 13 , RS[17] > 179 .
Ch 4 : EN[18] > 0 , NOC[19] > 8 , FB[20] > 13 , RS[21] > 179 .
Ch 5 : EN[22] > 0 , NOC[23] > 8 , FB[24] > 13 , RS[25] > 179 .
Ch 6 : EN[26] > 0 , NOC[27] > 8 , FB[28] > 0 , RS[29] > 0 .
Ch 7 : EN[30] > 0 , NOC[31] > 0 , FB[32] > 0 , RS[33] > 0 .
Ch 8 : EN[34] > 0 , NOC[35] > 0 , FB[36] > 0 , RS[37] > 0 .
Ch 9 : EN[38] > 0 , NOC[39] > 0 , FB[40] > 0 , RS[41] > 0 .
Ch 10 : EN[42] > 0 , NOC[43] > 0 , FB[44] > 13 , RS[45] > 179 .
Ch 11 : EN[46] > 0 , NOC[47] > 8 , FB[48] > 13 , RS[49] > 179 .
Ive included the offset in brackets, Ive checked them they are correct.
At least all EN values should be 1 (enable). and i have no 32, 8, 197, 178, ... values in my parameter types...
so, see if u can find whats wrong here
thanks a lot
from knx.
any idea?
from knx.
I didn't find any obvious error. Maybe its an endianess problem or ETS changes the size of parameter?
You can try
printHex("", knx.paramData(0), 50)
to print the raw hex data of the paramters. The stack does nothing with this block of data. So you need to test how this data changes when you change the parameters in ETS.
from knx.
Do you really need 65000 maximum entries in the address table and the association table? Perhaps this takes away a lot of memory. You can also try changing flashSize to 2048 or some other value instead of 512 in memory.cpp (line 16). I also had the problem of parameters being overwritten.
from knx.
I was busy these days so it took me a while to return to this again. Found the cause. It was my catalog XML generator.
forgot to set size on LdCtrlRelSegment and LdCtrlWriteRelMem. So nothing was downloaded ...
seems alright now.
from knx.
Related Issues (20)
- Can only read 18 Bytes of parameter data from ETS HOT 7
- TPUART - Strange connection issue with Samd21 & TP HOT 1
- Unhandled service identifier: 20B on ESP8266 HOT 1
- is it possible to get knx product certification using this stack. HOT 1
- Device programming via ETS HOT 3
- getting error communicating with NCN HOT 1
- DPT 1.24 and 1.100 missing
- Transmitting Telegrams Over KNX Bus Error HOT 1
- cemi_frame.cpp
- big flash size though eeprom warning
- Issue on decoding DPT 10.001 values - "Index" HOT 3
- callbacks missing occasionally HOT 1
- Pass through KNX-bus to Serial with H8C09 board HOT 6
- Debug message since commit 338aa1b of 2023-05-28 maybe inconsistent ? HOT 8
- Update PlatformIO Registry Version and Example Projects HOT 2
- Arduino ethernet sheild supported?. HOT 1
- CI Pipeline broken HOT 1
- Basic documentation HOT 6
- Missing ARDUINO_ARCH_RP2040 in knx/bits.h HOT 7
- KNX-Demo no prog status in ETS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knx.