Not enough credit!

Begonnen von mflammia1, 31 Oktober 2016, 15:11:40

Vorheriges Thema - Nächstes Thema

malc_b

You could access the cube via telnet.  See here http://culfw.de/commandref.html .  I think the led setting is stored in eeprom so it might stick between reboots, otherwise you'd need to manually set it everytime you powered off.  In anycase it is something you could try now.

chapelhill - I checked the led code before I made that suggestion.  FYI it just tests the bits , with &1 and &2 so top bits are ignored.  If lsb is 0 led is off, if 1 led is on.  That is done once, then bit lsb+1 is checked each clock and the led toggled if it is set.  So as long as you are a bit flexible on the count you can have flashing or on or off as you wish.  The led flashing wasn't something I thought was important though as my cube will be out of sight. 

medolino2009

Zitat von: malc_b am 03 Januar 2017, 09:51:38
You could access the cube via telnet.  See here http://culfw.de/commandref.html .  I think the led setting is stored in eeprom so it might stick between reboots, otherwise you'd need to manually set it everytime you powered off.  In anycase it is something you could try now.

chapelhill - I checked the led code before I made that suggestion.  FYI it just tests the bits , with &1 and &2 so top bits are ignored.  If lsb is 0 led is off, if 1 led is on.  That is done once, then bit lsb+1 is checked each clock and the led toggled if it is set.  So as long as you are a bit flexible on the count you can have flashing or on or off as you wish.  The led flashing wasn't something I thought was important though as my cube will be out of sight.

So this means ethernet connection on Max Cube is still working ??? (When i flashed CUL i connected Max Cube to  Raspberry Pi trough USB, my ethernet connection is not in use at a moment... will try this when i get home)

Thanx for suggestion :)

Best regards

Miki (NL)

malc_b

I've modded my cube if anyone wants the binary.  As I can't see a need for the led I've used all of that as it turns out that the led can be sent a byte and stores a byte in eeprom.  Indeed fhem complains if you don't send 01 rather than 1.  In this binary, based on a-culfw 1.23.05 the led byte top 2 bits are the credit10ms maximum multiplier, 900 x1- x4, and the bottom 6 bits are the credit10ms added per second, 1-64 so:

led = 00 would be max = 900, 1 credit/s, i.e. standard CUL
led = C0 would be max = 3600, 1 credit/s, i.e. like max cube
led = 0A would be max = 900, 10 credit/s, i.e. simulate 10 CULs

If anyone is interested this is the code I've added in clock.c, line 201, in place of the standard credit10ms increment


{
    uint16_t max = MAX_CREDIT*(1+(led_mode >> 6));

    if (credit_10ms < max )
      credit_10ms += (1 + (led_mode & 0x3F));
    if (credit_10ms > max)
      credit_10ms = max;  //test > max always in case limit is changed
   
  }


I've not bothered to change any of the initialization code so max will start at 900 and ramp up to the new limit.


medolino2009

#33
Zitat von: malc_b am 03 Januar 2017, 17:24:02
I've modded my cube if anyone wants the binary.  As I can't see a need for the led I've used all of that as it turns out that the led can be sent a byte and stores a byte in eeprom.  Indeed fhem complains if you don't send 01 rather than 1.  In this binary, based on a-culfw 1.23.05 the led byte top 2 bits are the credit10ms maximum multiplier, 900 x1- x4, and the bottom 6 bits are the credit10ms added per second, 1-64 so:

led = 00 would be max = 900, 1 credit/s, i.e. standard CUL
led = C0 would be max = 3600, 1 credit/s, i.e. like max cube
led = 0A would be max = 900, 10 credit/s, i.e. simulate 10 CULs

If anyone is interested this is the code I've added in clock.c, line 201, in place of the standard credit10ms increment


