Author Topic: Help with turning off dimmer when light hits 1%  (Read 1943 times)

Offline Greybeardvacationrental

  • Jr. Member
  • **
  • Posts: 74
  • Karma: +1/-0
Re: Help with turning off dimmer when light hits 1%
« Reply #45 on: June 05, 2018, 05:32:16 am »
The question is what memory we are talking about.
If you ssh to Vera and run "df -h" command, or run this command via AltUI OS.Command section, you'll see following results (look for "rootfs", "/dev/mtdblock7" and "overlayfs:/overlay" sections, as too much memory used here causes "no space left on device" error and problems with firmware upgrade or other issues):

For Vera PLUS rootfs, /dev/mtdblock7 and overlayfs:/overlay sections report size of 8,6MB, while for Vera Edge reported size is 9,4MB.
And this makes a difference of 800KB, which is about 10% of your total memory.

In practice, the same setup (restored from the same backup file) on Plus gives me memory filled in about 90%, while on Edge it is around 72%.
I don't know why the difference is bigger than it should be when you compare just amounts of total memory of both controllers. Probably Edge needs less system files (i.e. no Zigbee or Bluetooth files) and this gives some additional space.
But at least you can do an update without resetting.  That's all I care about.  I don't know why I'd go with the Plus anyway since I don't use zigbee or bluetooth.  I can't imagine the speed is all that much different for what I need them to do.  The Vera 3's speed is fine and it doesn't have the capacity of either.  The Secure seems like way to much money for not a lot of benefit.  I don't know, maybe the speed of the Plus and Secure is noticable?
« Last Edit: June 05, 2018, 06:48:05 am by Greybeardvacationrental »

Offline kwieto

  • Hero Member
  • *****
  • Posts: 539
  • Karma: +20/-11
Re: Help with turning off dimmer when light hits 1%
« Reply #46 on: June 05, 2018, 07:47:30 am »
But at least you can do an update without resetting.  That's all I care about. 

That's not that obvious as it depends on your setup. Some people report having issues with "no space left on device" error on Plus, I don't remember if Edge is also affected.
I had an issue where my controller upgraded, OK, but had issues after that upgrade. I couldn't do factory reset due to lack of space on the controller - I couldn't access it remotely, when accessed locally I couldn't force factory reset from the menu ("insufficient rights"). When I did reset via reset button controller was exclueded from my dashboard, but after re-attaching it I found that all configuration still remain as before "reset".
It took me half a day to finally wipe all data, but then, after restore it I've had other issues with it.
So, basically, no, you can't be sure that you'll be able to do an update without resetting.
« Last Edit: June 05, 2018, 10:28:32 am by kwieto »

Offline ember1205

  • Sr. Member
  • ****
  • Posts: 416
  • Karma: +5/-21
Re: Help with turning off dimmer when light hits 1%
« Reply #47 on: June 05, 2018, 09:40:14 am »
The question is what memory we are talking about.
If you ssh to Vera and run "df -h" command, or run this command via AltUI OS.Command section, you'll see following results (look for "rootfs", "/dev/mtdblock7" and "overlayfs:/overlay" sections, as too much memory used here causes "no space left on device" error and problems with firmware upgrade or other issues):

For Vera PLUS rootfs, /dev/mtdblock7 and overlayfs:/overlay sections report size of 8,6MB, while for Vera Edge reported size is 9,4MB.
And this makes a difference of 800KB, which is about 10% of your total memory.

In practice, the same setup (restored from the same backup file) on Plus gives me memory filled in about 90%, while on Edge it is around 72%.
I don't know why the difference is bigger than it should be when you compare just amounts of total memory of both controllers. Probably Edge needs less system files (i.e. no Zigbee or Bluetooth files) and this gives some additional space.

Apologies if this comes off as pedantic.. But memory and storage are two totally different things. I like to describe storage as the filing cabinet in the corner or the drawers in your desk - it's where you "put things away" so that you can get to them later. Memory is akin to the size of the top of your desk. How much memory you have (RAM) is directly related to how many things you can take out of the drawers and lay out on the desktop at any given time. Swapping is like having to remove a piece of paper from the desktop and putting it in a drawer so that you have room to pull a different piece of paper out and lay it on the desk.

"df -h" is a command to check STORAGE.

Offline kwieto

  • Hero Member
  • *****
  • Posts: 539
  • Karma: +20/-11
Re: Help with turning off dimmer when light hits 1%
« Reply #48 on: June 05, 2018, 01:02:20 pm »
I'm not really familiar with naming.
Vera tells about Flash Memory (128MB for all current controllers) and just Memory (depending on the controller, from 128 to 512MB).

df -h command gives status of Flash Memory, I guess. But I'm not sure as in Plus case it doesn't sum up to 128MB, but rather to about 200MB
Nevertheless, the problem is not the total amount of Flash Memory (Storage?), but sections reserved for system files (folders mentioned by me in some post above).
Here you have limited space of 8,6MB (Plus) or 9,4MB (Edge) which can be easily overfilled.
The "Memory" (RAM?) part unfortunately can also be issue and lack of this memory was most probably the reason for bricking my previous controller in a way that even Customer Care couldn't revive it.



Offline HSD99

  • Full Member
  • ***
  • Posts: 226
  • Karma: +6/-0
Re: Help with turning off dimmer when light hits 1%
« Reply #49 on: June 05, 2018, 08:16:38 pm »
Don't feel bad---this is an issue usually reserved for Linux system admins.  Linux commands are just like their Unix predecessors--information dense, but not friendly if you don't know what you're looking at. Embedded Linux systems use FLASH memory as the "disk drive", the permanent storage that retains data even when the power is off. "Memory" is RAM (Random Access Memory) which may be written and read as often as desired at very high speed, but does not retain data when the power is off.

FLASH memory in embedded systems has limitations on how often it may be read and written before damage occurs to the memory cells. FLASH memory controller chips or system software is supposed to be responsible for "wear-leveling" to keep track of which blocks are used and to spread the workload across all the blocks. Good system software design tries to avoid reading and writing the FLASH as much as possible.

To help this problem, Linux has software, tempfs,  that can use a portion of the RAM as a filesystem. Programs use this instead of the FLASH for temporary files. When Vera boots, all the operational code is copied from FLASH into RAM, and runs from there. Temporary files are created in the tempfs in RAM.

Vera Plus seems to allocate 50% of the RAM (128MB of 256MB total) to the tempfs. This is pretty typical for an embedded Linux system of this complexity. That leaves 128MB of RAM for all of the running code, plus buffers and scratchpad use,unless something goes wrong and an out-of-control process fills up the RAM. 128MB of RAM should be plenty under normal use, and the tempfs can be adjusted to be any size desired, if more RAM is needed.

My production VP shows this in response to the "free" command, which shows RAM use:

             total         used         free       shared      buffers
Mem:     255492    114868     140624       0        10308
-/+ buffers:           104560     150932
Swap:            0            0            0

114MB is in use, with 140MB free. This is the RAM, not the FLASH.

If you run the "du -h" command, it will show you everything in the FLASH filesystem with totals. Mine shows 119MB used. There is also a boot loader stored in the FLASH that does not show in the Linux filesystem since it isn't part of it, but does take space on the FLASH chip. If the FLASH chip is 128MB, then it's pretty full.

If we run the "df -h" command, we'll see free space in the filesystem. The first thing to note is the 128MB of tempfs, which is RAM, not FLASH. But it is part of the filesystem and is displayed in this command.

The entries for devices, e.g /dev/mtdblock10 are parts of the FLASH memory, our "disk." The devices are in turn mounted on the filesystem, for example /etc/cmh-firmware. This is how the physical device is connected to the logical device.

Here's my overlay filesystem:

overlayfs:/overlay        8.6M      5.8M      2.9M  67% /

This is after weeding out unused plug-in files, and the 2+MB of regional Z-wave HEX files.

I have no idea why Vera has such small partitions, or why they can't make the install script check before it gets into trouble, and clean up extraneous files. I took a quick look at the file system and it looks like there is a bunch of OpenWRT OS stuff that may not be needed for Vera. Perhaps they should take a look at that...

I see that akbooer has given you a script to check on the free space on /overlay. Kudos to him, and I hope it helps your system.
 

Offline ember1205

  • Sr. Member
  • ****
  • Posts: 416
  • Karma: +5/-21
Re: Help with turning off dimmer when light hits 1%
« Reply #50 on: June 05, 2018, 08:20:04 pm »
I have no idea why Vera has such small partitions, or why they can't make the install script check before it gets into trouble, and clean up extraneous files. I took a quick look at the file system and it looks like there is a bunch of OpenWRT OS stuff that may not be needed for Vera. Perhaps they should take a look at that...


What's worse is why Vera insists on using these crazy small areas of disk to store files temporarily during an upgrade. They KNOW the limitations of their filesystem setup, yet they don't afford you the opportunity to use a different area of storage purely for the upgrade process.

Offline kwieto

  • Hero Member
  • *****
  • Posts: 539
  • Karma: +20/-11
Re: Help with turning off dimmer when light hits 1%
« Reply #51 on: June 06, 2018, 09:17:28 am »
I see that akbooer has given you a script to check on the free space on /overlay. Kudos to him, and I hope it helps your system.


I hope so.
I also did a major clearing of the remains from uninstalled plugins (I don't understand why these files are kept and saved in backups even if plugin is removed) and probably go for removing regional z-wave files as well. The question is what in case of upgrade - as I understood, regional z-wave files will be recreated at that time and my concern is what will happen if the space will be already stuffed?