{
    uint16_t max = MAX_CREDIT*(1+(led_mode >> 6));

    if (credit_10ms < max )
      credit_10ms += (1 + (led_mode & 0x3F));
    if (credit_10ms > max)
      credit_10ms = max;  //test > max always in case limit is changed
   
  }


I've not bothered to change any of the initialization code so max will start at 900 and ramp up to the new limit.

Wow this is great... will try this when i get home again... If i understand good... with this, we have 900 credits per hour limit...standard Max Cube has 33 or something like that, right ?

Thank you very much for sharing...

By the way...i tried telnet with my cube...it is not working... i was doing something wrong probably... but doesn't matter if this firmware make possible use of 900 credits standard at startup...i think this will be ok....

But just to be sure.... if i want to change to 3600 , i need to use fhem right ?

Thank you

Best regards

Miki (NL)

medolino2009

i have one more question...

Do i need to flash bootloader everytime i wanna flash firmware or not ? if not...how to come in bootloader to flash new firmware without reseting everything with J1 on Max Cube

Thanx in advance

Best regards

Miki (NL)

malc_b

Standard Max/cul is 1% duty cycle.  1 hour is 60x60=3600 s so 1% of that is 3600 x 10ms.  Max firmware starts with 3600 credit_10ms (36s) but when you use all of those it is an hour before you can send any more data.  CUL firmware starts with 900 credit_10ms (9s) and restores these at 1/s so it is 15min before it is back to 900.  So CUL firmware stops when 9s of messages have been sent and restarts when it has enough for the next message in the queue.

With this firmware you can change the 900 limit to 1800, 2700, or 3600 and the rate of restoring the credits from 1/s to 64/s but I wouldn't go higher than you need on the rate and certainly not more than the number of radiator valves, wall stats etc..

Bootloader need only be install once.  The 1st time cube will go into firmware flash mode automatically when you plug in the usb/power lead (because the main firmware is blank).  Subsequent times you need to hold down the reset button on the underside of the cube as you plug in the usb/power lead.  That tells it to go into bootloader rather than run main firmware.  You can then use teraterm or similar to send the new firmware via xmodem.  Wait until the file is all sent and then give it a minute to finish flashing, then power off and back on.

I think you can access the cube via telnet or usb.  Same commands work for both and you can set led via either.  So you should be able to set the led after you have finished flashing and have powered off/on.  You can test this by setting it flashing/off/on and powering on/off to check it remembers the setting.  I would assume that pimatic uses the same method to control the cube so maybe that is why you can't get telnet to work.  Fhem I assume uses telnet and telnet supports multiple sessions usually.



medolino2009

#36
Zitat von: malc_b am 04 Januar 2017, 10:41:56
Standard Max/cul is 1% duty cycle.  1 hour is 60x60=3600 s so 1% of that is 3600 x 10ms.  Max firmware starts with 3600 credit_10ms (36s) but when you use all of those it is an hour before you can send any more data.  CUL firmware starts with 900 credit_10ms (9s) and restores these at 1/s so it is 15min before it is back to 900.  So CUL firmware stops when 9s of messages have been sent and restarts when it has enough for the next message in the queue.

With this firmware you can change the 900 limit to 1800, 2700, or 3600 and the rate of restoring the credits from 1/s to 64/s but I wouldn't go higher than you need on the rate and certainly not more than the number of radiator valves, wall stats etc..

Bootloader need only be install once.  The 1st time cube will go into firmware flash mode automatically when you plug in the usb/power lead (because the main firmware is blank).  Subsequent times you need to hold down the reset button on the underside of the cube as you plug in the usb/power lead.  That tells it to go into bootloader rather than run main firmware.  You can then use teraterm or similar to send the new firmware via xmodem.  Wait until the file is all sent and then give it a minute to finish flashing, then power off and back on.

I think you can access the cube via telnet or usb.  Same commands work for both and you can set led via either.  So you should be able to set the led after you have finished flashing and have powered off/on.  You can test this by setting it flashing/off/on and powering on/off to check it remembers the setting.  I would assume that pimatic uses the same method to control the cube so maybe that is why you can't get telnet to work.  Fhem I assume uses telnet and telnet supports multiple sessions usually.

So theoretically with your firmware i will much faster get transfer errors (LOVF) , because i will be sending same amount of data...but error will go away after 15 minutes , and before was that 1 hour ???

Would you please be so kind to make one firmware where everything is at max...64/s 3600 etc... so i wouldn't have LOVF error constantly... i am getting data from all thermostats with actual temp... thats why i need this much higher...

Thanx in advance

Best regards

Miki (NL)

malc_b

No, you can have either standard CUL firmware mode of 900 or standard Max firmware of 3600 or in between.  That is the total size of one message of set of messages before you get an error.  The restore rate is 1/s (standard for CUL) to 64/s.  So if you set say 900 and 10/s then you can send 9s worth of messages and recover from that in 90s.

medolino2009

Zitat von: malc_b am 04 Januar 2017, 11:47:21
No, you can have either standard CUL firmware mode of 900 or standard Max firmware of 3600 or in between.  That is the total size of one message of set of messages before you get an error.  The restore rate is 1/s (standard for CUL) to 64/s.  So if you set say 900 and 10/s then you can send 9s worth of messages and recover from that in 90s.

Ok, i understand now... but i am not that good with coding  ;D

Would you please be so kind to make one firmware where everything is at max...64/s 3600 etc... (standard at start up of cube, as i can't change values within Pimatic), so i wouldn't have LOVF error constantly... i am getting data from all thermostats with actual temp... thats why i need this much higher...

Thank you in advance

Best regards

malc_b

How many max devices do you have all told?  You really want to set as a max the most number of cubes you can have, if money was no object.  That would be the maximum number of max devices you could pair, one to each cube.

medolino2009

Zitat von: malc_b am 04 Januar 2017, 17:15:19
How many max devices do you have all told?  You really want to set as a max the most number of cubes you can have, if money was no object.  That would be the maximum number of max devices you could pair, one to each cube.

i have total of 15 devices, but some devices have bad connection or something like that...so i have more blank transmits before i get replay... thats why i get LOVF all the time... but this aside... i wanna be sure i can use my system as i like...that means, get temp from rooms , open or close stuff as i want...i don´t wanna be blocked by some credit rules.... it is stupid.... i payed around 500 euro for this installation... it was not cheap...so i wan´t to be able to do with it what i like...

so i probably wouldn´t use all credits...but don´t wanna think about it you know...

malc_b

OK, here are 2 versions with 3600 as maximum credits and credit return rates of 15/s and 30/s.  Note that 15/s is the only one that you could justify using if you get a visit for interference.  As you have 15 max valves then you could pair each one with a max cube and thus have the same traffic as the 36s-15 version.  The 36s-30 is twice as much traffic of course.

I haven't tested this versions.

medolino2009

Zitat von: malc_b am 04 Januar 2017, 18:23:09
OK, here are 2 versions with 3600 as maximum credits and credit return rates of 15/s and 30/s.  Note that 15/s is the only one that you could justify using if you get a visit for interference.  As you have 15 max valves then you could pair each one with a max cube and thus have the same traffic as the 36s-15 version.  The 36s-30 is twice as much traffic of course.

I haven't tested this versions.
Hallo,

It works i think...wil test it for couple of days....

You are greatest. Thank you very much for your help

Best regards

Miki (NL)

medolino2009

It is working now just perfect...we will see in couple of days if it stays this way :)

Thank you ones again

Best regards

Miki (NL)

medolino2009

just update.... It still works great... no LOVF's any more.... great job malc_b

Does anyone know why am i getting transfer errors sometimes ? (thermostats are not that far away from Cube... max 15 meter ... ) , would bigger antenna make differences ?

Thank you

Best ergards

Miki (NL)